• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Finally i fixed the all problems. I added this condition and thats all. world.chunkExists(specialItemEntity.chunkCoordX,specialItemEntity.chunkCoordZ)   Final code is :   EventHandler class package com.azizd.thunderbird.events; import com.azizd.thunderbird.Thunderbird; import com.azizd.thunderbird.entities.SpecialItemEntity; import com.azizd.thunderbird.init.itemInit; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(modid = Thunderbird.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class EventHandler { public static void register(){} @SubscribeEvent public static void crimsonIngotCraft(EntityJoinWorldEvent event){ Entity entity = event.getEntity(); World world = entity.world; double posX = entity.getPosX(); double posY = entity.getPosY(); double posZ = entity.getPosZ(); SpecialItemEntity specialItemEntity = new SpecialItemEntity(world, posX, posY, posZ); if(entity instanceof ItemEntity && !(entity instanceof SpecialItemEntity)){ ItemEntity itemEntity = (ItemEntity) event.getEntity(); ItemStack item = itemEntity.getItem(); if(item.getItem() == itemInit.RED_PEARL.get()){ if(world.chunkExists(specialItemEntity.chunkCoordX,specialItemEntity.chunkCoordZ)) { event.setCanceled(true); specialItemEntity.setItem(itemEntity.getItem().getStack()); specialItemEntity.setPickupDelay(30); specialItemEntity.setMotion(itemEntity.getMotion()); world.addEntity(specialItemEntity); } } } } }   SpecialItemEntity class package com.azizd.thunderbird.entities; import com.azizd.thunderbird.init.itemInit; import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class SpecialItemEntity extends ItemEntity { private ItemEntity entity = new ItemEntity(this.world,this.getPosX(),this.getPosY(),this.getPosZ()); public SpecialItemEntity(World worldIn, double x, double y, double z) { super(worldIn, x, y, z); } @Override public void tick() { if(this.inWater && !this.world.isRemote){ this.setDead(); int count = this.getItem().getCount(); entity.setPosition(this.getPosX(),this.getPosY(),this.getPosZ()); entity.setItem(new ItemStack(itemInit.CRIMSON_INGOT.get())); entity.getItem().setCount(count); this.world.addEntity(entity); } else{ super.tick(); } } }  
    • I want to propose to user few options, which he/she may craft from items in inventory. Client will prepare all combinations, than select only few best (in my context). Server will validate only this few combinations. Ofcouse I plans to add precheck how many combination client may construct and prevent few-seconds freezes with message like "Sorry, so many ingredients for autocompletion."
    • Dyes and colored objects are not handled through runtime coloring, they simply have different textures, there for ColorHandlerEvent / IItemColor / IBlockColor is not the way to go. It gets problematic, because Minecraft models dye color as an enum, which is of course inflexible and does not let you add things to it.   So really you just need to add new items, blocks, etc. as normal for all the colored "things" and ignore DyeColor. For things like sheep shearing, you probably either need to hook into the sheep rendering and have your own rendering for your own color (in addition to storing the fact that the sheep is "your color") or just spawn a custom sheep. Same goes for banners, you probably have to clone the complete logic, which is not really fun.   Overall: The basics are possible, but integrating it into the whole game is probably not possible / not easy.
    • Yes it is the error. I don't use a Mac, so I don't know how to fix this.
  • Topics

  • Who's Online (See full list)