-
Posts
62 -
Joined
-
Last visited
-
Days Won
7
Everything posted by IvanSteklow
-
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
- 1 reply
-
- 1
-
-
Thank you for all!
-
It's crashes on this block of code: public static SimpleNetworkWrapper INSTANCE; This is all class:
-
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:
-
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; }
-
Ok, I clean my code and added GuiHandler in both sides, but it doesn't work!
-
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!
-
[SOLVED][1.11.2] onBlockActivated doesn't work
IvanSteklow replied to IvanSteklow's topic in Modder Support
Thank you for all, I really forgot that I use new version of MC Simply I have ready method from my old mod. -
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!
-
Oh, thank you!
-
Launch command promt and in it write: gradlew eclipse It can repair project file
-
Giving different mod drops for the different types of Rabbits?
IvanSteklow replied to RoyalKingZB's topic in Modder Support
Use @SubscribeEvent public static livingDropsEvent(LivingDropsEvent event){ } -
I agree with you: https://github.com/IvanSteklow/VanillaExtras And this is the API: https://github.com/IvanSteklow/isDevCore
-
I have creative tab, but my item with metadata don't want to register in this tab. There is empty slot.
-
[SOLVED][1.11.2] Problem with block model
IvanSteklow replied to IvanSteklow's topic in Modder Support
Thank you, I just saw that I using my old API =) -
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?
-
Thank you!
-
Where I can see all available models?
-
But how to use multi-texture cube ?
-
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!
-
Thank you, I basicly forgot refresh workspace. =(
- 1 reply
-
- 1
-
-
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!
- 1 reply
-
- 1
-
-
Try download another installer (last stable build) of Forge === I think this is a problems in MC Forge maven repo
-
I think you have a problem with your internet connection
- 1 reply
-
- 1
-