Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

IvanSteklow

Forge Modder
  • Joined

  • Last visited

Everything posted by IvanSteklow

  1. How to make a slot from which item can't be hoppered? My slot class:https://github.com/IvanSteklow/VanillaExtras/blob/master/src/main/java/ivansteklow/vanillaex/inventory/slots/SlotItemEnchantedBook.java PLS HELP
  2. Thank you for all!
  3. It's crashes on this block of code: public static SimpleNetworkWrapper INSTANCE; This is all class:
  4. So, thank you, but now I got new problem... In this piece of code: if (sync == 0) PacketHandler.INSTANCE.sendToServer(new PacketGetWorker(this.te.getPos(), this.mc.player.getAdjustedHorizontalFacing(), "ivansteklow.vanillaex.client.gui.GuiBlockBreaker", "cooldown", "maxCooldown")); There is an error: Description: Rendering screen java.lang.NullPointerException: Rendering screen at ivansteklow.vanillaex.client.gui.GuiBlockBreaker.drawGuiContainerForegroundLayer(GuiBlockBreaker.java:77) What's wrong, why NullPointerException? It's full error:
  5. Yes, here is code where it called: @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY) { if (!worldIn.isRemote) { playerIn.openGui(ModCore.instance, GuiHandler.BLOCKBREAKER, worldIn, pos.getX(), pos.getY(), pos.getZ()); } return true; }
  6. Ok, I clean my code and added GuiHandler in both sides, but it doesn't work!
  7. Hi everyone! Recently I added a GUI to my block, but it doesn't work. It has inventory and it's has been tested, but GUI don't opens. This is my GITHUB Repo: https://github.com/IvanSteklow/VanillaExtras/tree/master/src/main/java/ivansteklow/vanillaex HELP ME PLS!
  8. Thank you for all, I really forgot that I use new version of MC Simply I have ready method from my old mod.
  9. Hi everyone! I have a problem with onBlockActivated event. More about my block: This is block that gives water (Infinity Water Jar), but it doesn't work. Code: public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack itemstack = playerIn.getHeldItem(hand); if (itemstack.isEmpty()) { return true; } else { Item item = heldItem.getItem(); if (item == Items.BUCKET) { itemstack.shrink(1); if (itemstack.isEmpty()) { playerIn.setHeldItem(hand, new ItemStack(Items.WATER_BUCKET)); } else if (!playerIn.inventory.addItemStackToInventory(new ItemStack(Items.WATER_BUCKET))) { playerIn.dropItem(new ItemStack(Items.WATER_BUCKET), false); } return true; } else if (item == Items.GLASS_BOTTLE) { ItemStack itemstack1 = PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER); if (itemstack.isEmpty()) { playerIn.setHeldItem(hand, itemstack1); } else if (!playerIn.inventory.addItemStackToInventory(itemstack1)) { playerIn.dropItem(itemstack1, false); } else if (playerIn instanceof EntityPlayerMP) { ((EntityPlayerMP) playerIn).sendContainerToPlayer(playerIn.inventoryContainer); } return true; } return false; } HELP ME PLS!
  10. Launch command promt and in it write: gradlew eclipse It can repair project file
  11. Use @SubscribeEvent public static livingDropsEvent(LivingDropsEvent event){ }
  12. I agree with you: https://github.com/IvanSteklow/VanillaExtras And this is the API: https://github.com/IvanSteklow/isDevCore
  13. I have creative tab, but my item with metadata don't want to register in this tab. There is empty slot.
  14. Thank you, I just saw that I using my old API =)
  15. Hi everyone! I've got a crash: net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Vanilla Extras (vanillaex) Caused by: java.lang.NullPointerException at ivansteklow.isdev.BlockRegisterer.regRender(BlockRegisterer.java:13) at ivansteklow.vanillaex.init.ModBlocks.initRender(ModBlocks.java:19) at ivansteklow.vanillaex.proxy.ClientProxy.preInit(ClientProxy.java:17) at ivansteklow.vanillaex.ModCore.preInit(ModCore.java:42) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:643) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:246) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:224) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:147) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:628) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:268) at net.minecraft.client.Minecraft.init(Minecraft.java:478) at net.minecraft.client.Minecraft.run(Minecraft.java:387) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) This is the file where I've got error: package ivansteklow.isdev; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraftforge.fml.common.registry.GameRegistry; public class BlockRegisterer { public static void regRender(Block block, String modid) { Item item = Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } public static void regBlock(Block block){ GameRegistry.register(block); ItemBlock item = new ItemBlock(block); item.setRegistryName(block.getRegistryName()); GameRegistry.register(item); } } And this is string where is error: Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); HELP ME PLS! What's wrong?
  16. Can I close my own topic?
  17. Where I can see all available models?
  18. But how to use multi-texture cube ?
  19. Hi everyone! I have a block with multi-texture, but if I launch MC and test my block, it doesn't have any texture. /assets/ishelper/models/block/waterjar.json { "parent": "block/cube_all", "textures": { "bottom": "ishelper:blocks/waterjar", "top": "ishelper:blocks/waterjar_top", "side": "ishelper:blocks/waterjar" } } This textures are exist, but MC don't see they. There are no any error in logs, only some WARNS: [17:26:28] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:28] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:28] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:28] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:28] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:28] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:28] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:30] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:30] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:30] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:30] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:30] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:30] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all [17:26:30] [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all Help me pls!
  20. Thank you, I basicly forgot refresh workspace. =(
  21. Hello everyone! I need a help with Block textures. On starting MC I get this message: https://pastebin.com/SBS88ELq This is my block class: BlockJar.java package ivansteklow.ishelper.blocks; import javax.annotation.Nullable; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Items; import net.minecraft.init.PotionTypes; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionUtils; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockJar extends Block { public BlockJar() { super(Material.ROCK); setSoundType(SoundType.STONE); setHardness(1.0f); setHarvestLevel("pickaxe", 1); setUnlocalizedName("waterjar"); } public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack itemstack = playerIn.getHeldItem(hand); if (itemstack.isEmpty()) { return true; } else { Item item = heldItem.getItem(); if (item == Items.BUCKET) { itemstack.shrink(1); if (itemstack.isEmpty()) { playerIn.setHeldItem(hand, new ItemStack(Items.WATER_BUCKET)); } else if (!playerIn.inventory.addItemStackToInventory(new ItemStack(Items.WATER_BUCKET))) { playerIn.dropItem(new ItemStack(Items.WATER_BUCKET), false); } return true; } else if (item == Items.GLASS_BOTTLE) { ItemStack itemstack1 = PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER); if (itemstack.isEmpty()) { playerIn.setHeldItem(hand, itemstack1); } else if (!playerIn.inventory.addItemStackToInventory(itemstack1)) { playerIn.dropItem(itemstack1, false); } else if (playerIn instanceof EntityPlayerMP) { ((EntityPlayerMP) playerIn).sendContainerToPlayer(playerIn.inventoryContainer); } return true; } return false; } } } This is my Registering blocks class: ModBlocks.java package ivansteklow.ishelper.init; import ivansteklow.isdev.BlockRegisterer; import ivansteklow.ishelper.blocks.BlockJar; import net.minecraft.block.Block; import net.minecraft.util.ResourceLocation; public class ModBlocks { public static Block blockJar; public static void init() { blockJar = new BlockJar().setRegistryName(new ResourceLocation(Refs.MOD_ID, "waterjar")); BlockRegisterer.regBlock(blockJar); } public static void initRender() { BlockRegisterer.regRender(blockJar, Refs.MOD_ID); } } BlockRegisterer.java (My API) package ivansteklow.isdev; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraftforge.fml.common.registry.GameRegistry; public class BlockRegisterer { public static void regRender(Block block, String modid) { Item item = Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } public static void regBlock(Block block){ GameRegistry.register(block); ItemBlock item = new ItemBlock(block); item.setRegistryName(block.getRegistryName()); GameRegistry.register(item); } } I have some files: /assets/ishelper/blockstates/waterjar.json { "variants": { "normal": { "model": "ishelper:waterjar" } } } /assets/ishelper/models/block/waterjar.json { "parent": "block/cube_all", "textures": { "all": "ishelper:blocks/waterjar" } } /assets/ishelper/models/item/waterjar.json { "parent": "block/cube_all", "textures": { "all": "ishelper:blocks/waterjar" } } What's wrong?! HELP ME PLS!
  22. Try download another installer (last stable build) of Forge === I think this is a problems in MC Forge maven repo
  23. I think you have a problem with your internet connection

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.