Everything posted by Leviathan143
-
My knawlidge isn't working [what is NBT baby don't hurt me no more].
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.
-
My knawlidge isn't working [what is NBT baby don't hurt me no more].
The error would be helpful, they're thrown for a reason.
-
Mod Ideas
Learn to code then. All the skilled coders will be busy with their own mods.
-
[1.8.9] PlayerInteractEvent - Client/Server - Right-clicking a ladder
That isn't OP's problem at at all, and it's not a bug either.
-
[1.7.10] "Failed to load texture" Armor Model/Render
You need a colon between the modid and the resource path.
-
[1.9] [SOLVED] Registering Items
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.
-
Custom Leggings has +8 armor?
I don't think that's what's causing this though? It isn't the problem, but it is a problem.
-
Custom Leggings has +8 armor?
I don't think that's what's causing this though? It isn't the problem, but it is a problem.
-
Custom Leggings has +8 armor?
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.
-
Custom Leggings has +8 armor?
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.
-
BlockState behaving oddly[Solved]
Yep, that was it. Thanks.
-
BlockState behaving oddly[Solved]
Yep, that was it. Thanks.
-
BlockState behaving oddly[Solved]
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); } }
-
BlockState behaving oddly[Solved]
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); } }
-
Closed.
Do you know how to use event handlers? Using GuiOpenEvent, you can open your gui instead of GuiScreenResourcePacks.
-
Closed.
Do you know how to use event handlers? Using GuiOpenEvent, you can open your gui instead of GuiScreenResourcePacks.
-
Block mapping texture
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.
-
Block mapping texture
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.
-
[SOLVED][1.7.10] Adding items to generated chests
Look at WeightedRandomChestContent, you can extend it and override WeightedRandomChestContent#generateChestContent() to have more control over loot.
-
[SOLVED][1.7.10] Adding items to generated chests
Look at WeightedRandomChestContent, you can extend it and override WeightedRandomChestContent#generateChestContent() to have more control over loot.
-
[1.9] Can a JSON model have multiple parents?
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
-
[1.9] Can a JSON model have multiple parents?
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
-
[1.9] Entity lags server side, could be two large?
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.
-
[1.8.9] [UNSOLVED] Constantly get player's hand position
Does the chicken need to be an Entity while it is held?
-
How to declare class as a member in a new class?
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.
IPS spam blocked by CleanTalk.