Static Abuse Removal - More events purged of static abuse, moved some

unwanted alchemy code into the dumpster
This commit is contained in:
nossr50 2019-07-03 00:27:09 -07:00
parent 3bddfed72f
commit 40a3de76fb
6 changed files with 72 additions and 81 deletions

View File

@ -20,7 +20,7 @@ import java.util.concurrent.locks.ReentrantLock;
public final class SQLDatabaseManager implements DatabaseManager { public final class SQLDatabaseManager implements DatabaseManager {
private mcMMO pluginRef; private mcMMO pluginRef;
public final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver"; private final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver";
private final String ALL_QUERY_VERSION = "total"; private final String ALL_QUERY_VERSION = "total";
private final Map<UUID, Integer> cachedUserIDs = new HashMap<>(); private final Map<UUID, Integer> cachedUserIDs = new HashMap<>();
private String tablePrefix = pluginRef.getMySQLConfigSettings().getConfigSectionDatabase().getTablePrefix(); private String tablePrefix = pluginRef.getMySQLConfigSettings().getConfigSectionDatabase().getTablePrefix();

View File

@ -0,0 +1,37 @@
//package com.gmail.nossr50.events.skills.alchemy;
//
//import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
//import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
//import org.bukkit.block.Block;
//import org.bukkit.block.BlockState;
//import org.bukkit.block.BrewingStand;
//import org.bukkit.entity.Player;
//import org.bukkit.event.Cancellable;
//
//public class McMMOPlayerBrewEvent extends McMMOPlayerSkillEvent implements Cancellable {
// private BlockState brewingStand;
//
// private boolean cancelled;
//
// public McMMOPlayerBrewEvent(Player player, BlockState brewingStand) {
// super(player, PrimarySkillType.ALCHEMY);
// this.brewingStand = brewingStand;
// cancelled = false;
// }
//
// public boolean isCancelled() {
// return cancelled;
// }
//
// public void setCancelled(boolean newValue) {
// this.cancelled = newValue;
// }
//
// public Block getBrewingStandBlock() {
// return brewingStand.getBlock();
// }
//
// public BrewingStand getBrewingStand() {
// return (BrewingStand) brewingStand;
// }
//}

View File

@ -0,0 +1,34 @@
//package com.gmail.nossr50.events.skills.alchemy;
//
//import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
//import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
//import org.bukkit.entity.Player;
//import org.bukkit.event.Cancellable;
//
//public class McMMOPlayerCatalysisEvent extends McMMOPlayerSkillEvent implements Cancellable {
// private double speed;
//
// private boolean cancelled;
//
// public McMMOPlayerCatalysisEvent(Player player, double speed) {
// super(player, PrimarySkillType.ALCHEMY);
// this.speed = speed;
// cancelled = false;
// }
//
// public boolean isCancelled() {
// return cancelled;
// }
//
// public void setCancelled(boolean newValue) {
// this.cancelled = newValue;
// }
//
// public double getSpeed() {
// return speed;
// }
//
// public void setSpeed(double speed) {
// this.speed = speed;
// }
//}

View File

@ -14,12 +14,10 @@ public abstract class McMMOPlayerSkillEvent extends PlayerEvent {
**/ **/
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
protected PrimarySkillType skill; protected PrimarySkillType skill;
protected int skillLevel;
protected McMMOPlayerSkillEvent(Player player, PrimarySkillType skill) { protected McMMOPlayerSkillEvent(Player player, PrimarySkillType skill) {
super(player); super(player);
this.skill = skill; this.skill = skill;
this.skillLevel = pluginRef.getUserManager().getPlayer(player).getSkillLevel(skill);
} }
public static HandlerList getHandlerList() { public static HandlerList getHandlerList() {
@ -33,13 +31,6 @@ public abstract class McMMOPlayerSkillEvent extends PlayerEvent {
return skill; return skill;
} }
/**
* @return The level of the skill involved in this event
*/
public int getSkillLevel() {
return skillLevel;
}
@Override @Override
public HandlerList getHandlers() { public HandlerList getHandlers() {
return handlers; return handlers;

View File

@ -1,37 +0,0 @@
package com.gmail.nossr50.events.skills.alchemy;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.BrewingStand;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
public class McMMOPlayerBrewEvent extends McMMOPlayerSkillEvent implements Cancellable {
private BlockState brewingStand;
private boolean cancelled;
public McMMOPlayerBrewEvent(Player player, BlockState brewingStand) {
super(player, PrimarySkillType.ALCHEMY);
this.brewingStand = brewingStand;
cancelled = false;
}
public boolean isCancelled() {
return cancelled;
}
public void setCancelled(boolean newValue) {
this.cancelled = newValue;
}
public Block getBrewingStandBlock() {
return brewingStand.getBlock();
}
public BrewingStand getBrewingStand() {
return (BrewingStand) brewingStand;
}
}

View File

@ -1,34 +0,0 @@
package com.gmail.nossr50.events.skills.alchemy;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
public class McMMOPlayerCatalysisEvent extends McMMOPlayerSkillEvent implements Cancellable {
private double speed;
private boolean cancelled;
public McMMOPlayerCatalysisEvent(Player player, double speed) {
super(player, PrimarySkillType.ALCHEMY);
this.speed = speed;
cancelled = false;
}
public boolean isCancelled() {
return cancelled;
}
public void setCancelled(boolean newValue) {
this.cancelled = newValue;
}
public double getSpeed() {
return speed;
}
public void setSpeed(double speed) {
this.speed = speed;
}
}