Skip to content

Commit

Permalink
Update for Forge 12.16.0.1805
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Mar 24, 2016
1 parent 4167ad8 commit e19734c
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 29 deletions.
8 changes: 8 additions & 0 deletions changelog.html
@@ -1,3 +1,11 @@
<h2>3.1.0</h2>
<h4>Features:</h4>
<ul>
<li>Update for latest Forge 12.16.0.1805.</li>
</ul>
<br/>
<hr/>

<h2>3.0.6</h2>
<h4>Features:</h4>
<ul>
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
@@ -1,8 +1,8 @@
mcversion=1.9
forgeversion=12.16.0.1770-1.9
forgeversion=12.16.0.1805-1.9
mcp_mappings=snapshot_20160319
curse_project_id=238222

version_major=3
version_minor=0
version_patch=6
version_minor=1
version_patch=0
30 changes: 17 additions & 13 deletions src/main/java/mezz/jei/GuiEventHandler.java
Expand Up @@ -40,8 +40,9 @@ public void onGuiInit(@Nonnull GuiScreenEvent.InitGuiEvent.Post event) {
return;
}

if (event.gui instanceof GuiContainer) {
GuiContainer guiContainer = (GuiContainer) event.gui;
GuiScreen gui = event.getGui();
if (gui instanceof GuiContainer) {
GuiContainer guiContainer = (GuiContainer) gui;
itemListOverlay.initGui(guiContainer);

RecipesGui recipesGui = new RecipesGui();
Expand All @@ -55,15 +56,16 @@ public void onGuiOpen(@Nonnull GuiOpenEvent event) {
return;
}

if (event.gui instanceof GuiContainer) {
GuiContainer guiContainer = (GuiContainer) event.gui;
GuiScreen gui = event.getGui();
if (gui instanceof GuiContainer) {
GuiContainer guiContainer = (GuiContainer) gui;
if (previousGui != guiContainer) {
previousGui = guiContainer;
if (itemListOverlay.isOpen()) {
itemListOverlay.close();
}
}
} else if (!(event.gui instanceof RecipesGui)) {
} else if (!(gui instanceof RecipesGui)) {
if (itemListOverlay.isOpen()) {
itemListOverlay.close();
}
Expand All @@ -73,8 +75,9 @@ public void onGuiOpen(@Nonnull GuiOpenEvent event) {
@SubscribeEvent
public void onDrawBackgroundEventPost(@Nonnull GuiScreenEvent.BackgroundDrawnEvent event) {
if (itemListOverlay != null && itemListOverlay.isOpen()) {
itemListOverlay.updateGui(event.gui);
itemListOverlay.drawScreen(event.gui.mc, event.getMouseX(), event.getMouseY());
GuiScreen gui = event.getGui();
itemListOverlay.updateGui(gui);
itemListOverlay.drawScreen(gui.mc, event.getMouseX(), event.getMouseY());
}
}

Expand All @@ -84,16 +87,17 @@ public void onDrawScreenEventPost(@Nonnull GuiScreenEvent.DrawScreenEvent.Post e
return;
}

if (event.gui instanceof GuiContainer) {
GuiContainer guiContainer = (GuiContainer) event.gui;
GuiScreen gui = event.getGui();
if (gui instanceof GuiContainer) {
GuiContainer guiContainer = (GuiContainer) gui;
RecipeRegistry recipeRegistry = Internal.getRuntime().getRecipeRegistry();
if (recipeRegistry.getRecipeClickableArea(guiContainer, event.mouseX - guiContainer.guiLeft, event.mouseY - guiContainer.guiTop) != null) {
TooltipRenderer.drawHoveringText(guiContainer.mc, showRecipesText, event.mouseX, event.mouseY);
if (recipeRegistry.getRecipeClickableArea(guiContainer, event.getMouseX() - guiContainer.guiLeft, event.getMouseY() - guiContainer.guiTop) != null) {
TooltipRenderer.drawHoveringText(guiContainer.mc, showRecipesText, event.getMouseX(), event.getMouseY());
}
}

if (itemListOverlay.isOpen()) {
itemListOverlay.drawTooltips(event.gui.mc, event.mouseX, event.mouseY);
itemListOverlay.drawTooltips(gui.mc, event.getMouseX(), event.getMouseY());
}
}

Expand All @@ -119,7 +123,7 @@ public void onGuiKeyboardEvent(GuiScreenEvent.KeyboardInputEvent.Pre event) {

@SubscribeEvent
public void onGuiMouseEvent(GuiScreenEvent.MouseInputEvent.Pre event) {
GuiScreen guiScreen = event.gui;
GuiScreen guiScreen = event.getGui();
if (inputHandler != null) {
int x = Mouse.getEventX() * guiScreen.width / guiScreen.mc.displayWidth;
int y = guiScreen.height - Mouse.getEventY() * guiScreen.height / guiScreen.mc.displayHeight - 1;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mezz/jei/JustEnoughItems.java
Expand Up @@ -22,7 +22,7 @@
version = Constants.VERSION,
guiFactory = "mezz.jei.config.JEIModGuiFactory",
acceptedMinecraftVersions = "[1.9]",
dependencies = "required-after:Forge@[12.16.0.0,);")
dependencies = "required-after:Forge@[12.16.0.1805,);")
public class JustEnoughItems {

@SidedProxy(clientSide = "mezz.jei.ProxyCommonClient", serverSide = "mezz.jei.ProxyCommon")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mezz/jei/ProxyCommonClient.java
Expand Up @@ -212,7 +212,7 @@ public void sendPacketToServer(PacketJEI packet) {
// subscribe to event with low priority so that addon mods that use the config can do their stuff first
@SubscribeEvent(priority = EventPriority.LOW)
public void onConfigChanged(@Nonnull ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
if (!Constants.MOD_ID.equals(eventArgs.modID)) {
if (!Constants.MOD_ID.equals(eventArgs.getModID())) {
return;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/mezz/jei/config/Config.java
Expand Up @@ -317,17 +317,17 @@ private static boolean syncWorldConfig() {

Property property = worldConfig.get(worldCategory, "overlayEnabled", defaultOverlayEnabled);
property.setLanguageKey("config.jei.interface.overlayEnabled");
property.comment = Translator.translateToLocal("config.jei.interface.overlayEnabled.comment");
property.setComment(Translator.translateToLocal("config.jei.interface.overlayEnabled.comment"));
overlayEnabled = property.getBoolean();

property = worldConfig.get(worldCategory, "cheatItemsEnabled", defaultCheatItemsEnabled);
property.setLanguageKey("config.jei.mode.cheatItemsEnabled");
property.comment = Translator.translateToLocal("config.jei.mode.cheatItemsEnabled.comment");
property.setComment(Translator.translateToLocal("config.jei.mode.cheatItemsEnabled.comment"));
cheatItemsEnabled = property.getBoolean();

property = worldConfig.get(worldCategory, "editEnabled", defaultEditModeEnabled);
property.setLanguageKey("config.jei.mode.editEnabled");
property.comment = Translator.translateToLocal("config.jei.mode.editEnabled.comment");
property.setComment(Translator.translateToLocal("config.jei.mode.editEnabled.comment"));
editModeEnabled = property.getBoolean();

property = worldConfig.get(worldCategory, "filterText", defaultFilterText);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/mezz/jei/config/LocalizedConfiguration.java
Expand Up @@ -51,7 +51,7 @@ public String getString(String name, String category, String defaultValue, Strin
Property prop = get(category, name, defaultValue);
prop.setValidValues(validValues);
prop.setLanguageKey(langKey);
prop.comment = comment + " [" + defaultLocalized + ": " + defaultValue + "] [" + validLocalized + ": " + Arrays.toString(prop.getValidValues()) + ']';
prop.setComment(comment + " [" + defaultLocalized + ": " + defaultValue + "] [" + validLocalized + ": " + Arrays.toString(prop.getValidValues()) + ']');
return prop.getString();
}

Expand All @@ -69,7 +69,7 @@ public <T extends Enum<T>> T getEnum(String name, String category, T defaultValu

prop.setValidValues(validValues);
prop.setLanguageKey(langKey);
prop.comment = comment + " [" + defaultLocalized + ": " + defaultValue + "] [" + validLocalized + ": " + Arrays.toString(prop.getValidValues()) + ']';
prop.setComment(comment + " [" + defaultLocalized + ": " + defaultValue + "] [" + validLocalized + ": " + Arrays.toString(prop.getValidValues()) + ']');
String stringValue = prop.getString();

T enumValue = defaultValue;
Expand All @@ -89,7 +89,7 @@ public String[] getStringList(String name, String category, String[] defaultValu

Property prop = get(category, name, defaultValue);
prop.setLanguageKey(langKey);
prop.comment = comment + " [" + defaultLocalized + ": " + Arrays.toString(defaultValue) + ']';
prop.setComment(comment + " [" + defaultLocalized + ": " + Arrays.toString(defaultValue) + ']');
return prop.getStringList();
}

Expand All @@ -101,7 +101,7 @@ public String[] getStringList(String name, String category, String[] defaultValu
Property prop = get(category, name, defaultValue);
prop.setLanguageKey(langKey);
prop.setValidValues(validValues);
prop.comment = comment + " [" + defaultLocalized + ": " + Arrays.toString(defaultValue) + "] [" + validLocalized + ": " + Arrays.toString(prop.getValidValues()) + ']';
prop.setComment(comment + " [" + defaultLocalized + ": " + Arrays.toString(defaultValue) + "] [" + validLocalized + ": " + Arrays.toString(prop.getValidValues()) + ']');
return prop.getStringList();
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mezz/jei/network/PacketHandler.java
Expand Up @@ -31,8 +31,8 @@ public PacketHandler() {

@SubscribeEvent
public void onPacket(FMLNetworkEvent.ServerCustomPacketEvent event) {
PacketBuffer packetBuffer = new PacketBuffer(event.packet.payload());
EntityPlayerMP player = ((NetHandlerPlayServer) event.handler).playerEntity;
PacketBuffer packetBuffer = new PacketBuffer(event.getPacket().payload());
EntityPlayerMP player = ((NetHandlerPlayServer) event.getHandler()).playerEntity;

try {
byte packetIdOrdinal = packetBuffer.readByte();
Expand Down
Expand Up @@ -105,11 +105,11 @@ private static void addModdedBrewingRecipes(Collection<BrewingRecipeWrapper> rec
for (IBrewingRecipe iBrewingRecipe : brewingRecipes) {
if (iBrewingRecipe instanceof BrewingRecipe) {
BrewingRecipe brewingRecipe = (BrewingRecipe) iBrewingRecipe;
BrewingRecipeWrapper recipe = new BrewingRecipeWrapper(brewingRecipe.ingredient, brewingRecipe.input, brewingRecipe.output, 0);
BrewingRecipeWrapper recipe = new BrewingRecipeWrapper(brewingRecipe.getIngredient(), brewingRecipe.getInput(), brewingRecipe.getOutput(), 0);
recipes.add(recipe);
} else if (iBrewingRecipe instanceof BrewingOreRecipe) {
BrewingOreRecipe brewingRecipe = (BrewingOreRecipe) iBrewingRecipe;
BrewingRecipeWrapper recipe = new BrewingRecipeWrapper(brewingRecipe.ingredient, brewingRecipe.input, brewingRecipe.output, 0);
BrewingRecipeWrapper recipe = new BrewingRecipeWrapper(brewingRecipe.getIngredient(), brewingRecipe.getInput(), brewingRecipe.getOutput(), 0);
recipes.add(recipe);
} else if (!(iBrewingRecipe instanceof VanillaBrewingRecipe)) {
Class recipeClass = iBrewingRecipe.getClass();
Expand Down

0 comments on commit e19734c

Please sign in to comment.