Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3e7b3b3b2 | ||
|
|
ed31471e4f | ||
|
|
20db0ac775 | ||
|
|
e4c1164b7a | ||
|
|
5d11841e4a | ||
|
|
804a60f169 | ||
|
|
d9176f84b5 |
No files matched your search
@@ -0,0 +1,25 @@
|
||||
# Editorconfig is awesome: http://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
continuation_indent_size = 8
|
||||
|
||||
[*.java]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.xml]
|
||||
indent_style = tab
|
||||
indent_size = 2
|
||||
|
||||
[*.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -6,7 +6,7 @@
|
||||
<groupId>com.programmerdan.minecraft</groupId>
|
||||
<artifactId>SimpleAdminHacks</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.1.2</version>
|
||||
<version>1.2.1</version>
|
||||
<name>SimpleAdminHacks</name>
|
||||
<url>https://github.com/DevotedMC/SimpleAdminHacks</url>
|
||||
|
||||
@@ -107,13 +107,13 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.10.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.12-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.minelink</groupId>
|
||||
<artifactId>CombatTagPlus</artifactId>
|
||||
<version>1.2.4-SNAPSHOT</version>
|
||||
<version>1.3.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@@ -142,24 +142,24 @@
|
||||
<dependency>
|
||||
<groupId>com.comphenix.protocol</groupId>
|
||||
<artifactId>ProtocolLib-API</artifactId>
|
||||
<version>4.0-SNAPSHOT</version>
|
||||
<version>4.3.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>vg.civcraft.mc.namelayer</groupId>
|
||||
<artifactId>NameLayer</artifactId>
|
||||
<version>2.9.08</version>
|
||||
<version>2.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>vg.civcraft.mc.citadel</groupId>
|
||||
<artifactId>Citadel</artifactId>
|
||||
<version>3.7.02</version>
|
||||
<version>3.9.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>vg.civcraft.mc.civmodcore</groupId>
|
||||
<artifactId>CivModCore</artifactId>
|
||||
<version>1.5.09</version>
|
||||
<version>1.6.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Note: CrazyCrates isn't distributed in POM form.
|
||||
|
||||
+54
-6
@@ -28,11 +28,18 @@ public class GameFeaturesConfig extends SimpleHackConfig {
|
||||
private boolean villagerTrading;
|
||||
private boolean witherSpawning;
|
||||
private boolean enderChestPlacement;
|
||||
private boolean enderChestUse;
|
||||
private boolean shulkerBoxUse;
|
||||
private boolean totemPowers;
|
||||
private boolean elytraUse;
|
||||
private boolean chorusFruitUse;
|
||||
|
||||
private boolean weepingAngel;
|
||||
private int weepingAngelEnv;
|
||||
private int weepingAngelPlayer;
|
||||
|
||||
private boolean blockWaterInHell;
|
||||
|
||||
public GameFeaturesConfig(SimpleAdminHacks plugin, ConfigurationSection base) {
|
||||
super(plugin, base);
|
||||
}
|
||||
@@ -43,22 +50,39 @@ public class GameFeaturesConfig extends SimpleHackConfig {
|
||||
if (!this.potatoXPEnabled) plugin().log(" Potato XP Disabled");
|
||||
|
||||
this.villagerTrading = config.getBoolean("villagerTrading", false);
|
||||
if (!villagerTrading) plugin().log("VillagerTrading is disabled");
|
||||
if (!villagerTrading) plugin().log(" VillagerTrading is disabled");
|
||||
|
||||
this.witherSpawning = config.getBoolean("witherSpawning", false);
|
||||
if (!this.witherSpawning) plugin().log("Wither Spawning is disabled");
|
||||
if (!this.witherSpawning) plugin().log(" Wither Spawning is disabled");
|
||||
|
||||
this.enderChestPlacement = config.getBoolean("enderChestPlacement", false);
|
||||
if (!this.enderChestPlacement) plugin().log("Placeing EnderChests is disabled");
|
||||
this.enderChestPlacement = config.getBoolean("enderChestPlacement", true);
|
||||
if (!this.enderChestPlacement) plugin().log(" Placing EnderChests is disabled");
|
||||
|
||||
this.enderChestUse = config.getBoolean("enderChestUse", false);
|
||||
if (!this.enderChestUse) plugin().log(" Using EnderChests is disabled");
|
||||
|
||||
this.shulkerBoxUse = config.getBoolean("shulkerBoxUse", false);
|
||||
if (!this.shulkerBoxUse) plugin().log(" Using Shulker Boxes is disabled");
|
||||
|
||||
this.totemPowers = config.getBoolean("totemPower", false);
|
||||
if (!this.totemPowers) plugin().log(" Undeath via totems is disabled");
|
||||
|
||||
this.elytraUse = config.getBoolean("elytraUse", true);
|
||||
if (!this.elytraUse) plugin().log(" Elytra use is disabled");
|
||||
|
||||
this.chorusFruitUse = config.getBoolean("chorusFruitTeleportation", false);
|
||||
if (!this.chorusFruitUse) plugin().log(" Chorus Fruit Teleportation is disabled");
|
||||
|
||||
this.weepingAngel = config.getBoolean("weepingAngel.enabled", false);
|
||||
this.weepingAngel = config.getBoolean("weepingAngel.enabled", false);
|
||||
if (this.weepingAngel) {
|
||||
this.weepingAngelEnv = config.getInt("weepingAngel.environment", 1);
|
||||
this.weepingAngelPlayer = config.getInt("weepingAngel.playerKill", 5);
|
||||
|
||||
plugin().log("Weeping Angel is enabled. Times | Env[" + weepingAngelEnv + "] PK[" + weepingAngelPlayer + "]");
|
||||
plugin().log(" Weeping Angel is enabled. Times | Env[" + weepingAngelEnv + "] PK[" + weepingAngelPlayer + "]");
|
||||
}
|
||||
|
||||
this.blockWaterInHell = config.getBoolean("blockWaterInHell", true);
|
||||
if (this.blockWaterInHell) plugin().log(" Blocking bucket use in hell biomes");
|
||||
|
||||
/* Add additional feature config grabs here. */
|
||||
}
|
||||
@@ -82,6 +106,26 @@ public class GameFeaturesConfig extends SimpleHackConfig {
|
||||
return this.enderChestPlacement;
|
||||
}
|
||||
|
||||
public boolean isEnderChestUse() {
|
||||
return this.enderChestUse;
|
||||
}
|
||||
|
||||
public boolean isShulkerBoxUse() {
|
||||
return this.shulkerBoxUse;
|
||||
}
|
||||
|
||||
public boolean isTotemPowers() {
|
||||
return this.totemPowers;
|
||||
}
|
||||
|
||||
public boolean isElytraUse() {
|
||||
return this.elytraUse;
|
||||
}
|
||||
|
||||
public boolean isChorusFruitTeleportation() {
|
||||
return this.chorusFruitUse;
|
||||
}
|
||||
|
||||
public boolean isWeepingAngel() {
|
||||
return this.weepingAngel;
|
||||
}
|
||||
@@ -94,5 +138,9 @@ public class GameFeaturesConfig extends SimpleHackConfig {
|
||||
return this.weepingAngelPlayer;
|
||||
}
|
||||
|
||||
public boolean isBlockWaterInHell() {
|
||||
return this.blockWaterInHell;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+17
-3
@@ -8,6 +8,7 @@ import com.programmerdan.minecraft.simpleadminhacks.SimpleAdminHacks;
|
||||
import com.programmerdan.minecraft.simpleadminhacks.SimpleHackConfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class GameFixesConfig extends SimpleHackConfig {
|
||||
|
||||
@@ -17,7 +18,8 @@ public class GameFixesConfig extends SimpleHackConfig {
|
||||
private boolean stopHopperDupe;
|
||||
private boolean stopRailDupe;
|
||||
private boolean stopEndPortalDeletion;
|
||||
|
||||
private boolean stopBedBombing;
|
||||
|
||||
private ArrayList<BlockFace> bfArray;
|
||||
private ArrayList<Material> railArray;
|
||||
private ArrayList<Material> pistonArray;
|
||||
@@ -30,14 +32,22 @@ public class GameFixesConfig extends SimpleHackConfig {
|
||||
protected void wireup(ConfigurationSection config) {
|
||||
blockElytraBreakBug = config.getBoolean("blockElytraBreakBug", true);
|
||||
damageOnElytraBreakBug = config.getDouble("damageOnElytraBreakBug", 0.0d);
|
||||
if (blockElytraBreakBug) plugin().log(Level.INFO, " Block Elytra 1height break bug is enabled, doing {} damage to violators", damageOnElytraBreakBug);
|
||||
|
||||
canStorageTeleport = config.getBoolean("canStorageTeleport");
|
||||
if (!canStorageTeleport) plugin().log(" Storage holder teleportation is disabled.");
|
||||
|
||||
stopHopperDupe = config.getBoolean("stopHopperDupe");
|
||||
if (stopHopperDupe) plugin().log(" Stop Hopper self-feeding Dupe is enabled.");
|
||||
|
||||
stopRailDupe = config.getBoolean("stopRailDupe", true);
|
||||
if (stopRailDupe) plugin().log("Stop Rail Dupe is enabled.");
|
||||
if (stopRailDupe) plugin().log(" Stop Rail Dupe is enabled.");
|
||||
|
||||
stopEndPortalDeletion = config.getBoolean("stopEndPortalDeletion", true);
|
||||
if (stopEndPortalDeletion) plugin().log("Stop End Portal Deletion is enabled.");
|
||||
if (stopEndPortalDeletion) plugin().log(" Stop End Portal Deletion is enabled.");
|
||||
|
||||
stopBedBombing = config.getBoolean("stopBedBombingInHellBiomes", true);
|
||||
if (stopBedBombing) plugin().log(" Stop Bed Bombing In Hell Biomes is enabled.");
|
||||
}
|
||||
|
||||
private void wireUpArrays() {
|
||||
@@ -99,4 +109,8 @@ public class GameFixesConfig extends SimpleHackConfig {
|
||||
public ArrayList<Material> getPistonArray() {
|
||||
return pistonArray;
|
||||
}
|
||||
|
||||
public boolean stopBedBombing() {
|
||||
return this.stopBedBombing;
|
||||
}
|
||||
}
|
||||
@@ -105,6 +105,7 @@ public class Experimental extends SimpleHack<ExperimentalConfig> implements List
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
|
||||
private void monitorTeleportLow(PlayerTeleportEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isTeleportSpy()) return;
|
||||
StringBuffer sb = new StringBuffer("[LO] ");
|
||||
logTeleport(event, sb);
|
||||
@@ -112,6 +113,7 @@ public class Experimental extends SimpleHack<ExperimentalConfig> implements List
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = false)
|
||||
private void monitorTeleportHigh(PlayerTeleportEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isTeleportSpy()) return;
|
||||
StringBuffer sb = new StringBuffer("[HI] ");
|
||||
logTeleport(event, sb);
|
||||
@@ -119,6 +121,7 @@ public class Experimental extends SimpleHack<ExperimentalConfig> implements List
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
private void monitorTeleportTrack(PlayerPortalEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isPostTeleportSpy()) return;
|
||||
|
||||
final Player player = event.getPlayer();
|
||||
@@ -194,6 +197,7 @@ public class Experimental extends SimpleHack<ExperimentalConfig> implements List
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
|
||||
private void monitorCombatLow(EntityDamageByEntityEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isCombatSpy()) return;
|
||||
StringBuffer sb = new StringBuffer("[LO] ");
|
||||
logCombat(event, sb);
|
||||
@@ -219,6 +223,7 @@ public class Experimental extends SimpleHack<ExperimentalConfig> implements List
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = false)
|
||||
private void monitorCombatHigh(EntityDamageByEntityEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isCombatSpy()) return;
|
||||
StringBuffer sb = new StringBuffer("[HI]: ");
|
||||
logCombat(event, sb);
|
||||
|
||||
+152
-5
@@ -7,16 +7,24 @@ import java.util.List;
|
||||
import org.apache.commons.lang.time.DateUtils;
|
||||
import org.bukkit.BanList;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.block.BlockDispenseEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityResurrectEvent;
|
||||
import org.bukkit.event.entity.EntityToggleGlideEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.inventory.FurnaceExtractEvent;
|
||||
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.Material;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
@@ -27,7 +35,17 @@ import org.bukkit.configuration.ConfigurationSection;
|
||||
import com.programmerdan.minecraft.simpleadminhacks.SimpleAdminHacks;
|
||||
import com.programmerdan.minecraft.simpleadminhacks.SimpleHack;
|
||||
import com.programmerdan.minecraft.simpleadminhacks.configs.GameFeaturesConfig;
|
||||
|
||||
import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerItemDamageEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.Dispenser;
|
||||
import org.bukkit.material.Hopper;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
/**
|
||||
* This is a grab-bag class to hold any _features_ related configurations that impact the
|
||||
@@ -91,33 +109,75 @@ public class GameFeatures extends SimpleHack<GameFeaturesConfig> implements List
|
||||
genStatus.append(" Potato XP is disabled\n");
|
||||
}
|
||||
|
||||
genStatus.append(" Villager Trading is ");
|
||||
genStatus.append(" Villager Trading is ");
|
||||
if (config.isVillagerTrading()) {
|
||||
genStatus.append("enabled\n");
|
||||
} else {
|
||||
genStatus.append("disabled\n");
|
||||
}
|
||||
|
||||
genStatus.append(" Wither Spawning is ");
|
||||
genStatus.append(" Wither Spawning is ");
|
||||
if (config.isWitherSpawning()) {
|
||||
genStatus.append("enabled\n");
|
||||
} else {
|
||||
genStatus.append("disabled\n");
|
||||
}
|
||||
|
||||
genStatus.append(" Ender Chest placement is ");
|
||||
genStatus.append(" Ender Chest placement is ");
|
||||
if (config.isEnderChestPlacement()) {
|
||||
genStatus.append("enabled\n");
|
||||
} else {
|
||||
genStatus.append("disabled\n");
|
||||
}
|
||||
|
||||
genStatus.append(" WeepAngel is ");
|
||||
genStatus.append(" Ender Chest use is ");
|
||||
if (config.isEnderChestUse()) {
|
||||
genStatus.append("enabled\n");
|
||||
} else {
|
||||
genStatus.append("disabled\n");
|
||||
}
|
||||
|
||||
genStatus.append(" Shulker Box use is ");
|
||||
if (config.isShulkerBoxUse()) {
|
||||
genStatus.append("enabled\n");
|
||||
} else {
|
||||
genStatus.append("disabled\n");
|
||||
}
|
||||
|
||||
genStatus.append(" Totem of Undying effects are ");
|
||||
if (config.isTotemPowers()) {
|
||||
genStatus.append("enabled\n");
|
||||
} else {
|
||||
genStatus.append("disabled\n");
|
||||
}
|
||||
|
||||
genStatus.append(" Elytra use is ");
|
||||
if (config.isElytraUse()) {
|
||||
genStatus.append("enabled\n");
|
||||
} else {
|
||||
genStatus.append("disabled\n");
|
||||
}
|
||||
|
||||
genStatus.append(" Chorus Fruit teleportation is ");
|
||||
if (config.isChorusFruitTeleportation()) {
|
||||
genStatus.append("enabled\n");
|
||||
} else {
|
||||
genStatus.append("disabled\n");
|
||||
}
|
||||
|
||||
genStatus.append(" WeepAngel is ");
|
||||
if (config.isWeepingAngel()) {
|
||||
genStatus.append("enabled\n");
|
||||
} else {
|
||||
genStatus.append("disabled\n");
|
||||
}
|
||||
|
||||
genStatus.append(" Block water in HELL biomes is ");
|
||||
if (config.isBlockWaterInHell()) {
|
||||
genStatus.append("enabled\n");
|
||||
} else {
|
||||
genStatus.append("disabled\n");
|
||||
}
|
||||
|
||||
// more?
|
||||
} else {
|
||||
@@ -152,6 +212,7 @@ public class GameFeatures extends SimpleHack<GameFeaturesConfig> implements List
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void disableVillagerTrading(PlayerInteractEntityEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isVillagerTrading()) {
|
||||
Entity npc = event.getRightClicked();
|
||||
|
||||
@@ -165,6 +226,7 @@ public class GameFeatures extends SimpleHack<GameFeaturesConfig> implements List
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void disableWitherSpawning(CreatureSpawnEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isWitherSpawning()) {
|
||||
if (event.getEntityType().equals(EntityType.WITHER)) {
|
||||
event.setCancelled(true);
|
||||
@@ -174,15 +236,75 @@ public class GameFeatures extends SimpleHack<GameFeaturesConfig> implements List
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void disableEnderChestPlacement(BlockPlaceEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isEnderChestPlacement()) {
|
||||
if (event.getBlock().getType().equals(Material.ENDER_CHEST)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void disableEnderChestUse(PlayerInteractEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isEnderChestUse()) {
|
||||
Action action = event.getAction();
|
||||
Material material = event.getClickedBlock().getType();
|
||||
boolean ender_chest = action == Action.RIGHT_CLICK_BLOCK &&
|
||||
material.equals(Material.ENDER_CHEST);
|
||||
if (ender_chest) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void disableShulkerBoxUse(InventoryOpenEvent event){
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isShulkerBoxUse() && InventoryType.SHULKER_BOX.equals(event.getInventory().getType())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void disabledShulkerBoxHoppering(InventoryMoveItemEvent event) {
|
||||
if (!config.isEnabled() || config.isShulkerBoxUse()) return;
|
||||
|
||||
if ((event.getDestination() == null) || (event.getSource() == null)) return;
|
||||
if (InventoryType.SHULKER_BOX.equals(event.getDestination().getType()) ||
|
||||
InventoryType.SHULKER_BOX.equals(event.getSource().getType())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void disableTotemPowers(EntityResurrectEvent event) {
|
||||
if (!config.isEnabled() || config.isTotemPowers()) return;
|
||||
|
||||
if (EntityType.PLAYER.equals(event.getEntityType())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void disableChorusFruitTeleportation(PlayerTeleportEvent event) {
|
||||
if (!config.isEnabled() || config.isChorusFruitTeleportation()) return;
|
||||
|
||||
if (event.getCause().equals(PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void disableElytraUse(EntityToggleGlideEvent event) {
|
||||
if (!config.isEnabled() || config.isElytraUse()) return;
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void weepingAngelListener(PlayerDeathEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isWeepingAngel()) {
|
||||
return;
|
||||
}
|
||||
@@ -229,4 +351,29 @@ public class GameFeatures extends SimpleHack<GameFeaturesConfig> implements List
|
||||
}, 2L);
|
||||
}
|
||||
|
||||
}
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onPlayerBucketEmptyEvent(PlayerBucketEmptyEvent e) {
|
||||
if (config.isEnabled() && config.isBlockWaterInHell()) {
|
||||
if ((e.getBlockClicked().getBiome() == Biome.HELL) && (e.getBucket() == Material.WATER_BUCKET)) {
|
||||
e.setCancelled(true);
|
||||
e.getItemStack().setType(Material.BUCKET);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onDispenseEvent(BlockDispenseEvent event) {
|
||||
if (config.isEnabled() && config.isBlockWaterInHell()) {
|
||||
if (event.getBlock().getType() == Material.DISPENSER) {
|
||||
Dispenser disp = (Dispenser) event.getBlock().getState().getData();
|
||||
Biome biome = event.getBlock().getRelative(disp.getFacing()).getBiome();
|
||||
|
||||
if (Biome.HELL.equals(biome) && event.getItem() != null && event.getItem().getType().equals(Material.WATER_BUCKET)) {
|
||||
event.setItem(new ItemStack(Material.BUCKET, event.getItem().getAmount()));
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.programmerdan.minecraft.simpleadminhacks.hacks;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World.Environment;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@@ -70,27 +72,42 @@ public class GameFixes extends SimpleHack<GameFixesConfig> implements Listener {
|
||||
genStatus.append("GameFixes is ");
|
||||
if (config != null && config.isEnabled()) {
|
||||
genStatus.append(ChatColor.GREEN).append("active\n").append(ChatColor.RESET);
|
||||
genStatus.append(" Block elytra break bug is ");
|
||||
if (config.isBlockElytraBreakBug()) {
|
||||
genStatus.append(" Block elytra break bug is ").append(ChatColor.GREEN).append("enabled\n")
|
||||
.append(ChatColor.RESET);
|
||||
genStatus.append(ChatColor.GREEN).append("enabled\n").append(ChatColor.RESET);
|
||||
genStatus.append(" Will deal " + config.getDamageOnElytraBreakBug() + " damage to players\n");
|
||||
} else {
|
||||
genStatus.append(" Block elytra break bug is ").append(ChatColor.RED).append("disabled\n")
|
||||
.append(ChatColor.RESET);
|
||||
genStatus.append(ChatColor.RED).append("disabled\n").append(ChatColor.RESET);
|
||||
}
|
||||
genStatus.append(" Block storage entities from teleporting to prevents exploits ");
|
||||
if (!config.canStorageTeleport()) {
|
||||
genStatus.append(" Block storage entities from teleporting to prevents exploits ")
|
||||
.append(ChatColor.GREEN).append("enabled\n").append(ChatColor.RESET);
|
||||
genStatus.append(ChatColor.GREEN).append("enabled\n").append(ChatColor.RESET);
|
||||
} else {
|
||||
genStatus.append(" Block storage entities from teleporting to prevents exploits ")
|
||||
.append(ChatColor.RED).append("disabled\n").append(ChatColor.RESET);
|
||||
genStatus.append(ChatColor.RED).append("disabled\n").append(ChatColor.RESET);
|
||||
}
|
||||
genStatus.append(" Hopper self-feed duplication exploit fix ");
|
||||
if (config.isStopHopperDupe()) {
|
||||
genStatus.append(" Hopper self-feed duplication exploit fix ")
|
||||
.append(ChatColor.GREEN).append("enabled\n").append(ChatColor.RESET);
|
||||
genStatus.append(ChatColor.GREEN).append("enabled\n").append(ChatColor.RESET);
|
||||
} else {
|
||||
genStatus.append(" Hopper self-feed duplication exploit fix ")
|
||||
.append(ChatColor.RED).append("disabled\n").append(ChatColor.RESET);
|
||||
genStatus.append(ChatColor.RED).append("disabled\n").append(ChatColor.RESET);
|
||||
}
|
||||
genStatus.append(" Duplications using rails exploit fix ");
|
||||
if (config.isStopRailDupe()) {
|
||||
genStatus.append(ChatColor.GREEN).append("enabled\n").append(ChatColor.RESET);
|
||||
} else {
|
||||
genStatus.append(ChatColor.RED).append("disabled\n").append(ChatColor.RESET);
|
||||
}
|
||||
genStatus.append(" End Portal removal exploit fix ");
|
||||
if (config.isStopEndPortalDeletion()) {
|
||||
genStatus.append(ChatColor.GREEN).append("enabled\n").append(ChatColor.RESET);
|
||||
} else {
|
||||
genStatus.append(ChatColor.RED).append("disabled\n").append(ChatColor.RESET);
|
||||
}
|
||||
genStatus.append(" Bed Bombing in Nether / Hell Biomes fix ");
|
||||
if (config.stopBedBombing()) {
|
||||
genStatus.append(ChatColor.GREEN).append("enabled\n").append(ChatColor.RESET);
|
||||
} else {
|
||||
genStatus.append(ChatColor.RED).append("disabled\n").append(ChatColor.RESET);
|
||||
}
|
||||
} else {
|
||||
genStatus.append(ChatColor.RED).append("inactive").append(ChatColor.RESET);
|
||||
@@ -147,7 +164,7 @@ public class GameFixes extends SimpleHack<GameFixesConfig> implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onPistonPushRail(BlockPistonExtendEvent event) {
|
||||
if (config.isStopRailDupe()) {
|
||||
if (config.isEnabled() && config.isStopRailDupe()) {
|
||||
for (Block block : event.getBlocks()) {
|
||||
Material type = block.getType();
|
||||
|
||||
@@ -161,7 +178,7 @@ public class GameFixes extends SimpleHack<GameFixesConfig> implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onRailPlace(BlockPlaceEvent event) {
|
||||
if (config.isStopRailDupe()) {
|
||||
if (config.isEnabled() && config.isStopRailDupe()) {
|
||||
Block block = event.getBlock();
|
||||
Material type = block.getType();
|
||||
|
||||
@@ -181,7 +198,7 @@ public class GameFixes extends SimpleHack<GameFixesConfig> implements Listener {
|
||||
//Trying to stop players from deleting end portals
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event) {
|
||||
if (config.isStopEndPortalDeletion()) {
|
||||
if (config.isEnabled() && config.isStopEndPortalDeletion()) {
|
||||
Block block = event.getBlockClicked().getRelative(event.getBlockFace());
|
||||
|
||||
if (block.getType() == Material.ENDER_PORTAL) {
|
||||
@@ -192,7 +209,7 @@ public class GameFixes extends SimpleHack<GameFixesConfig> implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onDispenseEvent(BlockDispenseEvent event) {
|
||||
if (config.isStopEndPortalDeletion()) {
|
||||
if (config.isEnabled() && config.isStopEndPortalDeletion()) {
|
||||
if (event.getBlock().getType() == Material.DISPENSER) {
|
||||
Dispenser disp = (Dispenser) event.getBlock().getState().getData();
|
||||
Material type = event.getBlock().getRelative(disp.getFacing()).getType();
|
||||
@@ -204,6 +221,21 @@ public class GameFixes extends SimpleHack<GameFixesConfig> implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onPlayerEnterBed(BlockPlaceEvent event) {
|
||||
if (!config.isEnabled() || !config.stopBedBombing()) return;
|
||||
|
||||
Block b = event.getBlock();
|
||||
if (!(b.getType() == Material.BED || b.getType() == Material.BED_BLOCK))
|
||||
return;
|
||||
|
||||
Environment env = b.getLocation().getWorld().getEnvironment();
|
||||
Biome biome = b.getLocation().getBlock().getBiome();
|
||||
if (env == Environment.NETHER || env == Environment.THE_END || Biome.HELL == biome || Biome.SKY == biome) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
public static GameFixesConfig generate(SimpleAdminHacks plugin, ConfigurationSection config) {
|
||||
return new GameFixesConfig(plugin, config);
|
||||
|
||||
@@ -227,7 +227,7 @@ public class GameTuning extends SimpleHack<GameTuningConfig> implements Listener
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPortalTravel(EntityPortalEvent event) {
|
||||
if (config.isOneToOneNether()) {
|
||||
if (config.isEnabled() && config.isOneToOneNether()) {
|
||||
Location newLoc = event.getFrom();
|
||||
newLoc.setWorld(event.getTo().getWorld());
|
||||
event.setTo(newLoc);
|
||||
@@ -236,7 +236,7 @@ public class GameTuning extends SimpleHack<GameTuningConfig> implements Listener
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerPortalTravel(PlayerPortalEvent event) {
|
||||
if (config.isOneToOneNether() && event.getCause() == PlayerTeleportEvent.TeleportCause.NETHER_PORTAL) {
|
||||
if (config.isEnabled() && config.isOneToOneNether() && event.getCause() == PlayerTeleportEvent.TeleportCause.NETHER_PORTAL) {
|
||||
Location newLoc = event.getFrom();
|
||||
newLoc.setWorld(event.getTo().getWorld());
|
||||
event.setTo(newLoc);
|
||||
@@ -245,7 +245,7 @@ public class GameTuning extends SimpleHack<GameTuningConfig> implements Listener
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onPortalCreate(PortalCreateEvent event) {
|
||||
if (!config.isReturnNetherPortal()) {
|
||||
if (config.isEnabled() && !config.isReturnNetherPortal()) {
|
||||
if (event.getReason() == PortalCreateEvent.CreateReason.FIRE && event.getWorld().getName().equals("world_nether")) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@@ -255,6 +255,7 @@ public class GameTuning extends SimpleHack<GameTuningConfig> implements Listener
|
||||
//Trying to stop dupe bugs via minecart inventories
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onEntityRightClick(PlayerInteractEntityEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isChestedMinecartInventories() || !config.isHopperMinecartInventories()) {
|
||||
Entity target = event.getRightClicked();
|
||||
|
||||
@@ -270,6 +271,7 @@ public class GameTuning extends SimpleHack<GameTuningConfig> implements Listener
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onInventoryMoveItemEvent(InventoryMoveItemEvent event) {
|
||||
if (!config.isEnabled()) return;
|
||||
if (!config.isChestedMinecartInventories() || !config.isHopperMinecartInventories()) {
|
||||
InventoryHolder holder = event.getDestination().getHolder();
|
||||
if (holder instanceof StorageMinecart && !config.isChestedMinecartInventories()) {
|
||||
|
||||
@@ -5,9 +5,9 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import vg.civcraft.mc.namelayer.NameAPI;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_10_R1.NBTTagList;
|
||||
import net.minecraft.server.v1_10_R1.WorldNBTStorage;
|
||||
import net.minecraft.server.v1_12_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_12_R1.NBTTagList;
|
||||
import net.minecraft.server.v1_12_R1.WorldNBTStorage;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@@ -16,9 +16,9 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftInventoryPlayer;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftInventoryPlayer;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
@@ -89,7 +89,7 @@ public class InvControl extends SimpleHack<InvControlConfig> implements CommandE
|
||||
int food = rawPlayer.getInt("foodLevel");
|
||||
|
||||
// Fun NMS inventory reconstruction from file data.
|
||||
net.minecraft.server.v1_10_R1.PlayerInventory nms_pl_inv = new net.minecraft.server.v1_10_R1.PlayerInventory(null);
|
||||
net.minecraft.server.v1_12_R1.PlayerInventory nms_pl_inv = new net.minecraft.server.v1_12_R1.PlayerInventory(null);
|
||||
NBTTagList inv = rawPlayer.getList("Inventory", rawPlayer.getTypeId());
|
||||
nms_pl_inv.b(inv); // We use this to bypass the Craft code which requires a player object, unlike NMS.
|
||||
PlayerInventory pl_inv = (PlayerInventory) new CraftInventoryPlayer(nms_pl_inv);
|
||||
|
||||
+19
-17
@@ -3,13 +3,13 @@ package com.programmerdan.minecraft.simpleadminhacks.hacks;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.server.v1_10_R1.EntityTracker;
|
||||
import net.minecraft.server.v1_10_R1.EntityTrackerEntry;
|
||||
import net.minecraft.server.v1_10_R1.WorldServer;
|
||||
import net.minecraft.server.v1_10_R1.PacketPlayOutEntityTeleport;
|
||||
import net.minecraft.server.v1_12_R1.EntityTracker;
|
||||
import net.minecraft.server.v1_12_R1.EntityTrackerEntry;
|
||||
import net.minecraft.server.v1_12_R1.WorldServer;
|
||||
import net.minecraft.server.v1_12_R1.PacketPlayOutEntityTeleport;
|
||||
|
||||
import org.bukkit.craftbukkit.v1_10_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@@ -76,14 +76,17 @@ public class InvisibleFixTwo extends SimpleHack<InvisibleFixTwoConfig> implement
|
||||
|
||||
Vehicle vehicle = move.getVehicle();
|
||||
if (vehicle == null) return;
|
||||
Entity e = vehicle.getPassenger();
|
||||
if (e == null) return;
|
||||
|
||||
if (e.isOp() && config.getIgnoreOps()) return;
|
||||
String tPerm = config.getIgnorePermission();
|
||||
if (tPerm != null && e.hasPermission(tPerm)) return;
|
||||
if (vehicle.getPassengers() == null || vehicle.getPassengers().size() == 0) return;
|
||||
|
||||
forceUpdate(e);
|
||||
for (Entity e : vehicle.getPassengers()) {
|
||||
if (e == null) continue;
|
||||
|
||||
if (e.isOp() && config.getIgnoreOps()) continue;
|
||||
String tPerm = config.getIgnorePermission();
|
||||
if (tPerm != null && e.hasPermission(tPerm)) continue;
|
||||
|
||||
forceUpdate(e);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
@@ -121,12 +124,12 @@ public class InvisibleFixTwo extends SimpleHack<InvisibleFixTwoConfig> implement
|
||||
EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities
|
||||
.get(entity.getEntityId());
|
||||
|
||||
net.minecraft.server.v1_10_R1.Entity eEntity = getNmsEntity(entity);
|
||||
net.minecraft.server.v1_12_R1.Entity eEntity = getNmsEntity(entity);
|
||||
|
||||
entry.broadcast(new PacketPlayOutEntityTeleport(eEntity));
|
||||
}
|
||||
|
||||
private net.minecraft.server.v1_10_R1.Entity getNmsEntity(final Entity entity) {
|
||||
private net.minecraft.server.v1_12_R1.Entity getNmsEntity(final Entity entity) {
|
||||
CraftEntity craftEntity = (CraftEntity) entity;
|
||||
return craftEntity.getHandle();
|
||||
}
|
||||
@@ -175,5 +178,4 @@ public class InvisibleFixTwo extends SimpleHack<InvisibleFixTwoConfig> implement
|
||||
public static InvisibleFixTwoConfig generate(SimpleAdminHacks plugin, ConfigurationSection config) {
|
||||
return new InvisibleFixTwoConfig(plugin, config);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,14 +21,18 @@ hacks:
|
||||
# Wither spawn is also true = enabled and false = disabled
|
||||
witherSpawning: false
|
||||
# Enderchests is also true = enabled and false = disabled
|
||||
enderChestPlacement: false
|
||||
elytra: off
|
||||
chorus_fruit: off
|
||||
enderChestPlacement: true
|
||||
enderChestUse: false
|
||||
# ElytraUse: true = enabled, false = disabled
|
||||
elytraUse: true
|
||||
chorusFruitTeleportation: false
|
||||
# WeepingAngel bans people when they die, the numbers are in minutes.
|
||||
weepingAngel:
|
||||
enabled: false
|
||||
environment: 1
|
||||
playerKill: 5
|
||||
# prevent use of buckets or dispensing water in hell biomes
|
||||
blockWaterInHell: true
|
||||
GameFixes:
|
||||
enabled: true
|
||||
# Does not fully work atm
|
||||
@@ -38,6 +42,7 @@ hacks:
|
||||
stopHopperDupe: true
|
||||
stopRailDupe: true
|
||||
stopEndPortalDeletion: true
|
||||
stopBedBombingInHellBiomes: true
|
||||
GameTuning:
|
||||
enabled: true
|
||||
chunkLimits:
|
||||
@@ -50,6 +55,7 @@ hacks:
|
||||
DISPENSER: 4
|
||||
DROPPER: 4
|
||||
REDSTONE_COMPARATOR: 4
|
||||
OBSERVER: 2
|
||||
exempt:
|
||||
- Steve
|
||||
- Alex
|
||||
@@ -148,7 +154,7 @@ hacks:
|
||||
InvControl:
|
||||
enabled: true
|
||||
InvisibleFixTwo:
|
||||
enabled: true
|
||||
enabled: false
|
||||
# in ticks -- ticks to wait after teleport to force update
|
||||
teleportDelay: 5
|
||||
# in milliseconds -- min time between forced updates if active
|
||||
@@ -156,7 +162,7 @@ hacks:
|
||||
ignoreOps: true
|
||||
ignorePermission: sah.allowInvisible
|
||||
InvisibleFix:
|
||||
enabled: true
|
||||
enabled: false
|
||||
ignoreOps: true
|
||||
ignorePermission: sah.allowInvisible
|
||||
# in ticks
|
||||
@@ -190,6 +196,7 @@ hacks:
|
||||
- HOPPER
|
||||
- PISTON_BASE
|
||||
- PISTON_STICKY_BASE
|
||||
- OBSERVER
|
||||
Insight:
|
||||
enabled: false
|
||||
into:
|
||||
|
||||
Reference in new issue
Block a user