Misc deprecation fixes.
This commit is contained in:
parent
d0bdf744cf
commit
23375b5cd3
13 changed files with 28 additions and 27 deletions
|
@ -83,7 +83,7 @@ public class TechRebornClient implements ClientModInitializer {
|
|||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
ModelLoadingRegistry.INSTANCE.registerAppender((manager, out) -> {
|
||||
ModelLoadingRegistry.INSTANCE.registerModelProvider((manager, out) -> {
|
||||
out.accept(new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_base"), "inventory"));
|
||||
out.accept(new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_fluid"), "inventory"));
|
||||
out.accept(new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_background"), "inventory"));
|
||||
|
|
|
@ -52,11 +52,11 @@ import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandler;
|
|||
import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandlerRegistry;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.screen.PlayerScreenHandler;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
@ -366,7 +366,7 @@ public class ReiPlugin implements REIClientPlugin {
|
|||
}
|
||||
|
||||
public void drawFluid(MatrixStack matrixStack, Fluid fluid, int drawHeight, int x, int y, int width, int height) {
|
||||
RenderSystem.setShaderTexture(0, SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE);
|
||||
RenderSystem.setShaderTexture(0, PlayerScreenHandler.BLOCK_ATLAS_TEXTURE);
|
||||
y += height;
|
||||
|
||||
FluidRenderHandler handler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
|
||||
|
|
|
@ -26,8 +26,8 @@ package techreborn.client.render;
|
|||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.util.ModelIdentifier;
|
||||
import net.minecraft.screen.PlayerScreenHandler;
|
||||
import net.minecraft.util.Identifier;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class DynamicBucketBakedModel extends BaseDynamicFluidBakedModel {
|
|||
@Override
|
||||
public Sprite getParticleSprite() {
|
||||
return MinecraftClient.getInstance()
|
||||
.getSpriteAtlas(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE)
|
||||
.getSpriteAtlas(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE)
|
||||
.apply(new Identifier("minecraft:item/bucket"));
|
||||
}
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@ import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
|
|||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.model.BakedModelManager;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.util.ModelIdentifier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.screen.PlayerScreenHandler;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import techreborn.TechReborn;
|
||||
|
@ -55,7 +55,7 @@ public class DynamicCellBakedModel extends BaseDynamicFluidBakedModel {
|
|||
@Override
|
||||
public Sprite getParticleSprite() {
|
||||
return MinecraftClient.getInstance()
|
||||
.getSpriteAtlas(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE)
|
||||
.getSpriteAtlas(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE)
|
||||
.apply(new Identifier("techreborn:item/cell_base"));
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ import net.minecraft.client.render.block.BlockRenderManager;
|
|||
import net.minecraft.client.render.entity.EntityRenderer;
|
||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||
import net.minecraft.client.render.entity.TntMinecartEntityRenderer;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.PlayerScreenHandler;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3f;
|
||||
|
@ -53,7 +53,7 @@ public class NukeRenderer extends EntityRenderer<EntityNukePrimed> {
|
|||
@Nullable
|
||||
@Override
|
||||
public Identifier getTexture(EntityNukePrimed entityNukePrimed) {
|
||||
return SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE;
|
||||
return PlayerScreenHandler.BLOCK_ATLAS_TEXTURE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
package techreborn.blockentity;
|
||||
|
||||
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory;
|
||||
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
|
||||
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
@ -36,6 +36,7 @@ import net.minecraft.server.network.ServerPlayerEntity;
|
|||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.api.blockentity.IMachineGuiHandler;
|
||||
|
@ -138,13 +139,14 @@ public final class GuiType<T extends BlockEntity> implements IMachineGuiHandler
|
|||
|
||||
private GuiType(Identifier identifier) {
|
||||
this.identifier = identifier;
|
||||
this.screenHandlerType = ScreenHandlerRegistry.registerExtended(identifier, getScreenHandlerFactory());
|
||||
this.screenHandlerType = Registry.register(Registry.SCREEN_HANDLER, identifier, new ExtendedScreenHandlerType<>(getScreenHandlerFactory()));
|
||||
|
||||
TYPES.put(identifier, this);
|
||||
}
|
||||
|
||||
private ScreenHandlerRegistry.ExtendedClientHandlerFactory<BuiltScreenHandler> getScreenHandlerFactory() {
|
||||
private ExtendedScreenHandlerType.ExtendedFactory<BuiltScreenHandler> getScreenHandlerFactory() {
|
||||
return (syncId, playerInventory, packetByteBuf) -> {
|
||||
|
||||
final BlockEntity blockEntity = playerInventory.player.world.getBlockEntity(packetByteBuf.readBlockPos());
|
||||
BuiltScreenHandler screenHandler = ((BuiltScreenHandlerProvider) blockEntity).createScreenHandler(syncId, playerInventory.player);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue