Skip to content

Commit

Permalink
restrict gregtech rendering ban to wires and machines (#2285)
Browse files Browse the repository at this point in the history
* restrict rendering ban to wires and machines

* make if statement readable and changelog
  • Loading branch information
Darkere authored and raoulvdberge committed Jul 21, 2019
1 parent 6f66979 commit f261655
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Shortened crafting text for the Russion translation to fix Grid overlays (yaroslav4167)
- Fixed JEI hotkeys not working on fluid filter slots (raoulvdberge)
- Fixed crash when opening Crafter Manager with FTB Quests installed (raoulvdberge)
- GregTech Community Edition items are now banned from rendering on Refined Storage patterns because they are causing crashes (raoulvdberge)
- GregTech Community Edition Wires and Machines are now banned from rendering on Refined Storage patterns because they are causing crashes (raoulvdberge/Darkere)
- Fixed a bug where the container slots weren't synced when opening a Grid (raoulvdberge)

### 1.6.14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, W
ItemStack outputToRender = pattern.getOutputs().get(0);

// @Volatile: Gregtech banned for rendering due to issues
if (!"gregtech".equals(outputToRender.getItem().getCreatorModId(outputToRender))) {
if (!hasBrokenRendering(outputToRender)) {
return Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(outputToRender, world, entity);
}
}
Expand All @@ -50,6 +50,19 @@ public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, W
};
}

private boolean hasBrokenRendering(ItemStack stack) {
if ("gregtech".equals(stack.getItem().getCreatorModId(stack))) {
if ("tile.pipe".equals(stack.getTranslationKey())) {
return true;
}

if ("machine".equals(stack.getItem().delegate.name().getPath())) {
return true;
}
}
return false;
}

public static boolean canDisplayOutput(ItemStack patternStack, CraftingPattern pattern) {
if (pattern.isValid() && pattern.getOutputs().size() == 1) {
for (ICraftingPatternRenderHandler renderHandler : API.instance().getPatternRenderHandlers()) {
Expand Down

0 comments on commit f261655

Please sign in to comment.