use of net.minecraft.client.Minecraft in project malmo by Microsoft.
the class AuthenticationHelper method setSession.
private static boolean setSession(Session newSession) {
// Are we in the dev environment or deployed?
boolean devEnv = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
// We need to know, because the member name will either be obfuscated or not.
String sessionMemberName = devEnv ? "session" : "field_71449_j";
// NOTE: obfuscated name may need updating if Forge changes - search for "session" in Malmo\Minecraft\build\tasklogs\retromapSources.log
Field session;
try {
session = Minecraft.class.getDeclaredField(sessionMemberName);
session.setAccessible(true);
session.set(Minecraft.getMinecraft(), newSession);
return true;
} catch (SecurityException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
return false;
}
use of net.minecraft.client.Minecraft in project PneumaticCraft by MineMaarten.
the class GuiHelmetMainScreen method init.
public static void init() {
instance = new GuiHelmetMainScreen();
Minecraft minecraft = FMLClientHandler.instance().getClient();
ScaledResolution scaledresolution = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
int width = scaledresolution.getScaledWidth();
int height = scaledresolution.getScaledHeight();
instance.setWorldAndResolution(minecraft, width, height);
for (int i = 1; i < instance.upgradePages.size(); i++) {
page = i;
instance.initGui();
}
page = 0;
instance.init = false;
}
use of net.minecraft.client.Minecraft in project PneumaticCraft by MineMaarten.
the class SearchUpgradeHandler method getAnimatedStat.
@Override
@SideOnly(Side.CLIENT)
public GuiAnimatedStat getAnimatedStat() {
if (searchInfo == null) {
Minecraft minecraft = Minecraft.getMinecraft();
ScaledResolution sr = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
searchInfo = new GuiAnimatedStat(null, "Currently searching for:", new ItemStack(Itemss.machineUpgrade, 1, ItemMachineUpgrade.UPGRADE_SEARCH_DAMAGE), statX != -1 ? statX : sr.getScaledWidth() - 2, statY, 0x3000AA00, null, statLeftSided);
searchInfo.setMinDimensionsAndReset(0, 0);
}
return searchInfo;
}
use of net.minecraft.client.Minecraft in project PneumaticCraft by MineMaarten.
the class BlockTrackUpgradeHandler method getAnimatedStat.
@Override
public GuiAnimatedStat getAnimatedStat() {
if (blockTrackInfo == null) {
Minecraft minecraft = Minecraft.getMinecraft();
ScaledResolution sr = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
blockTrackInfo = new GuiAnimatedStat(null, "Current tracked blocks:", new ItemStack(Itemss.machineUpgrade, 1, ItemMachineUpgrade.UPGRADE_BLOCK_TRACKER), statX != -1 ? statX : sr.getScaledWidth() - 2, statY, 0x3000AA00, null, statLeftSided);
blockTrackInfo.setMinDimensionsAndReset(0, 0);
}
return blockTrackInfo;
}
use of net.minecraft.client.Minecraft in project PneumaticCraft by MineMaarten.
the class EntityTrackUpgradeHandler method getAnimatedStat.
@Override
@SideOnly(Side.CLIENT)
public GuiAnimatedStat getAnimatedStat() {
if (entityTrackInfo == null) {
Minecraft minecraft = Minecraft.getMinecraft();
ScaledResolution sr = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
entityTrackInfo = new GuiAnimatedStat(null, "Current tracked entities:", new ItemStack(Itemss.machineUpgrade, 1, ItemMachineUpgrade.UPGRADE_ENTITY_TRACKER), statX != -1 ? statX : sr.getScaledWidth() - 2, statY, 0x3000AA00, null, statLeftSided);
entityTrackInfo.setMinDimensionsAndReset(0, 0);
}
return entityTrackInfo;
}
Aggregations