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

Capturar mudanças em eventos de tick #135

Open
Eufranio opened this issue Feb 11, 2018 · 2 comments
Open

Capturar mudanças em eventos de tick #135

Eufranio opened this issue Feb 11, 2018 · 2 comments

Comments

@Eufranio
Copy link
Member

Eufranio commented Feb 11, 2018

Gist: https://gist.github.com/Eufranio/87c0991e078405d95cf448fbaea0e628

Alguns mods executam lógica no onWorldTick, em vez de terem as TileEntities atualizadas pelo servidor, e elas acabam não sendo capturadas, criando uma PhaseStack sem items. Algumas das vezes que os mods tentam atualizar TileEntities fora do ciclo:

[01:52:56] [Server thread/WARN] [/]: java.lang.Exception: Stack trace
[01:52:56] [Server thread/WARN] [/]: 	at java.lang.Thread.dumpStack(Thread.java:1336)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.World.handler$onSetBlockHead$zzd000(World.java:50678)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147465_d(World.java)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147468_f(World.java:1002)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.block.BlockPistonBase.func_149696_a(BlockPistonBase.java:263)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.WorldServer.func_147485_a(WorldServer.java:1275)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.WorldServer.func_147488_Z(WorldServer.java:1262)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.WorldServer.func_72835_b(WorldServer.java:308)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:963)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:432)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:841)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:693)
[01:52:56] [Server thread/WARN] [/]: 	at java.lang.Thread.run(Thread.java:748)
[01:52:56] [Server thread/WARN] [/]: java.lang.Exception: Stack trace
[01:52:56] [Server thread/WARN] [/]: 	at java.lang.Thread.dumpStack(Thread.java:1336)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.World.handler$onSetBlockHead$zzd000(World.java:50678)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147465_d(World.java)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147468_f(World.java:1002)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.block.BlockPistonExtension.func_149695_a(BlockPistonExtension.java:219)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147460_e(World.java:1147)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147459_d(World.java:1086)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147444_c(World.java:1048)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.World.markAndNotifyBlock(World.java:904)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147465_d(World.java:882)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.block.BlockPistonBase.func_149696_a(BlockPistonBase.java:217)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.WorldServer.func_147485_a(WorldServer.java:1275)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.WorldServer.func_147488_Z(WorldServer.java:1262)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.world.WorldServer.func_72835_b(WorldServer.java:308)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:963)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:432)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:841)
[01:52:56] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:693)
[01:52:56] [Server thread/WARN] [/]: 	at java.lang.Thread.run(Thread.java:748)
[01:52:39] [Server thread/WARN] [/]: java.lang.Exception: Stack trace
[01:52:39] [Server thread/WARN] [/]: 	at java.lang.Thread.dumpStack(Thread.java:1336)
[01:52:39] [Server thread/WARN] [/]: 	at net.minecraft.world.World.handler$onSetBlockHead$zzd000(World.java:50678)
[01:52:39] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147465_d(World.java)
[01:52:39] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147468_f(World.java:1002)
[01:52:39] [Server thread/WARN] [/]: 	at forestry.farming.logic.CropBlock.harvestBlock(CropBlock.java:43)
[01:52:39] [Server thread/WARN] [/]: 	at forestry.farming.logic.Crop.harvest(Crop.java:55)
[01:52:39] [Server thread/WARN] [/]: 	at forestry.farming.multiblock.FarmController.cullCrop(FarmController.java:754)
[01:52:39] [Server thread/WARN] [/]: 	at forestry.farming.multiblock.FarmController.doWork(FarmController.java:466)
[01:52:39] [Server thread/WARN] [/]: 	at forestry.farming.tiles.TileFarmGearbox.updateServer(TileFarmGearbox.java:74)
[01:52:39] [Server thread/WARN] [/]: 	at forestry.farming.multiblock.FarmController.updateServer(FarmController.java:272)
[01:52:39] [Server thread/WARN] [/]: 	at forestry.core.multiblock.MultiblockControllerBase.updateMultiblockEntity(MultiblockControllerBase.java:423)
[01:52:39] [Server thread/WARN] [/]: 	at forestry.core.multiblock.MultiblockWorldRegistry.tickStart(MultiblockWorldRegistry.java:82)
[01:52:39] [Server thread/WARN] [/]: 	at forestry.core.multiblock.MultiblockRegistry.tickStart(MultiblockRegistry.java:29)
[01:52:39] [Server thread/WARN] [/]: 	at forestry.core.multiblock.MultiblockServerTickHandler.onWorldTick(MultiblockServerTickHandler.java:20)
[01:52:39] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.ASMEventHandler_689_MultiblockServerTickHandler_onWorldTick_WorldTickEvent.invoke(.dynamic)
[01:52:39] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
[01:52:39] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
[01:52:39] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.FMLCommonHandler.onPreWorldTick(FMLCommonHandler.java:273)
[01:52:39] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:957)
[01:52:39] [Server thread/WARN] [/]: 	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:432)
[01:52:39] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:841)
[01:52:39] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:693)
[01:52:39] [Server thread/WARN] [/]: 	at java.lang.Thread.run(Thread.java:748)
[01:52:05] [Server thread/WARN] [/]: java.lang.Exception: Stack trace
[01:52:05] [Server thread/WARN] [/]: 	at java.lang.Thread.dumpStack(Thread.java:1336)
[01:52:05] [Server thread/WARN] [/]: 	at net.minecraft.world.World.handler$onSetBlockHead$zzd000(World.java:50678)
[01:52:05] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147465_d(World.java)
[01:52:05] [Server thread/WARN] [/]: 	at net.minecraft.block.BlockStaticLiquid.func_149818_n(BlockStaticLiquid.java:38)
[01:52:05] [Server thread/WARN] [/]: 	at net.minecraft.block.BlockStaticLiquid.func_149695_a(BlockStaticLiquid.java:31)
[01:52:05] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147460_e(World.java:1147)
[01:52:05] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147459_d(World.java:1086)
[01:52:05] [Server thread/WARN] [/]: 	at appeng.util.BlockUpdate.call(BlockUpdate.java:44)
[01:52:05] [Server thread/WARN] [/]: 	at appeng.util.BlockUpdate.call(BlockUpdate.java:25)
[01:52:05] [Server thread/WARN] [/]: 	at appeng.hooks.TickHandler.processQueue(TickHandler.java:283)
[01:52:05] [Server thread/WARN] [/]: 	at appeng.hooks.TickHandler.onTick(TickHandler.java:251)
[01:52:05] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.ASMEventHandler_450_TickHandler_onTick_TickEvent.invoke(.dynamic)
[01:52:05] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
[01:52:05] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
[01:52:05] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.FMLCommonHandler.onPreWorldTick(FMLCommonHandler.java:273)
[01:52:05] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:957)
[01:52:05] [Server thread/WARN] [/]: 	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:432)
[01:52:05] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:841)
[01:52:05] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:693)
[01:52:05] [Server thread/WARN] [/]: 	at java.lang.Thread.run(Thread.java:748)
[01:52:04] [Server thread/WARN] [/]: java.lang.Exception: Stack trace
[01:52:04] [Server thread/WARN] [/]: 	at java.lang.Thread.dumpStack(Thread.java:1336)
[01:52:04] [Server thread/WARN] [/]: 	at net.minecraft.world.World.handler$onSetBlockHead$zzd000(World.java:50678)
[01:52:04] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147465_d(World.java)
[01:52:04] [Server thread/WARN] [/]: 	at net.minecraft.block.BlockStaticLiquid.func_149818_n(BlockStaticLiquid.java:38)
[01:52:04] [Server thread/WARN] [/]: 	at net.minecraft.block.BlockStaticLiquid.func_149695_a(BlockStaticLiquid.java:31)
[01:52:04] [Server thread/WARN] [/]: 	at net.minecraft.world.World.func_147460_e(World.java:1147)
[01:52:04] [Server thread/WARN] [/]: 	at aroma1997.uncomplication.enet.EnergyNetLocal.update(EnergyNetLocal.java:890)
[01:52:04] [Server thread/WARN] [/]: 	at aroma1997.uncomplication.enet.EnergyNetLocal.addTileEntity(EnergyNetLocal.java:92)
[01:52:04] [Server thread/WARN] [/]: 	at aroma1997.uncomplication.enet.EnergyNetLocal.addTile(EnergyNetLocal.java:81)
[01:52:04] [Server thread/WARN] [/]: 	at aroma1997.uncomplication.enet.EventHandler.onEnergyTileLoad(EventHandler.java:36)
[01:52:04] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.ASMEventHandler_661_EventHandler_onEnergyTileLoad_EnergyTileLoadEvent.invoke(.dynamic)
[01:52:04] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
[01:52:04] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
[01:52:04] [Server thread/WARN] [/]: 	at ic2.core.block.machine.tileentity.TileEntityElectricMachine.onLoaded(TileEntityElectricMachine.java:78)
[01:52:04] [Server thread/WARN] [/]: 	at ic2.core.block.TileEntityBlock$1.tickCallback(TileEntityBlock.java:60)
[01:52:04] [Server thread/WARN] [/]: 	at ic2.core.TickHandler.processTickCallbacks(TickHandler.java:175)
[01:52:04] [Server thread/WARN] [/]: 	at ic2.core.TickHandler.onWorldTick(TickHandler.java:60)
[01:52:04] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.ASMEventHandler_162_TickHandler_onWorldTick_WorldTickEvent.invoke(.dynamic)
[01:52:04] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
[01:52:04] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
[01:52:04] [Server thread/WARN] [/]: 	at cpw.mods.fml.common.FMLCommonHandler.onPreWorldTick(FMLCommonHandler.java:273)
[01:52:04] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:957)
[01:52:04] [Server thread/WARN] [/]: 	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:432)
[01:52:04] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:841)
[01:52:04] [Server thread/WARN] [/]: 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:693)
[01:52:04] [Server thread/WARN] [/]: 	at java.lang.Thread.run(Thread.java:748)
@Eufranio
Copy link
Member Author

Vou dar uma olhada mais profunda em breve, mas caso seja impossível capturar TileEntities fora do ciclo padrão, vou ter que capturar manualmente. Forestry: https://github.com/ForestryMC/ForestryMC/blob/mc-1.7.10/src/main/java/forestry/farming/multiblock/FarmController.java

@Eufranio
Copy link
Member Author

Impossível capturar tile entities nos eventos de tick sem ASM pesado, vou ter que adicionar as TEs manualmente à stack.

Eufranio added a commit that referenced this issue Feb 18, 2018
Enabled debug verbose again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant