Skip to content

Commit

Permalink
Disable opening EnderStorage chests to prevent client crash with 1.1.…
Browse files Browse the repository at this point in the history
…3 r1 bukkit port; recover from alternate recipe failure to make testing easier
  • Loading branch information
mushroomhostage committed Jul 4, 2012
1 parent 336e72f commit 9d4b13e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 15 deletions.
50 changes: 36 additions & 14 deletions ExphcTweaks.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,28 @@ public class ExphcTweaks extends JavaPlugin implements Listener {
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() {
Expand All @@ -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();

Expand All @@ -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;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 9d4b13e

Please sign in to comment.