Skip to content

Commit

Permalink
Adds Hardcore Ender Expansion support for diamond dolly
Browse files Browse the repository at this point in the history
  • Loading branch information
querns committed Jul 13, 2024
1 parent fc36901 commit fa1e0f0
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ private void fixIC2Orientation(TileEntity entity, EntityPlayer player, int targY
}

private boolean isTEMovable(TileEntity te) {
if (te instanceof TileEntityMobSpawner) return this.canPickSpawners();
if (tileIsASpawner(te)) return this.canPickSpawners();
if (te instanceof TileEntityBarrel) return true;
if (te instanceof TileEntityChest) return true;
if (isTileBlacklisted(te.getClass())) {
Expand All @@ -535,6 +535,21 @@ private boolean isTEMovable(TileEntity te) {
return false;
}

private static boolean tileIsASpawner(TileEntity te) {
if (te instanceof TileEntityMobSpawner) {
return true;
}

try {
Class<?> heeClass = Class.forName("chylex.hee.tileentity.TileEntityCustomSpawner");
if (heeClass.isInstance(te)) {
return true;
}
} catch (ClassNotFoundException ignored) {}

return false;
}

private boolean isTileBlacklisted(Class clazz) {
for (Class<? extends TileEntity> tileClass : BetterBarrels.BlacklistedTileEntityClasses) {
if (clazz == tileClass) {
Expand Down Expand Up @@ -621,7 +636,7 @@ protected boolean pickupContainer(ItemStack stack, EntityPlayer player, World wo
nbtTarget.setString("Block", GameData.getBlockRegistry().getNameForObject(storedBlock));
nbtTarget.setInteger("Meta", blockMeta);
nbtTarget.setString("TEClass", containerTE.getClass().getName());
nbtTarget.setBoolean("isSpawner", containerTE instanceof TileEntityMobSpawner);
nbtTarget.setBoolean("isSpawner", tileIsASpawner(containerTE));
nbtTarget.setTag("NBT", nbtContainer); // TODO: Check this, seems the nbt classes were streamlined somewhat

if (tagCompoundWrite != null) {
Expand Down

0 comments on commit fa1e0f0

Please sign in to comment.