Everything posted by FLUFFY2
- 
	
		
		NoSuchMethod, NoSuchField, servside Modding
		
		First of all: Do not make mod under 1.7.2! Its unsupported and outdated! Where is your CommonProxy and ClientProxy anyway? You have to have them even if you don't need them!
 - 
	
		
		[1.6.4] Forge not downloading
		
		Yeah jsut like 8 mounths old. 1.7.2 is pretty stable, 1.7.10 isn't that stable. You don't have to update to 1.6 and than 1.7. But from 1.5 to 1.7 its gonna be tough one.
 - 
	
		
		[1.7.2] world.spawnParticles does not work :(
		
		Just a question. Why do you using player.worldObj if onItemRightClick contains World? Also for motion use 0.0D for testing!
 - 
	
		
		[1.6.4] Forge not downloading
		
		1.6.4 is unsupported and realy outdated. You better get back into modding by learning the new 1.7.10 Forge.
 - 
	
		
		[1.7.2]ItemStact instanceof ItemFood Crash[SOLVED]
		
		You created an int that equals the item max use duration and than its equals 16. Also crash log can be useful in SPOILER TAG!
 - 
	
		
		[1.7.10] onItemInteractionForEntity problem
		
		Oh so probably tim what others told you is from 1.6.4. There is realy a method what Kimeriderf said. Sorry for my mistake!
 - 
	
		
		[1.7.10] onItemInteractionForEntity problem
		
		Here is a tutorial for event handler: http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-1-7-2-1-6-4-eventhandler-and
 - 
	
		
		[1.7.10] onItemInteractionForEntity problem
		
		Oh i slipped that line: onItemInteractionForEntity() Where did you get that? There is no such method like this in Item.class. If you want to do stuff with right click on entity use EntityInteractEvent!
 - 
	
		
		Right Clicking Water
		
		MoxEmerald, the code should be in neither of them!
 - 
	
		
		[1.7.10] onItemInteractionForEntity problem
		
		EntityLiving instance of EntityLiving???
 - 
	
		
		[1.7.2] Bow with Multiple Arrows?
		
		Why dont you just duplicate the line? It will spawn two arrow than.
 - 
	
		
		Need Help with key input!
		
		If you want to play sounds only for you than client side is fine. Just use world.playSound() If you want to play the sound so everyone can hear it you need that packet handler. Than just use world.playSoundAtEntity(). Glad i can help you!
 - 
	
		
		Need Help with key input!
		
		Key inputs are client side only! Try to use if(world.isRemote) above isKeyPressed(). This will ensure that code is only running client side.(It will not crash server side) Then you have to send a packet to inform the server about you pressed the button and do other things you want. For pakets i recommend you Diesieben tut. Its kinda easy! You can find it in the Modder Support top page(Tutorials sticker). Good luck!
 - 
	
		
		[1.7.2] Problem with setting Item CreativeTab 
		
		Where are you registering your tab? Also where are you set the ID of your tab? You should make a class for your tab not just in your main class. Can we see your posInit please?
 - 
	
		
		SLOVED[1.7.10]Player Y pos problem
		
		Thank you now it works!
 - 
	
		
		SLOVED[1.7.10]Player Y pos problem
		
		Im getting this data client side. Are you trying to say i have to use: if(!world.isRemote)?
 - 
	
		
		SLOVED[1.7.10]Player Y pos problem
		
		Okey, but there is a way around it? I don't want to wait till 1.8 Forge comes. Thanks!
 - 
	
		
		SLOVED[1.7.10]Player Y pos problem
		
		Hello everyone, Its just a simple problem, but i can't slove that. I want to get the player.posY, but it bugged out. Code: int playerPosY = (int) Math.floor(player.posY); I know doubles to ints are bad idea, but with Math.floor its working. BUT my Y pos changes between my feet and eye Y pos. If Y equals 63 and Feet equals 64 and print them out is shows 63,64,63,64.... I want only 63, so how can i fix that? Also if im not useing Math.floor(i know i have to) its still jumping between 2 Y pos. Thanks!
 - 
	
		
		Dropping an Item for the Entity 
		
		I would recomend you to check out the EntityVillager class. It has the method if you right click on them a gui opens up. Change it to spawn an item to the world or player and you are good to go.
 - 
	
		
		[1.7.2]Packet Leaking Help
		
		Lex told me you can use Netty as long as you use the proper chennels provided by Forge. If you don't understand the above you have to use diesieben tutorial.
 - 
	
		
		[1.7.10]Getting world in packethandler.
		
		Sorry if you can't understand me, but English is not my main language. I know i can get the pos and the Item on client. I need to send pakets only to create the light source. If im create the light client side the server won't have knowlage about the it and others can't see it. I just can't understand why EnumSkyBlock.Block refuses to change its LightValue server side.
 - 
	
		
		Plants
		
		You should look around in the vanilla code. Good place to start is: ItemSeed.class ItemSeedFood.class There are mayebe some hooks provided by Forge you can use, but i don't know that for sure.
 - 
	
		
		[1.7.10]Getting world in packethandler.
		
		So, the problem is found, but i can't fix it: world.setLightValue(EnumSkyBlock.Block, message.x , message.y, message.z, Amnesia.instance.getLanternLightValue()); Its simply not working if i getting the server world. If i get client world it works, but we all know i need server world if i want an universal mod. Can someone help me or explain why is that? Thanks!
 - 
	
		
		[1.7.10]Getting world in packethandler.
		
		Okey thats even wierder. I tryed some debuging and everything went fine. Stone is placed get the right world time and pos. What diesieben said true but not in my case. I disabled my updateLight method so only the .setLightValue stays there. And its not creating the light. ITS WORKED BEFORE! I not want to create a ligh block and update that because it can replace blocks. It has to be EnumSkyBlock.Block. So its not the .worldObj, but my .setLightValue. I have to figure a way around that. Thanks for the help everyone!
 - 
	
		
		[1.7.10]Getting world in packethandler.
		
		Okey here you go: TickHandler(just the important part) [spoiler] WorldClient world = mc.theWorld; if (mc.thePlayer.inventory.getCurrentItem() != null && mc.thePlayer.inventory.getCurrentItem().getItem() == Amnesia.lanternonItem) { int playerPosX = (int) Math.floor(mc.thePlayer.posX); int playerPosY = (int) Math.floor(mc.thePlayer.posY); int playerPosZ = (int) Math.floor(mc.thePlayer.posZ); if (playerPosX != this.lastPlayerX || playerPosY != this.lastPlayerY || playerPosZ != this.lastPlayerZ) { Amnesia.snw.sendToServer(new Light1MessageHandler(playerPosX, playerPosY, playerPosZ, lastPlayerX, lastPlayerY, lastPlayerZ)); this.lastPlayerX = playerPosX; this.lastPlayerY = playerPosY; this.lastPlayerZ = playerPosZ; } if(!lanternEquipped) this.lanternEquipped = true; }else if (mc.thePlayer.inventory.getCurrentItem() != null && mc.thePlayer.inventory.getCurrentItem().getItem() != Amnesia.lanternonItem || mc.thePlayer.inventory.getCurrentItem() == null){ if(lanternEquipped){ Amnesia.snw.sendToServer(new DarkMessageHandler(lastPlayerX, lastPlayerY, lastPlayerZ)); //NOT IMPORTANT FOR THIS PROBLEM this.lastPlayerX = 0; this.lastPlayerY = 0; this.lastPlayerZ = 0; this.lanternEquipped = false; } } [/spoiler] Light1MessageHandler: [spoiler] package com.fluffy.amnesia.pakets; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; import com.fluffy.amnesia.Amnesia; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; public class Light1MessageHandler implements IMessage, IMessageHandler<Light1MessageHandler, IMessage> { int x; int y; int z; int oldX; int oldY; int oldZ; public Light1MessageHandler() { } public Light1MessageHandler(int x, int y, int z, int oldX, int oldY, int oldZ) { this.x = x; this.y = y; this.z = z; this.oldX = oldX; this.oldY = oldY; this.oldZ = oldZ; } @Override public void toBytes(ByteBuf buf) { buf.writeInt(this.x); buf.writeInt(this.y); buf.writeInt(this.z); buf.writeInt(this.oldX); buf.writeInt(this.oldY); buf.writeInt(this.oldZ); } @Override public void fromBytes(ByteBuf buf) { this.x = buf.readInt(); this.y = buf.readInt(); this.z = buf.readInt(); this.oldX = buf.readInt(); this.oldY = buf.readInt(); this.oldZ = buf.readInt(); } @Override public IMessage onMessage(Light1MessageHandler message, MessageContext ctx) { EntityPlayer player = ctx.getServerHandler().playerEntity; World world = ctx.getServerHandler().playerEntity.worldObj; world.setLightValue(EnumSkyBlock.Block, message.x , message.y, message.z, Amnesia.instance.getLanternLightValue()); updateLight(world, message); return null; } public void updateLight(World world, Light1MessageHandler message){ //Middle world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y + 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y - 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y, message.z - 1); //Side world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y + 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y - 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y + 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y - 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y + 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y - 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y + 1, message.z - 1); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y - 1, message.z - 1); //Corner world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y + 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y - 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y + 1, message.z - 1); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y - 1, message.z - 1); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y + 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y - 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y + 1, message.z - 1); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y - 1, message.z - 1); //Middle-Side world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y, message.z - 1); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y, message.z - 1); } } [/spoiler] Registration(preInt): snw = NetworkRegistry.INSTANCE.newSimpleChannel("Amnesia"); snw.registerMessage(Light1MessageHandler.class, Light1MessageHandler.class, 3, Side.SERVER); [code]
 
IPS spam blocked by CleanTalk.