Jump to content

Alexiy

Forge Modder
  • Posts

    198
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Alexiy

  1. It isn't that bad compared to what was a couple of years ago. Now there is plenty of open source code to look at if you can't find documentation. People contribute to Forge for free, so don't expect it to be professional-grade project.
  2. Use FurnaceFuelBurnTimeEvent.
  3. Oh, I've noticed you haven't overridden getStateFromMeta method. You have to override it and return appropriate state from the given metadata. And in getMetaFromState you have to return appropriate metadata, I guess in your case it will be just state.getValue(STAGE).
  4. Ok, let's try this - after the line worldIn.setBlockState(pos, state.cycleProperty(STAGE), 4) add following: IBlockState blockState=worldIn.getBlockState(pos); worldIn.notifyBlockUpdate(pos,blockState,blockState,2);
  5. Try 'setBlockState' without a flag or with a flag 2.
  6. I don't know what I've done with my project, by I am unable to create any world anymore. It stucks on world loading screen. Here is the log: https://pastebin.com/V2bKUvcq
  7. Override 'getItemEnchantability' and return respective tool material enchantability.
  8. It is intented to send changes to client, so it's effective on server only.
  9. I believe you still have to create a block for your fluid, because for texture to render you have to use ModelLoader.registerItemVariants and ModelLoader.setCustomMeshDefinition. They both accept Item, in your case, it will be an ItemBlock with your fluid block instance.
  10. Have you tried setting xSize, ySize, guiLeft and guiTop? For example: @Override public void initGui() { super.initGui(); xSize=width-10; ySize=height-10; guiLeft=(width-xSize)/2; guiTop=(height-ySize)/2; } "width" and "height" fields are the ones that scale when screen size changes.
  11. I know that if you click outside gui borders, a slot index of -999 will be passed to Container#slotClick method, so you might want to make use of that.
  12. Well, I implemented that in my custom handler. But I suppose it wouldn't be accepted in a pull request to Forge? I don't like that when, say, there is a stack in slot 12 with size 24, and a hopper inserts a stack with same item into empty slot 3 just because this slot happened to be found first.
  13. I suppose you can do this in Item#getSubItems function.
  14. Is there a reason that Forge's item handler doesn't merge incoming stacks with existing stacks first, but inserts into empty slot first instead? Is it performance?
  15. Are your json files' names lowercase?
  16. ItemPickupEvent is currently broken.
  17. ItemChease.json must be lowercase
  18. Try things with lighting, like: GlStateManager.disableLighting(); Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(icon3, 0, 0); GlStateManager.enableLighting();
  19. You can't. What you can do is utilize the position from the event, create an AA-bounding box of desired range and check for presence of your block within that box.
  20. Ignore them, it throws this exception because you aren't using registered username ("Player700" and alike). Or you can specify your username and password in run configuration so it actually logs in.
  21. I have a little mod which adds one creature (dragon). It has four variations. The variation is registered in data manager. When the creature is spawned, it's variation is set based on the biome where it spawns. Parameters of the dragon: public static final DataParameter<Integer> dragonType = EntityDataManager.createKey(EntityDragon.class, DataSerializers.VARINT); private static final DataParameter<Optional<UUID>> ownerID = EntityDataManager.createKey(EntityDragon.class,DataSerializers.OPTIONAL_UNIQUE_ID); private Entity owner; public static final DataParameter<Boolean> sitting = EntityDataManager.createKey(EntityDragon.class,DataSerializers.BOOLEAN); @Override protected void entityInit() { super.entityInit(); setSize(0.7f,0.85f); dataManager.register(dragonType,0); dataManager.register(ownerID, Optional.absent()); dataManager.register(sitting,false); } Setting the dragon type: @SubscribeEvent public void setDragonType(LivingSpawnEvent.SpecialSpawn livingSpawnEvent) { EntityLivingBase entityLivingBase=livingSpawnEvent.getEntityLiving(); if(entityLivingBase instanceof EntityDragon) { BlockPos blockPos=new BlockPos(livingSpawnEvent.getX(),livingSpawnEvent.getY(),livingSpawnEvent.getZ()); Biome biome=livingSpawnEvent.getWorld().getBiome(blockPos); int type=0; if(biome instanceof BiomeJungle) type=EntityDragon.GREEN; else if(biome instanceof BiomeDesert) type=EntityDragon.GOLD; else if(biome instanceof BiomeForest) type=EntityDragon.EBONY; else if(biome instanceof BiomeHills) type=EntityDragon.SILVER; entityLivingBase.getDataManager().set(EntityDragon.dragonType,type); } } The question is, is it possible to set the type without using the event? I couldn't find a suitable method to override that would have the dragon's position set.
  22. If i'm right, you must deal with item handlers only on server side.
  23. You can copy the itemstacks from the entity items in the list, then create new entity items for copied drops, then add those to the list.
  24. e.drops.addAll(e.drops); I don't think this will have any effect.
  25. Take a look at one of preset item models - assets/minecraft/models/item/handheld.json and ~generated.json. There are various sections. You should use one that corresponds to hotbar display in your json file and change the rotation, scale and translation as you like.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.