Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by winnetrie

  1. Well i solved my problem with another way. I made a brewing recipe with a milkbucket as ingredient and empty bottles as input. BUT, apparently you cannot use stackable items as input for brewing recipe, so....i made my own empty bottles.
  2. Is it posseble to return multiple non-stackable items from a recipe? I want to get 3 milk bottles out of 1 milk bucket. They have to be non-stackable!
  3. Got it working. I hope i have done it right: public class TemEventHandlerOverride { @SubscribeEvent public void MilkBucketDrinkable(PlayerInteractEvent.RightClickItem event){ ItemStack stack = event.getItemStack(); if(stack!=null){ if (stack.getItem() == Items.MILK_BUCKET){ event.setCanceled(true); } } } }
  4. Thank you. It seems i was looking in the wrong place. After importing PlayerInteractEvent i could see where all the stuff is. I was looking in the minecraft package, but i had to look in the net.minecraftforge.event package
  5. I want to prevent that players can drink from a bucket of milk. I added milk bottles instead. It makes more sense for me drinking from bottles instead from a bucket (except if it's beer :-D) Alright the question is wich event is that? Where do i even find all those events? Has someone an up to date list of all the events? Currently this is what i have. I made a class TemEventHandlerOverride: public class TemEventHandlerOverride { @SubscribeEvent public void MilkBucketDrinkable(){ } } I did not fill in an event, because i don't know wich 1. I register it like this, in the preInit: MinecraftForge.EVENT_BUS.register(new TemEventHandlerOverride()); I'm not sure if it has to be registered in the preInit of Init.
  6. Yeah i already figured it out by myself. You people are answering very fast hehe. I replaced it with this: entityLiving.curePotionEffects(new ItemStack(Items.MILK_BUCKET)); Thank you anyway!
  7. I made a custom drink that should remove potion effects just like the milk bucket. Somehow this isn't working. Just for the info i made a class that extends milkbucket, i also want to add some extra effects to it. The extra effect is working, just not the potioneffect removing thing. here is the code:
  8. Where do i find this "new" registryEvent? What forge version is this? How do i use it?
  9. It's both. It works when i run in dev env. and it works when i build it into a .jar. I also tested it on a server and yes all works fine. That's why i was wondering It isn't an error either it is a warning message. Here are some screenshots:
  10. You need to provide us more information to help you. I see you made your own model for BlockWeaponRack. Show us that json model file. isFullCube() has nothing to do with the appearance of your block. Your weaponrack looks like that because you defined that in your model file.
  11. As far as i can see it is. It only happened while setting up the 1.10.2 workspace, never had it before. Also my mod is working fine with that warning message. Even after i build my mod, it is still working fine.
  12. Aha good to know. What if you don't define 1? Is there a default or will my blocks not be shown on the map?
  13. I have this error since i created my 1.10.2 workspace: Build path specifies execution environment JavaSE-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment. While i don't think this is something really bad, it still concerns me. Anyone know how to fix this?
  14. I saw this MapColor thing alot in minecraft code, but i never figured out what it does exactly. So what is it used for and when? What does it do? Should i use it? I looked into that class, i know it has something to do with colors. I see that some blocks use this, but it looks like it doesn't do anything, yet it is there! I wonder if someone can tell me
  15. If they do not connect to themself, you do something wrong in here: private boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) { IBlockState iblockstate = worldIn.getBlockState(pos); Block block = iblockstate.getBlock(); return block == Blocks.BARRIER || block == this || block instanceof BlockWall || block instanceof BlockCustomWall || block instanceof BlockFenceGate || block instanceof BlockFence || (block.isOpaqueCube(iblockstate) && iblockstate.isFullCube()); } block==this block instanceof (your own custom wall class here) Those 2 should be enough to connect to themself Show you code again so we can see what's wrong Do you let them co-exists in the game or do you completely replace them or do you replace only the recipe so your walls will be returned instead? If any other mod requires for some reason a vanilla cobblestone wall in a recipe, you will have a problem if it isn't obtaineble. Ofcourse the oredictionary can solve this, but only other mods use it. There is also no common name for walls in the oredictionary. So other mods can name it wall, Wall, blockwall, blockWall, BlockWall, Blockwall etc etc. Too many option i think. I 'solved' this more or less in my 1.7.10 mod to include a vanillawand. Placing it in the crafting grid together with the 'new' wall will return the 'old wall. I don't know any other (better) way.
  16. Ow yes true, because i register items before blocks and the item needs to know wich block to use. I'll try the extending way. I was not sure that would work properly. But the main reason is i hate to do this: .setfunction1.setfunction2.setfunction3.setfunction4.setfunction5
  17. I made a custom cake. When i place it in the world the game crashes. here is the crash: Here is the code for cheeseblock: And here for the item: public class ItemCheeseCake extends Item{ private final Block block; public ItemCheeseCake(Block block, String unlocalname, String registryname) { this.block = block; this.setUnlocalizedName(unlocalname); this.setRegistryName(registryname); this.setMaxStackSize(1); setCreativeTab(Tem.itemstab); } public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { IBlockState iblockstate = worldIn.getBlockState(pos); Block block = iblockstate.getBlock(); if (block == Blocks.SNOW_LAYER && ((Integer)iblockstate.getValue(BlockSnow.LAYERS)).intValue() < 1) { facing = EnumFacing.UP; } else if (!block.isReplaceable(worldIn, pos)) { pos = pos.offset(facing); } if (playerIn.canPlayerEdit(pos, facing, stack) && stack.stackSize != 0 && worldIn.canBlockBePlaced(this.block, pos, false, facing, (Entity)null, stack)) { IBlockState iblockstate1 = this.block.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, 0, playerIn); if (!worldIn.setBlockState(pos, iblockstate1, 11)) { return EnumActionResult.FAIL; } else { iblockstate1 = worldIn.getBlockState(pos); if (iblockstate1.getBlock() == this.block) { ItemBlock.setTileEntityNBT(worldIn, playerIn, pos, stack); iblockstate1.getBlock().onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn, stack); } SoundType soundtype = iblockstate1.getBlock().getSoundType(iblockstate1, worldIn, pos, playerIn); worldIn.playSound(playerIn, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F); --stack.stackSize; return EnumActionResult.SUCCESS; } } else { return EnumActionResult.FAIL; } } } I can't see what's wrong
  18. I think you place this here too. It's still "trouble with custom wall blocks". I made an abstract wall class where all the basic things are inside needed for the walls. Like this: That basic class i named it BlockCustomWalls.class (but you name it whatever you like) So from now on if i want to create walls i can create a class for each wall type that extends BlockCustomWalls In there i define all the subtypes it looks like this: For the connections, look at the BlockCustomWall. You might also want to be able to place torches on top of the wall.
  19. I edited my previous post. I created a dummy model to use as a default (wich does nothing except for having a comment) The first 16 color types are for the blocks the next 16 colors are for the items. i register the render like this: registerMetaRender(claywall,0,"type=white"); registerMetaRender(claywall,1,"type=orange"); registerMetaRender(claywall,2,"type=magenta"); registerMetaRender(claywall,3,"type=lightblue"); registerMetaRender(claywall,4,"type=yellow"); registerMetaRender(claywall,5,"type=lime"); registerMetaRender(claywall,6,"type=pink"); registerMetaRender(claywall,7,"type=gray"); registerMetaRender(claywall,8,"type=silver"); registerMetaRender(claywall,9,"type=cyan"); registerMetaRender(claywall,10,"type=purple"); registerMetaRender(claywall,11,"type=blue"); registerMetaRender(claywall,12,"type=brown"); registerMetaRender(claywall,13,"type=green"); registerMetaRender(claywall,14,"type=red"); registerMetaRender(claywall,15,"type=black");
  20. Btw You don't need all those .json files anymore. Just use the new forge blockstates. I have made walls for all 16 hardened clay colors and i have only 1 .json file(the blockstate file). nothing more! here is my blockstate file claywall.json : Pretty cool he? Is everything working now for you or not?
  21. I did not say it is duplicating minecraft walls. What i was saying is that BlockWall creates 2 walls and you are extending it!! Somehow 1 gets more or less overwrited but the other 1 not, because you did not defined it in the blockstate wich ofc you didn't because you don't want that. You did not create your own wall class, you extend BlockWall class. If you extend a class you take everything inside that class to your class extending it. Unless you override it. You can even add new stuff, but you can't remove things. At least not that i know. I'm not sure you can override these variants, i wasn't able to do so. I think they will co-exist, even if you add your own. If you can override this: public static final PropertyEnum<BlockWall.EnumType> VARIANT = PropertyEnum.<BlockWall.EnumType>create("variant", BlockWall.EnumType.class); I think you can't. If i'm wrong i'll be happy to hear about it. As long as you can't, this will keep messing with your walls. EDIT: Just tested it your way just to make sure and this is what i get: Exception loading model for variant tem:testwall#east=false,north=false,south=true,up=true,variant=cobblestone,west=false for blockstate "tem:testwall[east=false,north=false,south=true,up=true,variant=cobblestone,west=false]" net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model tem:testwall#east=false,north=false,south=true,up=true,variant=cobblestone,west=false with loader VariantLoader.INSTANCE, Strange i don't see this in your log. And guess what happens too? I made 1 wall and i have 2 in the creative tab.
  22. Oh great.... *puts idea in the trashcan*
  23. I have seen mods with colored lights before but all outdated or abandoned. How hard would it be to accomplish this? Where do i find information of this? I mean wich class.
  24. BlockWall has variants for cobblestone and mossy cobblestone walls. I'm pretty sure you are creating them also(without you knowing this). You prob see this in the console. I think because you create them and there aren't any variants defined in your blockstate for cobble and mossycobble they have no texture and show up in the creative tab as "doubles" without textures. You need to make your own class for walls. I made my own abstract class for walls and extend from that. Counterpart of this is, it will no longer be a child of BlockWall. Post the log from the console so we can help you better. Also i think your code looks pretty complicated, not to say chaotic. Everyone has his/her own style, but still.... Like Diesieben7 said, use metadata.
  25. Oh yes, true. I do understand now. Sorry... Edit: Sometimes i wonder why things aren't working and after a while i realize i have been stupid lol! this happens to often Ofc this isn't working: public class TemStairsTab extends CreativeTabs { public TemStairsTab(String label) { super(label); //this.setBackgroundImageName("teleport.png"); } @Override public Item getTabIconItem() { ItemStack stack= new ItemStack(ModBlocks.bricksstairwhite); Item item = stack.getItem(); return item; } @Override @SideOnly(Side.CLIENT) public int getIconItemDamage(){ return 3; } } Why? because ModBlocks.bricksstairwhite has no subtypes.... That's why it is called bricksstairwhite Just tried this method getIconItemDamage() with the other tabs and it's all working fine!
  • Create New...

Important Information

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