Jump to content

Reygok

Members
  • Posts

    56
  • Joined

  • Last visited

Everything posted by Reygok

  1. Hi all, I updated my first mod to work with Minecraft 1.9 Diamonds are pretty cool yeah, but they are too easy to acquire for experienced players after a few minutes of gameplay. So I created my very first mod! After you've mined a bit, got your first diamond tools, and build you portal to the nether, you can start a new quest: finding Vibranium! It's a pretty rare ore you can only find near bedrock level, and it's exclusive to the nether. But only finding some ore is not everything, because Vibranium alone cannot be crafted into Tools or Armor. You need to combine a few tiny lumps of it, and then craft this together with Coal, Iron, Gold, Diamond and Blaze Powder! (Idea by athoren1) Tools have 10 times the durability of Diamond, and are twice as fast. They are also more susceptible to enchanting, even more than Gold. The Armor has the same resistance than Diamond (because I don't know how to make it stronger ) but it has a very high durability of 128. Additionally, the Chestplate gives you the potion-effect Strength I, and the whole Armor set together gives you Fire Resistance, both permanently. As these material traits are quite impressive, Vibranium Ore is pretty rare, and it has to be processed into an alloy to even get the material Adamantium to craft anything useful out of it. I hope some people like it, I know it's a pretty basic mod, but I had fun making it, and it is the first step on the road to another awesome mod idea. Features: Vibranium Ore (occurs only in the nether) Vibranium Lump Tiny Lump of Vibranium Adamantium Ingot Adamantium Tools Adamantium Armor Curse Link: http://minecraft.curseforge.com/projects/adamantium-mod-better-than-diamonds
  2. Yeah, so my question was basically: where do I specify that In 1.8 it was with the getTexture method. I do it like this, I read it was better to use the single-argument version of registering; but who knows. And yeah the EnumType was also correct. setRegistryName(name); GameRegistry.register(item); This was in fact the real solution, and exactly what I imagined: a change in a place where I would never look. So I changed this: public static ArmorMaterial ARMOR_ADAMANTIUM = EnumHelper.addArmorMaterial("adamantium", "adamantiumArmor", 128, durability, 30, SoundEvents.item_armor_equip_iron); to this: public static ArmorMaterial ARMOR_ADAMANTIUM = EnumHelper.addArmorMaterial("adamantium", "adamantium:adamantiumArmor", 128, durability, 30, SoundEvents.item_armor_equip_iron); And boom works perfectly. Thanks a lot, Choonster
  3. Hi I'm now almost done updating my mod to 1.9. There is one single thing which doesn't work: the textures for my custom armor are not loading. There must be a change from 1.8 to 1.9, because it worked fine in 1.8, but with a method in ItemArmor called getTextures. I commented it, because it doesn't exist anymore, but I have this error in the console: [17:59:12] [Client thread/WARN]: Failed to load texture: minecraft:textures/models/armor/adamantiumArmor_layer_1.png java.io.FileNotFoundException: minecraft:textures/models/armor/adamantiumArmor_layer_1.png Why does the game look for the textures in the vanilla folder? Here is my code: https://github.com/Reygok/AdamantiumMod.git
  4. I am so sorry for wasting your time... It did not work because I did not start the right .jar file. Since there are 2, and I'm usually playing with friends on a hosted server, where there is only one .jar file, I wasn't sure which one, and I never tried the other one. Now I did, and averything works fine. Thanks anyway for the code improvements, I'm in the process of doing that. And sorry again...
  5. Hello all I decided it was time to update my mod from 1.8 to 1.9, and since it's pretty small that was not so hard. I just have an issue with the armor textures not loading, but that's for another time. My main problem is that the mod does not work on servers. In-game, it seems like the server doesn't load it, because all my items/blocks can be obtained through the creative tabs, but they are not usable. Meaning blocks that are placed disappear immediately, and blocks destroyed with, for example, my custom pickaxe just disappear visually, but I cannot walk through them after that, and a relog shows they are still there, while also all the mod-related items disappear from the hotbar. As I said, it worked perfectly on 1.8 servers, so there must be a change that I don't know about. The server console throws no error or even warnings. The weirdest thing is that if I start the server inside Eclipse, and then connect to it from outside eclipse, everything works. I presume it's hard to help with this little concrete information, so I liked my github; maybe someone has the kindness and time to take a look at my code. I will gladly provide any more details if needed. Thanks in advance https://github.com/Reygok/AdamantiumMod.git
  6. Okay, that helps, will look into it more. Thanks
  7. Hi, I made a block with lots of different possible shapes, which is made up of up to 8 smaller blocks, each an exact 8th of a full block. So you can build slabs, stairs or something else. I'm using DrawBlockHighlightEvent to draw the wireframe as it should be, but I also need to use collisionRayTrace so the block doesn't get selected when you look at it's 1x1x1 bounding box, but the spot where you look is empty. Like for stairs, you can "look through" the part that has no texture. I looked at it's collisionRayTrace method, and also at the super method, but I can't figure out what's going on there. If somebody has a good understanding of this method and is willing to explain it to me, that would be nice Thanks in advance, Reygok
  8. Well, I have that idea from diesieben07, who seems quite good at modding. I absolutely need to have the exact spot where the player clocks on a block, I don't see how else I could do that.
  9. The problem there seems to be that when this method is called, the tileEntity at that blockPos is already gone, since it gives ame a Nullpointerexception here: TileEntityTinyBlock tileEntity = (TileEntityTinyBlock) worldIn.getTileEntity(pos); int count = tileEntity.count(); <---- THERE
  10. Thanks a lot! I should have figured that out by myself...
  11. Because it is way easier to save the information I need in the TileEntity, than to check the 255 possible states I realized that just now, will reformulate the title and first post now.
  12. Hm wait, I have no idea how to access the TileEntity when I only have the state...
  13. Hi, I followed TheGreyGhost's tutorial for the 3D Web Model to handle the 255 possible states for my blocks, and I got it to work fine for one, but I have to repeat this code for a lot of blocks, but I can't get it to work for more than one. This is my error: The error says the two "***Model" classes try to load the same model, but how can they, since this is the code of the two: As you can see at the end, I specify the right model in both cases. Why do I still get this error? Here is the preInit from the main class: Thanks in advance!
  14. Oh god, I'm so blind, I didn't find the third one... Thanks
  15. Hi, I made a block which uses a TileEntity, and depending on it's state (which can be found out by looking at the tileEntity) it should drop a different amount of blocks when destroyed. However, since the "quantityDropped" method doesn't have anything to access the world, to scan the tileEntity, I have no idea how to change this amount. Since I cannot store anything in the block via variables, I have to access the tileEntity. Any suggestions? Thanks in advance, Reygok
  16. Here are the two concerning classes, my block: http://pastebin.com/q6g3wy6M and my item: http://pastebin.com/XA6BDsRU
  17. Okay, I did it now like you proposed. Even though it is a tiny bit more work everytime I start a new mod, but that doesn't happen very often anyway The other method really didn't make sense, but these are things which are never explained in tutorials, so how could I have known that? Anyway, thanks for the clarifications
  18. Well, I put "System.out.println("start onItemUse");" at the very beginning of the method, and this line is not printed. When I set my block to replaceable, it is. So perhaps the problem lies somewhere else? Should I provide my entire code?
  19. Hi, I created a partial block, and during the process of modifying "onItemUse()" I noticed it is only executed when the block "isReplaceable". At least in this case: My block is obviously the small dirt block. Now, when I right-click where I'm looking at on that picture, while my block isReplaceable, the method onItemUse is called, and I can modify the TileEntity on that position. Which is what I want to do. But, I don't want my block to be replaceable by other blocks! But when I set isReplaceable to false, the method isn't called anymore, and I don't understand that, since the method itself checks if the block can be placed, why is there another check, even before, and where is it, so I can change it? Thanks in advance Reygok
  20. Hm yeah, now the wireframe shows correctly; however, it is completely useless now. I thought the wireframe determined where exactly you could click, but that's the bounding box. Now this bounding box is always a full cube, so I can't place several blocks "inside it" anymore. Or, well I can, if I modify the "pos = pos.offset(side);" condition, but I'll often get the wrong hitY value. So there is no way of actually setting to real blockBounds to a complex shape?
  21. Oh yeah, just found it out, I thought I had to run drawSelectionBox myself. Well, now it slowly starts to work as intended. Small problem: The correct boxes are only drawn as long as I look at the last part of the texture that's loaded, when I look at another "part" of my block, I look through. I know why, but I don't know how to fix it. The problem is that I'm using setBlockBounds often, for setting the collision box for every tiny block, and also for setting the wireframe now. I tried without using setBlockBounds, but then I don't get any collisions anymore... I have this inside the Block class: @Override public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) { return new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 1.0, 1.0); } @Override public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) { TileEntityTinyDirt tileEntity = (TileEntityTinyDirt) worldIn.getTileEntity(pos); boolean bot_nw = tileEntity.isBot_nw(); boolean bot_ne = tileEntity.isBot_ne(); boolean bot_se = tileEntity.isBot_se(); boolean bot_sw = tileEntity.isBot_sw(); boolean top_nw = tileEntity.isTop_nw(); boolean top_ne = tileEntity.isTop_ne(); boolean top_se = tileEntity.isTop_se(); boolean top_sw = tileEntity.isTop_sw(); if(bot_nw) { AxisAlignedBB box = new AxisAlignedBB(0.0, 0.0, 0.0, 0.5, 0.5, 0.5); addCollisionBox(box, list, mask); } if(bot_ne) { AxisAlignedBB box = new AxisAlignedBB(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F); addCollisionBox(box, list, mask); } if(bot_se) { AxisAlignedBB box = new AxisAlignedBB(0.5F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F); addCollisionBox(box, list, mask); } if(bot_sw) { AxisAlignedBB box = new AxisAlignedBB(0.0F, 0.0F, 0.5F, 0.5F, 0.5F, 1.0F); addCollisionBox(box, list, mask); } if(top_nw) { AxisAlignedBB box = new AxisAlignedBB(0.0F, 0.5F, 0.0F, 0.5F, 1.0F, 0.5F); addCollisionBox(box, list, mask); } if(top_ne) { AxisAlignedBB box = new AxisAlignedBB(0.5F, 0.5F, 0.0F, 1.0F, 1.0F, 0.5F); addCollisionBox(box, list, mask); } if(top_se) { AxisAlignedBB box = new AxisAlignedBB(0.5F, 0.5F, 0.5F, 1.0F, 1.0F, 1.0F); addCollisionBox(box, list, mask); } if(top_sw) { AxisAlignedBB box = new AxisAlignedBB(0.0F, 0.5F, 0.5F, 0.5F, 1.0F, 1.0F); addCollisionBox(box, list, mask); } } public void addCollisionBox(AxisAlignedBB box, List list, AxisAlignedBB mask) { if (box != null && mask.intersectsWith(box)) { list.add(box); } } And this as the Event: @SubscribeEvent public void drawSelectionBox(DrawBlockHighlightEvent e) { ///* if(e.target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { BlockPos blockpos = e.target.getBlockPos(); World world = e.player.worldObj; TileEntity tileEntity = world.getTileEntity(blockpos); if(tileEntity instanceof TileEntityTinyDirt) { TileEntityTinyDirt tileEntityTinyDirt = (TileEntityTinyDirt) tileEntity; TinyDirt block = (TinyDirt) world.getBlockState(blockpos).getBlock(); if(tileEntityTinyDirt.isBot_nw()) { block.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 0.5F); e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks); } if(tileEntityTinyDirt.isBot_ne()) { block.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F); e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks); } if(tileEntityTinyDirt.isBot_se()) { block.setBlockBounds(0.5F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F); e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks); } if(tileEntityTinyDirt.isBot_sw()) { block.setBlockBounds(0.0F, 0.0F, 0.5F, 0.5F, 0.5F, 1.0F); e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks); } if(tileEntityTinyDirt.isTop_nw()) { block.setBlockBounds(0.0F, 0.5F, 0.0F, 0.5F, 1.0F, 0.5F); e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks); } if(tileEntityTinyDirt.isTop_ne()) { block.setBlockBounds(0.5F, 0.5F, 0.0F, 1.0F, 1.0F, 0.5F); e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks); } if(tileEntityTinyDirt.isTop_se()) { block.setBlockBounds(0.5F, 0.5F, 0.5F, 1.0F, 1.0F, 1.0F); e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks); } if(tileEntityTinyDirt.isTop_sw()) { block.setBlockBounds(0.0F, 0.5F, 0.5F, 0.5F, 1.0F, 1.0F); e.context.drawSelectionBox(e.player, e.target, 0, e.partialTicks); } e.setCanceled(true); } //*/ } }
  22. I completely forgot about that sorry Now the default box is gone, but I still have no idea how to "addVertex"es correctly. I played around with the values, but no box appears.
  23. @SubscribeEvent public void drawSelectionBox(DrawBlockHighlightEvent e) { World world = e.player.worldObj; EntityPlayer player = e.player; float partialTicks = e.partialTicks; if(world.getTileEntity(e.target.getBlockPos()) instanceof TileEntityTinyDirt) { GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); GlStateManager.color(0.0F, 0.0F, 0.0F, 0.4F); GL11.glLineWidth(2.0F); GlStateManager.disableTexture2D(); GlStateManager.depthMask(false); BlockPos blockpos = e.target.getBlockPos(); Block block = world.getBlockState(blockpos).getBlock(); if (block.getMaterial() != Material.air && world.getWorldBorder().contains(blockpos)) { double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)partialTicks; double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)partialTicks; double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)partialTicks; AxisAlignedBB box = new AxisAlignedBB(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) //.expand(0.0020000000949949026D, 0.0020000000949949026D, 0.0020000000949949026D) //.offset(-d0, -d1, -d2); Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); worldrenderer.startDrawing(3); //worldrenderer.addVertex(box.minX, box.minY, box.minZ); //worldrenderer.addVertex(box.minX+0.5, box.minY, box.minZ); //worldrenderer.addVertex(box.minX, box.minY, box.minZ); //worldrenderer.addVertex(box.minX, box.minY, box.minZ); tessellator.draw(); } GlStateManager.depthMask(true); GlStateManager.enableTexture2D(); GlStateManager.disableBlend(); } } I can't seem to change the bounding box of my block. I'm not sure what the 3 parameters for addVertex do, the info I find online is inconsistent. And shouldn't the box be "not there" with this code? Since the AxisAlignedBB I start with is empty.
  24. Yeah well, I know that's not futuristic at all haha ^^ But then I don't see the problem. And, to clarify, I don't have Forge standalone in a project. I just have the default project you get when you setup the forge workspace, and then I created a new project, and I include the default one in it.
×
×
  • Create New...

Important Information

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