Jump to content

DoctorBooooom

Members
  • Posts

    22
  • Joined

  • Last visited

Everything posted by DoctorBooooom

  1. Can you write example or post link?
  2. Is there a way to execute code asynchronously? For example I need to make a request in MySQL. Something like this: public static void execute(final String query) { Bukkit.getScheduler().runTaskAsynchronously(Main.plugin, new Runnable() { @Override public void run() { if (!hasConnected()) { connect(); } Logger.debug("Sended Query: " + query.replace("\\", "\\\\")); try { connection.createStatement().execute(query); } catch (Exception e) { Logger.debug("Возникла ошибка. Запрос не может быть выполнен или база недоступна."); } } }); }
  3. I have class, which extend GuiScreen, i'm trying override mouseClicked, but nothing happens @Override protected void mouseClicked(int i, int j, int k) { System.out.println("Clicked!"); if ((k != 0) || (this.hover < 0)) return; if (this.multipleSelection) { if (this.selectedList.contains(this.list.get(this.hover))) this.selectedList.remove(this.list.get(this.hover)); else this.selectedList.add(this.list.get(this.hover)); } else { if (this.hover >= 0) this.selected = this.hover; this.hover = -1; } }
  4. I want to send a string (eg player name) through the netty, however, the method writeString() and readString() do not exist. How i can do this? And how i get EntityPlayer which send the packet? package ru.DoctorBooooom.LastWorld.network.packet; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; public class Packet extends APacket { @Override public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { buffer.writeString("PlayerName"); } @Override public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { String name = buffer.readString(); } @Override public void handleClientSide(EntityPlayer player) { } @Override public void handleServerSide(EntityPlayer player) { } }
  5. @SubscribeEvent public void onEntityGetDamage(LivingHurtEvent event) { String type = event.source.damageType; if (type.equals("cactus")) { event.entityLiving.setHealth(event.entityLiving.getHealth() - 100500); } } Also, you can check the entityLiving is a player
  6. okay, it works fine, but there are ideas how to remove the mesh around the block?
  7. Something like this http://pastebin.com/hKyAgBwP ? And further check on the server when you try to break the block?
  8. But how do I get a block simultaneously exist and not exist? And if two players stand next to it and one can see it, the second should not see it. It's like magic points in taumсraft
  9. I put a block. if I'm creative mode (or put on a helmet for example), then I see him and I can break / change. If not, the block is not displayed and I can't see him / break / step
  10. How create block, that visible only for players in creative mod?
  11. entityPlayer.addChatMessage(new ChatComponentTranslation("msg.message_name.txt")); You need to create a language file (make sure its UTF-8 encoded) assets/<modID>/lang/<langID>.lang Example File: en_US.lang msg.message_name.txt=Displayed Message
  12. I created a wild boar (https://www.dropbox.com/s/ly87tofi7m0zo9u/2014-02-16_17.31.16.png), but he has no animation: he does not look at the players around, when attacking crashed with a run. I would like that he would sometimes dug the ground head and react to players. How to do it? EntityBoar class: http://pastebin.com/r7LTdGkT EntityBoar renderer: http://pastebin.com/eQqNbCS5 EntityBoar model: http://pastebin.com/BwHDisXT
  13. As it turned out, writes NBT date correctly. However reads not correctly. Probably a mistake in NBTTagList nbtListStats = nbtPlayer.getTagList("Stats", 9); , because there was no 1.6.4 2nd parameter, and now I have taken it at random.
  14. myblock= new BlockClass().setStepSound(Block.soundTypeWood).setHardness(1.0F).setBlockTextureName("mymod:myblock").setBlockName("myblock"); GameRegistry.registerBlock(myblock,"MyBlock");
  15. I wrote a mod that creates a system of levels, but it does not properly retains NBT data I go to the game, I Level 5 (https://www.dropbox.com/s/ahsy2bqqai7uvb5/2014-02-15_14.52.11.png) I used the command to get XP, and my level is a 19 (https://www.dropbox.com/s/yb6h6z91nv12o2u/2014-02-15_14.52.25.png) Relogin and... failure! my level is not 19, only 6! (https://www.dropbox.com/s/ms49a7a489jgf5b/2014-02-15_14.52.34.png) this is my code: a class that includes the login and logout events - http://pastebin.com/g7dXxHCa DataPlayer, which contains details of the player, and some methods - http://pastebin.com/B9PD2J5k And method from StatsUtil that check exp and call levelUp if need. http://pastebin.com/j8uxui2D
  16. In minecraft 1.6 i have this code: http://pastebin.com/XbsgnjfW How i can realise it on minecraft 1.7? I found method onBlockDestroyedByPlayer, but there no player param. And second question: i wrote all text messages in code... how i must move them in lang file?
  17. I want take away control from player, to get him going around (like fear magic in World of Warcraft). How i can do that? P.S. Sorry for my bad english
×
×
  • Create New...

Important Information

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