More compiler fixes

This commit is contained in:
Frank Bauer 2021-06-23 21:59:24 +02:00
parent cfa765437c
commit 4f053c161a
20 changed files with 84 additions and 67 deletions

View file

@ -94,7 +94,7 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
if (exitPos == null) return; if (exitPos == null) return;
if (entity instanceof ServerPlayer && ((ServerPlayer) entity).isCreative()) { if (entity instanceof ServerPlayer && ((ServerPlayer) entity).isCreative()) {
((ServerPlayer) entity).teleportTo(destination, exitPos.getX() + 0.5, exitPos.getY(), ((ServerPlayer) entity).teleportTo(destination, exitPos.getX() + 0.5, exitPos.getY(),
exitPos.getZ() + 0.5, entity.yRot, entity.xRot); exitPos.getZ() + 0.5, entity.getYRot(), entity.getXRot());
} else { } else {
((TeleportingEntity) entity).be_setExitPos(exitPos); ((TeleportingEntity) entity).be_setExitPos(exitPos);
Optional<Entity> teleported = Optional.ofNullable(entity.changeDimension(destination)); Optional<Entity> teleported = Optional.ofNullable(entity.changeDimension(destination));
@ -114,7 +114,7 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
private BlockPos findExitPos(ServerLevel currentWorld, ServerLevel targetWorld, BlockPos currentPos, Entity entity) { private BlockPos findExitPos(ServerLevel currentWorld, ServerLevel targetWorld, BlockPos currentPos, Entity entity) {
if (targetWorld == null) return null; if (targetWorld == null) return null;
Registry<DimensionType> registry = targetWorld.registryAccess().dimensionTypes(); Registry<DimensionType> registry = targetWorld.registryAccess().registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY);
ResourceLocation targetWorldId = targetWorld.dimension().location(); ResourceLocation targetWorldId = targetWorld.dimension().location();
ResourceLocation currentWorldId = currentWorld.dimension().location(); ResourceLocation currentWorldId = currentWorld.dimension().location();
double targetMultiplier = Objects.requireNonNull(registry.get(targetWorldId)).coordinateScale(); double targetMultiplier = Objects.requireNonNull(registry.get(targetWorldId)).coordinateScale();

View file

@ -79,7 +79,7 @@ public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider {
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) { public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
ItemStack tool = builder.getParameter(LootContextParams.TOOL); ItemStack tool = builder.getParameter(LootContextParams.TOOL);
if (tool != null) { if (tool != null) {
if (tool.getItem().is(FabricToolTags.SHEARS) || tool.isCorrectToolForDrops(state) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { if (tool.is(FabricToolTags.SHEARS) || tool.isCorrectToolForDrops(state) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) {
return Collections.singletonList(new ItemStack(this)); return Collections.singletonList(new ItemStack(this));
} }
int fortune = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.BLOCK_FORTUNE, tool); int fortune = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.BLOCK_FORTUNE, tool);

View file

@ -108,8 +108,8 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
} }
@Override @Override
public BlockEntity newBlockEntity(BlockGetter world) { public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
return new BlockEntityHydrothermalVent(); return new BlockEntityHydrothermalVent(pos, state);
} }
@Override @Override

View file

@ -44,8 +44,8 @@ public class InfusionPedestal extends PedestalBlock {
} }
@Override @Override
public BlockEntity newBlockEntity(BlockGetter world) { public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
return new InfusionPedestalEntity(); return new InfusionPedestalEntity(blockPos, blockState);
} }
@Override @Override

View file

