Update Iron Chests to 1.16!
This commit is contained in:
parent
55f6e9f0a5
commit
be6c0b9cf4
|
|
@ -4,15 +4,15 @@ org.gradle.jvmargs=-Xmx3G
|
|||
org.gradle.daemon=false
|
||||
|
||||
# Mod Version Information
|
||||
mod_version=10.0
|
||||
mod_version=11.0
|
||||
|
||||
# Minecraft Version Information
|
||||
minecraft_version=1.15.2
|
||||
minecraft_version_toml=15
|
||||
minecraft_version=1.16.1
|
||||
minecraft_version_toml=16
|
||||
|
||||
# Forge Version Information
|
||||
forge_version=31.1.17
|
||||
forge_version_toml=31
|
||||
forge_version=32.0.6
|
||||
forge_version_toml=32
|
||||
|
||||
# Mappings Information
|
||||
mappings_version=20200226-1.15.1
|
||||
mappings_version=20200514-1.16
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.progwml6.ironchest.client.screen;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.progwml6.ironchest.common.block.IronChestsTypes;
|
||||
import com.progwml6.ironchest.common.inventory.IronChestContainer;
|
||||
|
|
@ -28,32 +29,32 @@ public class IronChestScreen extends ContainerScreen<IronChestContainer> impleme
|
|||
this.textureXSize = container.getChestType().textureXSize;
|
||||
this.textureYSize = container.getChestType().textureYSize;
|
||||
|
||||
this.passEvents = false;
|
||||
this.field_230711_n_ = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(int mouseX, int mouseY, float partialTicks) {
|
||||
this.renderBackground();
|
||||
super.render(mouseX, mouseY, partialTicks);
|
||||
this.renderHoveredToolTip(mouseX, mouseY);
|
||||
public void func_230430_a_(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
|
||||
this.func_230446_a_(matrixStack);
|
||||
super.func_230430_a_(matrixStack, mouseX, mouseY, partialTicks);
|
||||
this.func_230459_a_(matrixStack, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
this.font.drawString(this.title.getFormattedText(), 8.0F, 6.0F, 4210752);
|
||||
this.font.drawString(this.playerInventory.getDisplayName().getFormattedText(), 8.0F, (float) (this.ySize - 96 + 2), 4210752);
|
||||
protected void func_230451_b_(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
this.field_230712_o_.func_238422_b_(matrixStack, this.field_230704_d_, 8.0F, 6.0F, 4210752);
|
||||
this.field_230712_o_.func_238422_b_(matrixStack, this.playerInventory.getDisplayName(), 8.0F, (float) (this.ySize - 96 + 2), 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
|
||||
protected void func_230450_a_(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
this.minecraft.getTextureManager().bindTexture(this.chestType.guiTexture);
|
||||
this.field_230706_i_.getTextureManager().bindTexture(this.chestType.guiTexture);
|
||||
|
||||
int x = (this.width - this.xSize) / 2;
|
||||
int y = (this.height - this.ySize) / 2;
|
||||
int x = (this.field_230708_k_ - this.xSize) / 2;
|
||||
int y = (this.field_230709_l_ - this.ySize) / 2;
|
||||
|
||||
blit(x, y, 0, 0, this.xSize, this.ySize, this.textureXSize, this.textureYSize);
|
||||
func_238463_a_(matrixStack, x, y, 0, 0, this.xSize, this.ySize, this.textureXSize, this.textureYSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.progwml6.ironchest.client.tileentity;
|
|||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
@ -21,7 +22,7 @@ public class IronChestItemStackRenderer<T extends TileEntity> extends ItemStackT
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(ItemStack itemStackIn, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) {
|
||||
public void func_239207_a_(ItemStack itemStackIn, ItemCameraTransforms.TransformType transformType, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) {
|
||||
TileEntityRendererDispatcher.instance.renderItem(this.te.get(), matrixStackIn, bufferIn, combinedLightIn, combinedOverlayIn);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
|
@ -11,17 +10,16 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.client.renderer.Atlases;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.renderer.model.Material;
|
||||
import net.minecraft.client.renderer.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.model.RenderMaterial;
|
||||
import net.minecraft.client.renderer.tileentity.DualBrightnessCallback;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.state.properties.ChestType;
|
||||
import net.minecraft.tileentity.IChestLid;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityMerger;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.vector.Vector3f;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class IronChestTileEntityRenderer<T extends TileEntity & IChestLid> extends TileEntityRenderer<T> {
|
||||
|
|
@ -82,7 +80,7 @@ public class IronChestTileEntityRenderer<T extends TileEntity & IChestLid> exten
|
|||
f1 = 1.0F - f1 * f1 * f1;
|
||||
int i = iCallbackWrapper.apply(new DualBrightnessCallback<>()).applyAsInt(combinedLightIn);
|
||||
|
||||
Material material = new Material(Atlases.CHEST_ATLAS, IronChestsModels.chooseChestTexture(chestType));
|
||||
RenderMaterial material = new RenderMaterial(Atlases.CHEST_ATLAS, IronChestsModels.chooseChestTexture(chestType));
|
||||
IVertexBuilder ivertexbuilder = material.getBuffer(bufferIn, RenderType::getEntityCutout);
|
||||
|
||||
this.handleModelRender(matrixStackIn, ivertexbuilder, this.chestLid, this.chestLock, this.chestBottom, f1, i, combinedOverlayIn);
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ package com.progwml6.ironchest.client.tileentity;
|
|||
import com.progwml6.ironchest.IronChests;
|
||||
import com.progwml6.ironchest.common.block.IronChestsTypes;
|
||||
import net.minecraft.client.renderer.Atlases;
|
||||
import net.minecraft.client.renderer.model.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import net.minecraft.entity.LivingEntity;
|
|||
import net.minecraft.entity.passive.CatEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.fluid.IFluidState;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
|
|
@ -94,13 +94,13 @@ public class GenericIronChestBlock extends Block implements IWaterLoggable {
|
|||
@Override
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
Direction direction = context.getPlacementHorizontalFacing().getOpposite();
|
||||
IFluidState ifluidstate = context.getWorld().getFluidState(context.getPos());
|
||||
FluidState ifluidstate = context.getWorld().getFluidState(context.getPos());
|
||||
|
||||
return this.getDefaultState().with(FACING, direction).with(WATERLOGGED, ifluidstate.getFluid() == Fluids.WATER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFluidState getFluidState(BlockState state) {
|
||||
public FluidState getFluidState(BlockState state) {
|
||||
return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state);
|
||||
}
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ public class GenericIronChestBlock extends Block implements IWaterLoggable {
|
|||
List<CatEntity> list = iWorld.getEntitiesWithinAABB(CatEntity.class, new AxisAlignedBB((double) blockPos.getX(), (double) (blockPos.getY() + 1), (double) blockPos.getZ(), (double) (blockPos.getX() + 1), (double) (blockPos.getY() + 2), (double) (blockPos.getZ() + 1)));
|
||||
if (!list.isEmpty()) {
|
||||
for (CatEntity catentity : list) {
|
||||
if (catentity.isSitting()) {
|
||||
if (catentity.func_233684_eK_()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import java.util.function.Supplier;
|
|||
|
||||
public class IronChestsBlocks {
|
||||
|
||||
public static final DeferredRegister<Block> BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, IronChests.MODID);
|
||||
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, IronChests.MODID);
|
||||
public static final DeferredRegister<Item> ITEMS = IronChestsItems.ITEMS;
|
||||
|
||||
public static final RegistryObject<IronChestBlock> IRON_CHEST = register(
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public enum IronChestsTypes implements IStringSerializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String func_176610_l() {
|
||||
return this.getEnglishName();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ public class GenericIronChestTileEntity extends LockableLootTileEntity implement
|
|||
}
|
||||
|
||||
@Override
|
||||
public void read(CompoundNBT compound) {
|
||||
super.read(compound);
|
||||
public void func_230337_a_(BlockState state, CompoundNBT compound) {
|
||||
super.func_230337_a_(state, compound);
|
||||
|
||||
this.chestContents = NonNullList.withSize(this.getSizeInventory(), ItemStack.EMPTY);
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import net.minecraftforge.registries.ForgeRegistries;
|
|||
|
||||
public class IronChestsTileEntityTypes {
|
||||
|
||||
public static final DeferredRegister<TileEntityType<?>> TILE_ENTITIES = new DeferredRegister<>(ForgeRegistries.TILE_ENTITIES, IronChests.MODID);
|
||||
public static final DeferredRegister<TileEntityType<?>> TILE_ENTITIES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, IronChests.MODID);
|
||||
|
||||
public static final RegistryObject<TileEntityType<IronChestTileEntity>> IRON_CHEST = TILE_ENTITIES.register(
|
||||
"iron_chest", () -> new TileEntityType<>(IronChestTileEntity::new, Sets.newHashSet(IronChestsBlocks.IRON_CHEST.get()), null));
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import net.minecraftforge.registries.ForgeRegistries;
|
|||
|
||||
public class IronChestsContainerTypes {
|
||||
|
||||
public static final DeferredRegister<ContainerType<?>> CONTAINERS = new DeferredRegister<>(ForgeRegistries.CONTAINERS, IronChests.MODID);
|
||||
public static final DeferredRegister<ContainerType<?>> CONTAINERS = DeferredRegister.create(ForgeRegistries.CONTAINERS, IronChests.MODID);
|
||||
|
||||
public static final RegistryObject<ContainerType<IronChestContainer>> IRON_CHEST = CONTAINERS.register("iron_chest", () -> new ContainerType<>(IronChestContainer::createIronContainer));
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
public class IronChestsItems {
|
||||
|
||||
public static final DeferredRegister<Item> ITEMS = new DeferredRegister<>(ForgeRegistries.ITEMS, IronChests.MODID);
|
||||
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, IronChests.MODID);
|
||||
|
||||
public static final ImmutableMap<IronChestsUpgradeType, RegistryObject<ChestUpgradeItem>> UPGRADES = ImmutableMap.copyOf(Arrays.stream(IronChestsUpgradeType.values())
|
||||
.collect(Collectors.toMap(Function.identity(), type -> register(type.name().toLowerCase(Locale.ROOT) + "_chest_upgrade",
|
||||
|
|
|
|||
Loading…
Reference in New Issue