Fix the Obsidian chest rendering as a gold chest, and fix the chest models crashing clients running on servers.
This commit is contained in:
parent
db2540c968
commit
c56c0d1942
|
|
@ -12,8 +12,8 @@ minecraft_range=[1.17.1,1.18)
|
||||||
|
|
||||||
# Forge Version Information
|
# Forge Version Information
|
||||||
loader_range=[33.0,)
|
loader_range=[33.0,)
|
||||||
forge_version=37.0.12
|
forge_version=37.0.13
|
||||||
forge_range=[37.0.1,)
|
forge_range=[37.0.13,)
|
||||||
|
|
||||||
# Mappings Information
|
# Mappings Information
|
||||||
mappings_version=1.17.1
|
mappings_version=1.17.1
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import com.progwml6.ironchest.IronChests;
|
||||||
import net.minecraft.world.entity.ai.goal.CatSitOnBlockGoal;
|
import net.minecraft.world.entity.ai.goal.CatSitOnBlockGoal;
|
||||||
import net.minecraft.world.entity.ai.goal.WrappedGoal;
|
import net.minecraft.world.entity.ai.goal.WrappedGoal;
|
||||||
import net.minecraft.world.entity.animal.Cat;
|
import net.minecraft.world.entity.animal.Cat;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.progwml6.ironchest.common.block;
|
||||||
import com.progwml6.ironchest.common.block.entity.AbstractIronChestBlockEntity;
|
import com.progwml6.ironchest.common.block.entity.AbstractIronChestBlockEntity;
|
||||||
import com.progwml6.ironchest.common.block.entity.CrystalChestBlockEntity;
|
import com.progwml6.ironchest.common.block.entity.CrystalChestBlockEntity;
|
||||||
import com.progwml6.ironchest.common.block.entity.IronChestsBlockEntityTypes;
|
import com.progwml6.ironchest.common.block.entity.IronChestsBlockEntityTypes;
|
||||||
import com.progwml6.ironchest.common.block.entity.SilverChestBlockEntity;
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
public class IronChestBlock extends AbstractIronChestBlock {
|
public class IronChestBlock extends AbstractIronChestBlock {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,12 @@
|
||||||
package com.progwml6.ironchest.common.block;
|
package com.progwml6.ironchest.common.block;
|
||||||
|
|
||||||
import com.progwml6.ironchest.IronChests;
|
import com.progwml6.ironchest.IronChests;
|
||||||
import com.progwml6.ironchest.client.model.inventory.IronChestItemStackRenderer;
|
|
||||||
import com.progwml6.ironchest.common.block.entity.CopperChestBlockEntity;
|
|
||||||
import com.progwml6.ironchest.common.block.entity.CrystalChestBlockEntity;
|
|
||||||
import com.progwml6.ironchest.common.block.entity.DiamondChestBlockEntity;
|
|
||||||
import com.progwml6.ironchest.common.block.entity.DirtChestBlockEntity;
|
|
||||||
import com.progwml6.ironchest.common.block.entity.GoldChestBlockEntity;
|
|
||||||
import com.progwml6.ironchest.common.block.entity.IronChestBlockEntity;
|
|
||||||
import com.progwml6.ironchest.common.block.entity.ObsidianChestBlockEntity;
|
|
||||||
import com.progwml6.ironchest.common.block.entity.SilverChestBlockEntity;
|
|
||||||
import com.progwml6.ironchest.common.item.IronChestBlockItem;
|
import com.progwml6.ironchest.common.item.IronChestBlockItem;
|
||||||
import com.progwml6.ironchest.common.item.IronChestsItems;
|
import com.progwml6.ironchest.common.item.IronChestsItems;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
||||||
import net.minecraftforge.fmllegacy.RegistryObject;
|
import net.minecraftforge.fmllegacy.RegistryObject;
|
||||||
import net.minecraftforge.registries.DeferredRegister;
|
import net.minecraftforge.registries.DeferredRegister;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
import net.minecraftforge.registries.ForgeRegistries;
|
||||||
|
|
@ -36,40 +22,40 @@ public class IronChestsBlocks {
|
||||||
|
|
||||||
public static final RegistryObject<IronChestBlock> IRON_CHEST = register(
|
public static final RegistryObject<IronChestBlock> IRON_CHEST = register(
|
||||||
"iron_chest", () -> new IronChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
"iron_chest", () -> new IronChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
||||||
() -> getIronChestItemStackRenderer());
|
IronChestsTypes.IRON);
|
||||||
|
|
||||||
public static final RegistryObject<GoldChestBlock> GOLD_CHEST = register(
|
public static final RegistryObject<GoldChestBlock> GOLD_CHEST = register(
|
||||||
"gold_chest", () -> new GoldChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
"gold_chest", () -> new GoldChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
||||||
() -> getGoldChestItemStackRenderer());
|
IronChestsTypes.GOLD);
|
||||||
|
|
||||||
public static final RegistryObject<DiamondChestBlock> DIAMOND_CHEST = register(
|
public static final RegistryObject<DiamondChestBlock> DIAMOND_CHEST = register(
|
||||||
"diamond_chest", () -> new DiamondChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
"diamond_chest", () -> new DiamondChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
||||||
() -> getDiamondChestItemStackRenderer());
|
IronChestsTypes.DIAMOND);
|
||||||
|
|
||||||
public static final RegistryObject<CopperChestBlock> COPPER_CHEST = register(
|
public static final RegistryObject<CopperChestBlock> COPPER_CHEST = register(
|
||||||
"copper_chest", () -> new CopperChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
"copper_chest", () -> new CopperChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
||||||
() -> getCopperChestItemStackRenderer());
|
IronChestsTypes.COPPER);
|
||||||
|
|
||||||
public static final RegistryObject<SilverChestBlock> SILVER_CHEST = register(
|
public static final RegistryObject<SilverChestBlock> SILVER_CHEST = register(
|
||||||
"silver_chest", () -> new SilverChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
"silver_chest", () -> new SilverChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
||||||
() -> getSilverChestItemStackRenderer());
|
IronChestsTypes.SILVER);
|
||||||
|
|
||||||
public static final RegistryObject<CrystalChestBlock> CRYSTAL_CHEST = register(
|
public static final RegistryObject<CrystalChestBlock> CRYSTAL_CHEST = register(
|
||||||
"crystal_chest", () -> new CrystalChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
"crystal_chest", () -> new CrystalChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
||||||
() -> getCrystalChestItemStackRenderer());
|
IronChestsTypes.CRYSTAL);
|
||||||
|
|
||||||
public static final RegistryObject<ObsidianChestBlock> OBSIDIAN_CHEST = register(
|
public static final RegistryObject<ObsidianChestBlock> OBSIDIAN_CHEST = register(
|
||||||
"obsidian_chest", () -> new ObsidianChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
"obsidian_chest", () -> new ObsidianChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
||||||
() -> getObsidianChestItemStackRenderer());
|
IronChestsTypes.OBSIDIAN);
|
||||||
|
|
||||||
public static final RegistryObject<DirtChestBlock> DIRT_CHEST = register(
|
public static final RegistryObject<DirtChestBlock> DIRT_CHEST = register(
|
||||||
"dirt_chest", () -> new DirtChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
"dirt_chest", () -> new DirtChestBlock(Block.Properties.of(Material.METAL).strength(3.0F)),
|
||||||
() -> getDirtChestItemStackRenderer());
|
IronChestsTypes.DIRT);
|
||||||
|
|
||||||
//HELPERS
|
//HELPERS
|
||||||
|
|
||||||
private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> sup, Supplier<Callable<BlockEntityWithoutLevelRenderer>> renderMethod) {
|
private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> sup, IronChestsTypes chestType) {
|
||||||
return register(name, sup, block -> item(block, renderMethod));
|
return register(name, sup, block -> item(block, () -> () -> chestType));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> sup, Function<RegistryObject<T>, Supplier<? extends Item>> itemCreator) {
|
private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> sup, Function<RegistryObject<T>, Supplier<? extends Item>> itemCreator) {
|
||||||
|
|
@ -82,47 +68,7 @@ public class IronChestsBlocks {
|
||||||
return BLOCKS.register(name, sup);
|
return BLOCKS.register(name, sup);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Supplier<BlockItem> item(final RegistryObject<? extends Block> block, final Supplier<Callable<BlockEntityWithoutLevelRenderer>> renderMethod) {
|
private static Supplier<BlockItem> item(final RegistryObject<? extends Block> block, Supplier<Callable<IronChestsTypes>> chestType) {
|
||||||
return () -> new IronChestBlockItem(block.get(), new Item.Properties().tab(IronChests.IRONCHESTS_ITEM_GROUP), renderMethod);
|
return () -> new IronChestBlockItem(block.get(), new Item.Properties().tab(IronChests.IRONCHESTS_ITEM_GROUP), chestType);
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public static Callable<BlockEntityWithoutLevelRenderer> getIronChestItemStackRenderer() {
|
|
||||||
return () -> new IronChestItemStackRenderer(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels(), () -> new IronChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.IRON_CHEST.get().defaultBlockState()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public static Callable<BlockEntityWithoutLevelRenderer> getGoldChestItemStackRenderer() {
|
|
||||||
return () -> new IronChestItemStackRenderer(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels(), () -> new GoldChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.GOLD_CHEST.get().defaultBlockState()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public static Callable<BlockEntityWithoutLevelRenderer> getDiamondChestItemStackRenderer() {
|
|
||||||
return () -> new IronChestItemStackRenderer(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels(), () -> new DiamondChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.DIAMOND_CHEST.get().defaultBlockState()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public static Callable<BlockEntityWithoutLevelRenderer> getCopperChestItemStackRenderer() {
|
|
||||||
return () -> new IronChestItemStackRenderer(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels(), () -> new CopperChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.COPPER_CHEST.get().defaultBlockState()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public static Callable<BlockEntityWithoutLevelRenderer> getSilverChestItemStackRenderer() {
|
|
||||||
return () -> new IronChestItemStackRenderer(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels(), () -> new SilverChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.SILVER_CHEST.get().defaultBlockState()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public static Callable<BlockEntityWithoutLevelRenderer> getCrystalChestItemStackRenderer() {
|
|
||||||
return () -> new IronChestItemStackRenderer(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels(), () -> new CrystalChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.CRYSTAL_CHEST.get().defaultBlockState()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public static Callable<BlockEntityWithoutLevelRenderer> getObsidianChestItemStackRenderer() {
|
|
||||||
return () -> new IronChestItemStackRenderer(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels(), () -> new ObsidianChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.OBSIDIAN_CHEST.get().defaultBlockState()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
|
||||||
public static Callable<BlockEntityWithoutLevelRenderer> getDirtChestItemStackRenderer() {
|
|
||||||
return () -> new IronChestItemStackRenderer(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels(), () -> new DirtChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.DIRT_CHEST.get().defaultBlockState()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import javax.annotation.Nullable;
|
||||||
public class ObsidianChestBlock extends AbstractIronChestBlock {
|
public class ObsidianChestBlock extends AbstractIronChestBlock {
|
||||||
|
|
||||||
public ObsidianChestBlock(BlockBehaviour.Properties properties) {
|
public ObsidianChestBlock(BlockBehaviour.Properties properties) {
|
||||||
super(properties, IronChestsBlockEntityTypes.GOLD_CHEST::get, IronChestsTypes.GOLD);
|
super(properties, IronChestsBlockEntityTypes.OBSIDIAN_CHEST::get, IronChestsTypes.OBSIDIAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,7 @@ import net.minecraft.world.CompoundContainer;
|
||||||
import net.minecraft.world.Container;
|
import net.minecraft.world.Container;
|
||||||
import net.minecraft.world.ContainerHelper;
|
import net.minecraft.world.ContainerHelper;
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
import net.minecraft.world.entity.player.Inventory;
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
|
||||||
import net.minecraft.world.inventory.ChestMenu;
|
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.BlockGetter;
|
import net.minecraft.world.level.BlockGetter;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import com.progwml6.ironchest.common.block.IronChestsTypes;
|
||||||
import com.progwml6.ironchest.common.block.entity.AbstractIronChestBlockEntity;
|
import com.progwml6.ironchest.common.block.entity.AbstractIronChestBlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.block.ChestBlock;
|
import net.minecraft.world.level.block.ChestBlock;
|
||||||
import net.minecraft.world.item.TooltipFlag;
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
|
@ -19,8 +18,6 @@ import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ChestUpgradeItem extends Item {
|
public class ChestUpgradeItem extends Item {
|
||||||
|
|
||||||
private final IronChestsUpgradeType type;
|
private final IronChestsUpgradeType type;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,25 @@
|
||||||
package com.progwml6.ironchest.common.item;
|
package com.progwml6.ironchest.common.item;
|
||||||
|
|
||||||
|
import com.progwml6.ironchest.client.model.inventory.IronChestItemStackRenderer;
|
||||||
|
import com.progwml6.ironchest.common.block.IronChestsBlocks;
|
||||||
|
import com.progwml6.ironchest.common.block.IronChestsTypes;
|
||||||
|
import com.progwml6.ironchest.common.block.entity.CopperChestBlockEntity;
|
||||||
|
import com.progwml6.ironchest.common.block.entity.CrystalChestBlockEntity;
|
||||||
|
import com.progwml6.ironchest.common.block.entity.DiamondChestBlockEntity;
|
||||||
|
import com.progwml6.ironchest.common.block.entity.DirtChestBlockEntity;
|
||||||
|
import com.progwml6.ironchest.common.block.entity.GoldChestBlockEntity;
|
||||||
|
import com.progwml6.ironchest.common.block.entity.IronChestBlockEntity;
|
||||||
|
import com.progwml6.ironchest.common.block.entity.ObsidianChestBlockEntity;
|
||||||
|
import com.progwml6.ironchest.common.block.entity.SilverChestBlockEntity;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
|
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.client.IItemRenderProperties;
|
import net.minecraftforge.client.IItemRenderProperties;
|
||||||
|
import net.minecraftforge.fml.DistExecutor;
|
||||||
|
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
@ -12,13 +27,14 @@ import java.util.function.Supplier;
|
||||||
|
|
||||||
public class IronChestBlockItem extends BlockItem {
|
public class IronChestBlockItem extends BlockItem {
|
||||||
|
|
||||||
protected Supplier<BlockEntityWithoutLevelRenderer> itemRenderer;
|
protected Supplier<IronChestsTypes> type;
|
||||||
|
|
||||||
public IronChestBlockItem(Block block, Properties properties, Supplier<Callable<BlockEntityWithoutLevelRenderer>> itemRenderer) {
|
public IronChestBlockItem(Block block, Properties properties, Supplier<Callable<IronChestsTypes>> type) {
|
||||||
super(block, properties);
|
super(block, properties);
|
||||||
|
|
||||||
BlockEntityWithoutLevelRenderer tmp = net.minecraftforge.fml.DistExecutor.callWhenOn(Dist.CLIENT, itemRenderer);
|
IronChestsTypes tempType = DistExecutor.callWhenOn(Dist.CLIENT, type);
|
||||||
this.itemRenderer = tmp == null ? null : () -> tmp;
|
|
||||||
|
this.type = tempType == null ? null : () -> tempType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -28,8 +44,20 @@ public class IronChestBlockItem extends BlockItem {
|
||||||
consumer.accept(new IItemRenderProperties() {
|
consumer.accept(new IItemRenderProperties() {
|
||||||
@Override
|
@Override
|
||||||
public BlockEntityWithoutLevelRenderer getItemStackRenderer() {
|
public BlockEntityWithoutLevelRenderer getItemStackRenderer() {
|
||||||
System.out.println(itemRenderer);
|
Supplier<BlockEntity> modelToUse;
|
||||||
return itemRenderer.get();
|
|
||||||
|
switch (type.get()) {
|
||||||
|
case GOLD -> modelToUse = () -> new GoldChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.GOLD_CHEST.get().defaultBlockState());
|
||||||
|
case DIAMOND -> modelToUse = () -> new DiamondChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.DIAMOND_CHEST.get().defaultBlockState());
|
||||||
|
case COPPER -> modelToUse = () -> new CopperChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.COPPER_CHEST.get().defaultBlockState());
|
||||||
|
case SILVER -> modelToUse = () -> new SilverChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.SILVER_CHEST.get().defaultBlockState());
|
||||||
|
case CRYSTAL -> modelToUse = () -> new CrystalChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.CRYSTAL_CHEST.get().defaultBlockState());
|
||||||
|
case OBSIDIAN -> modelToUse = () -> new ObsidianChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.OBSIDIAN_CHEST.get().defaultBlockState());
|
||||||
|
case DIRT -> modelToUse = () -> new DirtChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.DIRT_CHEST.get().defaultBlockState());
|
||||||
|
default -> modelToUse = () -> new IronChestBlockEntity(BlockPos.ZERO, IronChestsBlocks.IRON_CHEST.get().defaultBlockState());
|
||||||
|
}
|
||||||
|
|
||||||
|
return new IronChestItemStackRenderer(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels(), modelToUse);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue