Everything posted by Ninjusk
-
Container/Gui bug(Solved)
Heres the full crash Report Also i forgot to say im using Forge version 6.5.0.467 for minecraft 1.4.6
-
Container/Gui bug(Solved)
Ok so I'm writing a mod that adds a entity that has its own inventory like the player. its inventory holds 27 Itemstacks like a chest. now the only way to open this GUI is to be ridding the entity(only why both the client and server can get the inventory instance right now). now i use player.openGui(ShurtugalMod.instance, 1, this.worldObj,(int) posX,(int) posY,(int) posZ); to open the GUI, i don't do anything with x y z because its not a TileEntity. now that being said when i open the GUI with a keybinding i wrote that tell the server when its clicked from my entity file it opens but when i try to access any of the container slots over id of 45 it crashes giving this error saying that the size of this array-list is only 45 2013-01-10 15:15:17 [iNFO] [sTDERR] Caused by: java.lang.IndexOutOfBoundsException: Index: 56, Size: 45 2013-01-10 15:15:17 [iNFO] [sTDERR] at java.util.ArrayList.rangeCheck(ArrayList.java:571) 2013-01-10 15:15:17 [iNFO] [sTDERR] at java.util.ArrayList.get(ArrayList.java:349) 2013-01-10 15:15:17 [iNFO] [sTDERR] at net.minecraft.inventory.Container.slotClick(Container.java:198) this is the line it crashes on var7 = (Slot)this.inventorySlots.get(par1); so i decided to see what the size of this array-list was so the line before the crash i added a console print out of "this.inventorySlots.size()" and that returned 63(the number of slots in this gui) like it should be. so to see if it was because i open it from an entity not a block and that was problem so i quickly mod the GUI open statement for a block i made and so it brings up the same GUI as the dragon like this Player.openGui(ShurtugalMod.instance, 1, par1World,par2, par3, par4); and it comes up and works without a problem. im not sure what i did wrong? if anyone could help that would be awesome. heres all the relevant code, ask if you need anymore IInventory class Container Class GUI Class(Although this really isnt needed to find the bug, i think?) GuiHandler Anything else you need just ask Thank you for time.
-
Need Village help
Thank you for responding but im still confused on where to put what and if you have example of how to add components that would be incredibly helpful
-
Need Village help
Ok so after reading a bit of forge code ive found a what seems to be a way to add new components to villages using IVillageCreationHandler but i can not figure out how to get it actually generate the new piece. ive registered it in my main class and have from what i can tell it looks right. here is the IVillageCreationHandler class. package dragon.common.Gen; import java.util.List; import java.util.Random; import net.minecraft.src.ComponentVillageStartPiece; import net.minecraft.src.MathHelper; import net.minecraft.src.StructureBoundingBox; import net.minecraft.src.StructureVillagePieceWeight; import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler; public class VillageHandler implements IVillageCreationHandler { @Override public StructureVillagePieceWeight getVillagePieceWeight(Random random, int i) { return (new StructureVillagePieceWeight(ComponentVillagePinkTemple.class, 20, MathHelper.getRandomIntegerInRange(random, 0 + i, 1 + i))); } @Override public Class<?> getComponentClass() { return ComponentVillagePinkTemple.class; } @Override public Object buildComponent(StructureVillagePieceWeight villagePiece,ComponentVillageStartPiece startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) { StructureBoundingBox var8 = new StructureBoundingBox(0,0,0,5,12,9); ComponentVillagePinkTemple pink = new ComponentVillagePinkTemple(startPiece, p1, random, var8, p5); return pink; } } If anyone who understands this better then i do could help me that would be awsome. thank you for your time
-
Sending a packet to all players
I need to send a packet to all players(or maybe only the ones who can see the mob). how would i do this?
-
IItemRenderer?
I know is 3d but i want something that is twice as large as could be normally rendered
-
IItemRenderer?
Ive been trying to find a way to render a Spear in hand that it is a real spear and not just some 16 X 16 item but instead a larger render of of a spear. ive been looking into the IItemRenderer but i cant tell if it will do what i need because the EQUIPPED enum seems to only be for blocks. what im wondering is if this class is what i need or if it does something else?
-
dimension in 1.3.2 help
Sorry for making a new topic but i count find any where that explained it well enough. all i need to know is how to get the basics of a dimension working and what function needed to be called to telport the player. if any one has gotten anything working and could show me there source that would be extremely helpful.
-
How to render a block that is not really there?
you could create a block with no collision like this public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; } so it u could just walk thorough it. but im not sure if thats what ur looking for
-
Entitys only spawning at ( 0 , 0 , 0 ) at client side
I got it right as it came out and have been too busy working on updating to bother updating but now i just did.
-
Entitys only spawning at ( 0 , 0 , 0 ) at client side
Im running build 200 should i get a newer one?
-
Entitys only spawning at ( 0 , 0 , 0 ) at client side
so im working on entities that are spawning at 0,0,0 on client side but when i print out where they are on the server its the correct position, heres my spawn code private void spawnjet(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { TronEntityLightJet entityliving = new TronEntityLightJet(par2World, Color, par1ItemStack); entityliving.setLocationAndAngles(par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, par3EntityPlayer.rotationYaw,par3EntityPlayer.rotationPitch); par2World.spawnEntityInWorld(entityliving); par3EntityPlayer.mountEntity(entityliving); par3EntityPlayer.inventory.consumeInventoryItem(TronBase.BlueJetBaton.shiftedIndex); } currently this function is only being called on the server and not client. just ask if you need more code or information.
-
Getting Mobs to work with SMP? [forge4.0.0]
Is the PacketManager the part that deals with entities movement or is there a piece i missed?
-
Getting Mobs to work with SMP? [forge4.0.0]
I have a couple of mobs that are written like you would write them for 1.2.5(meaning no code to do with muiltiplayer or packets) and i need to add muitiplayer support to them. i have not found anywhere explaining how to for 4.0.0 and would appreciate anyone wiling to explain how to do it in the new forge. Thank you for you time.
-
Getting internal sever to know about an entity [Forge 4.0.0]
So im working on a mod that adds ridable entitys to the game. but in survival when you get off you are telported back to when you got on. that and in LAN the serve is not even aware that that the entity is moving. Currently i do not have anything relating to muiltiplayer, so my question is what do i need to add and how will i go about setting it up? main mod class package net.minecraft.src.GridMod; import net.minecraft.src.*; import net.minecraftforge.client.MinecraftForgeClient; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.EntityRegistry; @Mod(modid = "GridMod", name = "GridMod", version = "V0.1") @NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = { "TheGrid" } //packetHandler = GridPacketHandler.class //connectionHandler = ConnectionHandler.class ) public class TronBase { public static final Item YellowBaton = new TronItemBaton(201, 0).setItemName("YellowBaton"); public static final Item BlueBaton = new TronItemBaton(202, 1).setItemName("BlueBaton"); public static final Item GreenBaton = new TronItemBaton(203, 2).setItemName("greenBaton"); public static final String items = "/Tron/items.png", blocks = "/Tron/blocks.png"; @Init public void LoadMethod(FMLInitializationEvent event) { ModLoader.addName(YellowBaton, "Yellow Baton"); ModLoader.addName(BlueBaton, "Blue Baton"); ModLoader.addName(GreenBaton, "Green Baton"); MinecraftForgeClient.preloadTexture(items); MinecraftForgeClient.preloadTexture(blocks); EntityRegistry.registerModEntity(TronEntityLightCycle.class, "PlayerLightCycle", 1, this, 250, 5, false); RenderingRegistry.instance().registerEntityRenderingHandler(TronEntityLightCycle.class, new TronRenderLightCycle(new TronModelLightCycle(), 0.5F)); } }
IPS spam blocked by CleanTalk.