Skip to content

Commit

Permalink
Merge pull request #1 Delete unused code
Browse files Browse the repository at this point in the history
Delete unused code
  • Loading branch information
muriplz authored Jan 18, 2024
2 parents 849a25d + 654bcbd commit 899188e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 135 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.15.5
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.6

#Fabric api
fabric_version=0.91.0+1.20.1
fabric_version=0.94.1+1.20.4

# Mod Properties
mod_version=1.0
Expand Down
32 changes: 0 additions & 32 deletions src/main/java/com/kryeit/votifier/Votifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.kryeit.votifier.config.ConfigReader;
import com.kryeit.votifier.crypto.RSAIO;
import com.kryeit.votifier.crypto.RSAKeygen;
import com.kryeit.votifier.model.VoteListener;
import com.kryeit.votifier.model.VotifierEvent;
import com.kryeit.votifier.model.listeners.BasicVoteListener;
import com.kryeit.votifier.net.VoteReceiver;
Expand All @@ -34,8 +33,6 @@
import java.io.IOException;
import java.nio.file.Path;
import java.security.KeyPair;
import java.util.ArrayList;
import java.util.List;

/**
* The main Votifier plugin class.
Expand All @@ -48,18 +45,10 @@ public class Votifier implements DedicatedServerModInitializer {
/** The logger instance. */
public static final Logger LOGGER = LoggerFactory.getLogger(Votifier.class);

/** Log entry prefix */
private static final String logPrefix = "[Votifier] ";

/** The Votifier instance. */
private static Votifier instance;

/** The current Votifier version. */
private String version;

/** The vote listeners. */
private final List<VoteListener> listeners = new ArrayList<VoteListener>();

/** The vote receiver. */
private VoteReceiver voteReceiver;

Expand All @@ -73,9 +62,6 @@ public class Votifier implements DedicatedServerModInitializer {
public void onInitializeServer() {
Votifier.instance = this;

// Set the plugin version.
version = "1.0";

// Handle configuration.
try {
LOGGER.info("Reading config file...");
Expand Down Expand Up @@ -151,24 +137,6 @@ public static Votifier getInstance() {
return instance;
}

/**
* Gets the version.
*
* @return The version
*/
public String getVersion() {
return version;
}

/**
* Gets the listeners.
*
* @return The listeners
*/
public List<VoteListener> getListeners() {
return listeners;
}

/**
* Gets the vote receiver.
*
Expand Down
83 changes: 0 additions & 83 deletions src/main/java/com/kryeit/votifier/model/ListenerLoader.java

This file was deleted.

16 changes: 1 addition & 15 deletions src/main/java/com/kryeit/votifier/net/VoteReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.kryeit.votifier.Votifier;
import com.kryeit.votifier.crypto.RSA;
import com.kryeit.votifier.model.Vote;
import com.kryeit.votifier.model.VoteListener;
import com.kryeit.votifier.model.VotifierEvent;

import javax.crypto.BadPaddingException;
Expand Down Expand Up @@ -120,7 +119,7 @@ public void run() {
InputStream in = socket.getInputStream();

// Send them our version.
writer.write("VOTIFIER " + Votifier.getInstance().getVersion());
writer.write("VOTIFIER");
writer.newLine();
writer.flush();

Expand Down Expand Up @@ -161,19 +160,6 @@ public void run() {
if (plugin.isDebug())
LOG.info("Received vote record -> " + vote);

// Dispatch the vote to all listeners.
for (VoteListener listener : Votifier.getInstance()
.getListeners()) {
try {
listener.voteMade(vote);
} catch (Exception ex) {
String vlName = listener.getClass().getSimpleName();
LOG.log(Level.WARNING,
"Exception caught while sending the vote notification to the '"
+ vlName + "' listener", ex);
}
}

// Call event
VotifierEvent.EVENT.invoker().onVoteReceived(vote);

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"depends": {
"fabricloader": "*",
"fabric": "*",
"minecraft": "1.20.1"
"minecraft": "1.20.4"
}
}

0 comments on commit 899188e

Please sign in to comment.