From fa325cefdfcb47a0d75c1fd3a562cdb49c17b7e8 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Wed, 15 Jan 2020 21:33:09 -0600 Subject: [PATCH] Fix crashes --- .../client/core/handler/ModelHandler.java | 6 +- .../client/render/entity/RenderNoop.java | 27 +++++ .../render/tile/RenderTileStarfield.java | 3 +- .../botania/client/render/tile/TEISR.java | 22 ++-- .../botania/common/block/ModBlocks.java | 14 +-- .../botania/common/block/ModSubtiles.java | 110 +++++++++--------- 6 files changed, 111 insertions(+), 71 deletions(-) create mode 100644 src/main/java/vazkii/botania/client/render/entity/RenderNoop.java diff --git a/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java b/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java index 3eb338c33..60b76b34c 100644 --- a/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java @@ -31,6 +31,7 @@ import vazkii.botania.client.render.entity.RenderBabylonWeapon; import vazkii.botania.client.render.entity.RenderCorporeaSpark; import vazkii.botania.client.render.entity.RenderDoppleganger; import vazkii.botania.client.render.entity.RenderManaStorm; +import vazkii.botania.client.render.entity.RenderNoop; import vazkii.botania.client.render.entity.RenderPinkWither; import vazkii.botania.client.render.entity.RenderPixie; import vazkii.botania.client.render.entity.RenderPoolMinecart; @@ -74,6 +75,7 @@ import vazkii.botania.common.entity.EntityBabylonWeapon; import vazkii.botania.common.entity.EntityCorporeaSpark; import vazkii.botania.common.entity.EntityDoppleganger; import vazkii.botania.common.entity.EntityEnderAirBottle; +import vazkii.botania.common.entity.EntityManaBurst; import vazkii.botania.common.entity.EntityManaStorm; import vazkii.botania.common.entity.EntityPinkWither; import vazkii.botania.common.entity.EntityPixie; @@ -106,7 +108,7 @@ public final class ModelHandler { ClientRegistry.bindTileEntityRenderer(TileAlfPortal.TYPE, RenderTileAlfPortal::new); ClientRegistry.bindTileEntityRenderer(TileFloatingFlower.TYPE, RenderTileFloatingFlower::new); // TODO 1.14 this seems highly questionable. - ModSubtiles.TYPES.stream() + ModSubtiles.getTypes().stream() .map(Pair::getSecond) .map(rl -> Registry.BLOCK_ENTITY_TYPE.getValue(rl).get()) .forEach(typ -> ClientRegistry.bindTileEntityRenderer(typ, RenderTileFloatingFlower::new)); @@ -135,6 +137,8 @@ public final class ModelHandler { ClientRegistry.bindTileEntityRenderer(TileAvatar.TYPE, RenderTileAvatar::new); ClientRegistry.bindTileEntityRenderer(TileAnimatedTorch.TYPE, RenderTileAnimatedTorch::new); + RenderingRegistry.registerEntityRenderingHandler(EntityManaBurst.TYPE, RenderNoop::new); + RenderingRegistry.registerEntityRenderingHandler(TileLightRelay.EntityPlayerMover.TYPE, RenderNoop::new); RenderingRegistry.registerEntityRenderingHandler(EntityPixie.TYPE, RenderPixie::new); RenderingRegistry.registerEntityRenderingHandler(EntityDoppleganger.TYPE, RenderDoppleganger::new); RenderingRegistry.registerEntityRenderingHandler(EntitySpark.TYPE, RenderSpark::new); diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderNoop.java b/src/main/java/vazkii/botania/client/render/entity/RenderNoop.java new file mode 100644 index 000000000..ba8973f70 --- /dev/null +++ b/src/main/java/vazkii/botania/client/render/entity/RenderNoop.java @@ -0,0 +1,27 @@ +package vazkii.botania.client.render.entity; + +import net.minecraft.client.renderer.culling.ClippingHelperImpl; +import net.minecraft.client.renderer.entity.EntityRenderer; +import net.minecraft.client.renderer.entity.EntityRendererManager; +import net.minecraft.client.renderer.texture.AtlasTexture; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +import javax.annotation.Nonnull; + +public class RenderNoop extends EntityRenderer { + public RenderNoop(EntityRendererManager manager) { + super(manager); + } + + @Override + public boolean shouldRender(T entity, @Nonnull ClippingHelperImpl clipping, double x, double y, double z) { + return false; + } + + @Nonnull + @Override + public ResourceLocation getEntityTexture(@Nonnull T entity) { + return AtlasTexture.LOCATION_BLOCKS_TEXTURE; + } +} diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileStarfield.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileStarfield.java index b443e5cf4..4fa2f48dc 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileStarfield.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileStarfield.java @@ -20,6 +20,7 @@ import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.Matrix4f; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.tileentity.EndPortalTileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; @@ -37,7 +38,7 @@ import java.util.Random; // [VanillaCopy] end portal TESR, relevant edits are commented public class RenderTileStarfield extends TileEntityRenderer { private static final Random RANDOM = new Random(31100L); - private static List field_228881_e_ = ObfuscationReflectionHelper.getPrivateValue(TileStarfield.class, null, "field_228881_e_"); + private static List field_228881_e_ = ObfuscationReflectionHelper.getPrivateValue(EndPortalTileEntityRenderer.class, null, "field_228881_e_"); public RenderTileStarfield(TileEntityRendererDispatcher manager) { super(manager); diff --git a/src/main/java/vazkii/botania/client/render/tile/TEISR.java b/src/main/java/vazkii/botania/client/render/tile/TEISR.java index 44ae01af4..3677dacc4 100644 --- a/src/main/java/vazkii/botania/client/render/tile/TEISR.java +++ b/src/main/java/vazkii/botania/client/render/tile/TEISR.java @@ -2,27 +2,33 @@ package vazkii.botania.client.render.tile; import com.google.common.base.Preconditions; import com.mojang.blaze3d.matrix.MatrixStack; +import net.minecraft.block.Block; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; -import net.minecraft.util.IItemProvider; +import net.minecraft.util.LazyValue; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.registry.Registry; public class TEISR extends ItemStackTileEntityRenderer { - private final IItemProvider item; - private final TileEntity dummy; + private final Block block; + private final LazyValue dummy; - public TEISR(IItemProvider item, TileEntityType type) { - this.item = Preconditions.checkNotNull(item); - this.dummy = type.create(); + public TEISR(Block block) { + this.block = Preconditions.checkNotNull(block); + this.dummy = new LazyValue<>(() -> { + TileEntityType type = Registry.BLOCK_ENTITY_TYPE.getValue(block.getRegistryName()).get(); + return type.create(); + }); } @Override public void render(ItemStack stack, MatrixStack ms, IRenderTypeBuffer buffers, int light, int overlay) { - if(stack.getItem() == item.asItem()) { - TileEntityRendererDispatcher.instance.getRenderer(dummy) + if(stack.getItem() == block.asItem()) { + TileEntityRendererDispatcher.instance.getRenderer(dummy.getValue()) .render(null, 0, ms, buffers, light, overlay); } } diff --git a/src/main/java/vazkii/botania/common/block/ModBlocks.java b/src/main/java/vazkii/botania/common/block/ModBlocks.java index 111cc1886..f5875d190 100644 --- a/src/main/java/vazkii/botania/common/block/ModBlocks.java +++ b/src/main/java/vazkii/botania/common/block/ModBlocks.java @@ -833,13 +833,13 @@ public final class ModBlocks { register(r, new ItemBlockMod(naturaPylon, pylonProps), naturaPylon.getRegistryName()); register(r, new ItemBlockMod(gaiaPylon, pylonProps), gaiaPylon.getRegistryName()); - register(r, new ItemBlockMod(teruTeruBozu, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(ModBlocks.teruTeruBozu, TileTeruTeruBozu.TYPE))), teruTeruBozu.getRegistryName()); - register(r, new ItemBlockMod(avatar, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(ModBlocks.avatar, TileAvatar.TYPE))), avatar.getRegistryName()); - register(r, new ItemBlockMod(bellows, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(ModBlocks.bellows, TileBellows.TYPE))), bellows.getRegistryName()); - register(r, new ItemBlockMod(brewery, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(ModBlocks.brewery, TileBrewery.TYPE))), brewery.getRegistryName()); - register(r, new ItemBlockMod(corporeaIndex, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(ModBlocks.corporeaIndex, TileCorporeaIndex.TYPE))), corporeaIndex.getRegistryName()); - register(r, new ItemBlockMod(hourglass, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(ModBlocks.hourglass, TileHourglass.TYPE))), hourglass.getRegistryName()); - Item head = new ItemGaiaHead(gaiaHead, gaiaHeadWall, ModItems.defaultBuilder().rarity(Rarity.UNCOMMON).setTEISR(() -> () -> new TEISR(ModBlocks.gaiaHead, TileGaiaHead.TYPE))); + register(r, new ItemBlockMod(teruTeruBozu, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(teruTeruBozu))), teruTeruBozu.getRegistryName()); + register(r, new ItemBlockMod(avatar, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(avatar))), avatar.getRegistryName()); + register(r, new ItemBlockMod(bellows, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(bellows))), bellows.getRegistryName()); + register(r, new ItemBlockMod(brewery, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(brewery))), brewery.getRegistryName()); + register(r, new ItemBlockMod(corporeaIndex, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(corporeaIndex))), corporeaIndex.getRegistryName()); + register(r, new ItemBlockMod(hourglass, ModItems.defaultBuilder().setTEISR(() -> () -> new TEISR(hourglass))), hourglass.getRegistryName()); + Item head = new ItemGaiaHead(gaiaHead, gaiaHeadWall, ModItems.defaultBuilder().rarity(Rarity.UNCOMMON).setTEISR(() -> () -> new TEISR(gaiaHead))); register(r, head, gaiaHead.getRegistryName()); return null; } diff --git a/src/main/java/vazkii/botania/common/block/ModSubtiles.java b/src/main/java/vazkii/botania/common/block/ModSubtiles.java index 804c99366..a6ec8f560 100644 --- a/src/main/java/vazkii/botania/common/block/ModSubtiles.java +++ b/src/main/java/vazkii/botania/common/block/ModSubtiles.java @@ -153,57 +153,59 @@ public class ModSubtiles { return new ResourceLocation(orig.getNamespace(), orig.getPath() + "_chibi"); } - public static final List, ResourceLocation>> TYPES = ImmutableList., ResourceLocation>>of( - Pair.of(SubTilePureDaisy::new, LibBlockNames.SUBTILE_PUREDAISY), - Pair.of(SubTileManastar::new, LibBlockNames.SUBTILE_MANASTAR), - Pair.of(SubTileEndoflame::new, LibBlockNames.SUBTILE_ENDOFLAME), - Pair.of(SubTileHydroangeas::new, LibBlockNames.SUBTILE_HYDROANGEAS), - Pair.of(SubTileThermalily::new, LibBlockNames.SUBTILE_THERMALILY), - Pair.of(SubTileArcaneRose::new, LibBlockNames.SUBTILE_ARCANE_ROSE), - Pair.of(SubTileMunchdew::new, LibBlockNames.SUBTILE_MUNCHDEW), - Pair.of(SubTileEntropinnyum::new, LibBlockNames.SUBTILE_ENTROPINNYUM), - Pair.of(SubTileKekimurus::new, LibBlockNames.SUBTILE_KEKIMURUS), - Pair.of(SubTileGourmaryllis::new, LibBlockNames.SUBTILE_GOURMARYLLIS), - Pair.of(SubTileNarslimmus::new, LibBlockNames.SUBTILE_NARSLIMMUS), - Pair.of(SubTileSpectrolus::new, LibBlockNames.SUBTILE_SPECTROLUS), - Pair.of(SubTileDandelifeon::new, LibBlockNames.SUBTILE_DANDELIFEON), - Pair.of(SubTileRafflowsia::new, LibBlockNames.SUBTILE_RAFFLOWSIA), - Pair.of(SubTileShulkMeNot::new, LibBlockNames.SUBTILE_SHULK_ME_NOT), - Pair.of(SubTileBellethorn::new, LibBlockNames.SUBTILE_BELLETHORN), - Pair.of(SubTileBellethorn.Mini::new, chibi(LibBlockNames.SUBTILE_BELLETHORN)), - Pair.of(SubTileBergamute::new, LibBlockNames.SUBTILE_BERGAMUTE), - Pair.of(SubTileDreadthorn::new, LibBlockNames.SUBTILE_DREADTHORN), - Pair.of(SubTileHeiseiDream::new, LibBlockNames.SUBTILE_HEISEI_DREAM), - Pair.of(SubTileTigerseye::new, LibBlockNames.SUBTILE_TIGERSEYE), - Pair.of(SubTileJadedAmaranthus::new, LibBlockNames.SUBTILE_JADED_AMARANTHUS), - Pair.of(SubTileOrechid::new, LibBlockNames.SUBTILE_ORECHID), - Pair.of(SubTileFallenKanade::new, LibBlockNames.SUBTILE_FALLEN_KANADE), - Pair.of(SubTileExoflame::new, LibBlockNames.SUBTILE_EXOFLAME), - Pair.of(SubTileAgricarnation::new, LibBlockNames.SUBTILE_AGRICARNATION), - Pair.of(SubTileAgricarnation.Mini::new, chibi(LibBlockNames.SUBTILE_AGRICARNATION)), - Pair.of(SubTileHopperhock::new, LibBlockNames.SUBTILE_HOPPERHOCK), - Pair.of(SubTileHopperhock.Mini::new, chibi(LibBlockNames.SUBTILE_HOPPERHOCK)), - Pair.of(SubTileTangleberrie::new, LibBlockNames.SUBTILE_TANGLEBERRIE), - Pair.of(SubTileJiyuulia::new, LibBlockNames.SUBTILE_JIYUULIA), - Pair.of(SubTileRannuncarpus::new, LibBlockNames.SUBTILE_RANNUNCARPUS), - Pair.of(SubTileRannuncarpus.Mini::new, chibi(LibBlockNames.SUBTILE_RANNUNCARPUS)), - Pair.of(SubTileHyacidus::new, LibBlockNames.SUBTILE_HYACIDUS), - Pair.of(SubTilePollidisiac::new, LibBlockNames.SUBTILE_POLLIDISIAC), - Pair.of(SubTileClayconia::new, LibBlockNames.SUBTILE_CLAYCONIA), - Pair.of(SubTileClayconia.Mini::new, chibi(LibBlockNames.SUBTILE_CLAYCONIA)), - Pair.of(SubTileLoonuim::new, LibBlockNames.SUBTILE_LOONIUM), - Pair.of(SubTileDaffomill::new, LibBlockNames.SUBTILE_DAFFOMILL), - Pair.of(SubTileVinculotus::new, LibBlockNames.SUBTILE_VINCULOTUS), - Pair.of(SubTileSpectranthemum::new, LibBlockNames.SUBTILE_SPECTRANTHEMUM), - Pair.of(SubTileMedumone::new, LibBlockNames.SUBTILE_MEDUMONE), - Pair.of(SubTileMarimorphosis::new, LibBlockNames.SUBTILE_MARIMORPHOSIS), - Pair.of(SubTileMarimorphosis.Mini::new, chibi(LibBlockNames.SUBTILE_MARIMORPHOSIS)), - Pair.of(SubTileBubbell::new, LibBlockNames.SUBTILE_BUBBELL), - Pair.of(SubTileBubbell.Mini::new, chibi(LibBlockNames.SUBTILE_BUBBELL)), - Pair.of(SubTileSolegnolia::new, LibBlockNames.SUBTILE_SOLEGNOLIA), - Pair.of(SubTileSolegnolia.Mini::new, chibi(LibBlockNames.SUBTILE_SOLEGNOLIA)), - Pair.of(SubTileOrechidIgnem::new, LibBlockNames.SUBTILE_ORECHID_IGNEM) - ); + public static List, ResourceLocation>> getTypes() { + return ImmutableList.of( + Pair.of(SubTilePureDaisy::new, LibBlockNames.SUBTILE_PUREDAISY), + Pair.of(SubTileManastar::new, LibBlockNames.SUBTILE_MANASTAR), + Pair.of(SubTileEndoflame::new, LibBlockNames.SUBTILE_ENDOFLAME), + Pair.of(SubTileHydroangeas::new, LibBlockNames.SUBTILE_HYDROANGEAS), + Pair.of(SubTileThermalily::new, LibBlockNames.SUBTILE_THERMALILY), + Pair.of(SubTileArcaneRose::new, LibBlockNames.SUBTILE_ARCANE_ROSE), + Pair.of(SubTileMunchdew::new, LibBlockNames.SUBTILE_MUNCHDEW), + Pair.of(SubTileEntropinnyum::new, LibBlockNames.SUBTILE_ENTROPINNYUM), + Pair.of(SubTileKekimurus::new, LibBlockNames.SUBTILE_KEKIMURUS), + Pair.of(SubTileGourmaryllis::new, LibBlockNames.SUBTILE_GOURMARYLLIS), + Pair.of(SubTileNarslimmus::new, LibBlockNames.SUBTILE_NARSLIMMUS), + Pair.of(SubTileSpectrolus::new, LibBlockNames.SUBTILE_SPECTROLUS), + Pair.of(SubTileDandelifeon::new, LibBlockNames.SUBTILE_DANDELIFEON), + Pair.of(SubTileRafflowsia::new, LibBlockNames.SUBTILE_RAFFLOWSIA), + Pair.of(SubTileShulkMeNot::new, LibBlockNames.SUBTILE_SHULK_ME_NOT), + Pair.of(SubTileBellethorn::new, LibBlockNames.SUBTILE_BELLETHORN), + Pair.of(SubTileBellethorn.Mini::new, chibi(LibBlockNames.SUBTILE_BELLETHORN)), + Pair.of(SubTileBergamute::new, LibBlockNames.SUBTILE_BERGAMUTE), + Pair.of(SubTileDreadthorn::new, LibBlockNames.SUBTILE_DREADTHORN), + Pair.of(SubTileHeiseiDream::new, LibBlockNames.SUBTILE_HEISEI_DREAM), + Pair.of(SubTileTigerseye::new, LibBlockNames.SUBTILE_TIGERSEYE), + Pair.of(SubTileJadedAmaranthus::new, LibBlockNames.SUBTILE_JADED_AMARANTHUS), + Pair.of(SubTileOrechid::new, LibBlockNames.SUBTILE_ORECHID), + Pair.of(SubTileFallenKanade::new, LibBlockNames.SUBTILE_FALLEN_KANADE), + Pair.of(SubTileExoflame::new, LibBlockNames.SUBTILE_EXOFLAME), + Pair.of(SubTileAgricarnation::new, LibBlockNames.SUBTILE_AGRICARNATION), + Pair.of(SubTileAgricarnation.Mini::new, chibi(LibBlockNames.SUBTILE_AGRICARNATION)), + Pair.of(SubTileHopperhock::new, LibBlockNames.SUBTILE_HOPPERHOCK), + Pair.of(SubTileHopperhock.Mini::new, chibi(LibBlockNames.SUBTILE_HOPPERHOCK)), + Pair.of(SubTileTangleberrie::new, LibBlockNames.SUBTILE_TANGLEBERRIE), + Pair.of(SubTileJiyuulia::new, LibBlockNames.SUBTILE_JIYUULIA), + Pair.of(SubTileRannuncarpus::new, LibBlockNames.SUBTILE_RANNUNCARPUS), + Pair.of(SubTileRannuncarpus.Mini::new, chibi(LibBlockNames.SUBTILE_RANNUNCARPUS)), + Pair.of(SubTileHyacidus::new, LibBlockNames.SUBTILE_HYACIDUS), + Pair.of(SubTilePollidisiac::new, LibBlockNames.SUBTILE_POLLIDISIAC), + Pair.of(SubTileClayconia::new, LibBlockNames.SUBTILE_CLAYCONIA), + Pair.of(SubTileClayconia.Mini::new, chibi(LibBlockNames.SUBTILE_CLAYCONIA)), + Pair.of(SubTileLoonuim::new, LibBlockNames.SUBTILE_LOONIUM), + Pair.of(SubTileDaffomill::new, LibBlockNames.SUBTILE_DAFFOMILL), + Pair.of(SubTileVinculotus::new, LibBlockNames.SUBTILE_VINCULOTUS), + Pair.of(SubTileSpectranthemum::new, LibBlockNames.SUBTILE_SPECTRANTHEMUM), + Pair.of(SubTileMedumone::new, LibBlockNames.SUBTILE_MEDUMONE), + Pair.of(SubTileMarimorphosis::new, LibBlockNames.SUBTILE_MARIMORPHOSIS), + Pair.of(SubTileMarimorphosis.Mini::new, chibi(LibBlockNames.SUBTILE_MARIMORPHOSIS)), + Pair.of(SubTileBubbell::new, LibBlockNames.SUBTILE_BUBBELL), + Pair.of(SubTileBubbell.Mini::new, chibi(LibBlockNames.SUBTILE_BUBBELL)), + Pair.of(SubTileSolegnolia::new, LibBlockNames.SUBTILE_SOLEGNOLIA), + Pair.of(SubTileSolegnolia.Mini::new, chibi(LibBlockNames.SUBTILE_SOLEGNOLIA)), + Pair.of(SubTileOrechidIgnem::new, LibBlockNames.SUBTILE_ORECHID_IGNEM) + ); + } @SubscribeEvent public static void registerBlocks(RegistryEvent.Register evt) { @@ -211,7 +213,7 @@ public class ModSubtiles { Block.Properties props = Block.Properties.from(Blocks.POPPY); Block.Properties floatProps = Block.Properties.create(Material.EARTH).hardnessAndResistance(0.5F).sound(SoundType.GROUND).lightValue(15); - for (Pair, ResourceLocation> type : TYPES) { + for (Pair, ResourceLocation> type : getTypes()) { register(r, new BlockSpecialFlower(props, type.getFirst()), type.getSecond()); register(r, new BlockFloatingSpecialFlower(floatProps, type.getFirst()), floating(type.getSecond())); } @@ -223,7 +225,7 @@ public class ModSubtiles { IForgeRegistry r = evt.getRegistry(); Item.Properties props = ModItems.defaultBuilder(); - for (Pair, ResourceLocation> type : TYPES) { + for (Pair, ResourceLocation> type : getTypes()) { Block block = b.getValue(type.getSecond()); Block floating = b.getValue(floating(type.getSecond())); @@ -237,7 +239,7 @@ public class ModSubtiles { IForgeRegistry b = ForgeRegistries.BLOCKS; IForgeRegistry> r = evt.getRegistry(); - for (Pair, ResourceLocation> type : TYPES) { + for (Pair, ResourceLocation> type : getTypes()) { Block block = b.getValue(type.getSecond()); Block floating = b.getValue(floating(type.getSecond())); register(r, TileEntityType.Builder.create(type.getFirst(), block, floating).build(null), type.getSecond());