GotoLink
Members-
Posts
2012 -
Joined
-
Last visited
-
Days Won
1
Everything posted by GotoLink
-
[Unsolved] Connected textures derping [1.6.2]
GotoLink replied to larsgerrits's topic in Modder Support
if(world.getBlockId(x-1, y, z) == this.blockID) if(world.getBlockId(x+1, y, z) == this.blockID) if(world.getBlockId(x, y, z-1) == this.blockID) if(world.getBlockId(x, y, z+1) == this.blockID) if(world.getBlockId(x+1, y, z+1) == this.blockID) if(world.getBlockId(x-1, y, z-1) == this.blockID) if(world.getBlockId(x-1, y, z+1) == this.blockID) { if(world.getBlockId(x+1, y, z-1) == this.blockID) { return textures[36]; } else { return textures[43]; } ///other code }}}}}}} Better, just check the surrounding first: List list = new ArrayList(); for(int i=x-1; i<x+2; i++) for(int j=y-1; j<y+2; j++) for(int k=z-1; k<z+2; k++) if((i!=x || j!=y || k!=z) && world.getBlockId(i,j,k) == this.blockID)//Find which neighbour block has same id list.add(new int[]{i,j,k}); Iterator itr = list.iterator(); while(itr.hasNext()) { int[] pos = (int[]) itr.next(); if(pos[1]>y) hasUpperNeighbour = true; else if(pos[1<y) hasLowerNeighbour = true; if(pos[0]>x) hasNorthNeighbour = true; else if(pos[0]<x) hasSouthNeighbour = true; if(pos[2]>z) hasEastNeighbour = true; else if(pos[2]<z) hasWestNeighbour = true; } if(hasUpperNeighbour) { if(hasLowerNeighbour) //... } else if(hasLowerNeighbour) { //... } else { //... } -
What is the "right" position ? Note that slots positions are determined in the Container class, not by the Gui
-
Custom Enchantment adding effect when attacking an Entity
GotoLink replied to OwnAgePau's topic in Modder Support
You don't call an event, unless you want someone else to catch it. You register to the event, to receive the calls. -
Hooking chat commands client-side on multiplayer
GotoLink replied to harik's topic in Modder Support
Because i am only making a client-side mod. Why would i want to make my mod require a specific server plugin as well? I simply want to show a client-side gui since my mod does not affect the server whatsoever. Then why do you want to use chat commands ? By staying on client side, you can handle any client input, why use something that make client interact with server ? Just build your own chat GUI, if you want it to look like the chat command. You can open it with your own key, and then handle any input message locally. -
[Unsolved] Connected textures derping [1.6.2]
GotoLink replied to larsgerrits's topic in Modder Support
Can't you chain if statement instead of checking...8 conditions inside each one ? It will be a lot easier to read and find the issue. -
Fixes: Render class Main mod file @EventHandler public void init(FMLInitializationEvent e) { EntityRegistry.addSpawn(EntityTest.class, 6, 2, 4, EnumCreatureType.creature); EntityRegistry.registerEntity(EntityTest.class, "Test", 1,this, 40,3,false ); EntityList.entityEggs.put(1, new EntityEggInfo(1, 0xFFFFFF, 0x000000); //RenderingRegistry.registerEntityRenderingHandler(EntityTest.class, new RenderTest(new ModelBiped(), 2F));TODO:Put on client side } } [/spoiler]
-
NEI API, adding a name to a new keybinding
GotoLink replied to DrEinsteinium's topic in Modder Support
I fixed the issue in my code I hope it will easier for future readers this way. public static List getItemDataList(){ NBTTagList itemList = new NBTTagList(); GameData.writeItemData(itemList);//writes data from idMap in GameData to given Taglist List<ItemData> data=new ArrayList(); NBTBase base; for(int i =0; i< itemList.tagCount; i++) { base = itemList.tagAt(i);//gets back the Tags from itemList if(base instanceof NBTTagCompound)//found a Compound type of Tag data.add(new ItemData((NBTTagCompound)base));//builds an ItemData instance from the Compound Tag, and adds it to data list } return data; } Then you can extract desired info from the data list Iterator itr = getItemDataList().iterator(); while(itr.hasNext()) { ItemData iData = (ItemData) itr.next(); iData.getModId();//mod id iData.getItemType();//item name at registration iData.getItemId();//item id } -
Trouble with mob rendering; mobs only use one renderer per mod.
GotoLink replied to linkseyi's topic in Modder Support
new ResourceLocation("textures/entity/Creep.png"); Where did you put that texture ? -
Block Break Particles and Fake Texture Error
GotoLink replied to ninjapancakes87's topic in Modder Support
Usually you only use one of them. Can you post both code ? -
worldObj.playSoundAtEntity(this, "griffinimod:shot", 1.0F, 1.0F); This should work, assuming you have sound at: mcp/src/minecraft/assets/griffinimod/sound/shot.ogg
-
Moving From Modloader to Forge/Armor Not Working Correctly
GotoLink replied to superninjaman45's topic in Modder Support
public String getArmorTextureFile(ItemStack itemstack) I am pretty sure this method do not exist anymore in 1.6. Change to the following: public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) -
Block Break Particles and Fake Texture Error
GotoLink replied to ninjapancakes87's topic in Modder Support
Do you use a TileEntityRenderer or a BlockRenderer ? Did you change some methods regarding rendering and icons in your block class ? -
Block Break Particles and Fake Texture Error
GotoLink replied to ninjapancakes87's topic in Modder Support
I'd say you forgot to bind a texture before rendering your model. -
[SOLVED] Fence Error - The game is crashed
GotoLink replied to Creepmander's topic in Modder Support
Modify your first post, you can change the title here. -
Block Break Particles and Fake Texture Error
GotoLink replied to ninjapancakes87's topic in Modder Support
This is probably a bug from this old version. Use a more recent one. -
[Help][unsolved]Zooming with Item in hand[1.5.2]
GotoLink replied to kaikaii99's topic in Modder Support
What I would do: Minecraft mc = Minecraft.getMinecraft(); boolean changed = false; @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { if(type.contains(TickType.RENDER) && mc.thePlayer!=null){ if(mc.thePlayer.getCurrentEquippedItem() != null){ ItemStack currItem = mc.thePlayer.getCurrentEquippedItem(); if(currItem.getItem().itemID == MainClass.MagicGauntlet.itemID){ if(Keyboard.isKeyDown(Keyboard.KEY_Z)){ if(!changed){ ReflectionHelper.setPrivateValue(c, o, 5D, 36); changed = true; } return; } } } if(changed){ ReflectionHelper.setPrivateValue(c, o, 1D, 36); changed = false; } } } This is to avoid all unnecessary reflection uses. -
NEI API, adding a name to a new keybinding
GotoLink replied to DrEinsteinium's topic in Modder Support
Hum, after thinking a bit, the more suited data is the idMap in GameData. It is a private Map, which contains ItemData for each item id. The ItemData contains modid, and item registration name. NBTTagList itemList = new NBTTagList(); GameData.writeItemData(itemList); List<ItemData> data=new ArrayList(); NBTBase base; for(int i =0; i< itemList.tagCount; i++) { base = itemList.tagAt(i); if(base instanceof NBTTagCompound) data.add(new ItemData((NBTTagCompound)base)); } -
Huh ? No, you can't, except if the block has a tileentity (or some ItemStack, which I don't know how you'd get it) Well, you have to differentiate powered and unpowered state. Just try to place a glass block next to that powered block of yours, or place your block on a powered area, then unpower it. You'll see why this is necessary. This might fix both of your issues. If not, use a TileEntity (you don't have to rewrite all, just move most things from block and TickHandler into the TileEntity) By the way, you won't need your TickHandler with a TileEntity.
-
TileEntity can save without limits all types of values within the world save. With blocks, as soon as the world unload, they are reset to default, and you can only have 16 bits of additional values. (your Array of String will never be saved by a block, consider it is only temporary) You can have gui and inventories with TileEntity, though it is not necessary. Have a look at this repository, this mod does things close to what you want.
-
Where is redstone power used in your code ? I don't see any difference between a powered or unpowered block ? Also, you may want to use a TileEntity.
-
You may want to give a list of your mods, and your maximum PermGen value. One of them could be...unoptimised ?
-
Isn't receiving the packet on spawn enough ? Client can then compute the data however you want.
-
NEI API, adding a name to a new keybinding
GotoLink replied to DrEinsteinium's topic in Modder Support
Ho, you can find a public call in GameRegistry class, sorry about that. About this method, the name it compares with is the name given by the modder at the registration of the item/block: registerBlock(block,name) or registerItem(item,name), which is not necessarily equal to the name given in the item own class. It may be more simple to use the itemsList in Item class, along with player.getHeldItem().itemID; but then it wouldn't use the mod id. -
Block Break Particles and Fake Texture Error
GotoLink replied to ninjapancakes87's topic in Modder Support
Yes, it should be in PreInit event. What version of Forge are you using ?