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.

TheDav1311

Members
  • Joined

  • Last visited

Everything posted by TheDav1311

  1. I try to handle it out by myself. And for the tutorial: That's the right link for the example: https://github.com/SlimeKnights/TinkersConstruct/tree/master/src/main/java/tconstruct/util/network/packet
  2. I registried the Netty Packet Handler now, but the example to Implementation not exist. How i can use it now?
  3. The only one that i found was this: http://www.minecraftforge.net/wiki/Packet_Handling and this is a little bit old.
  4. I want to have a Gui with a purchasing function I get the item but when i use it it delete itself Code: public class GuiTraitorMenu extends GuiScreen { private GuiButton teleporter = new GuiButton(0, 150 , 60, 100, 20, "Teleporter 2G"); private GuiButton fakemedipack = new GuiButton(1, 150 , 100, 100, 20, "explodierender Erste Hilfe Set 3G"); public GuiTraitorMenu () { super(); } @Override public void drawScreen(int x, int y, float f) { drawDefaultBackground(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(new ResourceLocation("minecrafttrouble:textures/gui/TraitorMenu.png")); drawTexturedModalRect((this.width - 256) / 2, (this.height - 256) *2, 0, 0, 256, 256); super.drawScreen(x, y, f); } @Override public void initGui() { this.buttonList.clear(); this.buttonList.add(teleporter); this.buttonList.add(fakemedipack); GoldCheck(); } public void actionPerformed(GuiButton button) { InventoryPlayer iv = this.mc.thePlayer.inventory; switch(button.id) { case 0: iv.addItemStackToInventory(new ItemStack(main.Teleporter)); iv.consumeInventoryItem(main.Gold);iv.consumeInventoryItem(main.Gold); GoldCheck(); case 1: iv.addItemStackToInventory(new ItemStack(main.FakeMediPack)); iv.consumeInventoryItem(main.Gold);iv.consumeInventoryItem(main.Gold);iv.consumeInventoryItem(main.Gold); GoldCheck(); break; default: } } @Override public boolean doesGuiPauseGame() { return false; } private boolean hasItemInt(Item item, int min) { InventoryPlayer iv = this.mc.thePlayer.inventory; int own = 0; for(int i = 0; i < iv.getSizeInventory(); i++) { if(iv.getStackInSlot(i) != null && iv.getStackInSlot(i).getItem() == item) { own = own + iv.getStackInSlot(i).stackSize; } } if(own >= min) { return true; } else { return false; } } private void GoldCheck() { if(hasItemInt(main.Muenze, 2)) { teleporter.enabled = true; } else { teleporter.enabled = false; } if(hasItemInt(main.Muenze, 3)) { fakemedipack.enabled = true; } else { fakemedipack.enabled = false; } } } Second Problem: if I max my Minecraft the Gui is normal but if it not about the whole screen it buggs the buttons are at the wrong position and i not see the whole Gui
  5. It works now: @SubscribeEvent public void entferneTodesNachricht(ClientChatReceivedEvent event) { if(event.message.getUnformattedText().contains("slain")) { event.setCanceled(true); } if(event.message.getUnformattedText().contains("cactus")) { event.setCanceled(true); } if(event.message.getUnformattedText().contains("drowned")) { event.setCanceled(true); } if(event.message.getUnformattedText().contains("blown")) { event.setCanceled(true); } if(event.message.getUnformattedText().contains("doomed")) { event.setCanceled(true); } if(event.message.getUnformattedText().contains("shot")) { event.setCanceled(true); } if(event.message.getUnformattedText().contains("burnt")) { event.setCanceled(true); } if(event.message.getUnformattedText().contains("fire")) { event.setCanceled(true); } if(event.message.getUnformattedText().contains("killed")) { event.setCanceled(true); } if(event.message.getUnformattedText().contains("escape")) { event.setCanceled(true); } if(event.message.getUnformattedText().contains("finished")) { event.setCanceled(true); } }
  6. I registered the EventHandler. @SubscribeEvent public void entferneTodesNachricht(ClientChatReceivedEvent event) { if(event.message.getUnformattedText().contains("slain")) { System.out.println("Hi"); } } This works but how i stop the message?
  7. I tried this but with no success @SubscribeEvent public void removeDeathMessage(ClientChatReceivedEvent event) { if(event.message.toString().contains("slain")) { System.out.println("Hi"); //Just to look if it works } }
  8. I don't want deathmessage in my mod like: Player157 was slain by Player84 Is there a way to deactivate them?
  9. My problem is that in the chat are always 2 different messages but i want only one In my eventhandler LivingDeathEvent Entity player = event.entity; int x = (int) event.entity.posX; int y = (int) event.entity.posY; int z = (int) event.entity.posZ; World world = event.entity.worldObj; if(player instanceof EntityPlayer) { world.setBlock(x, y, z, main.corpse); TileEntityCorpse te = (TileEntityCorpse)world.getTileEntity(x, y, z); te.setPlayer(((EntityPlayer) player).getCommandSenderName()); te.setTeam(((EntityPlayer) player).getTeam().getRegisteredName()); if(event.source.getEntity() instanceof EntityPlayer) te.setMurderer(event.source.getEntity().getCommandSenderName()); [...] } In the block class @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer Eplayer, int par6, float par7, float par8, float par9) { TileEntityCorpse te = (TileEntityCorpse )world.getTileEntity(x, y, z); String player = te.player; String team = te.team; Eplayer.addChatMessage(new ChatComponentTranslation(player + " was a " + team)); //System.out.println(player + " " + team + " " + te.murderer); return true; } In the TileEntity public String player; public String team; public String murderer; public TileEntityCorpse() { player = "Steve"; //Just fillers team = "Notch's Slaves"; mörder = "Herobrine"; } public void setPlayer(String player) { this.player = player; } public void setTeam(String team) { this.team = team; } public void setMurderer(String murderer) { this.murderer = murderer; } @Override public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); player = par1NBTTagCompound.getString("player"); team = par1NBTTagCompound.getString("team"); murderer = par1NBTTagCompound.getString("murderer"); } @Override public void writeToNBT(NBTTagCompound par1NBTTagCompound) { super.writeToNBT(par1NBTTagCompound); par1NBTTagCompound.setString("player", player); par1NBTTagCompound.setString("team", team); par1NBTTagCompound.setString(" murderer", murderer); } Chat output Steve was a Notch's Slaves Player135 was a traitor
  10. I want to save a String in a Block and then by activation that he return the String.
  11. My code looks now so: for(int j = 0; j < world.loadedTileEntityList.size(); j++) { TileEntity te = (TileEntity) world.loadedTileEntityList.get(j); } but I don't know how to change now the Inventory
  12. I start the round with a command : /startRound With all chest I mean all chests in the world. So, you can say fill all chests in the world with a command
  13. I want to have at a start of a round that all chest in the world get filled. But i have no idea how i should do this.
  14. My Solution now is this: for(int i = 0; i < world.playerEntities.size(); i++) { EntityPlayerMP playerMP = (EntityPlayerMP) world.playerEntities.get(i); world.getScoreboard().getTeam("ALPHA").getMembershipCollection().add(playerMP); } But after it they are not in the Team
  15. I want to get all player in one World and then put them into a team. It should look like with a "while" or a "for" EntityPlayer player = world. ......... ; world.getScoreboard().getTeam("BLABLA").getMembershipCollection().add(player); thx 4 help

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.