Jump to content

darthvader45

Members
  • Posts

    121
  • Joined

  • Last visited

Everything posted by darthvader45

  1. Ok, I noticed the Cray Tokens mod by MrCrayfish has not been updated from 1.6.4 to 1.7.10, so I decided to see if I could get an update working(then sending the update to him to upload on his site, of course). However, the class in his mod called LivingDropEvent has been giving me fits, as the vanilla hostile mobs(i.e. Creeper, Zombie, Skeleton, Spider, etc.) aren't dropping Cray Tokens like they're supposed to. LivingDropEvent.java: /* 1: */ package com.mrcrayfish.craytokens; /* 2: */ /* 3: */ /* 5: */ import java.util.Random; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.event.entity.living.LivingDropsEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; /* 4: */ /* 8: */ /* 9: */ /* 10: */ /* 11: */ /* 12: */ /* 13: */ public class LivingDropEvent /* 14: */ { /* 15: */ @SubscribeEvent /* 16: */ public void onDeath(LivingDropsEvent e) /* 17: */ { /* 18:16 */ Random rand = new Random(); /* 19:17 */ if ((e.entityLiving.isCreatureType(EnumCreatureType.monster, true)) && (!e.entityLiving.captureDrops)) /* 20: */ { /* 21:18 */ World world = e.entityLiving.worldObj; /* 22:19 */ EntityLiving living = (EntityLiving) e.entityLiving; /* 23:25 */ if (CrayTokens.platinumRarity == 0) /* 24: */ { /* 25:26 */ EntityItem platinumCoin = new EntityItem(world, living.chunkCoordX, living.chunkCoordY, living.chunkCoordZ); /* 26:27 */ platinumCoin.dropItem(CrayTokens.platinumToken, 1); /* 27:28 */ e.drops.add(platinumCoin); /* 28: */ } /* 29:29 */ else if (rand.nextInt(CrayTokens.platinumRarity) == 0) /* 30: */ { /* 31:30 */ EntityItem platinumCoin = new EntityItem(world, living.chunkCoordX, living.chunkCoordY, living.chunkCoordZ); /* 32:31 */ platinumCoin.dropItem(CrayTokens.platinumToken, 1); /* 33:32 */ e.drops.add(platinumCoin); /* 34: */ } /* 35:35 */ if (CrayTokens.goldRarity == 0) /* 36: */ { /* 37:36 */ EntityItem goldCoin = new EntityItem(world, living.chunkCoordX, living.chunkCoordY, living.chunkCoordZ); /* 38:37 */ goldCoin.dropItem(CrayTokens.goldToken, 1); /* 39:38 */ e.drops.add(goldCoin); /* 40: */ } /* 41:39 */ else if (rand.nextInt(CrayTokens.goldRarity) == 0) /* 42: */ { /* 43:40 */ EntityItem goldCoin = new EntityItem(world, living.chunkCoordX, living.chunkCoordY, living.chunkCoordZ); /* 44:41 */ goldCoin.dropItem(CrayTokens.goldToken, 1); /* 45:42 */ e.drops.add(goldCoin); /* 46: */ } /* 47:45 */ if (CrayTokens.silverRarity == 0) /* 48: */ { /* 49:46 */ EntityItem silverCoin = new EntityItem(world, living.chunkCoordX, living.chunkCoordY, living.chunkCoordZ); /* 50:47 */ silverCoin.dropItem(CrayTokens.silverToken, 1); /* 51:48 */ e.drops.add(silverCoin); /* 52: */ } /* 53:49 */ else if (rand.nextInt(CrayTokens.silverRarity) == 0) /* 54: */ { /* 55:50 */ EntityItem silverCoin = new EntityItem(world, living.chunkCoordX, living.chunkCoordY, living.chunkCoordZ); /* 56:51 */ silverCoin.dropItem(CrayTokens.silverToken, 1); /* 57:52 */ e.drops.add(silverCoin); /* 58: */ } /* 59:55 */ if (CrayTokens.copperRarity == 0) /* 60: */ { /* 61:56 */ EntityItem copperCoin = new EntityItem(world, living.chunkCoordX, living.chunkCoordY, living.chunkCoordZ); /* 62:57 */ int chance = rand.nextInt(4); /* 63:58 */ copperCoin.dropItem(CrayTokens.copperToken, chance); /* 64:59 */ e.drops.add(copperCoin); /* 65: */ } /* 66:60 */ else if (rand.nextInt(CrayTokens.copperRarity) == 0) /* 67: */ { /* 68:61 */ EntityItem copperCoin = new EntityItem(world, living.chunkCoordX, living.chunkCoordY, living.chunkCoordZ); /* 69:62 */ int chance = rand.nextInt(4); /* 71:64 */ e.drops.add(copperCoin); /* 72: */ } /* 73: */ } /* 74: */ } /* 75: */ } /* Location: C:\Users\joshl\Downloads\[Forge]CrayTokensv1.0(1.6.4).zip * Qualified Name: com.mrcrayfish.craytokens.LivingDropEvent * JD-Core Version: 0.7.0.1 */
  2. Yeah, I need to add sounds for the guns in the mod. As in, sounds that play when the gun is used. Edit: Nvm, got it working.
  3. I'm trying to add sounds for a gun in a mod I'm working on with a friend(a mod based on the Carnivores series of games, i.e. Carnivores, Carnivores: Ice Age) and I'm not sure on the most recent methods used for this. The tutorial for a blaster on the Forge wiki used this: @ForgeSubscribe public void onSound(SoundLoadEvent event) { try { String [] soundFiles = { "lasershot.ogg", "miningshot.wav", "miningcharge.wav", "miningLoaded1.wav", "plasmaboil1.wav", "plasmaboil2.wav", "plasmaCharged.wav", "plasmashot2.wav", "plasmablast1.wav", "blastershot1.wav", "blastershot2.wav" }; for (int i = 0; i < soundFiles.length; i++){ event.manager.soundPoolSounds.addSound(soundFiles[i], SenitielsSpaceMarineMod.class.getResource("/mods/SenitielsSpaceMarineMod/sounds/" + soundFiles[i])); } } catch (Exception e) { System.err.println("Space Marine Mod: Failed to register one or more sounds."); } } However, I have no idea what this would look like with 1.7.10 methods.
  4. Ok, I'm going to start a new topic on adding custom sounds. I'm trying to create a special Sounds file and add custom .ogg files for new gun items.
  5. I've got exactly the same type of code, of course referring to my block. Edit: Redid the last method similar to EternalDoom's class(with my fields of course), and it renders correctly in hand. Thank you Eternal.
  6. I cannot find a tutorial on the forge forums. Anywhere else I can look? I've even googled it, and it shows stuff that is not related to my problem.
  7. Ok, that's all done and over with. Now a new problem. I set up the block to render in hand, and it renders completely invisible. I made sure to register the TileEntity as well. ItemRenderUnknownEggOpen.java: package com.caske2000.carnivores.render; import org.lwjgl.opengl.GL11; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.client.IItemRenderer; public class ItemRenderUnknownEggOpen implements IItemRenderer { TileEntitySpecialRenderer render; private TileEntity entity; public ItemRenderUnknownEggOpen(TileEntitySpecialRenderer render, TileEntity entity){ this.entity = entity; this.render = render; } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { // TODO Auto-generated method stub return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { // TODO Auto-generated method stub return true; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { if(type == IItemRenderer.ItemRenderType.ENTITY){ GL11.glTranslatef(-0.5F, 0.0F, -0.5F); this.render.renderTileEntityAt(this.entity, 0.0D, 0.0D, 0.0D, 0.0F); } } }
  8. Do I put the 16x16 texture's name in the setBlockTextureName thing? I did that, and it gave me an error java.io.FileNotFoundException: minecraft:textures/blocks/unknownEggParticles.png
  9. Well, then, how am I going to get the texture to work?
  10. As I said earlier, this block was modeled via Techne, and had its texture added via a ResourceLocation.
  11. Actually, I erred in that respect. The block texture was for a custom modeled block, modeled with Techne and the texture was set through the ResourceLocation field. The dimensions of the texture are 128x128. As it is a Techne model, it required such dimensions.
  12. Yes. Using setBlockTextureName. Btw, it seems to be giving an error saying that it is missing a mapping. Why is this?
  13. Hmm, I'm having the exact same problem with the break particles. Here are my classes: BlockUnknownEgg: package com.caske2000.carnivores.blocks; import com.caske2000.carnivores.Carnivores; import com.caske2000.carnivores.tileentities.TileEntityUnknownEgg; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class BlockUnknownEgg extends BlockContainer { protected BlockUnknownEgg(Material material) { super(material); this.setHardness(2.0F); this.setResistance(5.0F); this.setCreativeTab(Carnivores.carnivoresTab); this.setBlockBounds(0F, 0F, 0F, 1.0F, 1.125F, 1.0F); } public int getRenderType() { return -1; } public boolean isOpaqueCube(){ return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityUnknownEgg(); } } RenderUnknownEgg: package com.caske2000.carnivores.render; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import com.caske2000.carnivores.model.ModelUnknownEgg; import com.caske2000.carnivores.reference.Reference; public class RenderUnknownEgg extends TileEntitySpecialRenderer{ private static final ResourceLocation texture = new ResourceLocation(Reference.MODID + ":" + "textures/blocks/unknownEgg.png"); private ModelUnknownEgg model; public RenderUnknownEgg() { this.model = new ModelUnknownEgg(); } @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } }
  14. Gwafu is having the problem, not me, but ok. Plus, if you could contact him Abrar, and get his source, I could see how to build this via the tutorial link I posted.
  15. I found something that might just help you build your project in its separate pieces like you said. Link: http://www.minecraftforge.net/forum/index.php?topic=14791.0
  16. Ok, on a different note, any idea why the gradlew.bat command setupDecompWorkspace is skipping genSRGs and downloading the client/server jars? I made sure to follow the setup tutorials to the letter.
  17. Is there any way I could change the render for vanilla logs to the more rounded shape given by SpringMine's mod(as in, a 1.7 alternative I could use to achieve a similar result)?
  18. How is BetterLogs replacing Vanilla blocks? It is only giving them new models. It does not change any vanilla code at all.
  19. Is there another way? I've not been able to find any specific tutorials, and it cannot be impossible to do.
  20. Ohhhh, so that's where it is. Damn, forgot about that. Thnx. Edit: My first error happens to be "field_71951_J cannot be resolved or is not a field". I know it doesn't exist in 1.7.2, but looking through Block.java has not given me anything useful.
  21. You mean type in both setupDecompWorkspace AND eclipse in the same line? Hmmm, I'll try that, can't guarantee anything since the output last time skipped the srg as well as the client and server jars. Edit: Nope, gave me this output:
  22. I don't think running the eclipse command lets me have the deobfuscated classes.
  23. Have done it several times with the same problem. It's really getting on my nerves.
×
×
  • Create New...

Important Information

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