-
Posts
180 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MSpace-Dev
-
Hello everyone, So, I am making a basic block with a basic hitbox. I am using getBoundingBox and getCollisionBoundingBox. I've aligned the hitbox perfeclty, and when I look at it, it looks perfect. But if I try walk towards it, it pushes me out of the 1 block area is occupies. A am able to walk up to the collision box, but if I stop moving forward, I get pushed away out of the 1x1 space. I think I'm missing a method to override, but I'm not sure which one. Here is what I've got so far. public class BlockMegaTorch extends BlockBase { protected static final AxisAlignedBB TORCH_AABB = new AxisAlignedBB(0.3125, 0.0D, 0.3125D, 0.6875D, 0.8125D, 0.6875D); public BlockMegaTorch(String name, Material materialIn) { super(name, materialIn); this.setHardness(1); this.setHarvestLevel("axe", 0); this.setSoundType(SoundType.WOOD); this.setLightLevel(1.0f); } @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { return TORCH_AABB; } @Nullable @Override public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return TORCH_AABB; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public boolean causesSuffocation(IBlockState state) { return false; } @SideOnly(Side.CLIENT) public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) { double d0 = (double)pos.getX() + 0.5D; double d1 = (double)pos.getY() + 0.9D; double d2 = (double)pos.getZ() + 0.5D; worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); } }
-
Hey everyone, So, as a test, I'm trying to make a basic block emit light, which I've named BlockTorch. I've registered the item, and all models are working, and all other bloc properties set work. But the this.setLightLevel doesn't seem to be working. When I place the block, no light is emitted. Here is my class code: public class BlockTorch extends BlockBase { public BlockTorch(String name, Material materialIn) { super(name, materialIn); this.setHardness(2); this.setHarvestLevel("axe", 0); this.setSoundType(SoundType.WOOD); this.setLightLevel(15); } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public boolean causesSuffocation(IBlockState state) { return false; } }
-
Awesome thanks for the help with the registering in this version. When I move onto to 1.12 some time, now I know about the JSON capabilities, so that'll help moving forward. Gonna keep cracking on!
-
Also, what version do JSON recipes work in? From what version onwards? Cause, I have my suspicions that it is 1.12 onwards, but I'm only in version 1.11.
-
I have a question about the JSON files. Do you really have to have 1 JSON file per recipe? I have this at the moment, can I add another recipe in this file? { "type": "crafting_unshaped", "pattern": [ "III", "III", "III" ], "key": { "I": "boe:tin_ingot" }, "result": { "item": "boe:tin_block" } }
-
Alright, I'll look for a resource that can get me started. Thanks for the replies!
-
So, as we may know, GameRegistry.register(); is not used anymore. And I have see that we use RegistryEvents to register items and blocks. Yet the only way I can find to register recipes is through GameRegistry.addRecipe. Is this still correct, or is there a new event that is used to register recipes within the game? Also, if there is no other way, when do I call the registerRecipes() function? preInit() | Init() | postInit() ?
-
[SOLVED] [Crash] Updating mod from 1.10 to 1.11.2
MSpace-Dev replied to MSpace-Dev's topic in Modder Support
Ah, that makes a lot of sense. Thanks! -
Hello everyone, So I have been trying to upgrade my mod from 1.10.2 to 1.11.2, but with no avail. I get this crash about Gradle.java | GradleLaunch.java | Launch.java Crash report can be found below. Please note that I have no errors in my mod classes at all. I have updated all events, class and method names to use the new names and syntax. The error seems to be my workspace after updating. I have Gradle 4.1.3 and I have refreshed the workspace multiple times, and run setupDecompWorkspace a couple times too. Everything should be set up. But I am clearly missing something. Crash Report:
-
Never realized I was in Project Files. Anyways, I have found it being decalred in ItemStack, and other classes. Except these aren't overriding anything, they're declaring new methods of it? I can't find what actually "calls" it. Perhaps if you tell me the answer, I'll be able to understand what's happening here better.
-
Look at the picture, that's exactly what I did. I clicked on Find Usages (Pressing Alt+F7) and that picture shows the results. A result of it only being used in my class. And when I say that I've found the super method, that method is the super method from MY derived class. What I'm saying is that I managed to get to the class where getRarity is declared. This takes me to the Item class where it's declared.
-
First off, I manage to find the super method public EnumRarity getRarity(ItemStack stack) { return stack.isItemEnchanted() ? EnumRarity.RARE : EnumRarity.COMMON; } Where do I go from there? (I'm ctrl+clicking things, btw) and I use IntelliJ IDE When I ctrl+click getRarity, it just takes me back to where I've overridden it, and not to where it gets called elsewhere, cause there is no 'elsewhere' Look at this picture:
-
I have tried to look, but I just get into a loop of going back and forth. I cannot find any other classes that use the method getRarity so, I cannot figure out what calls these methods, hence why I came here to ask the question. "Use your IDE." isn't super helpful. But I understand that you're trying to get people to figure things out for themselves, just... in this case, I never found what I was looking for. I also did find something called IForgeRegistryEntry so yeah...
-
Hey everyone, So.. I have always wondered why, when you want to set something like, say, an item's rarity. You'd use the method getRarity() to SET the rarity of that item. Why are these methods named like this? Is it because when the code compiles, the code that puts it all together looks through everything and GETS the values from these methods, and that's why you override these GET methods? Just been a little curious about this. I did also notice a little inconsistency though. Like when you want to set a block's light level, the method you override is called setLightLevel()... are there any rules to know when to use the GET method to set something and the SET method to set something?
-
Alright thanks for the tips and help. I've got my register down to this now public class ModItems { public static final Item[] ITEMS = { new ItemTinIngot("tin_ingot"), new ItemTinSword("tin_sword", Reference.TIN) }; }
-
So, I've added this in my Reference.java public static Item.ToolMaterial TIN = EnumHelper.addToolMaterial("TIN", 3, 1561, 8, 3, 22); Now, how can I set my material to this in the Item class? I can't find any set methods derived from the Item class to do this I see you just have: diaStudPick = new ItemDiamondStudPickaxe(toolMaterialDiamondStud); And I'd love to know what's in your constructor, and how you set the material in that class
-
Hello everyone, I am trying to add a universal tool material that I can use on all tools, instead of having to set the properties for each tool, like how you can select ToolMaterial.DIAMOND, I want to have an option like ModToolMaterial.TIN for example. So, I've added this in my Reference.java public static Item.ToolMaterial TIN = EnumHelper.addToolMaterial("TIN", 3, 1561, 8, 3, 22); Now, how can I set my material to this in the Item class? Thanks in advance!
-
Register 'ItemBlock' alongside 'Block' better than this?
MSpace-Dev replied to MSpace-Dev's topic in Modder Support
I have done that, yeah. But same as you, the items register before the tab. I guess I'll leave it then. I have NEI to get my items. Thanks for all the help! EDIT: Wait, your method worked perfectly! Haha, my items have shown up in the tab and my modded item is the icon too. Awesome -
Register 'ItemBlock' alongside 'Block' better than this?
MSpace-Dev replied to MSpace-Dev's topic in Modder Support
I have one more question that relates to all this. How would I get my creative tab to register before the items and blocks? Because, they are not getting put into the creative tab at the moment because I register the creative tab in preInit in my main mod folder, whereas all the items and blocks are being registered using the Register events which run before everything