Everything posted by CyberPunkBln
-
Forge 1.12 - NBT-Data in MetaData-Item and JSON-Recipes
Hello, a short question. I have an Item with MetaDatas with SubItems. All functioned perfectly but i use only the MetaDatas for Textures, Models and Recipes. The NBT-Data i use for the durability. Now i have a: GameRegistry.addSmelting(new ItemStack(this, 1, 2), new ItemStack(this, 1, 4), 0); and a ConfigVariable from a Config-File for the max Durability. The max Durability is an NBT-Data. And now i have the Problem that the Recipes accepts the Items with all Durability and make an Item with full Durability. I think i can use NBT-Data like: "nbt": { "durability": 5 } in accpeted Items in the Receipt. But when is okay to use NBT-Data not in the ouput so in the input. Where can say forge to use my Config-Variable from the Config-File maxDurability? Give it Variables in the JSON-Recipe-Files? thx Edit: No NBT-Data in Inputs from JSON-Recipes don't functioned. That the question how can i use NBT-Data for inputs in Smelting and Crafting Recipes?
-
[1.11.2] Make Water Bottles the same as a Bucket
@Draco18s For WebDevelopment is use Notepad++ for years . I think it is why iam an old man . Yes Eclipse i use, too. How i say i have converted a little Mod wit Name ThirstyBottles from 1.10.2 to 1.11.2. And then i must see that this mod has many Bugs in it and not functioned 100% for my needs. @V0idWa1k3r I think i give up with this. This is what i understand, but should old code: @SubscribeEvent public void onItemUsed(RightClickBlock event) { if (!event.getItemStack().isEmpty() && event.getItemStack().getItem() instanceof ItemGlassBottle) { BlockPos pos = new BlockPos(event.getHitVec()); ... } But this is where i need to much time to Dive Into Java4MinecraftForge : public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) RayTraceResult raytraceresult = this.rayTrace(worldIn, playerIn, flag); ... I have thinked that it cannot be so a hard dive into this materia when i want to make GlassBottles interact like a Bucket on water . But Thx for the Help at all.
-
[1.11.2] Make Water Bottles the same as a Bucket
Cool thx good steps into this. I will study the code from ItemBucket and learn from this code. Short can you explain how i cancel the vanilla events from ItemGlassBottle?
-
[1.11.2] Make Water Bottles the same as a Bucket
@diesieben07 Thx a good tip for me. Now i have the fresh 1.11.2 code for inspect and study. @V0idWa1k3r Yes this is, i think, the way. Do you have an code-example or an site with an good explanation, or is the orignal code with: public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) the right place for me to show? When i use this 2 event-handlers, what is with the original eventHandler in ItemGlassBottle?
-
[1.11.2] Make Water Bottles the same as a Bucket
I have no IDE for Java, i'm a WebDeveloper , i have converted the original mod from 1.10.2 to 1.11.2 and must seen that the original mod don't functioned. Same Issues on 1.10.2 and now i am here with my notepad++ and gradle pure . The Mod is functioned like the 1.10.2 i should be happy with the buggy original functions on 1.11.2. With the study of the orignal code from GlassBottle and Bucket i know now whats the problem, but with no solution. Also it gives no Website with the newest decompiled code? Only decompile with MCP-Packet? So its look like i must deactivate the original WaterBottle, coding a new WaterBottle and implement the Bucket-Code. Has noboby another Solution, how i easier can implement an new method for sucking up water with the GlassBottle? The only problem is the original trigger from OrignalClass ItemGlassBottle, the code from the Bucket are useless when 2 Objects trigger the same Blockstate, my Object and the OrignalObject. Why has Mojang the GlassBottle not simple made with an BlockToAir ?
-
[1.11.2] Make Water Bottles the same as a Bucket
Yeah cool i study the code. Very intresting for me. I Only want a open source mod convert to 1.11.2 from 1.10.2. The original Mod has the same problems i have. i study: http://book2s.com/java/src/package/net/minecraft/item/itemglassbottle.html and http://book2s.com/java/src/package/net/minecraft/item/itembucket.html seems old. How i can see, i trigger 2 BlockStates first my own and second the vanilla glassbottle. Hu Yeah my first Day after decades of non JAVA Prorgamming (php,python and so on but today i have say i want this mod for 1.11.2 and this must i made myself ). Sorry but i think in my very old brain that i can easy overwrite Objects in Java: @Override public class ItemGlassBottle extends Item {} And then complete rewrite the ItemGlassBottle. Fuhhhh . Knows anybody a newer Site with the source code from 1.11.2?
-
[1.11.2] Make Water Bottles the same as a Bucket
Yes exactly. My only for Solid Blocks 100% functioned Solution is: BlockPos pos = new BlockPos(event.getHitVec()); IBlockState state = event.getWorld().getBlockState(pos); if (state != null && state.getBlock() == Blocks.WATER) { event.getWorld().setBlockToAir(pos); event.getWorld().playSound(player, player.posX, player.posY, player.posZ, SoundEvents.ITEM_BOTTLE_FILL, SoundCategory.NEUTRAL, 1.0F, 1.0F); event.getEntityPlayer().setHeldItem(event.getHand(), giveBottleBack(event.getItemStack(), event.getEntityPlayer(), new ItemStack(Items.POTIONITEM,1,(byte)0))); } And this don't functioned like the Vanilla Bucket. The Vanilla Bucket make it better . The Vanilla Bucket trigger the Block Water (Water Source) perfectly.
-
[1.11.2] Make Water Bottles the same as a Bucket
Hello, i mean the Vanilla Bucket suck up Water Sources when i take water with the bucket, with finite water fluid. Means Water Bottles suck up no Water Source and make the finite water fluid sensless. The Bucket does this all very good right. He trigger all BlockStates from Water: I trigger with this: state.getBlock() == Blocks.WATER only the water source when a block is under this water source. I think the problem is that the WaterBlock does not are solid and slight transparency, i think. When i trigger solid blocks it functioned perfectly. I have many situations where the Vanilla-WaterBottle-NoWaterSource will be triggered, as an example when i try to suck up wit water bottle deep water sources. And therefore i must find a BlockState where i can excactly trigger water like the Vanilla Bucket, or another workaround that i can suck up water sources exactly like the Vanilla Bucket.
-
[1.11.2] Make Water Bottles the same as a Bucket
Hello, i have made water finite in my mod and now water bottles are the only item was not suck a water source like the bucket. Now i try to catch all blockstates that water can be have: At the moment i catch this with: BlockPos pos = new BlockPos(event.getHitVec()); IBlockState state = event.getWorld().getBlockState(pos); if (state != null && state.getBlock() == Blocks.WATER) But it seems that fluid are not so easy catchable. Some States of the Water Block can i not catch. Only direct water blocks with an solid block under can i catch. No water blocks under water and so on. How catch the Minecraft Bucket Fluid Blocks like Water? Has anybody a solution? Thx
IPS spam blocked by CleanTalk.