@ -34,7 +34,7 @@ public class NeedlegrassBlock extends EndPlantBlock {
@Override @Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) { public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
ItemStack tool = builder.getParameter(LootContextParams.TOOL); ItemStack tool = builder.getParameter(LootContextParams.TOOL);
if (tool != null && tool.getItem().is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { if (tool != null && tool.is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) {
return Lists.newArrayList(new ItemStack(this)); return Lists.newArrayList(new ItemStack(this));
} }
else { else {

View file

@ -89,7 +89,7 @@ public class SilkMothHiveBlock extends BaseBlock {
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
if (hand == InteractionHand.MAIN_HAND) { if (hand == InteractionHand.MAIN_HAND) {
ItemStack stack = player.getMainHandItem(); ItemStack stack = player.getMainHandItem();
if (stack.getItem().is(FabricToolTags.SHEARS) && state.getValue(FULLNESS) == 3) { if (stack.is(FabricToolTags.SHEARS) && state.getValue(FULLNESS) == 3) {
BlocksHelper.setWithUpdate(world, pos, state.setValue(FULLNESS, 0)); BlocksHelper.setWithUpdate(world, pos, state.setValue(FULLNESS, 0));
Direction dir = state.getValue(FACING); Direction dir = state.getValue(FACING);
double px = pos.getX() + dir.getStepX() + 0.5; double px = pos.getX() + dir.getStepX() + 0.5;

View file

@ -56,7 +56,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderT
@Override @Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) { public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
ItemStack tool = builder.getParameter(LootContextParams.TOOL); ItemStack tool = builder.getParameter(LootContextParams.TOOL);
if (tool != null && tool.getItem().is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { if (tool != null && tool.is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) {
return Lists.newArrayList(new ItemStack(this)); return Lists.newArrayList(new ItemStack(this));
} }
else { else {

View file

@ -1,5 +1,6 @@
package ru.betterend.blocks; package ru.betterend.blocks;
import java.util.Optional;
import java.util.Random; import java.util.Random;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
@ -9,9 +10,12 @@ import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource; import net.minecraft.sounds.SoundSource;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelAccessor;
@ -38,9 +42,9 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid
} }
@Override @Override
public Fluid takeLiquid(LevelAccessor world, BlockPos pos, BlockState state) { public ItemStack pickupBlock(LevelAccessor world, BlockPos pos, BlockState state) {
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 11); world.setBlock(pos, Blocks.AIR.defaultBlockState(), 11);
return Fluids.WATER; return new ItemStack(Items.WATER_BUCKET);
} }
@Override @Override
@ -120,4 +124,11 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid
public FluidState getFluidState(BlockState state) { public FluidState getFluidState(BlockState state) {
return Fluids.WATER.getSource(false); return Fluids.WATER.getSource(false);
} }
@Override
public Optional<SoundEvent> getPickupSound() {
return Fluids.WATER.getPickupSound();
}
} }

View file

@ -62,7 +62,7 @@ public class FurBlock extends BaseAttachedBlock implements IRenderTyped {
@Override @Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) { public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
ItemStack tool = builder.getParameter(LootContextParams.TOOL); ItemStack tool = builder.getParameter(LootContextParams.TOOL);
if (tool != null && tool.getItem().is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) { if (tool != null && tool.is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) {
return Lists.newArrayList(new ItemStack(this)); return Lists.newArrayList(new ItemStack(this));
} }
else if (dropChance < 1 || MHelper.RANDOM.nextInt(dropChance) == 0) { else if (dropChance < 1 || MHelper.RANDOM.nextInt(dropChance) == 0) {

View file

@ -355,8 +355,8 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
} }
@Override @Override
public BlockEntity newBlockEntity(BlockGetter world) { public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
return new PedestalBlockEntity(); return new PedestalBlockEntity(blockPos, blockState);
} }
public boolean hasUniqueEntity() { public boolean hasUniqueEntity() {
@ -440,7 +440,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
@Nullable @Nullable
protected static <E extends BlockEntity, A extends BlockEntity> BlockEntityTicker<A> createTickerHelper(BlockEntityType<A> blockEntityType, BlockEntityType<E> blockEntityType2, BlockEntityTicker<? super E> blockEntityTicker) { protected static <E extends BlockEntity, A extends BlockEntity> BlockEntityTicker<A> createTickerHelper(BlockEntityType<A> blockEntityType, BlockEntityType<E> blockEntityType2, BlockEntityTicker<? super E> blockEntityTicker) {
return blockEntityType2 == blockEntityType ? blockEntityTicker : null; return blockEntityType2 == blockEntityType ? (BlockEntityTicker<A>) blockEntityTicker : null;
} }
static { static {

View file

@ -3,6 +3,7 @@ package ru.betterend.blocks.entities;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.registry.EndBlockEntities; import ru.betterend.registry.EndBlockEntities;
import ru.betterend.rituals.InfusionRitual; import ru.betterend.rituals.InfusionRitual;
@ -10,13 +11,21 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
private InfusionRitual linkedRitual; private InfusionRitual linkedRitual;
public InfusionPedestalEntity() { public InfusionPedestalEntity(BlockPos blockPos, BlockState blockState) {
super(EndBlockEntities.INFUSION_PEDESTAL); super(EndBlockEntities.INFUSION_PEDESTAL, blockPos, blockState);
} }
@Override @Override
public void setLevel(Level world){
super.setLevel(world);
if (hasRitual()) {
linkedRitual.setLocation(world, this.getBlockPos());
} else {
linkRitual(new InfusionRitual(this, world, this.getBlockPos()));
}
}
public void setLevelAndPosition(Level world, BlockPos pos) { public void setLevelAndPosition(Level world, BlockPos pos) {
super.setLevelAndPosition(world, pos);
if (hasRitual()) { if (hasRitual()) {
linkedRitual.setLocation(world, pos); linkedRitual.setLocation(world, pos);
} else { } else {
@ -37,11 +46,11 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
} }
@Override @Override
public void tick() { protected void tick(Level tickLevel, BlockPos tickPos, BlockState tickState){
if (hasRitual()) { if (hasRitual()) {
linkedRitual.tick(); linkedRitual.tick();
} }
super.tick(); super.tick(tickLevel, tickPos, tickState);
} }
@Override @Override

View file

@ -20,7 +20,7 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
private final int maxAge = 314; private final int maxAge = 314;
private int age; private int age;
public PedestalBlockEntity(BlockPos blockPos, BlockState blockState) { public PedestalBlockEntity(BlockEntityType<?> blockEntityType, BlockPos blockPos, BlockState blockState) {
super(EndBlockEntities.PEDESTAL, blockPos, blockState); super(EndBlockEntities.PEDESTAL, blockPos, blockState);
} }
@ -132,12 +132,16 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
} }
} }
public static void tick(Level tickLevel, BlockPos tickPos, BlockState tickState, PedestalBlockEntity blockEntity) { protected void tick(Level tickLevel, BlockPos tickPos, BlockState tickState){
if (!blockEntity.isEmpty()) { if (!this.isEmpty()) {
blockEntity.age++; this.age++;
if (blockEntity.age > blockEntity.maxAge) { if (this.age > this.maxAge) {
blockEntity.age = 0; this.age = 0;
} }
} }
} }
public static void tick(Level tickLevel, BlockPos tickPos, BlockState tickState, PedestalBlockEntity blockEntity) {
blockEntity.tick(tickLevel, tickPos, tickState);
}
} }

View file

@ -24,7 +24,7 @@ import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public class PedestalItemRenderer<T extends PedestalBlockEntity> extends BlockEntityRenderer<T> { public class PedestalItemRenderer<T extends PedestalBlockEntity> implements BlockEntityRenderer<T> {
public PedestalItemRenderer(BlockEntityRenderDispatcher dispatcher) { public PedestalItemRenderer(BlockEntityRenderDispatcher dispatcher) {
super(dispatcher); super(dispatcher);

View file

@ -91,7 +91,7 @@ public class CubozoaEntity extends AbstractSchoolingFish {
} }
@Override @Override
protected ItemStack getBucketItemStack() { public ItemStack getBucketItemStack() {
ItemStack bucket = EndItems.BUCKET_CUBOZOA.getDefaultInstance(); ItemStack bucket = EndItems.BUCKET_CUBOZOA.getDefaultInstance();
CompoundTag tag = bucket.getOrCreateTag(); CompoundTag tag = bucket.getOrCreateTag();
tag.putByte("Variant", entityData.get(VARIANT)); tag.putByte("Variant", entityData.get(VARIANT));

View file

@ -6,11 +6,8 @@ import java.util.Random;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.entity.AgeableMob; import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.*;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.control.FlyingMoveControl; import net.minecraft.world.entity.ai.control.FlyingMoveControl;
@ -21,6 +18,8 @@ import net.minecraft.world.entity.ai.goal.FollowParentGoal;
import net.minecraft.world.entity.ai.goal.Goal; import net.minecraft.world.entity.ai.goal.Goal;
import net.minecraft.world.entity.ai.navigation.FlyingPathNavigation; import net.minecraft.world.entity.ai.navigation.FlyingPathNavigation;
import net.minecraft.world.entity.ai.navigation.PathNavigation; import net.minecraft.world.entity.ai.navigation.PathNavigation;
import net.minecraft.world.entity.ai.util.AirAndWaterRandomPos;
import net.minecraft.world.entity.ai.util.HoverRandomPos;
import net.minecraft.world.entity.ai.util.RandomPos; import net.minecraft.world.entity.ai.util.RandomPos;
import net.minecraft.world.entity.animal.Animal; import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.FlyingAnimal; import net.minecraft.world.entity.animal.FlyingAnimal;
@ -98,18 +97,18 @@ public class DragonflyEntity extends Animal implements FlyingAnimal {
} }
@Override @Override
protected boolean makeFlySound() { public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) {
return true;
}
@Override
public boolean causeFallDamage(float fallDistance, float damageMultiplier) {
return false; return false;
} }
@Override @Override
public boolean isMovementNoisy() { protected Entity.MovementEmission getMovementEmission() {
return false; return Entity.MovementEmission.EVENTS;
}
@Override
public boolean isFlying() {
return !this.onGround;
} }
@Override @Override
@ -168,11 +167,11 @@ public class DragonflyEntity extends Animal implements FlyingAnimal {
private Vec3 getRandomLocation() { private Vec3 getRandomLocation() {
int h = BlocksHelper.downRay(DragonflyEntity.this.level, DragonflyEntity.this.blockPosition(), 16); int h = BlocksHelper.downRay(DragonflyEntity.this.level, DragonflyEntity.this.blockPosition(), 16);
Vec3 rotation = DragonflyEntity.this.getViewVector(0.0F); Vec3 rotation = DragonflyEntity.this.getViewVector(0.0F);
Vec3 airPos = RandomPos.getAboveLandPos(DragonflyEntity.this, 8, 7, rotation, 1.5707964F, 2, 1); Vec3 airPos = HoverRandomPos.getPos(DragonflyEntity.this, 8, 7, rotation.x, rotation.z, 1.5707964F, 3, 1);
if (airPos != null) { if (airPos != null) {
if (isInVoid(airPos)) { if (isInVoid(airPos)) {
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
airPos = RandomPos.getAboveLandPos(DragonflyEntity.this, 16, 7, rotation, MHelper.PI2, 2, 1); airPos = HoverRandomPos.getPos(DragonflyEntity.this, 16, 7, rotation.x, rotation.z, MHelper.PI2, 3, 1);
if (airPos != null && !isInVoid(airPos)) { if (airPos != null && !isInVoid(airPos)) {
return airPos; return airPos;
} }
@ -184,7 +183,7 @@ public class DragonflyEntity extends Animal implements FlyingAnimal {
} }
return airPos; return airPos;
} }
return RandomPos.getAirPos(DragonflyEntity.this, 8, 4, -2, rotation, 1.5707963705062866D); return AirAndWaterRandomPos.getPos(DragonflyEntity.this, 8, 4, -2, rotation.x, rotation.z, 1.5707963705062866D);
} }
private boolean isInVoid(Vec3 pos) { private boolean isInVoid(Vec3 pos) {

View file

@ -88,7 +88,7 @@ public class EndFishEntity extends AbstractSchoolingFish {
} }
@Override @Override
protected ItemStack getBucketItemStack() { public ItemStack getBucketItemStack() {
ItemStack bucket = EndItems.BUCKET_END_FISH.getDefaultInstance(); ItemStack bucket = EndItems.BUCKET_END_FISH.getDefaultInstance();
CompoundTag tag = bucket.getOrCreateTag(); CompoundTag tag = bucket.getOrCreateTag();
tag.putByte("variant", entityData.get(VARIANT)); tag.putByte("variant", entityData.get(VARIANT));

View file

@ -4,6 +4,7 @@ import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import net.minecraft.world.entity.*;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -16,11 +17,6 @@ import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource; import net.minecraft.sounds.SoundSource;
import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.AgeableMob;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.control.FlyingMoveControl; import net.minecraft.world.entity.ai.control.FlyingMoveControl;
@ -142,18 +138,18 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
} }
@Override @Override
protected boolean makeFlySound() { public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) {
return true;
}
@Override
public boolean causeFallDamage(float fallDistance, float damageMultiplier) {
return false; return false;
} }
@Override @Override
public boolean isMovementNoisy() { protected Entity.MovementEmission getMovementEmission() {
return false; return Entity.MovementEmission.EVENTS;
}
@Override
public boolean isFlying() {
return !this.onGround;
} }
@Override @Override

View file

@ -7,8 +7,6 @@ import com.google.common.collect.Lists;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.ArmorRenderingRegistry.ModelProvider;
import net.fabricmc.fabric.api.client.rendering.v1.ArmorRenderingRegistry.TextureProvider;
import net.minecraft.client.model.HumanoidModel; import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.player.AbstractClientPlayer; import net.minecraft.client.player.AbstractClientPlayer;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -20,7 +18,7 @@ import ru.betterend.item.CrystaliteArmor;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public class CrystaliteArmorProvider implements ModelProvider, TextureProvider { public class CrystaliteArmorProvider /*implements ModelProvider, TextureProvider*/ {
private final static ResourceLocation FIRST_LAYER = new ResourceLocation("textures/models/armor/crystalite_layer_1.png"); private final static ResourceLocation FIRST_LAYER = new ResourceLocation("textures/models/armor/crystalite_layer_1.png");
private final static ResourceLocation SECOND_LAYER = new ResourceLocation("textures/models/armor/crystalite_layer_2.png"); private final static ResourceLocation SECOND_LAYER = new ResourceLocation("textures/models/armor/crystalite_layer_2.png");
private final static CrystaliteHelmetModel HELMET_MODEL = new CrystaliteHelmetModel(1.0F); private final static CrystaliteHelmetModel HELMET_MODEL = new CrystaliteHelmetModel(1.0F);

View file

@ -2,7 +2,6 @@ package ru.betterend.registry;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.ArmorRenderingRegistry;
import ru.betterend.item.model.CrystaliteArmorProvider; import ru.betterend.item.model.CrystaliteArmorProvider;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
@ -11,7 +10,8 @@ public class EndModelProviders {
public final static CrystaliteArmorProvider CRYSTALITE_PROVIDER = new CrystaliteArmorProvider(); public final static CrystaliteArmorProvider CRYSTALITE_PROVIDER = new CrystaliteArmorProvider();
public final static void register() { public final static void register() {
ArmorRenderingRegistry.registerModel(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems()); throw new RuntimeException("Needs Fix for 1.17");
ArmorRenderingRegistry.registerTexture(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems()); //ArmorRenderingRegistry.registerModel(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems());
//ArmorRenderingRegistry.registerTexture(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems());
} }
} }

View file

@ -293,7 +293,7 @@ public class EternalRitual {
private BlockPos findPortalPos(int portalId) { private BlockPos findPortalPos(int portalId) {
MinecraftServer server = world.getServer(); MinecraftServer server = world.getServer();
ServerLevel targetWorld = (ServerLevel) getTargetWorld(portalId); ServerLevel targetWorld = (ServerLevel) getTargetWorld(portalId);
Registry<DimensionType> registry = Objects.requireNonNull(server).registryAccess().dimensionTypes(); Registry<DimensionType> registry = Objects.requireNonNull(server).registryAccess().registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY);
double multiplier = Objects.requireNonNull(registry.get(targetWorldId)).coordinateScale(); double multiplier = Objects.requireNonNull(registry.get(targetWorldId)).coordinateScale();
BlockPos.MutableBlockPos basePos = center.mutable().set(center.getX() / multiplier, center.getY(), center.getZ() / multiplier); BlockPos.MutableBlockPos basePos = center.mutable().set(center.getX() / multiplier, center.getY(), center.getZ() / multiplier);
BlockPos framePos = findFrame(targetWorld, basePos.mutable()); BlockPos framePos = findFrame(targetWorld, basePos.mutable());