Jump to content


  • Posts

  • Joined

  • Last visited


  • Gender
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

riderj's Achievements

Tree Puncher

Tree Puncher (2/8)



  1. ModelLoader.setCustomModelResourceLocation, is this equivalent to what I was doing? Also, is there somewhere I can look to figure out what I should and should not do? Such as using getRegistryName() versus using substring with getUnlocalizedName().
  2. ModelResourceLocation(String modidPath, String p_i4081_2) My current code (reference): I've done an extensive google search trying to figure out what the second string parameter is for ModelResourceLocation, but none of the results were of any help. What is the second string parameter, and is the name required to be anything specific? Can I name it anything relative to my mod? I currently have it set to inventory.
  3. Shouldn't it ignore the efficiency value passed through getStrVsBlock then? Also is canHarvestBlock used solely by the modder inside their class? I changed the return to include cobblestone, but I see no difference in the speed it mines it. Does getStrVsBlock trump the canHarvestBlock?
  4. CustomItemTool.java ItemCustomPickaxe.java ItemForgedPickaxe.java I have been messing around with creating custom tools, and am stuck with the pickaxe. I created a custom class that handles the tools directly from the Item class. I did this so I can have my own custom enums for the materials. The problem I am facing is that the canHarvestBlock doesn't prevent the destruction of blocks, even if the function returns false in all of my classes. From what I have read on how tools destroy blocks are handled in minecraft (greyminecraftcoder blog post) the canHarvestBlock should prevent the block from being destroyed. This is not the case here, but I had figured out that if I modify the getStrVsBlock method to only change the efficiency I can prevent it from mining blocks, but I would like to get the canHarvestBlock method working. Any input on what could be wrong? There aren't errors. ItemCustomPickaxe extends CustomItemTool, and ItemForgedPickaxes extends ItemCustomPickaxe.
  5. I had searched, I just like solid writing and explanation. You don't just buy a laptop before looking at all the others to see what is best, right? I don't want to waste my time reading something that is poorly put together. The end of your last post is primarily what I am looking for, because I can google I'm not that incompetent.
  6. Yeah, I've used it a lot in my own games and am a big fan of the hot replace feature. I was scared that you would say I'd have to skim through the ugly OpenGL code. I've never taken any time to learn it so it's intimidating. I guess I'll mess around with the basics until I get a grasp on more than just the minecraft/forge programming. Been around the block a few times but have never gotten anywhere because I gave up. The task of sifting through thousands of lines of code to make anything cool gets frustrating, and it doesn't help that I didn't write it. The second portion of the main post is still in play, and if anyone has some great free/cheap resources such as books/articles that they have book marked I would gladly read them. They can relate to anything you think is important for a beginner to know and succeed with.
  7. I'm currently looking over the source code, but as everyone has noticed, not all fields are translated so that the developers can understand them. Is there a resource online, or a file someone might have that outlines some major fields that are obfuscated? Such as rendering? I noticed the wiki and the tutorials on the forum are slightly outdated/limited on what they teach. I'm curious if you guys have any other resources I should look into that might help (OpenGL books, and articles along the line of back end work)? I assume all the good mods like Advent of Ascension, Orespawn, and those of that kind, use different methods of rendering their unique mobs and items. Any resources would be fantastic.
  8. I'm trying to create a model file for a custom block, it has 2 parts. I tried creating one on my own but can't seem to get the grasp of how to render the model like it looks in world. I don't have a model file for the in world object because I had used opengl to render the texture. How would I create a model file to display that specific object in the hotbar? The breaking particles are also not rendering, I have looked at a few solutions but they seem to not work because setBlockTextureName is non existent. The following image includes the particle issue, and a preview of the model, the classes are below. TileEntityZygoBush.java package riderj.harvester.tileentity; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import riderj.harvester.entity.block.TileEntityZygoBushEntity; public class TileEntityZygoBush extends BlockContainer { public TileEntityZygoBush(Material materialIn) { super(materialIn); this.setBlockBounds(0.12F, 0.0F, 0.12F, .88F, 1F, .88F); } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityZygoBushEntity(); } //You don't want the normal render type, or it wont render properly. @Override public int getRenderType() { return -1; } //It's not an opaque cube, so you need this. @Override public boolean isOpaqueCube() { return false; } //It's not a normal block, so you need this too. public boolean renderAsNormalBlock() { return false; } } TileEntityZygoBushRender.java package riderj.harvester.client.renderer.tileentity; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; import riderj.harvester.client.renderer.models.blocks.ZygoBushModel; public class TileEntityZygoBushRender extends TileEntitySpecialRenderer { public ZygoBushModel model; public TileEntityZygoBushRender(){ this.model = new ZygoBushModel(); } @Override public void renderTileEntityAt(TileEntity te, double x,double y, double z, float scale, int idk) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); ResourceLocation texture = new ResourceLocation("harvester:textures/blocks/zygo_bush.png"); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } ZygoBushModel.java package riderj.harvester.client.renderer.models.blocks; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ZygoBushModel extends ModelBase{ //fields ModelRenderer BushTop; ModelRenderer Stem; public ZygoBushModel() { textureWidth = 64; textureHeight = 64; BushTop = new ModelRenderer(this, 0, 0); BushTop.addBox(0F, 0F, 0F, 12, 10, 12); BushTop.setRotationPoint(-6F, 8F, -6F); BushTop.setTextureSize(64, 64); BushTop.mirror = true; setRotation(BushTop, 0F, 0F, 0F); Stem = new ModelRenderer(this, 20, 28); Stem.addBox(0F, 0F, 0F, 2, 6, 2); Stem.setRotationPoint(-1F, 18F, -1F); Stem.setTextureSize(64, 64); Stem.mirror = true; setRotation(Stem, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5,entity); BushTop.render(f5); Stem.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5,Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5,entity); } }
  9. Will do, Thanks for the info. I should've thought about manually updating the client side item with the server.
  10. I had tried that, but the item wont update on the client until the gui is forced to update the hotbar
  11. public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if((Integer)worldIn.getBlockState(pos).getValue(AGE) == MAX_AGE){ ItemStack harvestItem = new ItemStack(this.getCrop(),worldIn.rand.nextInt(5)); playerIn.inventory.addItemStackToInventory(harvestItem); } worldIn.setBlockState(pos,worldIn.getBlockState(pos).withProperty(AGE,MAX_AGE-1)); return false; } I have tried using worldIn.isRemote for both the client and server, but still I get a random number for both the client and server. I then tried to setup a function to handle it outside of the event, and still random numbers for both client and server. So I'm at a standstill at how to get the client and server to sync up and give the right amount. Any help would be appreciated, thank you.
  12. Thanks for the resources, it's just that it is hard to figure out what I need to pay close attention to versus what's useless. I'm just feeling that I'm making no progress towards my end goal.
  13. I'm not running away from hard work, but is there a simpler way to learn to mod using Minecraft Forge? I spent two days trying to render a custom textured entity being thrown from the object the player is holding and teleport just like an EnderPearl. I then tried to recreate what the EnderEye does, but just having an entity flop on the ground and not search for a stronghold, but failed because I had another rendering issue. I would just like to know if there is some sort of tutorial sequence that will give me some sort of a basic guideline to follow when I want to create items, blocks, entities, farmland,mobs, crops, seeds, trees, ores, worlds, and custom content. I know that each one of those have your basic Client <--> Server communications, rendering methods, and registry methods, but how can I as a new person succeed with modding if I have to hack my way through it? I love searching code, it's just I hate when I have an issue and can't figure it out, and come to the forum for help and I get ignored.
  14. Thanks, I gave up on that for now. I am trying to learn from the bottom to the top because there are no tutorials showing the "standard" way to create a minecraft forge mod. So far I've learned about the proxies, and a bit about rendering textures to a throwable entity and how I would have to write my own renderer class for a custom throwable object if I don't want to use snowball as my base render handler. So I'm getting somewhere, but it's a long journey that's barely began haha.
  • Create New...

Important Information

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