Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

shucke

Members
  • Joined

  • Last visited

Everything posted by shucke

  1. Hey guys, i got a problem with the custom armor renderer. the helmet and legs works fine but the rotations of the body are a little off when aiming a bow, blocking with a sword and hitting. this is my model code: public class ModelDragonPlate extends ModelBiped{ public static final ResourceLocation texture = new ResourceLocation(Reference.MOD_ID, "textures/armor/dragon_plate.png"); ModelRenderer shoulderL; ModelRenderer hornL1; ModelRenderer hornL2; ModelRenderer shoulderR; ModelRenderer hornR1; ModelRenderer hornR2; ModelRenderer braceL; ModelRenderer braceR; public ModelDragonPlate(){ textureWidth = 64; textureHeight = 32; shoulderL = new ModelRenderer(this, 0, 0); shoulderL.addBox(-1.5F, -2.5F, -2.5F, 5, 5, 5); shoulderL.setRotationPoint(5F, 2F, 0F); shoulderL.setTextureSize(64, 32); setRotation(shoulderL, 0F, 0F, 0F); shoulderL.mirror = false; hornL1 = new ModelRenderer(this, 0, 0); hornL1.addBox(3F, -4F, 0.5F, 1, 3, 1); hornL1.setRotationPoint(5F, 2F, 0F); hornL1.setTextureSize(64, 32); hornL1.mirror = true; setRotation(hornL1, 0F, 0F, 0F); hornL2 = new ModelRenderer(this, 0, 0); hornL2.addBox(3F, -4F, -1.5F, 1, 3, 1); hornL2.setRotationPoint(5F, 2F, 0F); hornL2.setTextureSize(64, 32); hornL2.mirror = true; setRotation(hornL2, 0F, 0F, 0F); shoulderR = new ModelRenderer(this, 0, 0); shoulderR.addBox(-3.5F, -2.5F, -2.5F, 5, 5, 5); shoulderR.setRotationPoint(-5F, 2F, 0F); shoulderR.setTextureSize(64, 32); shoulderR.mirror = true; setRotation(shoulderR, 0F, 0F, 0F); hornR1 = new ModelRenderer(this, 0, 0); hornR1.addBox(-4F, -4F, 0.5F, 1, 3, 1); hornR1.setRotationPoint(-5F, 2F, 0F); hornR1.setTextureSize(64, 32); setRotation(hornR1, 0F, 0F, 0F); hornR1.mirror = false; hornR2 = new ModelRenderer(this, 0, 0); hornR2.addBox(-4F, -4F, -1.5F, 1, 3, 1); hornR2.setRotationPoint(-5F, 2F, 0F); hornR2.setTextureSize(64, 32); setRotation(hornR2, 0F, 0F, 0F); hornR2.mirror = false; braceL = new ModelRenderer(this, 0, 10); braceL.addBox(-1.5F, 5F, -2.5F, 5, 1, 5); braceL.setRotationPoint(5F, 2F, 0F); braceL.setTextureSize(64, 32); braceL.mirror = true; setRotation(braceL, 0F, 0F, 0F); braceR = new ModelRenderer(this, 0, 10); braceR.addBox(-3.5F, 5F, -2.5F, 5, 1, 5); braceR.setRotationPoint(-5F, 2F, 0F); braceR.setTextureSize(64, 32); setRotation(braceR, 0F, 0F, 0F); braceR.mirror = false; } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ setRotationAngles(f, f1, f2, f3, f4, f5, entity); GL11.glPushMatrix(); TextureHandler.instance.bindTexture(texture); shoulderL.render(f5); hornL1.render(f5); hornL2.render(f5); shoulderR.render(f5); hornR1.render(f5); hornR2.render(f5); braceL.render(f5); braceR.render(f5); GL11.glPopMatrix(); } 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){ EntityLivingBase living = (EntityLivingBase) entity; ItemStack itemstack = living.getHeldItem(); this.heldItemRight = living.getHeldItem() == null ? 0 : 1; if(living instanceof EntityPlayer){ EntityPlayer player = (EntityPlayer) living; if (living.getHeldItem() != null && player.getItemInUseCount() > 0) { EnumAction enumaction = itemstack.getItemUseAction(); if (enumaction == EnumAction.block) { heldItemRight = 3; } else if (enumaction == EnumAction.bow) { this.aimedBow = true; } } } super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); shoulderL.rotateAngleX = bipedLeftArm.rotateAngleX; if (this.heldItemLeft != 0){ shoulderL.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft; } shoulderL.rotateAngleY = bipedLeftArm.rotateAngleY; shoulderL.rotateAngleZ = bipedLeftArm.rotateAngleZ; hornL1.rotateAngleX = shoulderL.rotateAngleX; hornL1.rotateAngleY = shoulderL.rotateAngleY; hornL1.rotateAngleZ = shoulderL.rotateAngleZ; hornL2.rotateAngleX = shoulderL.rotateAngleX; hornL2.rotateAngleY = shoulderL.rotateAngleY; hornL2.rotateAngleZ = shoulderL.rotateAngleZ; braceL.rotateAngleX = shoulderL.rotateAngleX; braceL.rotateAngleY = shoulderL.rotateAngleY; braceL.rotateAngleZ = shoulderL.rotateAngleZ; shoulderR.rotateAngleX = bipedRightArm.rotateAngleX; if (this.heldItemRight != 0){ shoulderR.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight; } shoulderR.rotateAngleY = bipedRightArm.rotateAngleY; shoulderR.rotateAngleZ = bipedRightArm.rotateAngleZ; hornR1.rotateAngleX = shoulderR.rotateAngleX; hornR1.rotateAngleY = shoulderR.rotateAngleY; hornR1.rotateAngleZ = shoulderR.rotateAngleZ; hornR2.rotateAngleX = shoulderR.rotateAngleX; hornR2.rotateAngleY = shoulderR.rotateAngleY; hornR2.rotateAngleZ = shoulderR.rotateAngleZ; braceR.rotateAngleX = shoulderR.rotateAngleX; braceR.rotateAngleY = shoulderR.rotateAngleY; braceR.rotateAngleZ = shoulderR.rotateAngleZ; this.aimedBow = false; } anyone knows how to fix this?
  2. add to your Block class: public int damageDropped(int par1) { return par1; } minecraft returns 0 by default so you need to overide it.
  3. I am trying to make the tasks and the targetTasks fields in EntityLiving non final but it didnt seem to work. i have this in my *_at.cfg file: #EntityAITask remove final og.c -f og.d -f in eclipse its console it says this: Loaded 3 rules from AccessTransformer config file *_at.cfg but when i run the game trough eclipse it didnt remove the final modifier. and gives the following error: 2013-10-08 22:10:30 [iNFO] [sTDERR] The final field EntityLiving.tasks cannot be assigned 2013-10-08 22:10:30 [iNFO] [sTDERR] The final field EntityLiving.targetTasks cannot be assigned
  4. Ah thnx found it cant believe i forgot to look in the Tile Entity class...
  5. Is there an easy build in way to sync NBT data? i really have a ton of data and it is quite a pain to write it all to a ByteArrayDataOutput and a NBTTagCompound. Just sending and reading the NBT data seems to be a lot easier. i know it can be done since a tile entity does the same thing with its description packages. so.. can someone tell me how
  6. Is there a hook that will be called when a player disconnects?
  7. how would i do that?
  8. I just updated my modding enviroment to 1.6.4 and replaced the outdated jars. but now i am getting this error: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at org.lwjgl.Sys$1.run(Sys.java:73) at java.security.AccessController.doPrivileged(Native Method) at org.lwjgl.Sys.doLoadLibrary(Sys.java:66) at org.lwjgl.Sys.loadLibrary(Sys.java:95) at org.lwjgl.Sys.<clinit>(Sys.java:112) at net.minecraft.client.Minecraft.getSystemTime(Minecraft.java:2456) at net.minecraft.client.main.Main.main(Main.java:37) ... 6 more i did include the lwjgl.jar into my referenced libraries so i am a little confused now. anyone knows how to fix this?
  9. from what i see is that something is accessing the world and therefore it cannot be saved. 2013-09-18 16:01:03 [WARNING] [Minecraft-Server] The save is being accessed from another location, aborting maybe its a bug in a mod you got in your development enviroment.
  10. do it... it implements the createNewTileEntity method
  11. make your block extend BlockContainer!
  12. post render class also put this in your block class: @SideOnly(Side.CLIENT) public int getRenderType(){ return -1; }
  13. this is the method your looking for: this.worldObj.getEntitiesWithinAABB(par1Class, par2AxisAlignedBB) it gets all the entity's within the AABB.
  14. I thought that since the entity init was also called on the client side i just created a package to request the data from the server and send a new package back to the client. and i didnt know about the IEntityAdditionalSpawnData interface but that is exactly what i needed, thx!
  15. this is very easily done. use the IConnectionHandler interface to check when a player is logged in. then you need to get the NBTTagCompound from the player using the .getEntityData() method. and all you need o now is to read the NBT for a custom tag and if false do whatever u wanna do. set the tag to true and your done. this should work in theory... @Override public void playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager) { EntityPlayer entityPlayer = (EntityPlayer) player; NBTTagCompound nbt = entityPlayer.getEntityData(); boolean loggedInBefore = nbt.getBoolean("loggedInBefore"); if(!loggedInBefore){ //Work you magic nbt.setBoolean("loggedInBefore", true); } } i havent tested it yet though...
  16. I am wondering if there is a way to sync my entities without using the datawatcher. I dont want to use the datawatcher since it is a lot of data and packets are easier in my opinion. So i need to sync my entities with all the players when the entity is instatiated. so i made this simple packet: public class PacketEntityPetData extends PacketBase{ private EntityPet pet; private int entityID; private int petID; public PacketEntityPetData(){} public PacketEntityPetData(EntityPet entityPet){ this.pet = entityPet; } @Override public void write(ByteArrayDataOutput out) { if(FMLCommonHandler.instance().getEffectiveSide().isClient()){ out.writeInt(pet.entityId); }else{ out.writeInt(pet.entityId); out.writeInt(pet.getPet().getPetID()); } } @Override public void read(ByteArrayDataInput in) throws ProtocolException { if(FMLCommonHandler.instance().getEffectiveSide().isClient()){ this.entityID = in.readInt(); this.petID = in.readInt(); }else{ this.entityID = in.readInt(); } } @Override public void execute(EntityPlayer player, Side side) throws ProtocolException { if(side.isClient()){ this.pet = (EntityPet) player.worldObj.getEntityByID(entityID); this.pet.setPetBase(petID); }else{ System.out.println(this.entityID); this.pet = (EntityPet) player.worldObj.getEntityByID(entityID); PacketDispatcher.sendPacketToPlayer(new PacketEntityPetData(this.pet).makePacket(), (Player) player); } } } and the packet is send in the entityInit method: protected void entityInit(){ super.entityInit(); if(this.worldObj.isRemote){ PacketDispatcher.sendPacketToServer(new PacketEntityPetData(this).makePacket()); } //this.dataWatcher.addObject(21, Integer.valueOf(1)); } but i noticed that the entity ids arent the same when i send the packet. it prints 214 on the first tick on client opposing to the server which prints 103. so im getting a NullPointerException. anyone knows how to sync properly between client and server?
  17. this is probarly where you need to put your code in for connected textures public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side){} return the corresponding icon based on the other blocks around it. as for the transparency goes... take a look in the BlockIce class. it shouldnt be hard to find the method you need in there. and update just like you update your other mods from earlier versions. except you now need to put your textures in the assets folder instead of your mods folder. the forge team has made it a hell of a lot easier to install your mod eviroment. just download the forge source, hit install, wait till the installation is finished and your good to go. then you only need to put your source code in the new src folder change update your classes and everything should be ready.
  18. if your going to add icons to the game then you are probably going to have to edit base classes. If you need any more help look at the source for ee3. lol? i know how to add icons to the game i just need to know how to draw an icon to a gui with the method that is given in the GuiScreen class. it has to work somehow i just dont know how. ... Do what I just told you. Make a new picture and put the icon there! Otherwise go look at the source for ee3. uhm... got a few reasons why i shouldnt do it like that. like a said earlier .... it worked i was struggling with this problem for a while now so thx alot!
  19. if your going to add icons to the game then you are probably going to have to edit base classes. If you need any more help look at the source for ee3. lol? i know how to add icons to the game i just need to know how to draw an icon to a gui with the method that is given in the GuiScreen class. it has to work somehow i just dont know how.
  20. Cast it to be an EntityLiving EntityLiving entity = (EntityLiving)entityLivingBase
  21. that doesnt seem very usefull... i am using all the icons in the game for this and other mods may add some items that are compatible so i dont have any choice except to get this method working.
  22. How can i draw an icon on a guiScreen properly? i am familliar with the method and all but there is just a little problem. when i use the drawTexturedModelRectFromIcon method it draws from an empty sheet. so it doesnt draw anything visible. do i need to bind the icon somehow to make it work? this.drawTexturedModelRectFromIcon(this.xPosition+3, this.yPosition+3, PetMastery.petEgg.getIconFromDamage(0), 16, 16);
  23. thx a lot for anyone who also wants to know which way the water is flowing here is the code i made: public static ForgeDirection getWaterFlowDirection(World par1, int par2, int par3, int par4){ int var1 = par1.getBlockMetadata(par2, par3, par4); if(par1.getBlockId(par2, par3, par4) != Block.waterStill.blockID || var1 == 0){ return null; } for(ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS){ int x = par2 + direction.offsetX; int y = par3 + direction.offsetY; int z = par4 + direction.offsetZ; int var2 = par1.getBlockId(x, y, z); if(var2 == Block.waterStill.blockID){ int var3 = par1.getBlockMetadata(x, y, z); if(var3 > var1){ return direction; } } } return ForgeDirection.UNKNOWN; }
  24. ah never knew that thx for info. but... im making a water wheel which is rotating around its z-axel. and i need to know which way the wheel needs to rotate. so any ideas how to do that?
  25. is there a way to get the direction of which the water is flowing? i noticed that there is one in the WaterMoving block. but every water blocked i checked only is an instance of WaterStill. so is there a way to check the water flow direction?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.