Additional compiler fixes

This commit is contained in:
Frank Bauer 2021-06-23 22:23:20 +02:00
parent 4f053c161a
commit e541763ada
10 changed files with 19 additions and 17 deletions

View file

@ -15,7 +15,6 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntity;

View file

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

View file

@ -150,7 +150,7 @@ public class SilkMothNestBlock extends BaseBlock implements IRenderTyped {
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(ACTIVE) && state.getValue(FULLNESS) == 3) { if (stack.is(FabricToolTags.SHEARS) && state.getValue(ACTIVE) && 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

@ -1,7 +1,5 @@
package ru.betterend.blocks; package ru.betterend.blocks;
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.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
@ -9,6 +7,7 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
@ -17,6 +16,8 @@ import ru.betterend.blocks.basis.EndPlantBlock;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import java.util.Random;
public class SmallAmaranitaBlock extends EndPlantBlock { public class SmallAmaranitaBlock extends EndPlantBlock {
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 10, 12); private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 10, 12);
@ -29,7 +30,7 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) {
BlockPos bigPos = growBig(world, pos); BlockPos bigPos = growBig(world, pos);
if (bigPos != null) { if (bigPos != null) {
if (EndFeatures.GIGANTIC_AMARANITA.getFeature().place(world, null, random, bigPos, null)) { if (EndFeatures.GIGANTIC_AMARANITA.getFeature().place(new FeaturePlaceContext<>(world, null, random, bigPos, null))) {
replaceMushroom(world, bigPos); replaceMushroom(world, bigPos);
replaceMushroom(world, bigPos.south()); replaceMushroom(world, bigPos.south());
replaceMushroom(world, bigPos.east()); replaceMushroom(world, bigPos.east());
@ -37,7 +38,7 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
} }
return; return;
} }
EndFeatures.LARGE_AMARANITA.getFeature().place(world, null, random, pos, null); EndFeatures.LARGE_AMARANITA.getFeature().place(new FeaturePlaceContext<>(world, null, random, pos, null));
} }
@Override @Override

View file

@ -23,6 +23,7 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.BonemealableBlock; import net.minecraft.world.level.block.BonemealableBlock;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
@ -99,6 +100,6 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderT
@Override @Override
public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) {
BlocksHelper.setWithUpdate(world, pos, Blocks.AIR); BlocksHelper.setWithUpdate(world, pos, Blocks.AIR);
EndFeatures.JELLYSHROOM.getFeature().place(world, null, random, pos, null); EndFeatures.JELLYSHROOM.getFeature().place(new FeaturePlaceContext<>(world, null, random, pos, null));
} }
} }

View file

@ -50,7 +50,6 @@ import ru.bclib.client.models.ModelsHelper;
import ru.betterend.blocks.EndBlockProperties; import ru.betterend.blocks.EndBlockProperties;
import ru.betterend.blocks.EndBlockProperties.PedestalState; import ru.betterend.blocks.EndBlockProperties.PedestalState;
import ru.betterend.blocks.InfusionPedestal; import ru.betterend.blocks.InfusionPedestal;
import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
import ru.betterend.blocks.entities.InfusionPedestalEntity; import ru.betterend.blocks.entities.InfusionPedestalEntity;
import ru.betterend.blocks.entities.PedestalBlockEntity; import ru.betterend.blocks.entities.PedestalBlockEntity;
import ru.betterend.client.models.Patterns; import ru.betterend.client.models.Patterns;

View file

@ -3,14 +3,15 @@ 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.EternalRitual; import ru.betterend.rituals.EternalRitual;
public class EternalPedestalEntity extends PedestalBlockEntity { public class EternalPedestalEntity extends PedestalBlockEntity {
private EternalRitual linkedRitual; private EternalRitual linkedRitual;
public EternalPedestalEntity() { public EternalPedestalEntity(BlockPos blockPos, BlockState blockState) {
super(EndBlockEntities.ETERNAL_PEDESTAL); super(EndBlockEntities.ETERNAL_PEDESTAL, blockPos, blockState);
} }
public boolean hasRitual() { public boolean hasRitual() {

View file

@ -20,7 +20,6 @@ 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.AirAndWaterRandomPos;
import net.minecraft.world.entity.ai.util.HoverRandomPos; 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.Animal;
import net.minecraft.world.entity.animal.FlyingAnimal; import net.minecraft.world.entity.animal.FlyingAnimal;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;

View file

@ -96,7 +96,7 @@ public class ShadowWalkerEntity extends Monster {
} }
@Override @Override
protected float getVoicePitch() { public float getVoicePitch() {
return MHelper.randRange(0.75F, 1.25F, random); return MHelper.randRange(0.75F, 1.25F, random);
} }

View file

@ -5,6 +5,8 @@ import java.util.List;
import java.util.Random; import java.util.Random;
import net.minecraft.world.entity.*; import net.minecraft.world.entity.*;
import net.minecraft.world.entity.ai.util.AirAndWaterRandomPos;
import net.minecraft.world.entity.ai.util.HoverRandomPos;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -235,8 +237,8 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
@Nullable @Nullable
private Vec3 getRandomLocation() { private Vec3 getRandomLocation() {
Vec3 vec3d3 = SilkMothEntity.this.getViewVector(0.0F); Vec3 vec3d3 = SilkMothEntity.this.getViewVector(0.0F);
Vec3 vec3d4 = RandomPos.getAboveLandPos(SilkMothEntity.this, 8, 7, vec3d3, 1.5707964F, 2, 1); Vec3 vec3d4 = HoverRandomPos.getPos(SilkMothEntity.this, 8, 7, vec3d3.x, vec3d3.z, 1.5707964F, 3, 1);
return vec3d4 != null ? vec3d4 : RandomPos.getAirPos(SilkMothEntity.this, 8, 4, -2, vec3d3, 1.5707963705062866D); return vec3d4 != null ? vec3d4 : AirAndWaterRandomPos.getPos(SilkMothEntity.this, 8, 4, -2, vec3d3.x, vec3d3.z, 1.5707963705062866D);
} }
} }
@ -295,7 +297,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
BlocksHelper.setWithUpdate(SilkMothEntity.this.hiveWorld, SilkMothEntity.this.hivePos, state.setValue(EndBlockProperties.FULLNESS, fullness)); BlocksHelper.setWithUpdate(SilkMothEntity.this.hiveWorld, SilkMothEntity.this.hivePos, state.setValue(EndBlockProperties.FULLNESS, fullness));
} }
SilkMothEntity.this.level.playSound(null, SilkMothEntity.this.entrance, SoundEvents.BEEHIVE_ENTER, SoundSource.BLOCKS, 1, 1); SilkMothEntity.this.level.playSound(null, SilkMothEntity.this.entrance, SoundEvents.BEEHIVE_ENTER, SoundSource.BLOCKS, 1, 1);
SilkMothEntity.this.remove(); SilkMothEntity.this.discard();
} }
else { else {
SilkMothEntity.this.hivePos = null; SilkMothEntity.this.hivePos = null;