restrict gregtech rendering ban to wires and machines (#2285)

* restrict rendering ban to wires and machines

* make if statement readable and changelog
This commit is contained in:
Darkere
2019-07-21 17:00:00 +02:00
committed by Raoul
parent 6f669798b3
commit f26165533a
2 changed files with 15 additions and 2 deletions

View File

@@ -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

View File

@@ -40,7 +40,7 @@ public class BakedModelPattern extends BakedModelDelegate {
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);
}
}
@@ -50,6 +50,19 @@ public class BakedModelPattern extends BakedModelDelegate {
};
}
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()) {