Continue migration

This commit is contained in:
Aleksey 2021-04-12 16:34:13 +03:00
parent 47ed597358
commit 33dbfbe633
263 changed files with 1450 additions and 1486 deletions

View file

@ -5,7 +5,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.entity.ChestBlockEntity;
import net.minecraft.world.level.block.entity.LootableContainerBlockEntity;
import net.minecraft.world.entity.player.PlayerEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.player.PlayerInventory;
import net.minecraft.inventory.Inventories;
import net.minecraft.world.item.ItemStack;
@ -13,7 +13,7 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.screen.GenericContainerScreenHandler;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.sounds.SoundSource;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
@ -73,7 +73,7 @@ public class EBarrelBlockEntity extends LootableContainerBlockEntity {
return GenericContainerScreenHandler.createGeneric9x3(syncId, playerInventory, this);
}
public void onOpen(PlayerEntity player) {
public void onOpen(Player player) {
if (!player.isSpectator()) {
if (this.viewerCount < 0) {
this.viewerCount = 0;
@ -117,7 +117,7 @@ public class EBarrelBlockEntity extends LootableContainerBlockEntity {
}
}
public void onClose(PlayerEntity player) {
public void onClose(Player player) {
if (!player.isSpectator()) {
--this.viewerCount;
}
@ -132,7 +132,7 @@ public class EBarrelBlockEntity extends LootableContainerBlockEntity {
double d = (double) this.pos.getX() + 0.5D + (double) vec3i.getX() / 2.0D;
double e = (double) this.pos.getY() + 0.5D + (double) vec3i.getY() / 2.0D;
double f = (double) this.pos.getZ() + 0.5D + (double) vec3i.getZ() / 2.0D;
this.world.playLocalSound((PlayerEntity) null, d, e, f, soundEvent, SoundSource.BLOCKS, 0.5F,
this.world.playLocalSound((Player) null, d, e, f, soundEvent, SoundSource.BLOCKS, 0.5F,
this.world.random.nextFloat() * 0.1F + 0.9F);
}
}

View file

@ -14,12 +14,12 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
import net.minecraft.world.level.block.entity.LockableContainerBlockEntity;
import net.minecraft.world.entity.ExperienceOrbEntity;
import net.minecraft.world.entity.player.PlayerEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.player.PlayerInventory;
import net.minecraft.inventory.Inventories;
import net.minecraft.inventory.SidedInventory;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemConvertible;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.nbt.CompoundTag;
@ -171,7 +171,7 @@ public class EndStoneSmelterBlockEntity extends LockableContainerBlockEntity
return smeltTime;
}
public void dropExperience(PlayerEntity player) {
public void dropExperience(Player player) {
assert world != null;
List<Recipe<?>> list = Lists.newArrayList();
for (Entry<ResourceLocation> entry : this.recipesUsed.object2IntEntrySet()) {
@ -205,7 +205,7 @@ public class EndStoneSmelterBlockEntity extends LockableContainerBlockEntity
}
@Override
public boolean canPlayerUse(PlayerEntity player) {
public boolean canPlayerUse(Player player) {
assert this.world != null;
if (this.world.getBlockEntity(this.pos) != this) {
return false;
@ -442,7 +442,7 @@ public class EndStoneSmelterBlockEntity extends LockableContainerBlockEntity
return AVAILABLE_FUELS.containsKey(stack.getItem()) || getFabricFuel(stack) > 2000;
}
public static void registerFuel(ItemConvertible fuel, int time) {
public static void registerFuel(ItemLike fuel, int time) {
AVAILABLE_FUELS.put(fuel.asItem(), time);
}

View file

@ -4,7 +4,7 @@ import net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializable;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.entity.player.PlayerEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.inventory.Inventory;
import net.minecraft.world.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
@ -97,7 +97,7 @@ public class PedestalBlockEntity extends BlockEntity implements Inventory, Ticka
}
@Override
public boolean canPlayerUse(PlayerEntity player) {
public boolean canPlayerUse(Player player) {
return true;
}

View file

@ -24,7 +24,7 @@ import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.render.block.entity.LightmapCoordinatesRetriever;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.util.math.Vector3f;
import com.mojang.math.Vector3f;
import net.minecraft.world.item.BlockItem;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.Direction;

View file

@ -21,7 +21,7 @@ import net.minecraft.client.render.block.entity.SignBlockEntityRenderer.SignMode
import net.minecraft.client.texture.NativeImage;
import net.minecraft.client.util.SpriteIdentifier;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.util.math.Vector3f;
import com.mojang.math.Vector3f;
import net.minecraft.world.item.BlockItem;
import net.minecraft.text.OrderedText;
import net.minecraft.resources.ResourceLocation;

View file

@ -3,14 +3,14 @@ package ru.betterend.blocks.entities.render;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.Minecraft;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.util.math.Vector3f;
import com.mojang.math.Vector3f;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
@ -47,7 +47,7 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> extends BlockEn
ItemStack activeItem = blockEntity.getStack(0);
matrices.push();
MinecraftClient minecraft = MinecraftClient.getInstance();
Minecraft minecraft = Minecraft.getInstance();
BakedModel model = minecraft.getItemRenderer().getHeldItemModel(activeItem, world, null);
Vector3f translate = model.getTransformation().ground.translation;
PedestalBlock pedestal = (PedestalBlock) state.getBlock();