Jump to content

DiamondMiner88

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by DiamondMiner88

  1. Wait i dont get it... how do i subscribe from the client proxy class what annotation do i use? I have no idea how subscribing works. I made the ServerProxy but in the Client i already have public void registerItemRenderer(Item item, int meta, String id) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id)); } this i what is my ClientProxy class is: package com.diamondminer88.mod.character.proxy; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; public class ClientProxy implements CommonProxy { public void registerItemRenderer(Item item, int meta, String id) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id)); } public void init() { ModelLoader.setCustomModelResourceLocation(); } } I updated my Github too.
  2. Lol Mojang is working on 1.14 with snapshots already out but forge is still trying to get 1.13 done
  3. Because i don't know how to make it better.
  4. What did you do and btw can you setup a github repo i want to see your mod I'm interested.
  5. I have no idea Ill try to find a better way
  6. Oh sorry. Then whats a better way to do it? I posted my code at the top of my page and is that bad too?
  7. @Override public boolean canHarvestBlock(IBlockAccess world, BlockPos pos, EntityPlayer player) { Item MainHandHeldItem = player.getHeldItemMainhand().getItem(); if (MainHandHeldItem.equals(ItemInit.CLOUD_PICKAXE)) { return true; } else { return false; } } In your block class
  8. Are you wanting to make it so its impossible to break it if its not the Cloud tool but possible if it is?
  9. That makes your block unbreakable for ever.
  10. So do i just remove for (Item item : ModItems.ITEMS) { if (item instanceof IHasModel) { ((IHasModel)item).registerModels(); } } Because doesn't it serve a point? It registersModels, right?
  11. And in RegistryHandler it says: for (Item item : ModItems.ITEMS) { if (item instanceof IHasModel) { ((IHasModel)item).registerModels(); } } what do i put instead of the item instanceof IHasModel
  12. Try rebooting, then deleting your 1.12 profile in the launcher and forge (if its there) then downloading 1.12 again through the launcher, CLOSE minecraft, Then try to install Forge. I think you were attempting to download or launch 1.12 and also the installer trying to use it.
  13. This is what i did: package com.diamondminer88.mod.character.blocks.a.glass; import com.diamondminer88.mod.character.blocks.blockbases.a.BlockBaseGlassA; import com.diamondminer88.mod.character.init.ModBlocks; import com.diamondminer88.mod.character.init.ModItems; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import java.util.Random; public class AGlassBlack extends BlockBaseGlassA { public Item item; public EntityPlayer entityPlayer; public AGlassBlack(String name, Material material) { super(name, material); } @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { if (harvesters.get() != null) { entityPlayer = harvesters.get(); Item MainHandHeldItem = entityPlayer.getHeldItemMainhand().getItem(); if (MainHandHeldItem.equals(ModItems.TOOL_DIAMOND_GLASS_CUTTER) || MainHandHeldItem.equals(ModItems.TOOL_IRON_GLASS_CUTTER)) { this.item = Item.getItemFromBlock(ModBlocks.A_GLASS_BLACK); } else { this.item = ModItems.GLASS_SHARD_BLACK; } } return this.item; } @Override protected ItemStack getSilkTouchDrop(IBlockState state) { return new ItemStack(ModBlocks.A_GLASS_BLACK); } } And please when you are posting code onto the forum use the "code" function like i did. I made it so if you break the "AGlassBlack" block by my GlassCutter, it drops the block but if not, drops shards. As for the quantity, there there is only point to do quantityDropped if you're making it drop more than one of that item. The default is 1.
  14. I gave up on that tutorial so ill try to work with the CharacterMod, that one I already have working. Where do i change the static initializers? I tried making onItemRegister non-static but it didn't even register the items. The proxies: is this how you do it? CrayfishTM Only I don't know what to put instead of ModItems.registerRenders() in ClientProxy. And i still dont get what you mean by: In what class do i subscribe to ModelRegistryEvent and call ModelLoader.setCustomResourceLocation?
  15. So the Code style: I have no idea how to avoid the IHasModel. The Common Proxy: in 1.9 i made a mod with a client/server proxy, no common but im not sure if that same method will work in 1.12 How do I the the registry beside the ForgeRegistryEvent? I compared my other working mod to this one, the registry looks to me exactly the same, here's the working one: CharacterMod Where do i call the registry from?
  16. I'm following this tutorial, I did everything that he did before the block part, i checked the image that its a 16x16 pixel img, but my item is still not rendering but there are no errors in the log, like forge is detecting it but not displaying it for some reason. Harry Talks Github
  17. Ok i found a way to do that this is what i did and it worked! Thanks Guys! @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { if (harvesters.get() != null) { entityPlayer = harvesters.get(); Item MainHandHeldItem = entityPlayer.getHeldItemMainhand().getItem(); if (MainHandHeldItem.equals(ModItems.TOOL_DIAMOND_GLASS_CUTTER) || MainHandHeldItem.equals(ModItems.TOOL_IRON_GLASS_CUTTER)) { this.item = Item.getItemFromBlock(ModBlocks.A_GLASS_BLACK); } else { this.item = ModItems.GLASS_SHARD_BLACK; } } return this.item; } @Override public int quantityDropped(IBlockState state, int fortune, Random random) { if (harvesters.get() != null) { entityPlayer = harvesters.get(); Item MainHandHeldItem = entityPlayer.getHeldItemMainhand().getItem(); if (MainHandHeldItem.equals(ModItems.TOOL_DIAMOND_GLASS_CUTTER) || MainHandHeldItem.equals(ModItems.TOOL_IRON_GLASS_CUTTER)) { this.quantity = 1; } else { this.quantity = Main.randomNumber(1, 10); } } return this.quantity; }
  18. First of all im using Idea, and i already found a method so im testing with it.
  19. Ok i searched it up and i get it. The only problem is now I don't know how to compare the Item not ItemStack. How do i get the Item from an ItemStack?
  20. How do i get custom block drops? This is what i have so far: package com.diamondminer88.mod.character.blocks.A.Glass; import com.diamondminer88.mod.character.blocks.blockbases.BlockBaseGlassA; import com.diamondminer88.mod.character.init.ModBlocks; import com.diamondminer88.mod.character.init.ModItems; 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.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import java.util.Random; public class AGlassBlack extends BlockBaseGlassA { public EntityPlayer entityPlayer; public AGlassBlack(String name, Material material) { super(name, material); setSoundType(SoundType.GLASS); } @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { if (harvesters.get() != null) { entityPlayer = harvesters.get(); if (entityPlayer.getHeldItemMainhand() != null) { ItemStack MainHandItemStack = entityPlayer.getHeldItemMainhand(); if (MainHandItemStack == new ItemStack(ModItems.TOOL_DIAMOND_GLASS_CUTTER) || MainHandItemStack == new ItemStack(ModItems.TOOL_IRON_GLASS_CUTTER)) { return Item.getItemFromBlock(ModBlocks.A_GLASS_BLACK); } else { return ModItems.GLASS_SHARD_BLACK; } } } } @Override public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) { return true; } @Override protected ItemStack getSilkTouchDrop(IBlockState state) { return new ItemStack(ModBlocks.A_GLASS_BLACK); } }
  21. It worked! Thanks you guys so much!
  22. So i made the 2nd bounding box for east/west but i don't know how to retrieve the 'facing' NBT(?) tag.
  23. Oh so i need to make a second bounding box and based on block rotation use either the 1st one or 2nd one?
  24. Oh yeah you're right the model is rotating but the bounding box is not.
×
×
  • Create New...

Important Information

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