use of mcjty.lib.preferences.PreferencesProperties in project RFTools by McJty.
the class RenderGameOverlayEventHandler method renderBuffs.
private static void renderBuffs() {
if (buffs == null || buffs.isEmpty()) {
return;
}
EntityPlayerSP player = Minecraft.getMinecraft().player;
PreferencesProperties preferences = McJtyLib.getPreferencesProperties(player);
int x = preferences.getBuffX();
int y = preferences.getBuffY();
if (x == -1 || y == -1) {
return;
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
for (PlayerBuff buff : buffs) {
Item item = getBuffItem(buff);
if (item != null) {
RenderItem itemRender = Minecraft.getMinecraft().getRenderItem();
RenderHelper.renderItemStack(Minecraft.getMinecraft(), itemRender, new ItemStack(item), x, y, "", false);
// itemRender.renderItem(new ItemStack(item), player, ItemCameraTransforms.TransformType.FIXED, true);
x += BUFF_ICON_SIZE;
}
}
}
use of mcjty.lib.preferences.PreferencesProperties in project RFTools by McJty.
the class CmdReset method execute.
@Override
public void execute(ICommandSender sender, String[] args) {
if (args.length > 1) {
ITextComponent component = new TextComponentString(TextFormatting.RED + "Too many parameters!");
if (sender instanceof EntityPlayer) {
((EntityPlayer) sender).sendStatusMessage(component, false);
} else {
sender.sendMessage(component);
}
return;
}
if (!(sender instanceof EntityPlayer)) {
ITextComponent component = new TextComponentString(TextFormatting.RED + "This command only works as a player!");
if (sender instanceof EntityPlayer) {
((EntityPlayer) sender).sendStatusMessage(component, false);
} else {
sender.sendMessage(component);
}
return;
}
EntityPlayer player = (EntityPlayer) sender;
PreferencesProperties preferencesProperties = McJtyLib.getPreferencesProperties(player);
if (preferencesProperties != null) {
preferencesProperties.reset();
}
}
use of mcjty.lib.preferences.PreferencesProperties in project RFTools by McJty.
the class CmdSetBuffBar method execute.
@Override
public void execute(ICommandSender sender, String[] args) {
if (args.length > 3) {
ITextComponent component = new TextComponentString(TextFormatting.RED + "Too many parameters!");
if (sender instanceof EntityPlayer) {
((EntityPlayer) sender).sendStatusMessage(component, false);
} else {
sender.sendMessage(component);
}
return;
}
if (!(sender instanceof EntityPlayer)) {
ITextComponent component = new TextComponentString(TextFormatting.RED + "This command only works as a player!");
if (sender instanceof EntityPlayer) {
((EntityPlayer) sender).sendStatusMessage(component, false);
} else {
sender.sendMessage(component);
}
return;
}
EntityPlayer player = (EntityPlayer) sender;
PreferencesProperties properties = McJtyLib.getPreferencesProperties(player);
if (args.length < 3) {
int buffX = properties.getBuffX();
int buffY = properties.getBuffY();
ITextComponent component = new TextComponentString(TextFormatting.YELLOW + "Current buffbar location: " + buffX + "," + buffY);
if (sender instanceof EntityPlayer) {
((EntityPlayer) sender).sendStatusMessage(component, false);
} else {
sender.sendMessage(component);
}
return;
}
int x = fetchInt(sender, args, 1, 0);
int y = fetchInt(sender, args, 2, 0);
properties.setBuffXY(x, y);
}
use of mcjty.lib.preferences.PreferencesProperties in project RFTools by McJty.
the class CmdSetStyle method execute.
@Override
public void execute(ICommandSender sender, String[] args) {
if (args.length > 2) {
ITextComponent component = new TextComponentString(TextFormatting.RED + "Too many parameters!");
if (sender instanceof EntityPlayer) {
((EntityPlayer) sender).sendStatusMessage(component, false);
} else {
sender.sendMessage(component);
}
return;
}
if (!(sender instanceof EntityPlayer)) {
ITextComponent component = new TextComponentString(TextFormatting.RED + "This command only works as a player!");
if (sender instanceof EntityPlayer) {
((EntityPlayer) sender).sendStatusMessage(component, false);
} else {
sender.sendMessage(component);
}
return;
}
EntityPlayer player = (EntityPlayer) sender;
PreferencesProperties properties = McJtyLib.getPreferencesProperties(player);
if (args.length < 2) {
GuiStyle style = properties.getStyle();
ITextComponent component = new TextComponentString(TextFormatting.YELLOW + "Current GUI style: " + style.getStyle());
if (sender instanceof EntityPlayer) {
((EntityPlayer) sender).sendStatusMessage(component, false);
} else {
sender.sendMessage(component);
}
return;
}
String s = fetchString(sender, args, 1, "");
boolean b = properties.setStyle(s);
if (!b) {
String buf = "";
for (GuiStyle style : GuiStyle.values()) {
buf = buf + " " + style.getStyle();
}
ITextComponent component = new TextComponentString(TextFormatting.RED + "Unknown style! Options:" + buf);
if (sender instanceof EntityPlayer) {
((EntityPlayer) sender).sendStatusMessage(component, false);
} else {
sender.sendMessage(component);
}
}
}
Aggregations