public void removePlayerFromWhiteList(String name) { if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { safePlayers.remove(name); numSafePlayers--; } safePlayers.removeAll(Arrays.asList("", null)); ReikaChatHelper.write( name + " removed from " + placer + "'s " + this.getName() + " whitelist."); }
private final void drawRecipes() { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int posX = (width - xSize) / 2; int posY = (height - ySize) / 2; try { this.drawAuxData(posX, posY); } catch (Exception e) { ReikaChatHelper.write(Arrays.toString(e.getStackTrace())); e.printStackTrace(); } }
public void addPlayerToWhiteList(String name) { ReikaChatHelper.write( name + " added to " + placer + "'s whitelist for the\n" + this.getName() + " at " + xCoord + ", " + yCoord + ", " + zCoord + "."); if (name.equals(placer)) { ReikaChatHelper.write("Note: " + name + " is the owner;"); ReikaChatHelper.write( "They did not need to tell the " + this.getName() + " to not target them."); } if (FMLCommonHandler.instance().getEffectiveSide() != Side.SERVER) return; safePlayers.add(name); numSafePlayers++; }
@Override public boolean onItemUse( ItemStack is, EntityPlayer ep, World world, int x, int y, int z, int side, float a, float b, float c) { if (is.stackTagCompound == null) { is.setTagCompound(new NBTTagCompound()); is.stackTagCompound.setInteger("sx", Integer.MIN_VALUE); is.stackTagCompound.setInteger("sy", Integer.MIN_VALUE); is.stackTagCompound.setInteger("sz", Integer.MIN_VALUE); is.stackTagCompound.setInteger("ex", Integer.MIN_VALUE); is.stackTagCompound.setInteger("ey", Integer.MIN_VALUE); is.stackTagCompound.setInteger("ez", Integer.MIN_VALUE); } MovingObjectPosition mov = new MovingObjectPosition(x, y, z, side, ep.getLookVec()); if (!WorldEditHelper.hasPlayer(ep)) { ReikaChatHelper.write("Player " + ep.getEntityName() + " has no chosen block!"); return false; } int id = WorldEditHelper.getCommandedID(ep); int meta = WorldEditHelper.getCommandedMetadata(ep); if (id != 0) { if (id >= Block.blocksList.length || Block.blocksList[id] == null || Block.blocksList[id].getLocalizedName() == "") { ReikaChatHelper.write("Block " + id + " does not exist!"); return false; } } if (ep.isSneaking()) { is.stackTagCompound.setInteger("ex", mov.blockX); is.stackTagCompound.setInteger("ey", mov.blockY); is.stackTagCompound.setInteger("ez", mov.blockZ); ReikaChatHelper.write( "Position 2 set to " + is.stackTagCompound.getInteger("ex") + ", " + is.stackTagCompound.getInteger("ey") + ", " + is.stackTagCompound.getInteger("ez")); } else { is.stackTagCompound.setInteger("sx", mov.blockX); is.stackTagCompound.setInteger("sy", mov.blockY); is.stackTagCompound.setInteger("sz", mov.blockZ); ReikaChatHelper.write( "Position 1 set to " + is.stackTagCompound.getInteger("sx") + ", " + is.stackTagCompound.getInteger("sy") + ", " + is.stackTagCompound.getInteger("sz")); } is.setItemDamage(1); ep.setCurrentItemOrArmor(0, is); int[] s = { is.stackTagCompound.getInteger("sx"), is.stackTagCompound.getInteger("sy"), is.stackTagCompound.getInteger("sz") }; int[] e = { is.stackTagCompound.getInteger("ex"), is.stackTagCompound.getInteger("ey"), is.stackTagCompound.getInteger("ez") }; if (s[0] != Integer.MIN_VALUE && s[1] != Integer.MIN_VALUE && s[2] != Integer.MIN_VALUE) { if (e[0] != Integer.MIN_VALUE && e[1] != Integer.MIN_VALUE && e[2] != Integer.MIN_VALUE) { if (s[0] != e[0] || s[1] != e[1] || s[2] != e[2]) { String name; if (id == 0) name = "Air"; else name = Block.blocksList[id].getLocalizedName(); ReikaChatHelper.write( String.format( "%d", Math.abs((s[0] - e[0] + 1) * (s[1] - e[1] + 1) * (s[2] - e[2] + 1))) + " blocks being changed to Block " + name + " (ID " + id + ") with Metadata " + meta); for (int m = 0; m < 3; m++) { if (s[m] > e[m]) { int sc = s[m]; s[m] = e[m]; e[m] = sc; } } if (!world.isRemote) for (int i = s[0]; i <= e[0]; i += 1) { for (int j = s[1]; j <= e[1]; j += 1) { for (int k = s[2]; k <= e[2]; k += 1) { world.setBlock(i, j, k, id, meta, 3); world.markBlockForUpdate(i, j, k); } } } this.reset(is, ep); } } } return true; }