diff --git a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java index 841ad57da..39a6ccbb8 100644 --- a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java +++ b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java @@ -75,8 +75,9 @@ public final class ComputerCraftProxyClient ModLoadingContext.get().registerExtensionPoint( ExtensionPoint.GUIFACTORY, () -> packet -> { ContainerType type = ContainerType.factories.get( packet.getId() ).get(); if( packet.getAdditionalData() != null ) type.fromBytes( packet.getAdditionalData() ); - return ((BiFunction, EntityPlayer, GuiContainer>) ContainerType.guiFactories.get( packet.getId() )) - .apply( type, Minecraft.getInstance().player ); + @SuppressWarnings( "unchecked" ) + BiFunction, EntityPlayer, GuiContainer> factory = (BiFunction, EntityPlayer, GuiContainer>) ContainerType.guiFactories.get( packet.getId() ); + return factory.apply( type, Minecraft.getInstance().player ); } ); } diff --git a/src/main/java/dan200/computercraft/client/render/ItemPocketRenderer.java b/src/main/java/dan200/computercraft/client/render/ItemPocketRenderer.java index a44cb7b16..cff913e88 100644 --- a/src/main/java/dan200/computercraft/client/render/ItemPocketRenderer.java +++ b/src/main/java/dan200/computercraft/client/render/ItemPocketRenderer.java @@ -18,7 +18,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.model.IBakedModel; -import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.item.ItemStack; @@ -89,9 +88,7 @@ public final class ItemPocketRenderer extends ItemMapLikeRenderer GlStateManager.blendFunc( GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA ); GlStateManager.color4f( 1.0F, 1.0F, 1.0F, 1.0F ); - IBakedModel baked = renderItem.getItemModelWithOverrides( stack, null, null ); - baked = ForgeHooksClient.handleCameraTransforms( baked, TransformType.GUI, false ); - renderItem.renderItem( stack, baked ); + renderItem.renderItem( stack, transform( renderItem.getItemModelWithOverrides( stack, null, null ) ) ); GlStateManager.disableAlphaTest(); GlStateManager.disableRescaleNormal(); @@ -168,4 +165,10 @@ public final class ItemPocketRenderer extends ItemMapLikeRenderer GlStateManager.enableLighting(); } + + @SuppressWarnings( { "deprecation" } ) + private static IBakedModel transform( IBakedModel model ) + { + return ForgeHooksClient.handleCameraTransforms( model, net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType.GUI, false ); + } } diff --git a/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java b/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java index b29158056..242857fda 100644 --- a/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java +++ b/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java @@ -9,7 +9,6 @@ package dan200.computercraft.client.render; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.model.IBakedModel; -import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.util.EnumFacing; @@ -122,7 +121,7 @@ public class TurtleMultiModel implements IBakedModel @Nonnull @Override @Deprecated - public ItemCameraTransforms getItemCameraTransforms() + public net.minecraft.client.renderer.model.ItemCameraTransforms getItemCameraTransforms() { return m_baseModel.getItemCameraTransforms(); } diff --git a/src/main/java/dan200/computercraft/core/filesystem/ResourceMount.java b/src/main/java/dan200/computercraft/core/filesystem/ResourceMount.java index caf97ce71..81d71f9eb 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/ResourceMount.java +++ b/src/main/java/dan200/computercraft/core/filesystem/ResourceMount.java @@ -14,7 +14,6 @@ import dan200.computercraft.core.apis.handles.ArrayByteChannel; import net.minecraft.resources.IReloadableResourceManager; import net.minecraft.resources.IResource; import net.minecraft.resources.IResourceManager; -import net.minecraft.resources.IResourceManagerReloadListener; import net.minecraft.util.ResourceLocation; import net.minecraftforge.resource.IResourceType; import net.minecraftforge.resource.ISelectiveResourceReloadListener; @@ -241,7 +240,7 @@ public class ResourceMount implements IMount } /** - * A {@link IResourceManagerReloadListener} which reloads any associated mounts. + * A {@link ISelectiveResourceReloadListener} which reloads any associated mounts. * * While people should really be keeping a permanent reference to this, some people construct it every * method call, so let's make this as small as possible. diff --git a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java index a7a9420df..7351f64a5 100644 --- a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java @@ -7,7 +7,6 @@ package dan200.computercraft.shared.common; import net.minecraft.block.Block; -import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; @@ -23,7 +22,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Random; -public abstract class BlockGeneric extends Block implements ITileEntityProvider +public abstract class BlockGeneric extends Block { private final TileEntityType type; @@ -77,9 +76,15 @@ public abstract class BlockGeneric extends Block implements ITileEntityProvider if( te instanceof TileGeneric ) ((TileGeneric) te).blockTick(); } + @Override + public boolean hasTileEntity( IBlockState state ) + { + return true; + } + @Nullable @Override - public TileEntity createNewTileEntity( @Nonnull IBlockReader world ) + public TileEntity createTileEntity( @Nonnull IBlockState state, @Nonnull IBlockReader world ) { return type.create(); }