Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Hardcore Ender Expansion support for diamond dolly #34

Merged
merged 2 commits into from
Jul 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {}
OneEyeMaker marked this conversation as resolved.
Show resolved Hide resolved

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