mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-15 19:55:42 +00:00
Fix several deprecation warnings
This commit is contained in:
parent
fcaa777c95
commit
23ddd4feb5
@ -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<ContainerType<?>, EntityPlayer, GuiContainer>) ContainerType.guiFactories.get( packet.getId() ))
|
||||
.apply( type, Minecraft.getInstance().player );
|
||||
@SuppressWarnings( "unchecked" )
|
||||
BiFunction<ContainerType<?>, EntityPlayer, GuiContainer> factory = (BiFunction<ContainerType<?>, EntityPlayer, GuiContainer>) ContainerType.guiFactories.get( packet.getId() );
|
||||
return factory.apply( type, Minecraft.getInstance().player );
|
||||
} );
|
||||
}
|
||||
|
||||
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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<? extends TileGeneric> 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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user