Iron chests now work for 1.15!

This commit is contained in:
alexbegt 2020-02-27 21:21:03 -05:00
parent 56db909289
commit b49809cd9a
19 changed files with 51 additions and 38 deletions

View File

@ -11,8 +11,8 @@ minecraft_version=1.15.2
minecraft_version_toml=15
# Forge Version Information
forge_version=31.0.0
forge_version=31.1.17
forge_version_toml=31
# Mappings Information
mappings_version=20200122-1.15.1
mappings_version=20200226-1.15.1

View File

@ -67,8 +67,6 @@ public class IronChestsLangProvider extends LanguageProvider {
// MISC
this.add(IronChests.IRONCHESTS_ITEM_GROUP, "Iron Chests");
//IronChestsTypes.values()
}
private String getAutomaticName(Supplier<? extends IForgeRegistryEntry<?>> sup) {

View File

@ -21,7 +21,7 @@ public class IronChestItemStackRenderer<T extends TileEntity> extends ItemStackT
}
@Override
public void render(ItemStack itemStackIn, MatrixStack matrixStack, IRenderTypeBuffer iRenderTypeBuffer, int p_228364_4_, int p_228364_5_) {
TileEntityRendererDispatcher.instance.renderNullable(this.te.get(), matrixStack, iRenderTypeBuffer, p_228364_4_, p_228364_5_);
public void render(ItemStack itemStackIn, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) {
TileEntityRendererDispatcher.instance.renderItem(this.te.get(), matrixStackIn, bufferIn, combinedLightIn, combinedOverlayIn);
}
}

View File

