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.

Leviathan143

Forge Modder
  • Joined

  • Last visited

Everything posted by Leviathan143

  1. Item#onCreated() is only called when the item is crafted or smelted, so the stackTagCompund is be null if you obtain the item any other way.
  2. The error would be helpful, they're thrown for a reason.
  3. Learn to code then. All the skilled coders will be busy with their own mods.
  4. That isn't OP's problem at at all, and it's not a bug either.
  5. You need a colon between the modid and the resource path.
  6. proxy.registerRenderInfo(); InitItems.init(); You register the render before you've registered the item, so test_item is null. Use ModelLoader.setCustomModelResourceLocation() instead of that thing in registerRender() and get rid of cproxy too, Forge will route calls to the appropriate proxy.
  7. I don't think that's what's causing this though? It isn't the problem, but it is a problem.
  8. I don't think that's what's causing this though? It isn't the problem, but it is a problem.
  9. EnumHelper#addArmorMaterial() returns the created ArmorMaterial, store it instead of creating it every time. Reflection is expensive, and due to the way Enums work you'll probably break something.
  10. EnumHelper#addArmorMaterial() returns the created ArmorMaterial, store it instead of creating it every time. Reflection is expensive, and due to the way Enums work you'll probably break something.
  11. Yep, that was it. Thanks.
  12. Yep, that was it. Thanks.
  13. I have a block with a PropertyInteger called radius, when the block is right-clicked radius should be incremented by one, unless it is 8; if it is 8, it should be set to 1. This works perfectly except when radius is set to 2, instead of being set to 2, it is set to 8. package com.leviathan143.ellipsis.common.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.client.audio.ISound; import net.minecraft.client.audio.SoundCategory; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import com.leviathan143.ellipsis.common.data.RegionalMufflerMap; public class BlockRegionalMuffler extends Block { private static final PropertyInteger REGION_RADIUS = PropertyInteger.create("radius", 1, ; public BlockRegionalMuffler() { super(Material.iron); setDefaultState(this.blockState.getBaseState().withProperty(REGION_RADIUS, 1)); } @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { RegionalMufflerMap.get(worldIn).addMuffler(worldIn, pos); } @Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { RegionalMufflerMap.get(worldIn).removeMuffler(worldIn, pos); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if(playerIn.getHeldItem() != null) return false; int radius = state.getValue(REGION_RADIUS); radius = radius < 8 ? radius + 1 : 1; worldIn.setBlockState(pos, this.getDefaultState().withProperty(REGION_RADIUS, radius)); return true; } @Override protected BlockState createBlockState() { return new BlockState(this, new IProperty[]{REGION_RADIUS}); } @Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(REGION_RADIUS, meta + 1); } @Override public int getMetaFromState(IBlockState state) { int radius = state.getValue(REGION_RADIUS); return radius <= 7 ? radius - 1 : 1; } public boolean shouldMuffleSound(World world, BlockPos mufflerPos, ISound sound, SoundCategory category) { if(category.equals(SoundCategory.RECORDS)) return false; return Math.sqrt(mufflerPos.distanceSqToCenter(sound.getXPosF(), sound.getYPosF(), sound.getZPosF())) <= world.getBlockState(mufflerPos).getValue(REGION_RADIUS); } }
  14. I have a block with a PropertyInteger called radius, when the block is right-clicked radius should be incremented by one, unless it is 8; if it is 8, it should be set to 1. This works perfectly except when radius is set to 2, instead of being set to 2, it is set to 8. package com.leviathan143.ellipsis.common.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.client.audio.ISound; import net.minecraft.client.audio.SoundCategory; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import com.leviathan143.ellipsis.common.data.RegionalMufflerMap; public class BlockRegionalMuffler extends Block { private static final PropertyInteger REGION_RADIUS = PropertyInteger.create("radius", 1, ; public BlockRegionalMuffler() { super(Material.iron); setDefaultState(this.blockState.getBaseState().withProperty(REGION_RADIUS, 1)); } @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { RegionalMufflerMap.get(worldIn).addMuffler(worldIn, pos); } @Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { RegionalMufflerMap.get(worldIn).removeMuffler(worldIn, pos); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if(playerIn.getHeldItem() != null) return false; int radius = state.getValue(REGION_RADIUS); radius = radius < 8 ? radius + 1 : 1; worldIn.setBlockState(pos, this.getDefaultState().withProperty(REGION_RADIUS, radius)); return true; } @Override protected BlockState createBlockState() { return new BlockState(this, new IProperty[]{REGION_RADIUS}); } @Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(REGION_RADIUS, meta + 1); } @Override public int getMetaFromState(IBlockState state) { int radius = state.getValue(REGION_RADIUS); return radius <= 7 ? radius - 1 : 1; } public boolean shouldMuffleSound(World world, BlockPos mufflerPos, ISound sound, SoundCategory category) { if(category.equals(SoundCategory.RECORDS)) return false; return Math.sqrt(mufflerPos.distanceSqToCenter(sound.getXPosF(), sound.getYPosF(), sound.getZPosF())) <= world.getBlockState(mufflerPos).getValue(REGION_RADIUS); } }
  15. Leviathan143 replied to Blaze's topic in Modder Support
    Do you know how to use event handlers? Using GuiOpenEvent, you can open your gui instead of GuiScreenResourcePacks.
  16. Leviathan143 replied to Blaze's topic in Modder Support
    Do you know how to use event handlers? Using GuiOpenEvent, you can open your gui instead of GuiScreenResourcePacks.
  17. Maybe it is slightly easier now, but if you ever want to update past 1.7.10 it won't be. Just make separate textures, it's not hard.
  18. Maybe it is slightly easier now, but if you ever want to update past 1.7.10 it won't be. Just make separate textures, it's not hard.
  19. Look at WeightedRandomChestContent, you can extend it and override WeightedRandomChestContent#generateChestContent() to have more control over loot.
  20. Look at WeightedRandomChestContent, you can extend it and override WeightedRandomChestContent#generateChestContent() to have more control over loot.
  21. Since the Item is an ItemBlock, it doesn't need an item model, it will use the block model if there is no item model. For example
  22. Since the Item is an ItemBlock, it doesn't need an item model, it will use the block model if there is no item model. For example
  23. You should sample your mod to determine what's using so much CPU time/memory. 1. The JDK comes with the java profiler VisualVM; it's located in <jdkname>/bin, look for jvisualvm.exe or type "jvisualvm.exe" into a run window and press enter. 2. Launch your mod, then go into VisualVM and find the VM called GradleStart under local, right-click it and select Open. 3. Go into the Sampler tab, check the box labeled Settings and set the packages you wish to profile/not profile. 4. Press the CPU or Memory button to start sampling.
  24. Does the chicken need to be an Entity while it is held?
  25. I'm sorry, I fail to see what's wrong with those two statements. It's been quite a while since I've made a mod in MC, so maybe the syntax has changed or something. Could you perhaps be a little more specific? Thank you! You say you need an instance of ModelBiped, one is provided in the constructor. What you need for I am not sure of, as RenderManager has no constructor that takes a ModelBiped. Even if it did, constructing one would be useless. The information contained in it would not reflect Minecraft, because it would not be the RenderManager Minecraft is using.

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.