Skip to content
Browse files

Disable opening EnderStorage chests to prevent client crash with 1.1.…

…3 r1 bukkit port; recover from alternate recipe failure to make testing easier
  • Loading branch information...
1 parent 336e72f commit 9d4b13e053fa5bb00a8f4f0f5277747e75f4af2f @mushroomhostage committed
Showing with 37 additions and 15 deletions.
  1. +36 −14 ExphcTweaks.java
  2. +1 −1 plugin.yml
View
50 ExphcTweaks.java
@@ -54,20 +54,28 @@
public void onEnable() {
Bukkit.getServer().getPluginManager().registerEvents(this, this);
- // Recipe for Jammy Furniture Mod gutter to not conflict with WRCBE stone bowl
- // https://github.com/mushroomhostage/exphc/issues/54
- ShapedRecipe gutter = new ShapedRecipe(new ItemStack(JFM_GUTTERING_STRAIGHT, 6));
- gutter.shape(" ", "S S", "SSS");
- gutter.setIngredient('S', Material.STONE);
- Bukkit.addRecipe(gutter);
-
- // Recipe for MineFactory Reloaded item collector to not conflict with Iron Chest
- // https://github.com/mushroomhostage/exphc/issues/57
- ShapedRecipe collector = new ShapedRecipe(new ItemStack(MFR_MACHINE, 1, MFR_ITEM_COLLECTOR_DAMAGE));
- collector.shape("rrr", "rCr", "rrr");
- collector.setIngredient('r', Material.getMaterial(IC2_REFINED_IRON));
- collector.setIngredient('C', Material.getMaterial(RP2_APPLIANCE), RP2_PROJECT_TABLE_DAMAGE);
- Bukkit.addRecipe(collector);
+ try {
+ // Recipe for Jammy Furniture Mod gutter to not conflict with WRCBE stone bowl
+ // https://github.com/mushroomhostage/exphc/issues/54
+ ShapedRecipe gutter = new ShapedRecipe(new ItemStack(JFM_GUTTERING_STRAIGHT, 6));
+ gutter.shape(" ", "S S", "SSS");
+ gutter.setIngredient('S', Material.STONE);
+ Bukkit.addRecipe(gutter);
+ } catch (Exception e) {
+ log.warning("Not enabling alternate JFM Guttering recipe: "+e);
+ }
+
+ try {
+ // Recipe for MineFactory Reloaded item collector to not conflict with Iron Chest
+ // https://github.com/mushroomhostage/exphc/issues/57
+ ShapedRecipe collector = new ShapedRecipe(new ItemStack(MFR_MACHINE, 1, MFR_ITEM_COLLECTOR_DAMAGE));
+ collector.shape("rrr", "rCr", "rrr");
+ collector.setIngredient('r', Material.getMaterial(IC2_REFINED_IRON));
+ collector.setIngredient('C', Material.getMaterial(RP2_APPLIANCE), RP2_PROJECT_TABLE_DAMAGE);
+ Bukkit.addRecipe(collector);
+ } catch (Exception e) {
+ log.warning("Not enabling alterate MFR collector recipe: "+e);
+ }
}
public void onDisable() {
@@ -88,6 +96,7 @@ public void onPlayerInteract(PlayerInteractEvent event) {
ItemStack item = event.getItem();
// https://github.com/mushroomhostage/exphc/issues/24 AnimalBikes should be one-time use
+ // TODO: I think this is broken in 1.2.5.. was working in 1.2.3. maybe change to increase counter, up to limit? https://github.com/mushroomhostage/exphc/issues/53
if (block != null && item != null && item.getTypeId() == 567) { // AnimalBikes
Player player = event.getPlayer();
@@ -114,6 +123,19 @@ public void onPlayerInteract(PlayerInteractEvent event) {
log.info("[ExphcTweaks] [AB] Player "+player.getName()+" apparently did not place AnimalBike "+item.getDurability()+", not clearing hand");
}
}
+
+ // EnderStorage chests crash client due to server bug
+ // see https://gist.github.com/3045581
+ // present in enderstorage-server-1.1.3-bukkit-mcpc-1.2.5.zip
+ // fixed but need to update TODO: remove once updated server!
+ if (block != null && block.getTypeId() == 1666) { // EnderStorage chests (custom)
+ Player player = event.getPlayer();
+
+ player.sendMessage("Sorry, opening ender chests temporarily disabled due to crashes");
+ event.setCancelled(true);
+ // TODO: pouches, too..
+ return;
+ }
}
}
View
2 plugin.yml
@@ -1,6 +1,6 @@
name: ExphcTweaks
main: me.exphc.ExphcTweaks.ExphcTweaks
-version: 1.2.5
+version: 1.2.5rev4
commands:
clear:
description: Clear nearby item drops

0 comments on commit 9d4b13e

Please sign in to comment.
Something went wrong with that request. Please try again.