@ -1,5 +1,6 @@
package com.progwml6.ironchest.client.tileentity;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.progwml6.ironchest.common.block.GenericIronChestBlock;
@ -44,7 +45,7 @@ public class IronChestTileEntityRenderer<T extends TileEntity & IChestLid> exten
}
@Override
public void render(T tileEntityIn, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer iRenderTypeBuffer, int p_225616_5_, int p_225616_6_) {
public void render(T tileEntityIn, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) {
GenericIronChestTileEntity tileEntity = (GenericIronChestTileEntity) tileEntityIn;
World world = tileEntity.getWorld();
@ -62,11 +63,11 @@ public class IronChestTileEntityRenderer<T extends TileEntity & IChestLid> exten
if (block instanceof GenericIronChestBlock) {
GenericIronChestBlock ironChestBlock = (GenericIronChestBlock) block;
matrixStack.push();
matrixStackIn.push();
float f = blockstate.get(GenericIronChestBlock.FACING).getHorizontalAngle();
matrixStack.translate(0.5D, 0.5D, 0.5D);
matrixStack.rotate(Vector3f.field_229181_d_.func_229187_a_(-f));
matrixStack.translate(-0.5D, -0.5D, -0.5D);
matrixStackIn.translate(0.5D, 0.5D, 0.5D);
matrixStackIn.rotate(Vector3f.YP.rotationDegrees(-f));
matrixStackIn.translate(-0.5D, -0.5D, -0.5D);
TileEntityMerger.ICallbackWrapper<? extends GenericIronChestTileEntity> iCallbackWrapper;
if (flag) {
@ -79,22 +80,22 @@ public class IronChestTileEntityRenderer<T extends TileEntity & IChestLid> exten
float f1 = iCallbackWrapper.apply(GenericIronChestBlock.getLid((IChestLid) tileEntity)).get(partialTicks);
f1 = 1.0F - f1;
f1 = 1.0F - f1 * f1 * f1;
int i = iCallbackWrapper.apply(new DualBrightnessCallback<>()).applyAsInt(p_225616_5_);
int i = iCallbackWrapper.apply(new DualBrightnessCallback<>()).applyAsInt(combinedLightIn);
Material material = IronChestsModels.chooseChestModel(tileEntity, chestType);
IVertexBuilder ivertexbuilder = material.func_229311_a_(iRenderTypeBuffer, RenderType::entityCutout);
IVertexBuilder ivertexbuilder = material.getBuffer(bufferIn, RenderType::getEntityCutout);
this.handleModelRender(matrixStack, ivertexbuilder, this.chestLid, this.chestLock, this.chestBottom, f1, i, p_225616_6_);
this.handleModelRender(matrixStackIn, ivertexbuilder, this.chestLid, this.chestLock, this.chestBottom, f1, i, combinedOverlayIn);
matrixStack.pop();
matrixStackIn.pop();
}
}
private void handleModelRender(MatrixStack matrixStack, IVertexBuilder iVertexBuilder, ModelRenderer firstModel, ModelRenderer secondModel, ModelRenderer thirdModel, float f1, int p_228871_7_, int p_228871_8_) {
private void handleModelRender(MatrixStack matrixStackIn, IVertexBuilder iVertexBuilder, ModelRenderer firstModel, ModelRenderer secondModel, ModelRenderer thirdModel, float f1, int p_228871_7_, int p_228871_8_) {
firstModel.rotateAngleX = -(f1 * ((float) Math.PI / 2F));
secondModel.rotateAngleX = firstModel.rotateAngleX;
firstModel.render(matrixStack, iVertexBuilder, p_228871_7_, p_228871_8_);
secondModel.render(matrixStack, iVertexBuilder, p_228871_7_, p_228871_8_);
thirdModel.render(matrixStack, iVertexBuilder, p_228871_7_, p_228871_8_);
firstModel.render(matrixStackIn, iVertexBuilder, p_228871_7_, p_228871_8_);
secondModel.render(matrixStackIn, iVertexBuilder, p_228871_7_, p_228871_8_);
thirdModel.render(matrixStackIn, iVertexBuilder, p_228871_7_, p_228871_8_);
}
}

View File

@ -58,7 +58,7 @@ public class IronChestsModels {
return CRYSTAL_CHEST_LOCATION;
case OBSIDIAN:
return OBSIDIAN_CHEST_LOCATION;
case DIRTCHEST9000:
case DIRT:
return DIRT_CHEST_LOCATION;
case WOOD:
default:
@ -68,17 +68,17 @@ public class IronChestsModels {
@SubscribeEvent
public static void onStitch(TextureStitchEvent.Pre event) {
if (!event.getMap().getBasePath().equals(Atlases.CHEST_ATLAS)) {
if (!event.getMap().getTextureLocation().equals(Atlases.CHEST_ATLAS)) {
return;
}
event.addSprite(IRON_CHEST_LOCATION.func_229313_b_());
event.addSprite(GOLD_CHEST_LOCATION.func_229313_b_());
event.addSprite(DIAMOND_CHEST_LOCATION.func_229313_b_());
event.addSprite(COPPER_CHEST_LOCATION.func_229313_b_());
event.addSprite(SILVER_CHEST_LOCATION.func_229313_b_());
event.addSprite(CRYSTAL_CHEST_LOCATION.func_229313_b_());
event.addSprite(OBSIDIAN_CHEST_LOCATION.func_229313_b_());
event.addSprite(DIRT_CHEST_LOCATION.func_229313_b_());
event.addSprite(IRON_CHEST_LOCATION.getTextureLocation());
event.addSprite(GOLD_CHEST_LOCATION.getTextureLocation());
event.addSprite(DIAMOND_CHEST_LOCATION.getTextureLocation());
event.addSprite(COPPER_CHEST_LOCATION.getTextureLocation());
event.addSprite(SILVER_CHEST_LOCATION.getTextureLocation());
event.addSprite(CRYSTAL_CHEST_LOCATION.getTextureLocation());
event.addSprite(OBSIDIAN_CHEST_LOCATION.getTextureLocation());
event.addSprite(DIRT_CHEST_LOCATION.getTextureLocation());
}
}

View File

@ -10,7 +10,7 @@ import net.minecraft.world.IBlockReader;
public class DirtChestBlock extends GenericIronChestBlock {
public DirtChestBlock(Properties properties) {
super(IronChestsTypes.DIRTCHEST9000, IronChestsTileEntityTypes.DIRT_CHEST::get, properties);
super(IronChestsTypes.DIRT, IronChestsTileEntityTypes.DIRT_CHEST::get, properties);
}
@Override

View File

@ -27,7 +27,7 @@ public enum IronChestsTypes implements IStringSerializable {
SILVER(72, 9, 184, 258, new ResourceLocation("ironchest", "textures/gui/silver_container.png"), 256, 276),
CRYSTAL(108, 12, 238, 276, new ResourceLocation("ironchest", "textures/gui/diamond_container.png"), 256, 276),
OBSIDIAN(108, 12, 238, 276, new ResourceLocation("ironchest", "textures/gui/diamond_container.png"), 256, 276),
DIRTCHEST9000(1, 1, 184, 184, new ResourceLocation("ironchest", "textures/gui/dirt_container.png"), 256, 256),
DIRT(1, 1, 184, 184, new ResourceLocation("ironchest", "textures/gui/dirt_container.png"), 256, 256),
WOOD(0, 0, 0, 0, null, 0, 0);
private final String name;
@ -91,7 +91,7 @@ public enum IronChestsTypes implements IStringSerializable {
return IronChestsBlocks.CRYSTAL_CHEST.get();
case OBSIDIAN:
return IronChestsBlocks.OBSIDIAN_CHEST.get();
case DIRTCHEST9000:
case DIRT:
return IronChestsBlocks.DIRT_CHEST.get();
default:
return Blocks.CHEST;
@ -114,7 +114,7 @@ public enum IronChestsTypes implements IStringSerializable {
return new CrystalChestTileEntity();
case OBSIDIAN:
return new ObsidianChestTileEntity();
case DIRTCHEST9000:
case DIRT:
return new DirtChestTileEntity();
default:
return null;

View File

@ -21,7 +21,11 @@ public class DirtChestTileEntity extends GenericIronChestTileEntity {
private static boolean bookDataCreated = false;
public DirtChestTileEntity() {
super(IronChestsTileEntityTypes.DIRT_CHEST.get(), IronChestsTypes.DIRTCHEST9000, IronChestsBlocks.DIRT_CHEST::get);
super(IronChestsTileEntityTypes.DIRT_CHEST.get(), IronChestsTypes.DIRT, IronChestsBlocks.DIRT_CHEST::get);
if (!bookDataCreated) {
createBookData();
}
}
@Override

View File

@ -72,7 +72,7 @@ public class GenericIronChestTileEntity extends LockableLootTileEntity implement
@Override
protected ITextComponent getDefaultName() {
return new TranslationTextComponent(IronChests.MODID + ".container."+ this.chestType.getId() + "chest");
return new TranslationTextComponent(IronChests.MODID + ".container."+ this.chestType.getId() + "_chest");
}
@Override

View File

@ -79,11 +79,11 @@ public class IronChestContainer extends Container {
}
public static IronChestContainer createDirtContainer(int windowId, PlayerInventory playerInventory) {
return new IronChestContainer(IronChestsContainerTypes.DIRT_CHEST.get(), windowId, playerInventory, new Inventory(IronChestsTypes.DIRTCHEST9000.size), IronChestsTypes.DIRTCHEST9000);
return new IronChestContainer(IronChestsContainerTypes.DIRT_CHEST.get(), windowId, playerInventory, new Inventory(IronChestsTypes.DIRT.size), IronChestsTypes.DIRT);
}
public static IronChestContainer createDirtContainer(int windowId, PlayerInventory playerInventory, IInventory inventory) {
return new IronChestContainer(IronChestsContainerTypes.DIRT_CHEST.get(), windowId, playerInventory, inventory, IronChestsTypes.DIRTCHEST9000);
return new IronChestContainer(IronChestsContainerTypes.DIRT_CHEST.get(), windowId, playerInventory, inventory, IronChestsTypes.DIRT);
}
public IronChestContainer(ContainerType<?> containerType, int windowId, PlayerInventory playerInventory, IInventory inventory, IronChestsTypes chestType) {
@ -95,7 +95,7 @@ public class IronChestContainer extends Container {
inventory.openInventory(playerInventory.player);
if (chestType == IronChestsTypes.DIRTCHEST9000) {
if (chestType == IronChestsTypes.DIRT) {
this.addSlot(new DirtChestSlot(inventory, 0, 12 + 4 * 18, 8 + 2 * 18));
}
else {

View File

@ -27,6 +27,16 @@
"book.ironchest.dirtchest9000.page3": "We hope you have enjoyed reviewing this instruction manual, and hope you will consider using our products in future! Kind regards, The DirtChest 9000 manual writers incorporated.",
"book.ironchest.dirtchest9000.page4": "Warranty: This product has no warranty of any kind. Your dirt may not be stored, it may slowly leech into the environment, or alternatively, it may not do anything at all.",
"book.ironchest.dirtchest9000.page5": "DirtChest 9000 is kind to the environment. Please dispose of this guide book responsibly, and do not whatever you do just chuck it into some lava. We would be very sad.",
"_comment": "Containers",
"ironchest.container.iron_chest": "Iron Chest",
"ironchest.container.gold_chest": "Gold Chest",
"ironchest.container.diamond_chest": "Diamond Chest",
"ironchest.container.copper_chest": "Copper Chest",
"ironchest.container.silver_chest": "Silver Chest",
"ironchest.container.crystal_chest": "Crystal Chest",
"ironchest.container.obsidian_chest": "Obsidian Chest",
"ironchest.container.dirt_chest": "DirtChest 9000!",
"_comment": "Item Groups",
"itemGroup.ironchest": "Iron Chests"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB