Jump to content

riderj

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by riderj

  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.
  15. Still having issues with rendering the texture... I have no clue where it's messing up. I have looked everywhere multiple times, and have not found anything. I'm thinking that I'm rendering the entity wrong, but there is no documentation on what I need to do when creating a new entity.
  16. The Solution The reason why I was not able to render my own throwable "enderpearl" with a custom texture was because I had not written any OpenGL code to apply the texture to the entity. I was able to work around this by using the RenderSnowball class when registering my renderers. RenderingRegistry.registerEntityRenderingHandler(EntityItemTest.class,new RenderSnowball(Minecraft.getMinecraft().getRenderManager(),item,Harvester.game.getRenderItem())); I needed a RenderItem for the third parameter so I instanced a variable to Minecraft, called it game, and then that allowed me to get the RenderItem I needed. After registering the snowball as the render handler I was able to just allow the RenderSnowball to handle my test_item and its texture. I ended up creating a HarversterEntity class to handle entities and rendering. The old Post
  17. I have searched, but most are outdated. I've run into an issue with initializing the rendering class for my mob, I cannot seem to find any tutorials that touch base on how to render mobs in minecraft 1.8. I have found some that talk about the old 1.8, but that's no use to me.
  18. I have looked through source code of some mods that include mobs, and have successfully created a big white box with its own spawn egg. Though I cannot get the textures to load, probably because of the rendering class for the box is not being called, it still works. I would like however to properly learn how to make a mob for Minecraft 1.8, any leads to tutorials or articles will be greatly appreciated, thank you.
  19. That could work, thanks for your input. Any other ways are appreciated as well. The more the better for learning. Also, how can I learn how to mod when there are few tutorials, and no documentation? All I have to work from is what I have in my libs directory, and some of the methods are still not decoded.
  20. I've been getting used to Minecraft Forge, and have ran into an issue. I want to cause an anvil to "explode" when it reaches the ground, so I thought there would be a forge event that would allow this, but I am wrong. Before I got too complex, and over think it I wanted to see if there was an easier way. So what would be the simplest way to track if an anvil is falling, or has fallen?
  21. None of the solutions worked for me, probably due to my incompetence, so I guess I'll manually do it until I have time to read up on gradle and learn about it.
  22. How big of a problem is the incompatibility with the Modloader? Will it hinder my mod development?
  23. Do I have to change the build.gradle file every time to reflect the version change? If so what's the point of the @Mod annotation? I'm still new at modding minecraft using forge, so please give me some slack. Side Question: Why is the recommended build, 1.6.4-Recommended 9.11.1.965 1.6.4, not ForgeGradle? Though .964 is
×
×
  • Create New...

Important Information

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