Jump to content

FLUFFY2

Forge Modder
  • Posts

    424
  • Joined

  • Last visited

Everything posted by FLUFFY2

  1. Yeah right, but then you should not use "==". Use >= instead.
  2. if(par1ItemStack.getItemDamage() == par1ItemStack.getMaxDamage() - 1){ //Replace item } This should do the trick.
  3. You can try to check if the sword is about to break(only 1 damage left to break) change the item. Probably in onUpdate() method. I think you cannot check if its breaks or hits 0. Although im not sure.
  4. Okay im not sure which one gonna work for you so try both of them. The first one is side checking via world.isRemote Its returns false if its a server world and true if its client world. You can try to check if its the server world so its only do what you want once on the server. The second one is by event.phase checking. An example: if(event.phase == Phase.END){ //Do stuff }
  5. Still not working on a server. This can help i think: Client Proxy: @Override public void openKeyGui(EntityPlayer player, int x, int y, int z, int i1){ Minecraft.getMinecraft().displayGuiScreen(new KeyGui(player, x, y, z, i1)); } Server Proxy: public void openKeyGui(EntityPlayer player, int x, int y, int z, int i1){ } I call it like so: Amnesia.proxy.openKeyGui(entityplayer, x, y, z, i1); Without any kind of world checking. Amnesia.proxy is my ServerProxy! So on client side it works. On a dedicated server it only runs the method in my ServerProxy. Thats why i think i need pakets, but i just want to ask it first.
  6. Sorry for bunping this back up, but its looks like the proxy GUI open is broken if i play on a dedicated server. My question is do i realy have to send a packet to the player who is opened the GUI from my ServerProxy? Thanks!
  7. I just left it there by accident. The packet sending did the trick so thank you diesieben.
  8. Hello there! It might be a bug that Forge has nothing to do with. Its actually two bug. Both of them is mob related(Especially EntityMob). First of all mobs don't update their FOV when they are standing and "wandering" around. As soon as they move it updates. The last one is they lost their player chasing path. For example a creeper is chasing me and i make a 180 turn its continue to walk away from me. Then its realises he going the wrong way and starts to follow me again. Its a big problem for mobs who's are walking realy fast.(Like my mob). They walk away realy far than come back to me. It reminds me another problem that sometimes they lost their interest of me. Like it chase me than it goes away from me than start to chase me again. Sometimes they don't even come back after they leave me. Again its a big problem for fast mobs only. Thanks for reading that!
  9. Everything is based on the MovingSoundMinecart except i changed TileEntity to EntityPlayer. Here is my code so you can understand it: http://pastebin.com/Paxp1jfz Its not a problem, this is how i want it to work. The problem is others can't hear that sounds. I playing sounds like so: ISound start = new PatronusSoundEvent("patronus:PatronusStart", mc.thePlayer, 1.0F, 1.0F); Minecraft.getMinecraft().getSoundHandler().playSound(start);
  10. The sounds plays from the player when he holds down the right mouse button if an item is held. I want to use onUpdate() but i cant play client sounds on it what is understandable. I don't want to play the sound every time and my sounds its already working based on the MovingSoundsMinecart. Except the sound is connected to the player. I playing my sounds with Minecraft.getMinecraft().getSoundHandler.playSound(sound) tight now client side. I can't realy know other ways to do it, but others cant hear the sounds. With pakets it can cause lag? I it nessecaryt to use them? Thanks.
  11. I can't use them because they play the sound at a given pos. My sounds follows the player. I have looked up how minecart does it but i cant find the method where its playing its sounds.
  12. Hi there! I finally able to set up a moving sound effect that follows the player and stops when i want it. But it can be only heard by the player who created the sound. How can i make my sound for others to hear it? Sounds are played in a CLIENT tick handler right now. Thanks!
  13. In your IDE go to Referenced Libraries>forgeSrc>net,minecraft.item>Item.class There you can see every method you can imagine with some additional info. The starting line is "public". Joking aside you can use CTRL + F to search the class so you can find everything a lot easier. Hope i helped
  14. The best way to understadn and learn is to look up Item.class. It has all the methods and info you are looking for. For the color part you can use EnumChatFormatting.ANYCOLOR. An example: EnumChatFormatting.GREEN+"This is green"+EnumChatFormatting.RED+"This will be red". You can use EnumChatFormatting.RESET to break the color any further.
  15. Are you sure there is no mods? It looks like to me you installed The Aether mod. What is for 1.7.3 and not 1.7.10! But you also need PlayerAPI for that mod.
  16. Thank you very much for helping me. Its works like a dream. If i have more free time i will write a program that press [apploud] every hour under your name.
  17. Derp... Thanks you for everything. Mind if i ask a last question? How to use String in IMessageHandler? I found StringBuffer, but how can i put that in my packet? There is only toBytes and fromBytes and there is no toString and fromString.
  18. Okey now i fixed the problems with NBT's and the door. But my item is looses its data. I set its data via(client&server): Key.setKeyName(player.getCurrentEquippedItem(), "Test"); Key.setConsume(player.getCurrentEquippedItem(), message.consume); Key.setEffect(player.getCurrentEquippedItem(), true); Key class: http://pastebin.com/AuL6KFtC I can see the effect set for like 0.1sec. Thanks.
  19. Okey so its not realy want to work. I will post my code a bit later when i'm sure i didn't derp. Also can you tell me why is that refuse to work? if (i.hasTagCompound() && i.getTagCompound().hasKey("HasEffect")) Even if i do something like: "tag.setBoolean("HasEffect", false);" its still not pass the if statement, but it has "HasEffect". Thanks!
  20. Open gui -> send data to server -> send data to client for update. I thought its a simple way, but if its more than what i needed ,i will try something else.
  21. Thank you! The "call through proxy" method slove my crash. For the a), b) i can use return packet to the client, right?
  22. If you are trying to make crops that grows and places a block you shouldn't "manipulate" vanilla code. In fact, never change the vanilla code unless you are know what you are doing. Look around at those classes for more help: ItemSeeds BlocksStem BlockMelon/Pumpkin They should have all the info inside them. Just and advice: Don't copy/paste the code try to understand it. It realy helps. Hope you can do what you want!
  23. I mayebe found out the problem, but i can't find a way around it. Im basically opening my GUI in .onBlockActivated() with this: Minecraft.getMinecraft().displayGuiScreen(new KeyGui(entityplayer, x, y, z, i1)); Now if i open up a server it crases because Gui is client side only. If i use: entityplayer.openGui(Amnesia.instance, 21, x, y, z); It works, but i need some data for the gui and with this method i don't know how to send it. Can somebody tell me how to open a GUI with custom data properly? I can't realy find any method other than the "Minecraft.getMinecraft()" one. Thanks!
  24. I just changed the client player to server in my packet. ctx.getServerHandler().playerEntity. But here you go: http://pastebin.com/RNDT76ib
  25. Sorry i say it in a wrong way. (Englis is not my main lang) Its still not working with the server world.
×
×
  • Create New...

Important Information

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