diff --git a/src/main/java/ru/betterend/blocks/EndPortalBlock.java b/src/main/java/ru/betterend/blocks/EndPortalBlock.java index 6d5ab346..a419608e 100644 --- a/src/main/java/ru/betterend/blocks/EndPortalBlock.java +++ b/src/main/java/ru/betterend/blocks/EndPortalBlock.java @@ -94,7 +94,7 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I if (exitPos == null) return; if (entity instanceof ServerPlayer && ((ServerPlayer) entity).isCreative()) { ((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 { ((TeleportingEntity) entity).be_setExitPos(exitPos); Optional 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) { if (targetWorld == null) return null; - Registry registry = targetWorld.registryAccess().dimensionTypes(); + Registry registry = targetWorld.registryAccess().registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY); ResourceLocation targetWorldId = targetWorld.dimension().location(); ResourceLocation currentWorldId = currentWorld.dimension().location(); double targetMultiplier = Objects.requireNonNull(registry.get(targetWorldId)).coordinateScale(); diff --git a/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java b/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java index 625d503c..2a15a97e 100644 --- a/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java +++ b/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java @@ -79,7 +79,7 @@ public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider { public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); 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)); } int fortune = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.BLOCK_FORTUNE, tool); diff --git a/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java b/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java index 806455f5..96a55828 100644 --- a/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java +++ b/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java @@ -108,8 +108,8 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo } @Override - public BlockEntity newBlockEntity(BlockGetter world) { - return new BlockEntityHydrothermalVent(); + public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { + return new BlockEntityHydrothermalVent(pos, state); } @Override diff --git a/src/main/java/ru/betterend/blocks/InfusionPedestal.java b/src/main/java/ru/betterend/blocks/InfusionPedestal.java index 2604055d..4b49d48d 100644 --- a/src/main/java/ru/betterend/blocks/InfusionPedestal.java +++ b/src/main/java/ru/betterend/blocks/InfusionPedestal.java @@ -44,8 +44,8 @@ public class InfusionPedestal extends PedestalBlock { } @Override - public BlockEntity newBlockEntity(BlockGetter world) { - return new InfusionPedestalEntity(); + public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { + return new InfusionPedestalEntity(blockPos, blockState); } @Override diff --git a/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java b/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java index 57807754..12d61fa8 100644 --- a/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java +++ b/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java @@ -34,7 +34,7 @@ public class NeedlegrassBlock extends EndPlantBlock { @Override public List getDrops(BlockState state, LootContext.Builder builder) { 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)); } else { diff --git a/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java b/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java index a769f1a3..7cfc5aa6 100644 --- a/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java +++ b/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java @@ -89,7 +89,7 @@ public class SilkMothHiveBlock extends BaseBlock { public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { if (hand == InteractionHand.MAIN_HAND) { 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)); Direction dir = state.getValue(FACING); double px = pos.getX() + dir.getStepX() + 0.5; diff --git a/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java b/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java index 60aac3b5..7456529d 100644 --- a/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java +++ b/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java @@ -56,7 +56,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderT @Override public List getDrops(BlockState state, LootContext.Builder builder) { 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)); } else { diff --git a/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java b/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java index e58333b7..2c337d21 100644 --- a/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java +++ b/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java @@ -1,5 +1,6 @@ package ru.betterend.blocks; +import java.util.Optional; import java.util.Random; import net.fabricmc.api.EnvType; @@ -9,9 +10,12 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; 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.Level; import net.minecraft.world.level.LevelAccessor; @@ -38,9 +42,9 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid } @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); - return Fluids.WATER; + return new ItemStack(Items.WATER_BUCKET); } @Override @@ -120,4 +124,11 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid public FluidState getFluidState(BlockState state) { return Fluids.WATER.getSource(false); } + + + + @Override + public Optional getPickupSound() { + return Fluids.WATER.getPickupSound(); + } } diff --git a/src/main/java/ru/betterend/blocks/basis/FurBlock.java b/src/main/java/ru/betterend/blocks/basis/FurBlock.java index 0514f5b5..9f2b20aa 100644 --- a/src/main/java/ru/betterend/blocks/basis/FurBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/FurBlock.java @@ -62,7 +62,7 @@ public class FurBlock extends BaseAttachedBlock implements IRenderTyped { @Override public List getDrops(BlockState state, LootContext.Builder builder) { 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)); } else if (dropChance < 1 || MHelper.RANDOM.nextInt(dropChance) == 0) { diff --git a/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java b/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java index 6b580345..d6a389fc 100644 --- a/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java @@ -355,8 +355,8 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } @Override - public BlockEntity newBlockEntity(BlockGetter world) { - return new PedestalBlockEntity(); + public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { + return new PedestalBlockEntity(blockPos, blockState); } public boolean hasUniqueEntity() { @@ -440,7 +440,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { @Nullable protected static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType blockEntityType2, BlockEntityTicker blockEntityTicker) { - return blockEntityType2 == blockEntityType ? blockEntityTicker : null; + return blockEntityType2 == blockEntityType ? (BlockEntityTicker) blockEntityTicker : null; } static { diff --git a/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java b/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java index 2a6a4029..b13054dc 100644 --- a/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java +++ b/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java @@ -3,6 +3,7 @@ package ru.betterend.blocks.entities; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; import ru.betterend.registry.EndBlockEntities; import ru.betterend.rituals.InfusionRitual; @@ -10,13 +11,21 @@ public class InfusionPedestalEntity extends PedestalBlockEntity { private InfusionRitual linkedRitual; - public InfusionPedestalEntity() { - super(EndBlockEntities.INFUSION_PEDESTAL); + public InfusionPedestalEntity(BlockPos blockPos, BlockState blockState) { + super(EndBlockEntities.INFUSION_PEDESTAL, blockPos, blockState); + } + + @Override + public void setLevel(Level world){ + super.setLevel(world); + if (hasRitual()) { + linkedRitual.setLocation(world, this.getBlockPos()); + } else { + linkRitual(new InfusionRitual(this, world, this.getBlockPos())); + } } - @Override public void setLevelAndPosition(Level world, BlockPos pos) { - super.setLevelAndPosition(world, pos); if (hasRitual()) { linkedRitual.setLocation(world, pos); } else { @@ -37,11 +46,11 @@ public class InfusionPedestalEntity extends PedestalBlockEntity { } @Override - public void tick() { + protected void tick(Level tickLevel, BlockPos tickPos, BlockState tickState){ if (hasRitual()) { linkedRitual.tick(); } - super.tick(); + super.tick(tickLevel, tickPos, tickState); } @Override diff --git a/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java b/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java index 83a56db3..1f917f00 100644 --- a/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java +++ b/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java @@ -20,7 +20,7 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block private final int maxAge = 314; private int age; - public PedestalBlockEntity(BlockPos blockPos, BlockState blockState) { + public PedestalBlockEntity(BlockEntityType blockEntityType, BlockPos blockPos, BlockState 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) { - if (!blockEntity.isEmpty()) { - blockEntity.age++; - if (blockEntity.age > blockEntity.maxAge) { - blockEntity.age = 0; + protected void tick(Level tickLevel, BlockPos tickPos, BlockState tickState){ + if (!this.isEmpty()) { + this.age++; + if (this.age > this.maxAge) { + this.age = 0; } } } + + public static void tick(Level tickLevel, BlockPos tickPos, BlockState tickState, PedestalBlockEntity blockEntity) { + blockEntity.tick(tickLevel, tickPos, tickState); + } } diff --git a/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java b/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java index e66cdee8..1002bb3d 100644 --- a/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java +++ b/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java @@ -24,7 +24,7 @@ import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndItems; @Environment(EnvType.CLIENT) -public class PedestalItemRenderer extends BlockEntityRenderer { +public class PedestalItemRenderer implements BlockEntityRenderer { public PedestalItemRenderer(BlockEntityRenderDispatcher dispatcher) { super(dispatcher); diff --git a/src/main/java/ru/betterend/entity/CubozoaEntity.java b/src/main/java/ru/betterend/entity/CubozoaEntity.java index e58053f4..794bcbf9 100644 --- a/src/main/java/ru/betterend/entity/CubozoaEntity.java +++ b/src/main/java/ru/betterend/entity/CubozoaEntity.java @@ -91,7 +91,7 @@ public class CubozoaEntity extends AbstractSchoolingFish { } @Override - protected ItemStack getBucketItemStack() { + public ItemStack getBucketItemStack() { ItemStack bucket = EndItems.BUCKET_CUBOZOA.getDefaultInstance(); CompoundTag tag = bucket.getOrCreateTag(); tag.putByte("Variant", entityData.get(VARIANT)); diff --git a/src/main/java/ru/betterend/entity/DragonflyEntity.java b/src/main/java/ru/betterend/entity/DragonflyEntity.java index 998228cf..b2a07c71 100644 --- a/src/main/java/ru/betterend/entity/DragonflyEntity.java +++ b/src/main/java/ru/betterend/entity/DragonflyEntity.java @@ -6,11 +6,8 @@ import java.util.Random; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvent; -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.damagesource.DamageSource; +import net.minecraft.world.entity.*; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; 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.navigation.FlyingPathNavigation; 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.animal.Animal; import net.minecraft.world.entity.animal.FlyingAnimal; @@ -98,18 +97,18 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { } @Override - protected boolean makeFlySound() { - return true; - } - - @Override - public boolean causeFallDamage(float fallDistance, float damageMultiplier) { + public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { return false; } @Override - public boolean isMovementNoisy() { - return false; + protected Entity.MovementEmission getMovementEmission() { + return Entity.MovementEmission.EVENTS; + } + + @Override + public boolean isFlying() { + return !this.onGround; } @Override @@ -168,11 +167,11 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { private Vec3 getRandomLocation() { int h = BlocksHelper.downRay(DragonflyEntity.this.level, DragonflyEntity.this.blockPosition(), 16); 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 (isInVoid(airPos)) { 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)) { return airPos; } @@ -184,7 +183,7 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { } 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) { diff --git a/src/main/java/ru/betterend/entity/EndFishEntity.java b/src/main/java/ru/betterend/entity/EndFishEntity.java index dec0cad8..c0550ac2 100644 --- a/src/main/java/ru/betterend/entity/EndFishEntity.java +++ b/src/main/java/ru/betterend/entity/EndFishEntity.java @@ -88,7 +88,7 @@ public class EndFishEntity extends AbstractSchoolingFish { } @Override - protected ItemStack getBucketItemStack() { + public ItemStack getBucketItemStack() { ItemStack bucket = EndItems.BUCKET_END_FISH.getDefaultInstance(); CompoundTag tag = bucket.getOrCreateTag(); tag.putByte("variant", entityData.get(VARIANT)); diff --git a/src/main/java/ru/betterend/entity/SilkMothEntity.java b/src/main/java/ru/betterend/entity/SilkMothEntity.java index 98f3ac16..927bc096 100644 --- a/src/main/java/ru/betterend/entity/SilkMothEntity.java +++ b/src/main/java/ru/betterend/entity/SilkMothEntity.java @@ -4,6 +4,7 @@ import java.util.EnumSet; import java.util.List; import java.util.Random; +import net.minecraft.world.entity.*; import org.jetbrains.annotations.Nullable; import net.minecraft.core.BlockPos; @@ -16,11 +17,6 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; 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.Attributes; import net.minecraft.world.entity.ai.control.FlyingMoveControl; @@ -142,18 +138,18 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { } @Override - protected boolean makeFlySound() { - return true; - } - - @Override - public boolean causeFallDamage(float fallDistance, float damageMultiplier) { + public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { return false; } @Override - public boolean isMovementNoisy() { - return false; + protected Entity.MovementEmission getMovementEmission() { + return Entity.MovementEmission.EVENTS; + } + + @Override + public boolean isFlying() { + return !this.onGround; } @Override diff --git a/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java b/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java index b631ad7e..1bba7c04 100644 --- a/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java +++ b/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java @@ -7,8 +7,6 @@ import com.google.common.collect.Lists; import net.fabricmc.api.EnvType; 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.player.AbstractClientPlayer; import net.minecraft.resources.ResourceLocation; @@ -20,7 +18,7 @@ import ru.betterend.item.CrystaliteArmor; import ru.betterend.registry.EndItems; @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 SECOND_LAYER = new ResourceLocation("textures/models/armor/crystalite_layer_2.png"); private final static CrystaliteHelmetModel HELMET_MODEL = new CrystaliteHelmetModel(1.0F); diff --git a/src/main/java/ru/betterend/registry/EndModelProviders.java b/src/main/java/ru/betterend/registry/EndModelProviders.java index 80952641..c9d2d3e5 100644 --- a/src/main/java/ru/betterend/registry/EndModelProviders.java +++ b/src/main/java/ru/betterend/registry/EndModelProviders.java @@ -2,7 +2,6 @@ package ru.betterend.registry; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.fabricmc.fabric.api.client.rendering.v1.ArmorRenderingRegistry; import ru.betterend.item.model.CrystaliteArmorProvider; @Environment(EnvType.CLIENT) @@ -11,7 +10,8 @@ public class EndModelProviders { public final static CrystaliteArmorProvider CRYSTALITE_PROVIDER = new CrystaliteArmorProvider(); public final static void register() { - ArmorRenderingRegistry.registerModel(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems()); - ArmorRenderingRegistry.registerTexture(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems()); + throw new RuntimeException("Needs Fix for 1.17"); + //ArmorRenderingRegistry.registerModel(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems()); + //ArmorRenderingRegistry.registerTexture(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems()); } } diff --git a/src/main/java/ru/betterend/rituals/EternalRitual.java b/src/main/java/ru/betterend/rituals/EternalRitual.java index 1d7ebbdc..60e126c4 100644 --- a/src/main/java/ru/betterend/rituals/EternalRitual.java +++ b/src/main/java/ru/betterend/rituals/EternalRitual.java @@ -293,7 +293,7 @@ public class EternalRitual { private BlockPos findPortalPos(int portalId) { MinecraftServer server = world.getServer(); ServerLevel targetWorld = (ServerLevel) getTargetWorld(portalId); - Registry registry = Objects.requireNonNull(server).registryAccess().dimensionTypes(); + Registry registry = Objects.requireNonNull(server).registryAccess().registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY); double multiplier = Objects.requireNonNull(registry.get(targetWorldId)).coordinateScale(); BlockPos.MutableBlockPos basePos = center.mutable().set(center.getX() / multiplier, center.getY(), center.getZ() / multiplier); BlockPos framePos = findFrame(targetWorld, basePos.mutable());