Misc deprecation fixes.
This commit is contained in:
parent
d0bdf744cf
commit
23375b5cd3
13 changed files with 28 additions and 27 deletions
|
@ -31,7 +31,7 @@ import net.fabricmc.fabric.api.client.item.v1.ItemTooltipCallback;
|
|||
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
|
||||
import net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.screen.PlayerScreenHandler;
|
||||
import reborncore.api.blockentity.UnloadHandler;
|
||||
import reborncore.client.*;
|
||||
import reborncore.common.screen.ScreenIcons;
|
||||
|
@ -44,7 +44,7 @@ public class RebornCoreClient implements ClientModInitializer {
|
|||
public void onInitializeClient() {
|
||||
RebornFluidRenderManager.setupClient();
|
||||
HolidayRenderManager.setupClient();
|
||||
ClientSpriteRegistryCallback.event(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE).register((atlasTexture, registry) -> {
|
||||
ClientSpriteRegistryCallback.event(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE).register((atlasTexture, registry) -> {
|
||||
registry.register(ScreenIcons.HEAD);
|
||||
registry.register(ScreenIcons.CHEST);
|
||||
registry.register(ScreenIcons.LEGS);
|
||||
|
|
|
@ -34,6 +34,7 @@ import net.minecraft.client.texture.SpriteAtlasTexture;
|
|||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.resource.ResourceManager;
|
||||
import net.minecraft.resource.ResourceType;
|
||||
import net.minecraft.screen.PlayerScreenHandler;
|
||||
import net.minecraft.util.Identifier;
|
||||
import reborncore.common.fluid.FluidSettings;
|
||||
import reborncore.common.fluid.RebornFluid;
|
||||
|
@ -52,7 +53,7 @@ public class RebornFluidRenderManager implements ClientSpriteRegistryCallback, S
|
|||
|
||||
public static void setupClient() {
|
||||
RebornFluidRenderManager rebornFluidRenderManager = new RebornFluidRenderManager();
|
||||
ClientSpriteRegistryCallback.event(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE).register(rebornFluidRenderManager);
|
||||
ClientSpriteRegistryCallback.event(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE).register(rebornFluidRenderManager);
|
||||
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(rebornFluidRenderManager);
|
||||
RebornFluidManager.getFluidStream().forEach(RebornFluidRenderManager::setupFluidRenderer);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ import net.minecraft.client.texture.SpriteAtlasTexture;
|
|||
import net.minecraft.client.texture.TextureManager;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.screen.PlayerScreenHandler;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.fluid.FluidValue;
|
||||
|
@ -44,14 +45,12 @@ import reborncore.common.util.Tank;
|
|||
* Created by Gigabit101 on 08/08/2016.
|
||||
*/
|
||||
public class RenderUtil {
|
||||
public static final Identifier BLOCK_TEX = SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE;
|
||||
|
||||
public static TextureManager engine() {
|
||||
return MinecraftClient.getInstance().getTextureManager();
|
||||
}
|
||||
|
||||
public static void bindBlockTexture() {
|
||||
RenderSystem.setShaderTexture(0, BLOCK_TEX);
|
||||
RenderSystem.setShaderTexture(0, PlayerScreenHandler.BLOCK_ATLAS_TEXTURE);
|
||||
}
|
||||
|
||||
public static Sprite getStillTexture(FluidInstance fluid) {
|
||||
|
@ -62,7 +61,7 @@ public class RenderUtil {
|
|||
}
|
||||
|
||||
public static Sprite getSprite(Identifier identifier) {
|
||||
return MinecraftClient.getInstance().getSpriteAtlas(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE).apply(identifier);
|
||||
return MinecraftClient.getInstance().getSpriteAtlas(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE).apply(identifier);
|
||||
}
|
||||
|
||||
public static Sprite getStillTexture(Fluid fluid) {
|
||||
|
|
|
@ -33,8 +33,8 @@ import net.minecraft.client.render.Tessellator;
|
|||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.block.BlockRenderManager;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.PlayerScreenHandler;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Quaternion;
|
||||
|
@ -74,7 +74,7 @@ public class FluidConfigPopupElement extends ElementBase {
|
|||
BlockState actualState = state.getBlock().getDefaultState();
|
||||
BlockRenderManager dispatcher = MinecraftClient.getInstance().getBlockRenderManager();
|
||||
BakedModel model = dispatcher.getModels().getModel(state.getBlock().getDefaultState());
|
||||
MinecraftClient.getInstance().getTextureManager().bindTexture(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE);
|
||||
MinecraftClient.getInstance().getTextureManager().bindTexture(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE);
|
||||
drawState(gui, world, model, actualState, pos, dispatcher, 4, 23, Vec3f.POSITIVE_Y.getDegreesQuaternion(90F)); //left
|
||||
drawState(gui, world, model, actualState, pos, dispatcher, 23, 4, Vec3f.NEGATIVE_X.getDegreesQuaternion(90F)); //top
|
||||
drawState(gui, world, model, actualState, pos, dispatcher, 23, 23, null); //centre
|
||||
|
|
|
@ -33,8 +33,8 @@ import net.minecraft.client.render.Tessellator;
|
|||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.block.BlockRenderManager;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.PlayerScreenHandler;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Quaternion;
|
||||
|
@ -78,7 +78,7 @@ public class SlotConfigPopupElement extends ElementBase {
|
|||
BlockState actualState = state.getBlock().getDefaultState();
|
||||
BlockRenderManager dispatcher = MinecraftClient.getInstance().getBlockRenderManager();
|
||||
BakedModel model = dispatcher.getModels().getModel(state.getBlock().getDefaultState());
|
||||
MinecraftClient.getInstance().getTextureManager().bindTexture(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE);
|
||||
MinecraftClient.getInstance().getTextureManager().bindTexture(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE);
|
||||
drawState(gui, world, model, actualState, pos, dispatcher, 4, 23, Vec3f.POSITIVE_Y.getDegreesQuaternion(90F)); //left
|
||||
drawState(gui, world, model, actualState, pos, dispatcher, 23, 4, Vec3f.NEGATIVE_X.getDegreesQuaternion(90F)); //top
|
||||
drawState(gui, world, model, actualState, pos, dispatcher, 23, 23, null); //centre
|
||||
|
|
|
@ -38,10 +38,10 @@ import net.minecraft.client.render.Tessellator;
|
|||
import net.minecraft.client.render.VertexFormat;
|
||||
import net.minecraft.client.render.VertexFormats;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.screen.PlayerScreenHandler;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
@ -715,7 +715,7 @@ public class GuiBuilder {
|
|||
if (fluid.getFluid() == Fluids.EMPTY) {
|
||||
return;
|
||||
}
|
||||
RenderSystem.setShaderTexture(0, SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE);
|
||||
RenderSystem.setShaderTexture(0, PlayerScreenHandler.BLOCK_ATLAS_TEXTURE);
|
||||
y += height;
|
||||
final Sprite sprite = FluidVariantRendering.getSprite(fluid.getVariant());
|
||||
int color = FluidVariantRendering.getColor(fluid.getVariant());
|
||||
|
|
|
@ -48,8 +48,7 @@ public class BlockWrenchEventHandler {
|
|||
if (ToolManager.INSTANCE.canHandleTool(playerEntity.getStackInHand(Hand.MAIN_HAND))) {
|
||||
BlockState state = world.getBlockState(blockHitResult.getBlockPos());
|
||||
if (wrenchableBlocks.contains(state.getBlock())) {
|
||||
Block block = state.getBlock();
|
||||
block.onUse(state, world, blockHitResult.getBlockPos(), playerEntity, hand, blockHitResult);
|
||||
state.onUse(world, playerEntity, hand, blockHitResult);
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue