Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FLUFFY2

Forge Modder
  • Joined

  • Last visited

Everything posted by FLUFFY2

  1. 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!
  2. 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.
  3. Just a question. Why do you using player.worldObj if onItemRightClick contains World? Also for motion use 0.0D for testing!
  4. 1.6.4 is unsupported and realy outdated. You better get back into modding by learning the new 1.7.10 Forge.
  5. 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!
  6. 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!
  7. 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
  8. 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!
  9. MoxEmerald, the code should be in neither of them!
  10. EntityLiving instance of EntityLiving???
  11. Why dont you just duplicate the line? It will spawn two arrow than.
  12. 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!
  13. 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!
  14. 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?
  15. Thank you now it works!
  16. Im getting this data client side. Are you trying to say i have to use: if(!world.isRemote)?
  17. Okey, but there is a way around it? I don't want to wait till 1.8 Forge comes. Thanks!
  18. 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!
  19. 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.
  20. 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.
  21. 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.
  22. 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.
  23. 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!
  24. 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!
  25. 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]

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.