mirror of
https://github.com/GTNewHorizons/Gadomancy.git
synced 2026-11-26 14:53:21 +00:00
- EssentiaCompressor: <init> (uncapped for now)
This commit is contained in:
1 parent
97476abb2b
commit
68773b0681
31 files changed
+1754
-69
No files matched your search
@@ -9,6 +9,8 @@ import makeo.gadomancy.common.blocks.tiles.TileNodeManipulator;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileStickyJar;
|
||||
import makeo.gadomancy.common.data.SyncDataHolder;
|
||||
import makeo.gadomancy.common.data.config.ModConfig;
|
||||
import makeo.gadomancy.common.entities.EntityItemElement;
|
||||
import makeo.gadomancy.common.items.ItemElement;
|
||||
import makeo.gadomancy.common.registration.RegisteredBlocks;
|
||||
import makeo.gadomancy.common.registration.RegisteredItems;
|
||||
import makeo.gadomancy.common.utils.GolemEnumHelper;
|
||||
@@ -59,10 +61,23 @@ public class EventHandlerWorld {
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOW)
|
||||
public void on(EntityJoinWorldEvent event) {
|
||||
if(!event.world.isRemote && event.entity instanceof EntityItem
|
||||
&& isDisguised(((EntityItem) event.entity).getEntityItem())) {
|
||||
long time = event.world.getTotalWorldTime() + event.world.rand.nextInt(60) + 40;
|
||||
trackedItems.put((EntityItem) event.entity, time);
|
||||
if(!event.world.isRemote && event.entity instanceof EntityItem) {
|
||||
ItemStack stack = ((EntityItem) event.entity).getEntityItem();
|
||||
if(isDisguised(stack)) {
|
||||
long time = event.world.getTotalWorldTime() + event.world.rand.nextInt(60) + 40;
|
||||
trackedItems.put((EntityItem) event.entity, time);
|
||||
}
|
||||
if(stack.getItem() instanceof ItemElement && !(event.entity instanceof EntityItemElement)) {
|
||||
event.setCanceled(true);
|
||||
EntityItem newItem = new EntityItemElement(event.world,
|
||||
event.entity.posX, event.entity.posY, event.entity.posZ,
|
||||
((EntityItem) event.entity).getEntityItem());
|
||||
newItem.delayBeforeCanPickup = ((EntityItem) event.entity).delayBeforeCanPickup;
|
||||
newItem.motionX = event.entity.motionX;
|
||||
newItem.motionY = event.entity.motionY;
|
||||
newItem.motionZ = event.entity.motionZ;
|
||||
event.world.spawnEntityInWorld(newItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user