Compare commits

..
14 Commits
Author SHA1 Message Date
MissBismuthandMartin Robertz 87e5a32b89 Fix painted blocks missing paint when placed with wand (#280)
Co-authored-by: Martin Robertz <[email protected]>
2026-10-27 20:48:42 +01:00
Ressed c232ea8534 Fix the iteration of getting slot from inventory for existing item filter. (#269) 2026-10-25 19:25:58 +01:00
Fib4ikandM R S E d27f30951a Add redstone signal support for item conduit. (#265)
Co-authored-by: M R S E <[email protected]>
2026-10-06 19:19:44 +02:00
Mykhailo Balaker 8dcda4e822 Prevent fall-through when clicking on the "Show Range" button in Vacuum Chest GUI (#274) 2026-09-27 18:08:03 +00:00
fehling135 e337597a3c Make specialmobs really availale for soul binder (#270) 2026-09-25 17:46:29 +02:00
Nikolay S. a8197e0026 Remove broken NBT-matching logic (#268) 2026-09-20 13:33:30 +02:00
danyadev 9549d9385c optimize recipe checking on mc loading (#263) 2026-09-07 16:18:00 +02:00
Martin Robertz d44c6bb7c7 update deps 2026-09-05 10:11:02 +02:00
Eldrinn ElanteyandCaedis a4a40ee726 Fix night vision deactivating after dimension change via portal (#262)
Co-authored-by: Caedis <[email protected]>
2026-09-04 18:41:45 -05:00
Caedis caec163702 Revert #231 (#261) 2026-09-04 14:09:25 +00:00
Glease 673f832c2d fix PacketTeleport sanitizer false positive (#253) 2026-09-03 07:00:46 +02:00
Eldrinn Elantey ce11a2dcf2 Fix night vision deactivating after dimension change via portal (#231) 2026-09-02 15:09:32 +00:00
vcwdfca 68e209203c Fix Player inventory cannot be shown when the EnderIO fluid conduit tier is lower than Ender (#255) 2026-09-02 15:03:02 +00:00
0715f8b536 remove direct getStackInSlot exploit (#245)
Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: attempt0 <[email protected]>
2026-09-02 09:38:29 +00:00
26 changed files with 451 additions and 242 deletions

No files matched your search

+17 -17
View File
@@ -1,35 +1,35 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:EnderCore:0.5.14:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.32:dev')
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.8.118-GTNH:dev')
api("com.github.GTNewHorizons:GTNHLib:0.11.35:dev")
api('com.github.GTNewHorizons:EnderCore:0.5.15:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ForestryMC:4.11.37:dev')
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.8.130-GTNH:dev')
api("com.github.GTNewHorizons:GTNHLib:0.11.45:dev")
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.63:dev')
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
shadowImplementation('cglib:cglib-nodep:3.3.0')
api("com.github.GTNewHorizons:TinkersConstruct:1.14.96-GTNH:dev")
api("com.github.GTNewHorizons:TinkersConstruct:1.14.107-GTNH:dev")
devOnlyNonPublishable('com.github.GTNewHorizons:waila:1.19.31:dev') {transitive = false}
devOnlyNonPublishable('com.github.GTNewHorizons:waila:1.19.34:dev') {transitive = false}
compileOnly('ganymedes01.etfuturum:Et-Futurum-Requiem:2.6.48-GTNH:dev') {transitive = false}
runtimeOnlyNonPublishable('com.github.GTNewHorizons:WAILAPlugins:0.7.2:dev') {transitive = false}
compileOnly("com.github.GTNewHorizons:Backhand:1.8.13:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Backhand:1.8.14:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-999-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.21-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.54.73:dev') {transitive = false}
compileOnly("com.github.GTNewHorizons:ModularUI2:2.3.85-1.7.10:dev") {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.17.30:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.2.26-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Chisel:2.17.31-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.55-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.22-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.54.129:dev') {transitive = false}
compileOnly("com.github.GTNewHorizons:ModularUI2:2.3.88-1.7.10:dev") {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.17.31:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.2.29-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Chisel:2.17.32-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.61-GTNH:api') {transitive = false}
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
compileOnly(rfg.deobf('curse.maven:computercraft-67504:2269339')) // https://www.curseforge.com/minecraft/mc-mods/computercraft/files/2269339
compileOnly(rfg.deobf('curse.maven:mekanism-268560:2475797')) // https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2475797
compileOnly(rfg.deobf('maven.modrinth:immibis-microblocks:59.1.2')) // https://modrinth.com/mod/immibis-microblocks/version/59.1.2
compileOnlyApi('com.github.GTNewHorizons:Angelica:2.1.60:api') {transitive = false}
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.179:dev")
compileOnly('com.github.GTNewHorizons:BetterBuildersWands:0.13.12-GTNH:dev@jar')
compileOnlyApi('com.github.GTNewHorizons:Angelica:2.2.10:api') {transitive = false}
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.196:dev")
compileOnly('curse.maven:automagy-222153:2285272')
}
+10 -10
View File
@@ -1,12 +1,12 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1df82b76031285ef2e6a4f59ffe9299d/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/c7d5be6a02945ac2e045048ee54a7d32/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/643f404f769811f5f265fd66f7af5d89/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/38256085a73e137cb4937ea9c4807fec/redirect
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
toolchainVersion=25
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.27'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.29'
}
@@ -47,6 +47,7 @@ import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import crazypants.enderio.api.IMC;
import crazypants.enderio.betterbuilderswands.PaintedCustomMapping;
import crazypants.enderio.block.BlockDarkSteelAnvil;
import crazypants.enderio.block.BlockDarkSteelLadder;
import crazypants.enderio.block.BlockDarkSteelPressurePlate;
@@ -190,7 +191,8 @@ import crazypants.util.EE3Util;
after:Waila@[1.5.8,);\
after:Thaumcraft;\
after:appliedenergistics2@[rv2-beta-8,);\
after:Railcraft@[9.16.7,)\
after:Railcraft@[9.16.7,);\
after:betterbuilderswands@[0.13.12,)\
""", guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
public class EnderIO {
@@ -839,6 +841,9 @@ public class EnderIO {
Log.info("Failed to registered Capacitor Banks as Tinkers Construct Flux Upgrades");
}
}
if (Loader.isModLoaded("betterbuilderswands")) {
PaintedCustomMapping.registerMappings();
}
ThaumcraftCompat.load();
}
@@ -0,0 +1,101 @@
package crazypants.enderio.betterbuilderswands;
import java.util.function.BiFunction;
import java.util.function.IntFunction;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import com.github.bsideup.jabel.Desugar;
import crazypants.enderio.EnderIO;
import crazypants.enderio.machine.painter.BlockPaintedCarpet;
import crazypants.enderio.machine.painter.BlockPaintedFence;
import crazypants.enderio.machine.painter.BlockPaintedFenceGate;
import crazypants.enderio.machine.painter.BlockPaintedGlowstone;
import crazypants.enderio.machine.painter.BlockPaintedSlab;
import crazypants.enderio.machine.painter.BlockPaintedStair;
import crazypants.enderio.machine.painter.BlockPaintedWall;
import crazypants.enderio.machine.painter.TileEntityPaintedBlock;
import portablejim.bbw.BetterBuildersWandsMod;
import portablejim.bbw.basics.Point3d;
import portablejim.bbw.core.conversion.ICustomMapping;
import portablejim.bbw.shims.IPlayerShim;
import portablejim.bbw.shims.IWorldShim;
@Desugar
public record PaintedCustomMapping(Block lookBlock, BiFunction<Block, Integer, ItemStack> itemStackGetter, int meta)
implements ICustomMapping {
@Override
public Block getLookBlock() {
return lookBlock;
}
@Override
public int getMeta() {
return meta;
}
@Override
public ItemStack getItems(IWorldShim world, IPlayerShim player, Point3d point) {
if (world.getTile(point) instanceof TileEntityPaintedBlock painted) {
return itemStackGetter.apply(painted.getSourceBlock(), painted.getSourceBlockMetadata());
}
return null;
}
@Override
public boolean shouldCopyTileNBT() {
return true;
}
public static void registerMappings() {
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedGlowstone,
BlockPaintedGlowstone::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedStair,
BlockPaintedStair::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedFence,
BlockPaintedFence::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedFenceGate,
BlockPaintedFenceGate::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedCarpet,
BlockPaintedCarpet::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedSlab,
BlockPaintedSlab::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedWall,
BlockPaintedWall::createItemStackForSourceBlock,
i));
register(
i -> new PaintedCustomMapping(
EnderIO.blockPaintedDoubleSlab,
BlockPaintedSlab::createItemStackForSourceBlock,
i));
}
private static void register(IntFunction<ICustomMapping> mapping) {
for (int i = 0; i < 16; i++) {
BetterBuildersWandsMod.instance.mappingManager.setMapping(mapping.apply(i));
}
}
}
@@ -320,7 +320,7 @@ public class ConduitUtil {
}
int signalStrength = getInternalSignalForColor(bundle, col);
if (signalStrength < 15 && DyeColor.RED == col && bundle != null && bundle.getEntity() != null) {
if (signalStrength < 15 && bundle != null && bundle.getEntity() != null) {
TileEntity te = bundle.getEntity();
signalStrength = Math
.max(signalStrength, te.getWorldObj().getStrongestIndirectPower(te.xCoord, te.yCoord, te.zCoord));
@@ -284,6 +284,8 @@ public class LiquidSettings extends BaseSettingsPanel {
rsB.onGuiInit();
colorB.onGuiInit();
gui.getContainer().setInventorySlotsVisible(true);
if (!isEnder) {
return;
}
@@ -295,7 +297,6 @@ public class LiquidSettings extends BaseSettingsPanel {
roundRobinB.onGuiInit();
roundRobinB.setSelected(eConduit.isRoundRobin(gui.getDir()));
gui.getContainer().setInventorySlotsVisible(true);
if (isFilterVisible()) {
addFilterTooltips();
@@ -175,6 +175,7 @@ public class ItemSettings extends BaseSettingsPanel {
private void updateButtons() {
rsB.onGuiInit();
rsB.setMode(itemConduit.getExtractionRedstoneMode(gui.getDir()));
colorB.onGuiInit();
loopB.onGuiInit();
loopB.setSelected(itemConduit.isSelfFeedEnabled(gui.getDir()));
@@ -47,8 +47,8 @@ public class ExistingItemFilter implements IItemFilter {
private boolean isStackInInventory(NetworkedInventory ni, ItemStack item) {
int[] slots = ni.getInventory().getAccessibleSlotsFromSide(ni.getInventorySide());
for (int i = 0; i < slots.length; i++) {
ItemStack stack = ni.getInventory().getStackInSlot(i);
for (int slot : slots) {
ItemStack stack = ni.getInventory().getStackInSlot(slot);
if (stackEqual(item, stack)) {
return true;
}
@@ -116,8 +116,8 @@ public class ExistingItemFilter implements IItemFilter {
snapshot = new ArrayList<>();
}
int[] slots = ni.getInventory().getAccessibleSlotsFromSide(ni.getInventorySide());
for (int i = 0; i < slots.length; i++) {
ItemStack stack = ni.getInventory().getStackInSlot(i);
for (int slot : slots) {
ItemStack stack = ni.getInventory().getStackInSlot(slot);
if (stack != null && !isStackInSnapshot(stack)) {
snapshot.add(stack);
}
@@ -597,6 +597,11 @@ public final class Config {
public static float fusedQuartzExplosionResistance = 2000.0f;
public static boolean enchanterOutputEnableBlockRestriction = false;
public static boolean enchanterOutputAllowlistAsDenylist = false;
public static String[] enchanterOutputFilterlist = new String[] { "minecraft:hopper",
"EnderIO:blockConduitBundle" };
public static void load(FMLPreInitializationEvent event) {
PacketHandler.INSTANCE
.registerMessage(PacketConfigSync.class, PacketConfigSync.class, PacketHandler.nextID(), Side.CLIENT);
@@ -2978,6 +2983,22 @@ public final class Config {
0.0f,
Float.MAX_VALUE,
"How blast resistant the three Fused Quartz blocks should be.");
enchanterOutputEnableBlockRestriction = config.getBoolean(
"enchanterOutputEnableBlockRestriction",
sectionMisc.name,
enchanterOutputEnableBlockRestriction,
"Enable restricting the valid blocks that are allowed to pull from the output slot of an Enchanter, to prevent dupes");
enchanterOutputAllowlistAsDenylist = config.getBoolean(
"enchanterOutputAllowlistAsDenylist",
sectionMisc.name,
enchanterOutputAllowlistAsDenylist,
"Treat the list of blocks allowed to pull from an Enchanter's output slot as a denylist instead (if you know only some specific blocks bypass inventory APIs)");
enchanterOutputFilterlist = config.getStringList(
"enchanterOutputFilterlist",
sectionMisc.name,
enchanterOutputFilterlist,
"These blocks are allowed/denied from pulling from the output slot of an Enchanter (default is allowlist)");
}
public static void checkYetaAccess() {
@@ -337,32 +337,18 @@ public class KeyTracker {
}
private void handleNightVision() {
if (nightVisionKey.isPressed()) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if (!DarkSteelController.instance.isNightVisionUpgradeOrEnchEquipped(player)) {
return;
}
boolean isActive = !DarkSteelController.instance.isNightVisionActive();
if (isActive) {
player.worldObj.playSound(
player.posX,
player.posY,
player.posZ,
EnderIO.DOMAIN + ":ds.nightvision.on",
0.1f,
player.worldObj.rand.nextFloat() * 0.4f - 0.2f + 1.0f,
false);
} else {
player.worldObj.playSound(
player.posX,
player.posY,
player.posZ,
EnderIO.DOMAIN + ":ds.nightvision.off",
0.1f,
1.0f,
false);
}
DarkSteelController.instance.setNightVisionActive(isActive);
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if (nightVisionKey.isPressed() && DarkSteelController.instance.isNightVisionUpgradeOrEnchEquipped(player)) {
boolean turningOn = !DarkSteelController.instance.isActive(player, Type.NIGHT_VISION);
player.worldObj.playSound(
player.posX,
player.posY,
player.posZ,
EnderIO.DOMAIN + (turningOn ? ":ds.nightvision.on" : ":ds.nightvision.off"),
0.1f,
turningOn ? player.worldObj.rand.nextFloat() * 0.4f - 0.2f + 1.0f : 1.0f,
false);
toggleDarkSteelController(Type.NIGHT_VISION, "darksteel.upgrade.nightVision");
}
}
@@ -107,9 +107,6 @@ public class DarkSteelController {
private final Map<UUID, EnumSet<Type>> allActive = new HashMap<>();
private boolean nightVisionActive = false;
private boolean removeNightvision = false;
private DarkSteelController() {
PacketHandler.INSTANCE.registerMessage(
PacketDarkSteelPowerPacket.class,
@@ -196,6 +193,8 @@ public class DarkSteelController {
updateSwim(player);
updateSolar(player);
updateNightvision(player);
}
}
@@ -447,7 +446,6 @@ public class DarkSteelController {
if (player == null) {
return;
}
updateNightvision(player);
if (player.capabilities.isFlying) {
return;
}
@@ -569,16 +567,20 @@ public class DarkSteelController {
}
private void updateNightvision(EntityPlayer player) {
if (isNightVisionUpgradeOrEnchEquipped(player) && nightVisionActive) {
player.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 210, 0, true));
if (player.worldObj.isRemote) {
return;
}
if (!isNightVisionUpgradeOrEnchEquipped(player) && nightVisionActive) {
nightVisionActive = false;
removeNightvision = true;
}
if (removeNightvision) {
PotionEffect effect = player.getActivePotionEffect(Potion.nightVision);
boolean hasNVUpgrade = isNightVisionUpgradeOrEnchEquipped(player);
boolean isNVUpgradeEnabled = isActive(player, Type.NIGHT_VISION);
if (hasNVUpgrade && isNVUpgradeEnabled) {
// only (re)apply effect if ours is missing or about to expire
if (effect == null || (effect.getIsAmbient() && effect.getDuration() < 220)) {
player.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 400, 0, true));
}
} else if (effect != null && effect.getIsAmbient() && (hasNVUpgrade || isNVUpgradeEnabled)) {
// if our effect exists and the player removed the upgrade item or toggled it off (both can't be true here)
player.removePotionEffect(Potion.nightVision.getId());
removeNightvision = false;
}
}
@@ -613,21 +615,9 @@ public class DarkSteelController {
return false;
}
// ---
public boolean isNightVisionUpgradeOrEnchEquipped(EntityPlayer player) {
ItemStack helmet = player.getEquipmentInSlot(4);
return (NightVisionUpgrade.loadFromItem(helmet) != null || isNightVisionEnch(helmet));
}
public void setNightVisionActive(boolean isNightVisionActive) {
if (nightVisionActive && !isNightVisionActive) {
removeNightvision = true;
}
this.nightVisionActive = isNightVisionActive;
}
public boolean isNightVisionActive() {
return nightVisionActive;
}
}
@@ -15,7 +15,8 @@ public class PacketUpgradeState implements IMessage, IMessageHandler<PacketUpgra
GLIDE,
SPEED,
STEP_ASSIST,
JUMP
JUMP,
NIGHT_VISION
}
public PacketUpgradeState() {}
@@ -52,7 +52,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
@Override
public boolean isActive() {
return currentTask == null ? false : currentTask.getProgress() >= 0 && hasPower() && redstoneCheckPassed;
return currentTask != null && currentTask.getProgress() >= 0 && hasPower() && redstoneCheckPassed;
}
@Override
@@ -224,7 +224,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
ItemStack copy = item.copy();
// try to add it to existing stacks first
for (ItemStack outStack : outputStacks) {
if (outStack != null && copy != null) {
if (outStack != null) {
int num = getNumCanMerge(outStack, copy);
outStack.stackSize += num;
copy.stackSize -= num;
@@ -322,7 +322,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
}
protected int getNumCanMerge(ItemStack itemStack, ItemStack result) {
if (!itemStack.isItemEqual(result)) {
if (!itemStack.isItemEqual(result) || !ItemStack.areItemStackTagsEqual(itemStack, result)) {
return 0;
}
return Math.min(itemStack.getMaxStackSize() - itemStack.stackSize, result.stackSize);
@@ -152,8 +152,9 @@ public class CrusherRecipeManager {
if (input == null) {
return null;
}
MachineRecipeInput[] machineInputs = { new MachineRecipeInput(0, input) };
for (Recipe recipe : recipes) {
if (recipe.isInputForRecipe(new MachineRecipeInput(0, input))) {
if (recipe.isInputForRecipe(machineInputs)) {
return recipe;
}
}
@@ -68,6 +68,11 @@ public class ContainerEnchanter extends ContainerEnderTileEntity<TileEnchanter>
return false;
}
@Override
public ItemStack getStack() {
return te.getOutput();
}
@Override
public void onPickupFromSlot(EntityPlayer player, ItemStack stack) {
if (!player.capabilities.isCreativeMode) {
@@ -2,8 +2,6 @@ package crazypants.enderio.machine.enchanter;
import static crazypants.enderio.EnderIO.hasAutomagy;
import java.util.ArrayList;
import net.minecraft.enchantment.EnchantmentData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
@@ -11,16 +9,21 @@ import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import com.gtnewhorizon.gtnhlib.geometry.CubeIterator;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.Log;
import crazypants.enderio.ModObject;
import crazypants.enderio.TileEntityEio;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.obelisk.xp.TileExperienceObelisk;
import crazypants.enderio.xp.ExperienceContainer;
import crazypants.enderio.xp.XpUtil;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import tuhljin.automagy.tiles.TileEntityJarXP;
public class TileEnchanter extends TileEntityEio implements ISidedInventory {
@@ -28,6 +31,8 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
private final ItemStack[] inv = new ItemStack[3];
private byte[] stacksizes = new byte[2];
private IntList cachedXPsources = new IntArrayList();
private short facing = (short) ForgeDirection.NORTH.ordinal();
public void setFacing(short s) {
@@ -65,6 +70,9 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
root.setTag("Items", itemList);
root.setByteArray("SizeCache", stacksizes);
root.setShort("facing", facing);
root.setIntArray(
"XpCache",
(cachedXPsources.size() <= 200 ? cachedXPsources : cachedXPsources.subList(0, 200)).toIntArray());
}
@Override
@@ -82,6 +90,11 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
stacksizes = root.getByteArray("SizeCache");
if (stacksizes == null || stacksizes.length < 2) stacksizes = new byte[2];
facing = root.getShort("facing");
cachedXPsources.clear();
int[] xpcache = root.getIntArray("XpCache");
if (xpcache != null) {
cachedXPsources.addAll(IntList.of(xpcache));
}
}
@Override
@@ -96,9 +109,10 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
@Override
public ItemStack getStackInSlot(int slot) {
if (slot < 0 || slot >= inv.length) {
if (slot < 0 || slot > inv.length - 1) {
return null;
}
if (slot == 2 && !doesCraftHaveXP()) return null;
return inv[slot];
}
@@ -130,69 +144,97 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
return result;
}
// part of the next method
public boolean absorbXP(int amt) {
if (inv[2] == null || amt <= 0 || inv[2].stackSize < amt) return true;
public boolean doesCraftHaveXP() {
if (inv[2] == null) return false;
int LV = getCurrentEnchantmentCost();
if (LV == 0) return false;
int xpCost = XpUtil.getExperienceForLevel(LV * amt);
int xp;
absorb: {
ArrayList<ExperienceContainer> obelisksToEmpty = new ArrayList<>();
if (true) {
CubeIterator iter = new CubeIterator(8);
while (iter.hasNext()) {
iter.next();
if (worldObj.getTileEntity(
iter.n + xCoord,
iter.l + yCoord,
iter.m + zCoord) instanceof TileExperienceObelisk obelisk) {
ExperienceContainer cont = obelisk.getContainer();
xp = cont.getExperienceTotal();
if (xp >= xpCost) {
if (!worldObj.isRemote) {
obelisksToEmpty.forEach(o -> o.drain(null, Integer.MAX_VALUE, true));
cont.drain(null, Integer.MAX_VALUE, true);
cont.addExperience(Math.max(0, xp - xpCost));
}
return false;
}
xpCost -= xp;
obelisksToEmpty.add(cont);
}
}
}
if (hasAutomagy) {
ArrayList<TileEntityJarXP> jarsToEmpty = new ArrayList<>();
CubeIterator iter = new CubeIterator(8);
while (iter.hasNext()) {
iter.next();
if (worldObj.getTileEntity(
iter.n + xCoord,
iter.l + yCoord,
iter.m + zCoord) instanceof TileEntityJarXP jar) {
xp = jar.getXP();
if (xp >= xpCost) {
if (!worldObj.isRemote) {
obelisksToEmpty.forEach(o -> o.drain(null, Integer.MAX_VALUE, true));
jarsToEmpty.forEach(j -> j.setXP(0));
jar.setXP(xp - xpCost);
}
return false;
}
xpCost -= xp;
jarsToEmpty.add(jar);
}
}
}
return true;
}
if (LV == 0) return true;
return checkAndCacheXPSources(XpUtil.getExperienceForLevel(LV));
}
// checks AND drains XP; returns true if xp is NOT sufficient
private boolean checkAndCacheXPSources(int xpCost) {
if (drainFromCache(xpCost, false)) return true;
cachedXPsources.clear();
int xp;
CubeIterator iter;
iter = new CubeIterator(8);
while (iter.hasNext()) {
iter.next();
int x = iter.n + xCoord;
int y = iter.l + yCoord;
int z = iter.m + zCoord;
if (!worldObj.blockExists(x, y, z)) continue;
final TileEntity te = worldObj.getTileEntity(x, y, z);
if (te instanceof TileExperienceObelisk obelisk) {
ExperienceContainer cont = obelisk.getContainer();
xp = cont.getExperienceTotal();
if (xp != 0) cachedXPsources.add(((iter.n & 0xff) << 16) + ((iter.l & 0xff) << 8) + (iter.m & 0xff));
if (xp >= xpCost) return true;
xpCost -= xp;
} else if (hasAutomagy && te instanceof TileEntityJarXP jar) {
xp = jar.getXP();
if (xp != 0) cachedXPsources.add(((iter.n & 0xff) << 16) + ((iter.l & 0xff) << 8) + (iter.m & 0xff));
if (xp >= xpCost) return true;
xpCost -= xp;
}
}
return false;
}
private boolean drainFromCache(int xpCost, boolean actual) {
ExperienceContainer cont;
int len = cachedXPsources.size();
if (len == 0) return false;
for (int ind = 0; ind < len; ind++) {
int nlm = cachedXPsources.getInt(ind);
int z = (byte) nlm + zCoord;
int y = (byte) (nlm >>= 8) + yCoord;
int x = (byte) (nlm >>= 8) + xCoord;
if (!worldObj.blockExists(x, y, z)) continue;
TileEntity te = worldObj.getTileEntity(x, y, z);
if (te instanceof TileExperienceObelisk obelisk) {
cont = obelisk.getContainer();
int xp = cont.getExperienceTotal();
if (xp == 0) continue;
if (actual) cont.drain(null, Integer.MAX_VALUE, true);
int ebx = xp - xpCost;
if (ebx < 0) {
xpCost = -ebx;
continue;
}
if (actual) cont.addExperience(ebx);
return true;
}
if (hasAutomagy && te instanceof TileEntityJarXP jar) {
int xp = jar.getXP();
if (xp == 0) continue;
int ebx = xp - xpCost; // 5head JIT optimization
if (ebx < 0) {
xpCost = -ebx;
if (actual) jar.setXP(0);
continue;
}
if (actual) jar.setXP(ebx);
return true;
}
cachedXPsources.removeInt(ind);
}
return false;
}
// part of the next method
private boolean absorbXP(int amt) {
if (inv[2] == null) return false;
int LV = getCurrentEnchantmentCost();
if (LV == 0) return true;
int xpCost = XpUtil.getExperienceForLevel(LV * amt);
if (!checkAndCacheXPSources(xpCost)) return false;
return drainFromCache(xpCost, !worldObj.isRemote);
}
// checks AND drains XP; returns false if xp is not sufficient
// also removes the items from the other two slots when automation does the recipe
public boolean checkAndDrainXP(int amt) {
if (absorbXP(amt)) return true;
private boolean checkAndDrainXP(int amt) {
if (!absorbXP(amt)) return false;
EnchantmentData enchData = getCurrentEnchantmentData();
EnchanterRecipe recipe = getCurrentEnchantmentRecipe();
ItemStack curStack = inv[1];
@@ -212,7 +254,7 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
if (!worldObj.isRemote) {
worldObj.playSoundEffect(xCoord + 0.5d, yCoord + 0.5d, zCoord + 0.5d, "random.anvil_land", 0.2f, 1.0f);
}
return false;
return true;
}
@Override
@@ -222,6 +264,15 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
@Override
public void setInventorySlotContents(int slot, ItemStack contents) {
if (slot == 2) {
if (inv[2] == null || inv[2].stackSize <= 0
|| contents != null && contents.stackSize > 0
&& contents.getItem() == Items.enchanted_book
&& contents.stackSize == inv[2].stackSize)
return;
if (checkAndDrainXP(1)) Log.warn("Potentially duped books at: " + xCoord + " " + yCoord + " " + zCoord);
// return;
} ;
if (contents == null) {
inv[slot] = contents;
} else {
@@ -240,10 +291,11 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
output = new ItemStack(Items.enchanted_book);
Items.enchanted_book.addEnchantment(output, enchantment);
}
setOutput(output);
if (inv[0] != null) stacksizes[0] = (byte) inv[0].stackSize;
if (inv[1] != null) stacksizes[1] = (byte) inv[1].stackSize;
setOutput(output);
}
@Override
@@ -388,18 +440,34 @@ public class TileEnchanter extends TileEntityEio implements ISidedInventory {
markDirty();
}
public ItemStack getOutput() {
return inv[2];
}
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == 0 ? new int[] { 2 } : new int[] { 0, 1 };
}
@Override
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
return true;
public boolean canInsertItem(int slot, ItemStack p_102007_2_, int p_102007_3_) {
return slot == 0 || slot == 1;
}
@Override
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
return true;
public boolean canExtractItem(int slot, ItemStack p_102008_2_, int p_102008_3_) {
return slot == 2 ? isAllowedBlockBeneath() : true;
}
public boolean isAllowedBlockBeneath() {
if (!Config.enchanterOutputEnableBlockRestriction) return true;
var blockBeneath = worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord);
for (String blocknam : Config.enchanterOutputFilterlist) {
String[] splitname = blocknam.split(":", 1);
if (GameRegistry.findBlock(splitname[0], splitname[1]) != blockBeneath) continue;
return !Config.enchanterOutputAllowlistAsDenylist;
}
return Config.enchanterOutputAllowlistAsDenylist;
}
}
@@ -15,7 +15,9 @@ import crazypants.enderio.machine.SlotDefinition;
public class TileEntityPainter extends AbstractPoweredTaskEntity implements ISidedInventory {
// private static final short MAX_POWER_USE_PER_TICK = 6;
private static final int SLOT_INPUT = 0;
private static final int SLOT_PAINT_SOURCE = 1;
private static final int SLOT_OUTPUT = 2;
public TileEntityPainter() {
// 0 = input slot, 1 = paint source, 2 = output slot
@@ -24,7 +26,8 @@ public class TileEntityPainter extends AbstractPoweredTaskEntity implements ISid
@Override
public boolean canExtractItem(int i, ItemStack itemstack, int j) {
return super.canExtractItem(i, itemstack, j) && PainterUtil.isMetadataEquivelent(itemstack, inventory[2]);
return super.canExtractItem(i, itemstack, j)
&& PainterUtil.isMetadataEquivelent(itemstack, inventory[SLOT_OUTPUT]);
}
@Override
@@ -32,49 +35,44 @@ public class TileEntityPainter extends AbstractPoweredTaskEntity implements ISid
return "Auto Painter";
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
@Override
public boolean isMachineItemValidForSlot(int i, ItemStack itemStack) {
if (i > 1) {
return false;
}
if (i == 0) {
if (i == SLOT_INPUT) {
List<IMachineRecipe> recipes = MachineRecipeRegistry.instance
.getRecipesForInput(getMachineName(), MachineRecipeInput.create(i, itemStack));
if (inventory[1] == null) {
if (inventory[SLOT_PAINT_SOURCE] == null) {
return !recipes.isEmpty();
} else {
for (IMachineRecipe rec : recipes) {
if (rec instanceof BasicPainterTemplate) {
BasicPainterTemplate temp = (BasicPainterTemplate) rec;
if (temp.isValidPaintSource(inventory[1])) {
if (rec instanceof BasicPainterTemplate temp) {
if (temp.isValidPaintSource(inventory[SLOT_PAINT_SOURCE])) {
return true;
}
}
}
return false;
}
return false;
}
if (inventory[0] == null) {
Map<String, IMachineRecipe> recipes = MachineRecipeRegistry.instance.getRecipesForMachine(getMachineName());
for (IMachineRecipe rec : recipes.values()) {
if (rec instanceof BasicPainterTemplate) {
BasicPainterTemplate temp = (BasicPainterTemplate) rec;
if (temp.isValidPaintSource(itemStack)) {
return true;
} else if (i == SLOT_PAINT_SOURCE) {
if (inventory[SLOT_INPUT] == null) {
Map<String, IMachineRecipe> recipes = MachineRecipeRegistry.instance
.getRecipesForMachine(getMachineName());
for (IMachineRecipe rec : recipes.values()) {
if (rec instanceof BasicPainterTemplate temp) {
if (temp.isValidPaintSource(itemStack)) {
return true;
}
}
}
return PaintSourceValidator.instance.isValidSourceDefault(itemStack);
} else {
return MachineRecipeRegistry.instance.getRecipeForInputs(
getMachineName(),
targetInput(),
MachineRecipeInput.create(SLOT_PAINT_SOURCE, itemStack)) != null;
}
return PaintSourceValidator.instance.isValidSourceDefault(itemStack);
} else {
return false;
}
return MachineRecipeRegistry.instance.getRecipeForInputs(
getMachineName(),
i == 0 ? MachineRecipeInput.create(0, itemStack) : targetInput(),
i == 1 ? MachineRecipeInput.create(1, itemStack) : paintSource()) != null;
}
@Override
@@ -83,27 +81,10 @@ public class TileEntityPainter extends AbstractPoweredTaskEntity implements ISid
}
private MachineRecipeInput targetInput() {
return MachineRecipeInput.create(0, inventory[0]);
return MachineRecipeInput.create(SLOT_INPUT, inventory[SLOT_INPUT]);
}
private MachineRecipeInput paintSource() {
return MachineRecipeInput.create(1, inventory[1]);
}
@Override
protected int getNumCanMerge(ItemStack itemStack, ItemStack result) {
if (result == null || !result.isItemEqual(inventory[2])) {
// next result is a different item type
return 0;
} else if (result.hasTagCompound() && inventory[2].hasTagCompound()) {
if (inventory[2].getTagCompound().hasKey("Items")) return 0; // presence of internal items
String cookedId = result.getTagCompound().getString(BlockPainter.KEY_SOURCE_BLOCK_ID);
String invId = inventory[2].getTagCompound().getString(BlockPainter.KEY_SOURCE_BLOCK_ID);
if (!cookedId.equals(invId)) {
// next result has a different source item than the current one
return 0;
}
}
return Math.min(itemStack.getMaxStackSize() - itemStack.stackSize, result.stackSize);
return MachineRecipeInput.create(SLOT_PAINT_SOURCE, inventory[SLOT_PAINT_SOURCE]);
}
}
@@ -38,38 +38,46 @@ public class Recipe implements IRecipe {
return false;
}
List<RecipeInput> requiredInputs = new ArrayList<>();
for (RecipeInput input : inputs) {
if (input.getFluidInput() != null || input.getInput() != null) {
requiredInputs.add(input.copy());
int[] remaining = new int[inputs.length];
for (int i = 0; i < inputs.length; i++) {
RecipeInput input = inputs[i];
if (input.isFluid()) {
remaining[i] = input.getFluidInput().amount;
} else if (input.getInput() != null) {
remaining[i] = input.getInput().stackSize;
}
}
for (MachineRecipeInput input : machineInputs) {
if (input != null && (input.fluid != null || input.item != null)) {
RecipeInput required = null;
for (int i = 0; i < requiredInputs.size() && required == null; i++) {
RecipeInput tst = requiredInputs.get(i);
if ((tst.isInput(input.item) && tst.getInput().stackSize > 0) || tst.isInput(input.fluid)) {
required = tst;
}
for (MachineRecipeInput machineInput : machineInputs) {
if (machineInput == null || (machineInput.item == null && machineInput.fluid == null)) {
continue;
}
int matchedInput = -1;
for (int i = 0; i < inputs.length; i++) {
if (remaining[i] <= 0) {
continue;
}
if (required == null) {
return false;
}
// reduce the required input quantity by the available amount
if (input.isFluid()) {
required.getFluidInput().amount -= input.fluid.amount;
} else {
required.getInput().stackSize -= input.item.stackSize;
RecipeInput required = inputs[i];
boolean matches = machineInput.isFluid() ? required.isInput(machineInput.fluid)
: required.isInput(machineInput.item);
if (matches) {
matchedInput = i;
break;
}
}
}
for (RecipeInput required : requiredInputs) {
if (required.isFluid() && required.getFluidInput().amount > 0) {
if (matchedInput < 0) {
return false;
} else if (!required.isFluid() && required.getInput().stackSize > 0) {
}
remaining[matchedInput] -= machineInput.isFluid() ? machineInput.fluid.amount : machineInput.item.stackSize;
}
for (int amount : remaining) {
if (amount > 0) {
return false;
}
}
@@ -15,8 +15,14 @@ public class SoulBinderEnderCystalRecipe extends AbstractSoulBinderRecipe {
Config.soulBinderEnderCystalRF,
Config.soulBinderEnderCystalLevels,
"SoulBinderEnderCystalRecipe",
"SpecialMobs.SpecialEnderman",
"Enderman");
"Enderman",
"SpecialMobs.BlindingEnderman",
"SpecialMobs.CursedEnderman",
"SpecialMobs.IcyEnderman",
"SpecialMobs.LightningEnderman",
"SpecialMobs.MiniEnderman",
"SpecialMobs.MirageEnderman",
"SpecialMobs.ThiefEnderman");
}
@Override
@@ -15,8 +15,14 @@ public class SoulBinderPrecientCystalRecipe extends AbstractSoulBinderRecipe {
Config.soulBinderPrecientCystalRF,
Config.soulBinderPrecientCystalLevels,
"SoulBinderPrecientCystalRecipe",
"SpecialMobs.SpecialEnderman",
"Enderman");
"Enderman",
"SpecialMobs.BlindingEnderman",
"SpecialMobs.CursedEnderman",
"SpecialMobs.IcyEnderman",
"SpecialMobs.LightningEnderman",
"SpecialMobs.MiniEnderman",
"SpecialMobs.MirageEnderman",
"SpecialMobs.ThiefEnderman");
}
@Override
@@ -16,7 +16,12 @@ public class SoulBinderReanimationRecipe extends AbstractSoulBinderRecipe {
Config.soulBinderReanimationLevels,
"SoulBinderReanimationRecipe",
"Zombie",
"SpecialMobs.SpecialZombie");
"SpecialMobs.BrutishZombie",
"SpecialMobs.FireZombie",
"SpecialMobs.FishingZombie",
"SpecialMobs.GiantZombie",
"SpecialMobs.HungryZombie",
"SpecialMobs.PlagueZombie");
}
@Override
@@ -16,7 +16,13 @@ public class SoulBinderSentientRecipe extends AbstractSoulBinderRecipe {
Config.soulBinderReanimationLevels,
"SoulBinderSentientRecipe",
"Witch",
"enderzoo.WitherWitch");
"enderzoo.WitherWitch",
"SpecialMobs.DominationWitch",
"SpecialMobs.RageWitch",
"SpecialMobs.ShadowsWitch",
"SpecialMobs.UndeadWitch",
"SpecialMobs.WildsWitch",
"SpecialMobs.WindWitch");
}
@Override
@@ -148,6 +148,7 @@ public class GuiVacuumChest extends GuiContainerBaseEIO {
break;
case RANGE_ID:
te.setShowRange(showRangeB.isSelected());
break;
case ID_WHITELIST:
itemFilter = te.getItemFilter();
if (itemFilter != null) {
@@ -26,27 +26,33 @@ public class PacketUtil {
if (!(container instanceof IContainerWithTileEntity)) {
Log.LOGGER.warn(
Log.securityMarker,
"Player {} tried to send {} while not opening correct GUI. Target TileEntity at {}, {}, {}",
"Player {} tried to send {} while not opening correct GUI. Target TileEntity {} at {}, {}, {} in {}. Current container {}",
player.getGameProfile(),
messageClass.getSimpleName(),
receivedTile,
receivedTile.xCoord,
receivedTile.yCoord,
receivedTile.zCoord);
receivedTile.zCoord,
receivedTile.getWorldObj().provider.dimensionId,
container);
return true;
}
TileEntity expectedTile = ((IContainerWithTileEntity) container).getTileEntity();
if (receivedTile != expectedTile) {
Log.LOGGER.warn(
Log.securityMarker,
"Player {} tried to send {} which attempts to modify setting of TileEntity at {}, {}, {}. Expected: {}, {}, {}",
"Player {} tried to send {} which attempts to modify setting of TileEntity at {}, {}, {} in {}. Expected: {}, {}, {} in {}. Current container {}",
player.getGameProfile(),
messageClass.getSimpleName(),
receivedTile.xCoord,
receivedTile.yCoord,
receivedTile.zCoord,
receivedTile.getWorldObj().provider.dimensionId,
expectedTile.xCoord,
expectedTile.yCoord,
expectedTile.zCoord);
expectedTile.zCoord,
expectedTile.getWorldObj().provider.dimensionId,
container);
return true;
}
return false;
@@ -59,9 +59,19 @@ public class PacketTeleport extends MessageTileEntity<TileTelePad>
@Override
public IMessage onMessage(PacketTeleport message, MessageContext ctx) {
World world = ctx.side.isClient() ? EnderIO.proxy.getClientWorld() : message.getWorld(ctx);
boolean isClient = ctx.side.isClient();
World world = isClient ? EnderIO.proxy.getClientWorld() : message.getWorld(ctx);
TileTelePad te = message.getTileEntity(world);
if (PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) return null;
if (te == null) return null;
if (!isClient) {
// BEGIN is the only type of PacketTeleport that originates from a TE GUI
if (message.type == Type.BEGIN && PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) {
return null;
}
// TELEPORT is never sent to server
if (message.type == Type.TELEPORT) return null;
// other types are sent in background without a gui, so no checks
}
Entity e = world.getEntityByID(message.entityId);
switch (message.type) {
case BEGIN: