use of cpw.mods.fml.relauncher.SideOnly in project Engine by VoltzEngine-Project.
the class BlockTile method getIcon.
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) {
Tile tile = inject(access, x, y, z);
IIcon value = tile.getIcon(side, access.getBlockMetadata(x, y, z));
eject();
return value;
}
use of cpw.mods.fml.relauncher.SideOnly in project Engine by VoltzEngine-Project.
the class PlayerKeyHandler method mouseHandler.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void mouseHandler(MouseEvent e) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null) {
final Item item = stack.getItem();
if (item instanceof IModeItem.IModeScrollItem) {
if (player.isSneaking() && e.dwheel != 0) {
int newMode = ((IModeItem.IModeScrollItem) stack.getItem()).cycleMode(stack, player, e.dwheel / 120);
if (newMode != ((IModeItem.IModeScrollItem) stack.getItem()).getMode(stack)) {
Engine.instance.packetHandler.sendToServer(new PacketPlayerItemMode(player.inventory.currentItem, newMode));
}
e.setCanceled(true);
}
} else if (item instanceof IMouseButtonHandler && e.button != -1) {
Engine.instance.packetHandler.sendToServer(new PacketMouseClick(player.inventory.currentItem, e.button, e.buttonstate));
((IMouseButtonHandler) item).mouseClick(stack, player, e.button, e.buttonstate);
if (((IMouseButtonHandler) item).shouldCancelMouseEvent(stack, player, e.button, e.buttonstate)) {
e.setCanceled(true);
}
}
}
}
use of cpw.mods.fml.relauncher.SideOnly in project Engine by VoltzEngine-Project.
the class PacketBlast method decodeInto.
@Override
@SideOnly(Side.CLIENT)
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
type = BlastPacketType.values()[buffer.readInt()];
x = buffer.readDouble();
y = buffer.readDouble();
z = buffer.readDouble();
size = buffer.readDouble();
String id = ByteBufUtils.readUTF8String(buffer);
handler = ExplosiveRegistry.get(id);
if (handler == null) {
Engine.logger().error("Failed to load handler[" + id + "] from packet data");
}
NBTTagCompound save = ByteBufUtils.readTag(buffer);
blast = (Blast) handler.createBlastForTrigger(Minecraft.getMinecraft().theWorld, x, y, z, TriggerCauseRegistry.rebuild(save.getCompoundTag("trigger"), Minecraft.getMinecraft().theWorld), size, save.getCompoundTag("explosiveData"));
if (type == BlastPacketType.EDIT_DISPLAY) {
edit = new BlockEdit(save.getCompoundTag("edit"));
}
blast.readBytes(buffer);
}
use of cpw.mods.fml.relauncher.SideOnly in project Engine by VoltzEngine-Project.
the class ItemDevData method getSubItems.
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list) {
list.add(new ItemStack(item, 1, 0));
list.add(new ItemStack(item, 1, 1));
}
use of cpw.mods.fml.relauncher.SideOnly in project BetterStorage by copygirl.
the class ItemBucketSlime method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advancedTooltips) {
String id = getSlimeId(stack);
Handler handler = getHandler(id);
String name = StackUtils.get(stack, (String) null, "Slime", "name");
if ((name != null) || advancedTooltips)
list.add("Contains: " + ((name != null) ? ("\"" + name + "\"" + (advancedTooltips ? " (" + id + ")" : "")) : id));
NBTTagList effectList = (NBTTagList) StackUtils.getTag(stack, "Effects");
if ((effectList != null) && (handler != null)) {
int max = ((advancedTooltips || GuiScreen.isShiftKeyDown()) ? 6 : 3);
for (int i = 0; i < Math.min(effectList.tagCount(), max); i++) {
PotionEffect effect = PotionEffect.readCustomPotionEffectFromNBT(effectList.getCompoundTagAt(i));
Potion potion = Potion.potionTypes[effect.getPotionID()];
int duration = (int) (effect.getDuration() * handler.durationMultiplier());
StringBuilder str = new StringBuilder().append(potion.isBadEffect() ? EnumChatFormatting.RED : EnumChatFormatting.GRAY).append(StatCollector.translateToLocal(effect.getEffectName()));
if (effect.getAmplifier() > 0)
str.append(" ").append(StatCollector.translateToLocal("potion.potency." + effect.getAmplifier()));
str.append(" (").append(StringUtils.ticksToElapsedTime(duration)).append(")");
list.add(str.toString());
}
int more = (effectList.tagCount() - max);
if (more > 0)
list.add(EnumChatFormatting.DARK_GRAY.toString() + EnumChatFormatting.ITALIC + LanguageUtils.translateTooltip("bucketSlime.more." + ((more == 1) ? "1" : "x"), "%X%", Integer.toString(more)));
}
}
Aggregations