Jump to content

Thor597

Forge Modder
  • Posts

    268
  • Joined

  • Last visited

Everything posted by Thor597

  1. Which method in your block class do you use to get the texture index? Im not entirely sure what you mean by that but here is the block class: package thedecopack.medieval.blocks; import net.minecraft.src.*; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import java.util.List; import java.util.Random; import thedecopack.medieval.DecoMedieval; public class BlockMedievalCedarLog extends Block { protected BlockMedievalCedarLog(int par1) { super(par1, Material.wood); this.setCreativeTab(DecoMedieval.medievalTab); } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random par1Random) { return 1; } /** * Returns the ID of the items to drop on destruction. */ public int idDropped(int par1, Random par2Random, int par3) { return this.blockID; } /** * ejects contained items into the world, and notifies neighbours of an update, as appropriate */ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { byte var7 = 4; int var8 = var7 + 1; if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { for (int var9 = -var7; var9 <= var7; ++var9) { for (int var10 = -var7; var10 <= var7; ++var10) { for (int var11 = -var7; var11 <= var7; ++var11) { int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11); if (Block.blocksList[var12] != null) { Block.blocksList[var12].beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); } } } } } } /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public int getBlockTextureFromSide(int i) { if(i == 1 || i == 0) { return 17; } else { return 16; } } @Override public boolean canSustainLeaves(World world, int x, int y, int z) { return true; } @Override public boolean isWood(World world, int x, int y, int z) { return true; } public String getTextureFile() { return DecoMedieval.instance.blockTextureFile(); } }
  2. My problem is that every time I change the fast/fancy graphic settings my block needs a block update or another one of its type to be placed down in order for it to change texture(but it changes in my hand immediately) and I can see through it and into the block underneath when its fancy
  3. So i'm sure you guys know about how some biomes has their own hills biome, for example taigahills where the hills version is a bit taller, and I wanted to have my biome have the same thing going. So I went investigating and found out it was done in a genlayer file. So how do I do this for my custom biome without editing base files? And do I need to use addBiome on the "hills" biome or just the normal one? Some help and advice would be nice!
  4. I figured it out, anyway 1 question. Items that has hasEffect = true makes some tabs go purple and its weird, ive been getting this on achieves with this effect item too, the achieve screen goes white
  5. How do I make a new creative tab without editing base files?
  6. I made a config file and added my blocks, however I crash when I start the game. Crash Log: 2012-11-09 16:10:11 [iNFO] [sTDERR] Exception in thread "Minecraft main thread" java.lang.ExceptionInInitializerError 2012-11-09 16:10:11 [iNFO] [sTDERR] at java.lang.Class.forName0(Native Method) 2012-11-09 16:10:11 [iNFO] [sTDERR] at java.lang.Class.forName(Unknown Source) 2012-11-09 16:10:11 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:410) 2012-11-09 16:10:11 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2012-11-09 16:10:11 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2012-11-09 16:10:11 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2012-11-09 16:10:11 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2012-11-09 16:10:11 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) 2012-11-09 16:10:11 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2012-11-09 16:10:11 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) 2012-11-09 16:10:11 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) 2012-11-09 16:10:11 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268) 2012-11-09 16:10:11 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140) 2012-11-09 16:10:11 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2012-11-09 16:10:11 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2012-11-09 16:10:11 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2012-11-09 16:10:11 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2012-11-09 16:10:11 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) 2012-11-09 16:10:11 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2012-11-09 16:10:11 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) 2012-11-09 16:10:11 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) 2012-11-09 16:10:11 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268) 2012-11-09 16:10:11 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83) 2012-11-09 16:10:11 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:478) 2012-11-09 16:10:11 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:150) 2012-11-09 16:10:11 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:420) 2012-11-09 16:10:11 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:752) 2012-11-09 16:10:11 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source) 2012-11-09 16:10:11 [iNFO] [sTDERR] Caused by: java.lang.IllegalArgumentException: Slot 0 is already occupied by thormod.ThorMod_Berries@73616964 when adding thormod.ThorMod_Ores@4e5f6a 2012-11-09 16:10:11 [iNFO] [sTDERR] at net.minecraft.src.Block.<init>(Block.java:292) 2012-11-09 16:10:11 [iNFO] [sTDERR] at thormod.ThorMod_Ores.<init>(ThorMod_Ores.java:12) 2012-11-09 16:10:11 [iNFO] [sTDERR] at net.minecraft.src.ThorMod.<clinit>(ThorMod.java:75) 2012-11-09 16:10:11 [iNFO] [sTDERR] ... 28 more Base Mod File Code: public static int berryBushStartId; public static final Block BerryBushes = (new ThorMod_Berries(berryBushStartId)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setBlockName("BerryBushes").setCreativeTab(CreativeTabs.tabDecorations); public static int oresStartId; public static final Block Ores = new ThorMod_Ores(oresStartId, Material.rock).setBlockName("ThorOres").setCreativeTab(CreativeTabs.tabBlock).setHardness(4F); @PreInit public void preInit(FMLPreInitializationEvent event) { proxy.registerRenderInformation(); new ThorMod_Configuration(event); } ThorMod_Configuration: package thormod; import net.minecraft.src.*; import net.minecraftforge.common.Configuration; import cpw.mods.fml.common.event.FMLPreInitializationEvent; public class ThorMod_Configuration { public ThorMod_Configuration(FMLPreInitializationEvent event) { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); config.load(); this.blocks(config); config.save(); } public void blocks(Configuration config) { ThorMod.berryBushStartId = config.getBlock("Berry Bushes' Start ID", 158).getInt(); ThorMod.oresStartId = config.getBlock("Nether & End Ores Start ID", 2723).getInt(); } } Does anyone see the problem?
  7. It worked, however because im doing this for a rail block it changes direction and shit when powered when this is done can you make an example for a rail that changes texture when powered and stays in the same position? I tried copying rail code and crap but it didnt work, because BlockRail has a different kind of setup than mine since both rail and powered rail uses it
  8. so if its powered set metadata to 1 and if not powered set to 0?
  9. Im making a block where I want it to change texture if its powered by redstone I dont want to make a second block just for a different texture How would I do this?
  10. Can you please actually say what blocks in that mod uses this texture and in what classes I need to look to make my block animated? I cant just go blindly into every class looking
  11. So I started up my client to test out this model I made for an item, however I crashed with this error: 2012-11-02 23:46:07 [iNFO] [sTDERR] cpw.mods.fml.common.LoaderException: java.lang.reflect.InvocationTargetException 2012-11-02 23:46:07 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.transition(LoadController.java:102) 2012-11-02 23:46:07 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:461) 2012-11-02 23:46:07 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:141) 2012-11-02 23:46:07 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:405) 2012-11-02 23:46:07 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:737) 2012-11-02 23:46:07 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source) 2012-11-02 23:46:07 [iNFO] [sTDERR] Caused by: java.lang.reflect.InvocationTargetException 2012-11-02 23:46:07 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2012-11-02 23:46:07 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2012-11-02 23:46:07 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2012-11-02 23:46:07 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2012-11-02 23:46:07 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:371) 2012-11-02 23:46:07 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2012-11-02 23:46:07 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2012-11-02 23:46:07 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2012-11-02 23:46:07 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2012-11-02 23:46:07 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) 2012-11-02 23:46:07 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2012-11-02 23:46:07 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) 2012-11-02 23:46:07 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) 2012-11-02 23:46:07 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268) 2012-11-02 23:46:07 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:124) 2012-11-02 23:46:07 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2012-11-02 23:46:07 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2012-11-02 23:46:07 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2012-11-02 23:46:07 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2012-11-02 23:46:07 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) 2012-11-02 23:46:07 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2012-11-02 23:46:07 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) 2012-11-02 23:46:07 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) 2012-11-02 23:46:07 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268) 2012-11-02 23:46:07 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:81) 2012-11-02 23:46:07 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:460) 2012-11-02 23:46:07 [iNFO] [sTDERR] ... 4 more 2012-11-02 23:46:07 [iNFO] [sTDERR] Caused by: java.lang.NullPointerException 2012-11-02 23:46:07 [iNFO] [sTDERR] at arcticraft.ClientProxy.registerRenderInformation(ClientProxy.java:23) 2012-11-02 23:46:07 [iNFO] [sTDERR] at arcticraft.Arcticraft.preInit(Arcticraft.java:211) 2012-11-02 23:46:07 [iNFO] [sTDERR] ... 30 more ClientProxy stuff: package arcticraft; import arcticraft.entities.*; import arcticraft.models.*; import arcticraft.renderers.*; import net.minecraft.src.*; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.TickRegistry; public class ClientProxy extends CommonProxy { @Override @SideOnly(Side.CLIENT) public void registerRenderInformation() { MinecraftForgeClient.registerItemRenderer(Arcticraft.staff.shiftedIndex, new AC_ItemRenderStaff()); } } ItemRenderer file: package arcticraft.renderers; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import arcticraft.models.AC_ModelStaff; import net.minecraft.src.*; import net.minecraftforge.client.*; public class AC_ItemRenderStaff implements IItemRenderer { private static AC_ModelStaff staffModel = new AC_ModelStaff(); public boolean handleRenderType(ItemStack item, ItemRenderType type) { if (type == ItemRenderType.EQUIPPED) { return true; } return false; } public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case ENTITY: renderTool(-0.5F, 0.5F, -0.5F); break; case EQUIPPED: renderTool(0F, 0.4F, 0F); break; case INVENTORY: renderTool(1F, 0.65F, 1F); break; default: break; } } private void renderTool(float x, float y, float z) { Tessellator tesselator = Tessellator.instance; GL11.glPushMatrix(); //start ForgeHooksClient.bindTexture("/arcticraft/textures/mobs/evilIceMage.png", 0); GL11.glTranslatef(x, y, z); //size float var10 = 0.0625F; staffModel.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, var10); GL11.glPopMatrix(); //end } } Staff code and clientproxy registering in my base file(Arcticraft.java) public static Item staff; @PreInit public void preInit(FMLPreInitializationEvent event) { proxy.registerRenderInformation(); } @Init public void Init(FMLInitializationEvent event) { this.initItems(); } public void initItems() { this.staff = (new AC_ItemStaff(1950).setItemName("staff").setIconCoord(13, 2)); } AC_ItemStaff: package arcticraft.items; import arcticraft.entities.AC_EntityStaffBall; import net.minecraft.src.*; import net.minecraft.client.Minecraft; public class AC_ItemStaff extends Item { public AC_ItemStaff(int par1) { super(par1); this.maxStackSize = 1; maxStackSize = 1; //1 for durability | 1-64 for consumption setMaxDamage(1000); //Durability = # + 1 setTabToDisplayOn(CreativeTabs.tabCombat); } public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { if(entityplayer.capabilities.isCreativeMode) { world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!world.isRemote) { world.spawnEntityInWorld(new AC_EntityStaffBall(world, entityplayer, entityplayer, iconIndex, iconIndex)); } return itemstack; } if (entityplayer.ridingEntity != null) { return itemstack; } else { world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!world.isRemote) { world.spawnEntityInWorld(new AC_EntityStaffBall(world, entityplayer, entityplayer, iconIndex, iconIndex)); } itemstack.damageItem(1, entityplayer); return itemstack;} } public String getTextureFile() { return "/arcticraft/textures/ACItems.png"; } } And thats probably all the code you need to know about. But yeah, I need help on this!
  12. I get a crash when starting, it says I am naming my object null but I am not, crash log: java.lang.IllegalArgumentException: Illegal object for naming null at cpw.mods.fml.common.registry.LanguageRegistry.addNameForObject(LanguageRegistry.java:93) at thedecopack.medieval.blocks.MedievalBlocks.namesEnglish(MedievalBlocks.java:32) at thedecopack.medieval.blocks.MedievalBlocks.<init>(MedievalBlocks.java:15) at thedecopack.medieval.DecoMedieval.Init(DecoMedieval.java:37) 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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:440) 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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140) 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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) at com.google.common.eventbus.EventBus.post(EventBus.java:268) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:651) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:196) at net.minecraft.client.Minecraft.startGame(Minecraft.java:465) at net.minecraft.client.Minecraft.run(Minecraft.java:752) at java.lang.Thread.run(Unknown Source) 2012-10-31 20:50:21 [iNFO] [sTDERR] java.lang.IllegalArgumentException: Illegal object for naming null 2012-10-31 20:50:21 [iNFO] [sTDERR] at cpw.mods.fml.common.registry.LanguageRegistry.addNameForObject(LanguageRegistry.java:93) 2012-10-31 20:50:21 [iNFO] [sTDERR] at thedecopack.medieval.blocks.MedievalBlocks.namesEnglish(MedievalBlocks.java:32) 2012-10-31 20:50:21 [iNFO] [sTDERR] at thedecopack.medieval.blocks.MedievalBlocks.<init>(MedievalBlocks.java:15) 2012-10-31 20:50:21 [iNFO] [sTDERR] at thedecopack.medieval.DecoMedieval.Init(DecoMedieval.java:37) 2012-10-31 20:50:21 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2012-10-31 20:50:21 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2012-10-31 20:50:21 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2012-10-31 20:50:21 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2012-10-31 20:50:21 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:440) 2012-10-31 20:50:21 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2012-10-31 20:50:21 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2012-10-31 20:50:21 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2012-10-31 20:50:21 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2012-10-31 20:50:21 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) 2012-10-31 20:50:21 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2012-10-31 20:50:21 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) 2012-10-31 20:50:21 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) 2012-10-31 20:50:21 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268) 2012-10-31 20:50:21 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140) 2012-10-31 20:50:21 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2012-10-31 20:50:21 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2012-10-31 20:50:21 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2012-10-31 20:50:21 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2012-10-31 20:50:21 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69) 2012-10-31 20:50:21 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2012-10-31 20:50:21 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317) 2012-10-31 20:50:21 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300) 2012-10-31 20:50:21 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:268) 2012-10-31 20:50:21 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83) 2012-10-31 20:50:21 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.initializeMods(Loader.java:651) 2012-10-31 20:50:21 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:196) 2012-10-31 20:50:21 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:465) 2012-10-31 20:50:21 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:752) 2012-10-31 20:50:21 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source) MedievalBlocks: package thedecopack.medieval.blocks; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import net.minecraft.src.Block; import net.minecraft.src.BlockWood; public class MedievalBlocks { public static Block redCedarPlanks; public MedievalBlocks() { this.namesEnglish("en_US"); this.namesEnglish("en_PT"); this.namesEnglish("en_GB"); this.namesEnglish("en_CA"); this.namesEnglish("en_AU"); this.namesNorwegian("nb_NO"); this.redCedarPlanks = (new BlockWoodMedieval(2200, 0)).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setBlockName("wood").setRequiresSelfNotify(); RegisterBlocks(new Block[] { redCedarPlanks, }); } public void namesEnglish(String lang) { LanguageRegistry.instance().addNameForObject(redCedarPlanks, lang, "Red Cedar Planks"); } public void namesNorwegian(String lang) { LanguageRegistry.instance().addNameForObject(redCedarPlanks, lang, "Røde Sederplanker"); } private void RegisterBlocks(Block ablock []) { Block ablock1[] = ablock; int i = ablock1.length; for(int j = 0; j < i; j++) { Block block = ablock1[j]; GameRegistry.registerBlock(block); } } }
  13. Iterator<EntityPlayer> players = this.worldObj.playerEntities.iterator(); while(players.hasNext()) { EntityPlayer player = players.next(); if(player instanceof EntityPlayerMP) { player.sendChatToPlayer("\247bNooo! SsSsSsStupid HumansSsSsSsSsSs, you will pay for what you've done!"); } } I altered it to this. Thank you!
  14. Also, how can I get an instance of EntityPlayer in my onDeathUpdate because what I have now is Minecraft.getMinecraft().thePlayer.addChatMessage and the problem with that is that 1. It sends the message 2 times and 2. It will crash on the server so what I need is like if(EntityPlayerInstance instanceof EntityPlayerMP) { EntityPlayerInstance.addChatMessage }
  15. So, Im making a boss. And it has its health bar. So im using an interface to do some stuff to make it all work. However, when I spawn the boss it dies instantly. Code in Entity File: /** The maximum health of the Entity. */ protected int maxHealth = 250; public int getMaxHealth() { return this.maxHealth; } protected void entityInit() { super.entityInit(); this.dataWatcher.addObject(18, new Integer(this.maxHealth)); } public void onLivingUpdate() { if (!this.worldObj.isRemote) { this.dataWatcher.updateObject(18, Integer.valueOf(this.health)); } } @SideOnly(Side.CLIENT) /** * Returns the health points of the dragon. */ public int getBossHP() { return this.dataWatcher.getWatchableObjectInt(18); } public int getBossMaxHP() { return this.maxHealth; } AC_IArcticBoss: package arcticraft.entities; import net.minecraft.src.*; public interface AC_IArcticBoss { public abstract int getBossHP(); public abstract int getBossMaxHP(); public abstract boolean isCurrentBoss(); public abstract int getBossEntityID(); public abstract String getBossTitle(); public abstract Entity GetEntity(); }
  16. I had to switch it around a little, but this works: int ZombieBossID = EntityRegistry.findGlobalUniqueEntityId(); EntityRegistry.registerGlobalEntityID(AC_EntityZombieBoss.class, "FrozenZombieBoss", ZombieBossID, zombieBackGround, zombieSpots); EntityRegistry.registerModEntity(AC_EntityZombieBoss.class, "FrozenZombieBoss", ZombieBossID, this, 128, 10, true); LanguageRegistry.instance().addStringLocalization("entity.FrozenZombieBoss.name", "en_US", "Frozen Zombie Boss");
  17. This is the current code in the @Init EntityRegistry.registerGlobalEntityID(AC_EntityFrozenZombie.class, "FrozenZombie", EntityRegistry.findGlobalUniqueEntityId(), zombieBackGround, zombieSpots); EntityRegistry.registerModEntity(AC_EntityFrozenZombie.class, "FrozenZombie", EntityRegistry.findGlobalUniqueEntityId(), this, 64, 10, true); LanguageRegistry.instance().addStringLocalization("entity.FrozenZombie.name", "en_US", "Frozen Zombie"); but no, still the same problem
  18. How come I didnt have to do it for my other entities and the tutorial at the tutorials said nothing about it? (anyway, im putting in the tracking thing now)
  19. So I've made these bosses that worked just fine for 1.2.5 but when I updated to 1.3.2 all my other mobs worked. But the bosses didnt, they are invisible and I cant interact with them. However I can hear their sounds and the boss I have that leaves a trail of snow behind it actually does even though it is like this. So I know they actually are there. Code in @Init EntityRegistry.registerGlobalEntityID(AC_EntityFrozenZombie.class, "FrozenZombie", EntityRegistry.findGlobalUniqueEntityId(), zombieBackGround, zombieSpots); LanguageRegistry.instance().addStringLocalization("entity.FrozenZombie.name", "en_US", "Frozen Zombie"); Code in ClientProxy RenderingRegistry.registerEntityRenderingHandler(AC_EntityZombieBoss.class, new AC_RenderZombieBoss(new AC_ModelZombieBoss(), 1.5F)); Render file package arcticraft.renderers; import net.minecraft.src.*; import org.lwjgl.opengl.GL11; import arcticraft.entities.AC_EntityZombieBoss; public class AC_RenderZombieBoss extends RenderBiped { public static AC_EntityZombieBoss ZombieBoss; public AC_RenderZombieBoss(ModelBiped par1ModelBiped, float par2) { super(par1ModelBiped, par2); } public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { this.renderZombieBoss((AC_EntityZombieBoss)par1Entity, par2, par4, par6, par8, par9); super.doRender(par1Entity, par2, par4, par6, par8, par9); } public void renderZombieBoss(AC_EntityZombieBoss par1EntityZombieBoss, double par2, double par4, double par6, float par8, float par9) { ZombieBoss = par1EntityZombieBoss; } /** * Applies the scale to the transform matrix */ protected void preRenderScale(AC_EntityZombieBoss par1EntityLiving, float par2) { GL11.glScalef(1.5F, 1.5F, 1.5F); } /** * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: * entityLiving, partialTickTime */ protected void preRenderCallback(EntityLiving par1EntityLiving, float par2) { this.preRenderScale((AC_EntityZombieBoss)par1EntityLiving, par2); } } Model file package arcticraft.models; import arcticraft.entities.AC_EntityZombieBoss; import arcticraft.renderers.AC_RenderZombieBoss; import net.minecraft.src.*; public class AC_ModelZombieBoss extends ModelBiped { /** * Sets the models various rotation angles. */ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6) { super.setRotationAngles(par1, par2, par3, par4, par5, par6); float var7 = MathHelper.sin(this.onGround * (float)Math.PI); float var8 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; AC_EntityZombieBoss var1 = AC_RenderZombieBoss.ZombieBoss; if(var1.isSneaking()) { this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; this.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); this.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F); this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F); } } } Entity file(CAUTION theres a lot of shit in here) package arcticraft.entities; import arcticraft.Arcticraft; import net.minecraft.src.*; import net.minecraft.client.Minecraft; public class AC_EntityZombieBoss extends AC_EntityLivingArcticStuff implements AC_IArcticBoss { Minecraft mc = ModLoader.getMinecraftInstance(); public int deathTicks = 0; public String bossName; private int ticks; public Entity target; public boolean gotTarget; public int orgX; public int orgY; public int orgZ; public int specialAtckTicks = 0; protected int attackStrength = 2; public AC_EntityZombieBoss(World par1World) { super(par1World); this.setSize(this.width * 1.0F, this.height * 1.5F); this.texture = "/arcticraft/textures/mobs/frozen-king.png"; this.moveSpeed = 0.35F; this.attackStrength = 30; this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false)); this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 16.0F, 0, true)); this.bossName = AC_NameGenFrostZombie.gen(); orgX = MathHelper.floor_double(posX); orgY = MathHelper.floor_double(boundingBox.minY) + 1; orgZ = MathHelper.floor_double(posZ); } public AC_EntityZombieBoss(World world, int i, int j, int k, int l, int i1) { super(world); this.setSize(this.width * 1.0F, this.height * 1.5F); this.texture = "/arcticraft/textures/mobs/frozen-king.png"; this.moveSpeed = 0.35F; this.attackStrength = 30; this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false)); this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 16.0F, 0, true)); this.bossName = AC_NameGenFrostZombie.gen(); orgX = i; orgY = j; orgZ = k; } /** * (abstract) Protected helper method to write subclass entity data to NBT. */ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { super.writeEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.setString("BossName", bossName); par1NBTTagCompound.setShort("OriginX", (short)orgX); par1NBTTagCompound.setShort("OriginY", (short)orgY); par1NBTTagCompound.setShort("OriginZ", (short)orgZ); gotTarget = target != null; par1NBTTagCompound.setBoolean("GotTarget", gotTarget); par1NBTTagCompound.setBoolean("IsCurrentBoss", isCurrentBoss()); } /** * (abstract) Protected helper method to read subclass entity data from NBT. */ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); orgX = par1NBTTagCompound.getShort("OriginX"); orgY = par1NBTTagCompound.getShort("OriginY"); orgZ = par1NBTTagCompound.getShort("OriginZ"); gotTarget = par1NBTTagCompound.getBoolean("GotTarget"); bossName = par1NBTTagCompound.getString("BossName"); if (par1NBTTagCompound.getBoolean("IsCurrentBoss")) { Arcticraft.currentBoss = this; } } protected Entity findPlayerToAttack() { EntityPlayer entityplayer = worldObj.getClosestPlayerToEntity(this, 32D); if (entityplayer != null && canEntityBeSeen(entityplayer)) { return entityplayer; } else { return null; } } public boolean attackEntityAsMob(Entity par1Entity) { int var2 = this.attackStrength; return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), var2); } public void updateEntityActionState() { /*if(Arcticraft.currentBoss == this) { soundMgr.stopPlaying("Betweenlands.BossBattleLoop"); soundMgr.playSound("Betweenlands.BossBattleAmbience", 0, 10, 0, 10F, 1F, 0); } */ if (gotTarget && target == null) { target = findPlayerToAttack(); gotTarget = false; } if (target == null) { setPosition((double)orgX + 0.5D, orgY, (double)orgZ + 0.5D); return; } setPosition(posX, orgY, posZ); if (target != null && target.isDead) { setPosition((double)orgX + 0.5D, orgY, (double)orgZ + 0.5D); motionX = 0.0D; motionY = 0.0D; motionZ = 0.0D; target = null; Arcticraft.currentBoss = null; gotTarget = false; } } public void onUpdate() { super.onUpdate(); if(this.getBossHP() >= 40 && this.getBossHP() <= 64 && this.rand.nextInt(5) == 0) { ++this.health; this.spawnParticlesAroundMob("heart"); } if(Arcticraft.currentBoss == null && this.getBossHP() > 0) { this.setSneaking(true); } else if(Arcticraft.currentBoss != null && Arcticraft.currentBoss == this) { this.setSneaking(false); } } /** * handles entity death timer, experience orb and particle creation */ protected void onDeathUpdate() { ++this.deathTicks; Arcticraft.currentBoss = null; if(this.rand.nextInt(7) == 0) { this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "mob.zombiehurt", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); } if (this.deathTicks >= 180 && this.deathTicks <= 200) { float var1 = (this.rand.nextFloat() - 0.5F) * 8.0F; float var2 = (this.rand.nextFloat() - 0.5F) * 4.0F; float var3 = (this.rand.nextFloat() - 0.5F) * 8.0F; AC_EntityHugeSnowFX entityblueshine = new AC_EntityHugeSnowFX(worldObj, this.posX + (double)var1, this.posY + 2.0D + (double)var2, this.posZ + (double)var3, 0.0D, 0.0D, 0.0D); ModLoader.getMinecraftInstance().effectRenderer.addEffect(entityblueshine); } this.renderYawOffset = this.rotationYawHead += 100.0F; int var4; int var5; if (this.deathTicks >= 10) { this.moveEntity(0.0D, 0.5555D, 0.0D); } if (!this.worldObj.isRemote && this.deathTicks > 150 && this.deathTicks % 5 == 0) { var4 = 1500; while (var4 > 0) { var5 = EntityXPOrb.getXPSplit(var4); var4 -= var5; this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var5)); } } if(this.deathTicks == 20) { ModLoader.getMinecraftInstance().thePlayer.addChatMessage("\247aB-b-braains?"); } if (this.deathTicks == 200) { var4 = 15000; while (var4 > 0) { var5 = EntityXPOrb.getXPSplit(var4); var4 -= var5; this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var5)); } EntityItem var13 = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Arcticraft.crown)); var13.setPosition(this.posX, this.height * 2F, this.posZ); this.worldObj.spawnEntityInWorld(var13); this.setDead(); } } public int getMaxHealth() { return 220; } public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { Arcticraft.currentBoss = this; return super.attackEntityFrom(par1DamageSource, par2); } /** * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue */ public int getTotalArmorValue() { return 2; } /** * Returns true if the newer Entity AI code should be run */ protected boolean isAIEnabled() { return true; } /** * Returns the sound this mob makes while it's alive. */ protected String getLivingSound() { return "mob.zombie"; } /** * Returns the sound this mob makes when it is hurt. */ protected String getHurtSound() { return "mob.zombiehurt"; } /** * Returns the sound this mob makes on death. */ protected String getDeathSound() { return "mob.zombiedeath"; } public String getBossTitle() { return (new StringBuilder()).append(bossName).append(", the Frost Zombie King").toString(); } public int getBossHP() { return health; } public int getBossMaxHP() { return 220; } public boolean isCurrentBoss() { if (Arcticraft.currentBoss == null) { return false; } else { return equals(Arcticraft.currentBoss); } } public int getBossEntityID() { return entityId; } public Entity GetEntity() { return this; } } So as I have been having this problem for a while and I am very frustrated as to wtf it is, I would really appreciate some help.
  20. Can someone please do an updated tutorial on doing non-living entity rendering? Mine are literally ALWAYS invisible no matter what mod im working on
  21. /path/to/your is in the minecraft.jar in MCP and if you release your mod in a zip it will be in the yourmod.zip in the mods folder. (I know this since I wrote that tutorial)
×
×
  • Create New...

Important Information

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