I do not know who added that but someone bound the api for network fields to the IC2 Exp TEBlock.
Here is the function i am talking about:
https://github.com/TinyModular…rk/NetworkHelper.java#L56
(Iknow its 1.7.10 but the API is the same)
Here is the thing the API is now boud to the BlockTileEntityClass which does not allow the Function to be used unless you are using IC2 Core classes... Which makes these interfaces like INetworkProvider completly useless for IC2Exp.
Here is the code which prevents it:
Class: ic2.core.network.TeUpdate
Function: apply(TeUpdateDataClient.TeData update, World world)
This function is simply applying the Data From the Network Packet (which is sended by the updateTileEntityField) to the TileEntity. Normally it has no TileEntityBlock or BlockTileEntity requirement.
Since 1.10 & IC2Exps version: 2.2.6.40 it has a BlockTileEntity & TileEntityBlock Requirement
private static void apply(TeUpdateDataClient.TeData update, World world) {
IBlockState state = world.getBlockState(update.pos);
if (state.getBlock() != BlockName.te.getInstance()) {
if (debug) IC2.log.info(LogCategory.Network, "Can't apply update to %d/%d/%d, invalid state %s.", new Object[] { Integer.valueOf(update.pos.getX()), Integer.valueOf(update.pos.getY()), Integer.valueOf(update.pos.getZ()), state });
return;
}
TileEntity te = world.getTileEntity(update.pos);
if ((update.teClass != null) && ((te == null) || (te.getClass() != update.teClass))) {
if (debug) IC2.log.info(LogCategory.Network, "Instantiating %d/%d/%d with %s", new Object[] { Integer.valueOf(update.pos.getX()), Integer.valueOf(update.pos.getY()), Integer.valueOf(update.pos.getZ()), update.teClass.getName() });
te = TileEntityBlock.instantiate(update.teClass);
world.setTileEntity(update.pos, te); } else {
if (te == null) {
if (debug) IC2.log.info(LogCategory.Network, "Can't apply update to %d/%d/%d, no te/teClass.", new Object[] { Integer.valueOf(update.pos.getX()), Integer.valueOf(update.pos.getY()), Integer.valueOf(update.pos.getZ()) });
return;
}
if (debug) IC2.log.info(LogCategory.Network, "TE class %d/%d/%d unchanged.", new Object[] { Integer.valueOf(update.pos.getX()), Integer.valueOf(update.pos.getY()), Integer.valueOf(update.pos.getZ()) });
}
for (TeUpdateDataClient.FieldData fieldUpdate : update.getFields()) {
Object value = DataEncoder.getValue(fieldUpdate.value);
if (fieldUpdate.field != null)
ReflectionUtil.setValue(te, fieldUpdate.field, value);
else {
ReflectionUtil.setValueRecursive(te, fieldUpdate.name, value);
}
if ((te instanceof INetworkUpdateListener))
((INetworkUpdateListener)te).onNetworkUpdate(fieldUpdate.name);
}
}
Display More
This code should not be bound to the TileEntityBlock or to the BlockTileEntity!
It makes addons impossible to use that feature...
Make it not bound to the BlockTileEntity or the TileEntity Block!