Everything posted by lethinh
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
I use @Mod.EventBusSubscriber on the beginning of the class file
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
When I toggle line breakpoint. It doesn't break. But it doesn't break unbreable block
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
Thanks for your idea but it doesn't work. The world.isRemote has already called in the code.
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
So do you know how to convert List<ItemStack> to ItemStack ?
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
How to wheater the code is reaching the break unbreakable block statements?
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
Do you know how to use debugger? I'm using Intellij IDEA
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
It breaks ordinary breakable blocks. The game doesn't crash. And I have called the event by using MinecraftForge.EventBus::register
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
It doesn't break unbreakable block. That's the point of the code.
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
I have just learned java for few months. And the code didn't work: @SubscribeEvent public void onPlayerDig(PlayerInteractEvent.LeftClickBlock event) { World world = event.getWorld(); EntityPlayer player = event.getEntityPlayer(); if (event.getFace() == null || world.isRemote || StackUtils.isEmpty(player.getHeldItem(EnumHand.MAIN_HAND)) || player.isCreative()) return; BlockPos pos = event.getPos(); IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); List<ItemStack> drop = new ArrayList<>(); if (drop == null) drop = new ArrayList<>(block.getDrops(world, pos, state, EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, new ItemStack(this)))); block.harvestBlock(world, player, pos, state, world.getTileEntity(pos), new ItemStack(block)); InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(block)); world.setBlockToAir(pos); world.playEvent(2001, pos, Block.getStateId(state)); }
-
[Forge 1.10.2] Ticking player crash?
My fml-client-latest.log: https://gist.github.com/letruongthinh/39a43b171466c9a97cec851b27871e23 My latest.log: https://gist.github.com/letruongthinh/0030e677c0918872b176a3ddb6d4eec7
-
[Forge 1.10.2] Ticking player crash?
It shows these error lines: [21:04:27] [File IO Thread/ERROR]: Failed to save chunk java.lang.NullPointerException at java.io.DataOutputStream.writeUTF(DataOutputStream.java:347) ~[?:1.8.0_51] at java.io.DataOutputStream.writeUTF(DataOutputStream.java:323) ~[?:1.8.0_51] at net.minecraft.nbt.NBTTagCompound.writeEntry(NBTTagCompound.java:555) ~[NBTTagCompound.class:?] at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:29) ~[NBTTagCompound.class:?] at net.minecraft.nbt.NBTTagList.write(NBTTagList.java:37) ~[NBTTagList.class:?] at net.minecraft.nbt.NBTTagCompound.writeEntry(NBTTagCompound.java:556) ~[NBTTagCompound.class:?] at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:29) ~[NBTTagCompound.class:?] at net.minecraft.nbt.NBTTagCompound.writeEntry(NBTTagCompound.java:556) ~[NBTTagCompound.class:?] at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:29) ~[NBTTagCompound.class:?] at net.minecraft.nbt.CompressedStreamTools.writeTag(CompressedStreamTools.java:126) ~[CompressedStreamTools.class:?] at net.minecraft.nbt.CompressedStreamTools.write(CompressedStreamTools.java:116) ~[CompressedStreamTools.class:?] at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkData(AnvilChunkLoader.java:252) ~[AnvilChunkLoader.class:?] at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeNextIO(AnvilChunkLoader.java:230) [AnvilChunkLoader.class:?] at net.minecraft.world.storage.ThreadedFileIOBase.processQueue(ThreadedFileIOBase.java:48) [ThreadedFileIOBase.class:?] at net.minecraft.world.storage.ThreadedFileIOBase.run(ThreadedFileIOBase.java:36) [ThreadedFileIOBase.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51]
-
[Forge 1.10.2] Ticking player crash?
Yes!
-
[Forge 1.10.2] Ticking player crash?
Well, I changed the SLOT_PLAN to 0, SLOLT_CRAFT_RESULT to 1, and SLOT_CRAFT_MATRIX to 2 in the InventoryConstructor.
-
[Forge 1.10.2] Ticking player crash?
Now it doesn't open the gui. Here is my ContainerBase code: https://gist.github.com/letruongthinh/21f58eb3c04fac917d72ed35190397d0 My ContainerConstructor code: https://gist.github.com/letruongthinh/649c2ace3a7dd7fed501b421df50478e
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
It is: @SubscribeEvent public void onPlayerDig(PlayerInteractEvent.LeftClickBlock event) { World world = event.getWorld(); EntityPlayer player = event.getEntityPlayer(); if (event.getFace() == null || world.isRemote || StackUtils.isEmpty(player.getHeldItem(EnumHand.MAIN_HAND)) || player.isCreative()) return; BlockPos pos = event.getPos(); IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); List<ItemStack> drop = new ArrayList<>(); if (block.getDrops(world, pos, state, EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, new ItemStack(this))) == drop) { if (drop == null) drop = new ArrayList<>(block.getDrops(world, pos, state, EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, new ItemStack(this)))); InventoryHelper.spawnItemStack(world, (double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), drop); } else block.harvestBlock(world, player, pos, state, world.getTileEntity(pos), drop); world.setBlockToAir(pos); world.playEvent(2001, pos, Block.getStateId(state)); }
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
Can't be. If I do that, the method InventoryHelper::spawnItemStack and Block::harvestBlock WILL NOT WORK
-
[Forge 1.10.2] Ticking player crash?
Hello everyone. I'm getting trouble with my TileEntity. Here is my crash report: https://gist.github.com/letruongthinh/cfe53052b3b289502973deb28c65f71a My Inventory Base code: https://gist.github.com/letruongthinh/7f2dd5df5ae401aca54f7deb3085f9f9 My InventoryTile code: https://gist.github.com/letruongthinh/594b82c891f6796f3994bb012993b63d My Tile Base code: https://gist.github.com/letruongthinh/9cf3622a35e9069332e0c74c85aee15b
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
I can't. Block::getDrops is List<ItemStack> but the drop is a item stack.
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
All the code that I have shown to you. And could you show me how to not call Block::getMetaFromState?
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
Do you know how to fix those errors? I have tried all!
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
Here is my final newest code: https://gist.github.com/anonymous/28b892b90e2f73d2242a3f2b077e77ca
-
[Forge 1.10.2] How to create a block that have meta and facing direction?
Here is my written code: https://gist.github.com/anonymous/07469e8949863a712c21d1c512accb13 And I'm stuck on that I have created a block that have meta but facing hasn't. Please help me...
-
stackSize is private - how would I modify the stacksize now? [Forge 1.11.2]
You can use getCount() to get stack size or setCount() to set stackSize. The stackSize is private because ItemStack in forge 1.11.2 is never null. You should use ItemStack.EMPTY instead of null!
-
[Forge 1.10.2] How to create a container that have moving progress arrow and send packet to client, server and player?
Does anyone know how to do that?
-
[Forge 1.10.2] Create a pickaxe that break unbreakable blocks?
Still doesn't work!
IPS spam blocked by CleanTalk.