Everything posted by GotoLink
- 
	
		
		GUI Phantom Item, GUI Shift-Click and TileEntity Redstone Strength
		
		Note that redstone do not power instantaneously. If you want both blocks to be powered at the same time, you have to take redstone delay into account.
 - 
	
		
		Disable Items via Configuration File?
		
		Well, as a first, you need to get the boolean. Then, only if it is set to true, should you initialize, register the item and its recipe. If you gui needs your item (i don't know why it would, but...) you should disable the gui with it. Only open the gui if boolean is set to true. All the same for any other dependency your item may have.
 - 
	
		
		Adding furnace GUI
		
		And you can simplify it again in: public class SlotRestricted extends Slot { public static final int allowedID = yourItem.itemID; public SlotRestricted(IInventory par2IInventory, int par3, int par4, int par5) { super(par2IInventory, par3, par4, par5); } /** * Check if the stack is a valid item for this slot. */ public boolean isItemValid(ItemStack par1ItemStack) { return par1ItemStack.itemID == allowedID; } }
 - 
	
		
		How do I give a potion effect when wearing armor?
		
		For your first question, what would absorption be ? Is it more defense ? Second, In GuiBoneBench: public GuiBoneBench(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { super(new ContainerWorkbench(par1InventoryPlayer, par2World, par3, par4, par5)); } In GuiHandler: switch(id) { case 1: return id == 1 && world.getBlockId(x, y, z) == Mainclass.BoneBench.blockID ? new ContainerBoneBench(player.inventory, world, x, y, z) : null; } Looks strange to have two containers for the same Gui. Also, SlotBoneBench and BoneBenchRecipeSorter look like identical copies of vanilla classes. Can't you use the original ones ?
 - 
	
		
		GUI Phantom Item, GUI Shift-Click and TileEntity Redstone Strength
		
		No, make the change on server side means having a server side check beforehand, typically: if(!world.isRemote) { //do things } else { //do nothing }
 - 
	
		
		[Solved]Forge Liquids System confusing
		
		Override tryPlaceContainedLiquid(World par1World, int par2, int par3, int par4) of ItemBucket ?
 - 
	
		
		NetworkMod - Gui
		
		Should be better this way: @Mod(modid = mod_id, name = "The Nether Overhaul", version="ALPHA 1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class mod_Nether { public static final String mod_id = "teamoverhaul_netheroverhaul"; @Instance(mod_id) public static mod_Nether instance;
 - 
	
		
		Custom portal teleportation cords confusion.
		
		mServer.worldServerForDimension(1) To me, this is the End dimension id. Don't know why you are using it.
 - 
	
		
		GUI Phantom Item, GUI Shift-Click and TileEntity Redstone Strength
		
		#3: Make sure you variable isn't static, that you change the value on server side, and save the value within NBT.
 - 
	
		
		[SOLVED] KeyHandler crashed on ServerPacketHandler load
		
		You never showed that ExoServerTickHandler class. I assumed it was working. Anyway, this is another issue, which is probably easy to fix for you.
 - 
	
		
		Custom portal teleportation cords confusion.
		
		var6.mcServer.getConfigurationManager().transferPlayerToDimension(var6, 0, new TeleporterSoulForest(mServer.worldServerForDimension(1))); Why are you giving this server dimension id to you teleporter ?
 - 
	
		
		[SOLVED] KeyHandler crashed on ServerPacketHandler load
		
		public class ExoArmorPowerup { public static ExoServerTickHandler event; public static void sendPacket(EntityPlayer player) { ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream(); DataOutputStream dataOutputStream = new DataOutputStream( byteOutputStream); try { dataOutputStream.writeInt(player.entityId);//this info is unused when handling the packet ?? } catch (Exception e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload( ExoServerPacketHandler.ARMORPOWERUP, byteOutputStream.toByteArray()); FMLClientHandler.instance().sendPacket(packet); } public static void handlePacket(Packet250CustomPayload packet, EntityPlayer player) { // TODO Auto-generated method stub if (event.powerupIsAvailable == true) { player.worldObj.createExplosion(null, player.posX + 5, player.posY, player.posZ, 5.0F, false); player.worldObj.createExplosion(null, player.posX - 5, player.posY, player.posZ, 5.0F, false); player.worldObj.createExplosion(null, player.posX, player.posY, player.posZ + 5, 5.0F, false); player.worldObj.createExplosion(null, player.posX, player.posY, player.posZ - 5, 5.0F, false); event.powerupIsAvailable = false; } } } public class ExoServerKeyHandler extends KeyHandler { public static KeyBinding armorPowerup = new KeyBinding("Armor's Powerup", Keyboard.KEY_F); public static KeyBinding[] arrayOfKeys = new KeyBinding[] { armorPowerup }; public static boolean[] areRepeating = new boolean[] { false }; public ExoServerKeyHandler() { super(arrayOfKeys, areRepeating); } @Override public String getLabel() { return "ExotiumWorld's ServerKeyHandler"; } @Override public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { if(kb.keyCode == armorPowerup.keyCode) { if(tickEnd) { System.out.println("Key up"); ExoArmorPowerup.sendPacket(Minecraft.getMinecraft().thePlayer); } } } @Override public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) { } // FireModeHandler.switchFireMode(); @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.CLIENT); } }
 - 
	
		
		Electricity Mod
		
		It then sounds logical that the power increases each second. You should replace the power value if it is any different.
 - 
	
		
		[SOLVED] KeyHandler crashed on ServerPacketHandler load
		
		ServerKeyHandler doesn't really make sense as a name. Anyway, most errors are here: public class ExoArmorPowerup { public static ExoServerTickHandler event; public static EntityPlayer player; public static World world;// i don't see the initialization of this field, but it is useless anyway public static void sendPacket() { EntityPlayer player = Minecraft.getMinecraft().thePlayer;//This is client side only method, meaning player field is now client side only //prefer using this method in your keyhandler, and passing the argument in the method ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream(); DataOutputStream dataOutputStream = new DataOutputStream( byteOutputStream); try { dataOutputStream.writeInt(player.entityId);//this info is unused when handling the packet ?? } catch (Exception e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload( ExoServerPacketHandler.ARMORPOWERUP, byteOutputStream.toByteArray()); FMLClientHandler.instance().sendPacket(packet); } public static void handlePacket(Packet250CustomPayload packet, EntityPlayer player2) { // TODO Auto-generated method stub if (event.powerupIsAvailable == true) {//you are using client-only player field while being on server side -> crash //instead use the player argument from the method //prefer using player.worldObj instead of your world field world.createExplosion(null, player.posX + 5, player.posY, player.posZ, 5.0F, false); world.createExplosion(null, player.posX - 5, player.posY, player.posZ, 5.0F, false); world.createExplosion(null, player.posX, player.posY, player.posZ + 5, 5.0F, false); world.createExplosion(null, player.posX, player.posY, player.posZ - 5, 5.0F, false); event.powerupIsAvailable = false; } } }
 - 
	
		
		Block with Texture of another Block
		
		What do you mean with " a Block where you can put in another Block" ? Is there an inventory ?
 - 
	
		
		about Item.func_111206_d(String s)
		
		The error is making your item before the PreInit event. I edited the tutorial to fix this.
 - 
	
		
		Crazy Redstone Signal
		
		Your TickHandler uses World ticks, that is both client and server ones. Use the world instance instead of the ModLoader.etc shit. (with World ticks, the world instance is tickData[0]) AFAIK, you don't need your tickhandler. Simply override public void updateEntity() {} with your tick() method.
 - 
	
		
		Village Event
		
		Villages don't save the buildings, only the center. The system regularly check for doors to spawn villagers or golem.
 - 
	
		
		Help with telling if a swing is in progress
		
		You use a static call with EntityPlayerBase, while isSwingInProgress is instance dependent. You can use entity.causeDamage(args); //name of the method may not be accurate
 - 
	
		
		Using API's?
		
		I'll pretend you know a few things in Java. You can use the API directly like you would with any class, this is called a strong reference in Java. It means code will crash if an used part of the API isn't installed. ("Class not found exception"...you might have seen that already) You can have weak reference by using reflection. This a powerful tool to use, perfectly suited in your case. Well coded, new things will happen if an API is installed, but no crash on other situation. You can start learning reflection here: http://docs.oracle.com/javase/tutorial/reflect/ If you are unsure about it, you can start by using strong reference, and if you find the API easy to use and worth the effort, you can convert strong references to weak with reflection
 - 
	
		
		Hooking chat commands client-side on multiplayer
		
		You know, till we found an actual use for those "client-only commands" that can't be handled by a GUI, there is no need for them. The fact that you like chat command more than GUI is not really a valid argument by the way.
 - 
	
		
		[Solved] Trouble using RenderBlocks and a TileEntitySpecialRenderer
		
		Well, you don't have any texture bound, and the renderBlockByRenderType(args) do not use block argument to get the texture.
 - 
	
		
		Block texture not updating based on TileEntity variable
		
		world.markBlockForUpdate(x,y,z); will also send description packet.
 - 
	
		
		Using API's?
		
		You can do that using reflection. Remember to catch exceptions if API isn't installed.
 - 
	
		
		Block texture not updating based on TileEntity variable
		
		You can re-render the block by calling world.markBlockForUpdate(x,y,z); Get the dimension id with world.provider.dimensionId;
 
IPS spam blocked by CleanTalk.