Continue migration
This commit is contained in:
parent
47ed597358
commit
33dbfbe633
263 changed files with 1450 additions and 1486 deletions
|
@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.mob.PiglinBrain;
|
||||
import net.minecraft.world.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
|
@ -48,7 +48,7 @@ public class EndBarrelBlock extends BarrelBlock implements BlockPatterned {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult onUse(BlockState state, Level world, BlockPos pos, PlayerEntity player, Hand hand,
|
||||
public ActionResult onUse(BlockState state, Level world, BlockPos pos, Player player, Hand hand,
|
||||
BlockHitResult hit) {
|
||||
if (world.isClientSide) {
|
||||
return ActionResult.SUCCESS;
|
||||
|
|
|
@ -6,7 +6,7 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.block.RotatedPillarBlock;
|
||||
import net.minecraft.world.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
|
@ -25,7 +25,7 @@ public class EndBlockStripableLogLog extends EndPillarBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult onUse(BlockState state, Level world, BlockPos pos, PlayerEntity player, Hand hand,
|
||||
public ActionResult onUse(BlockState state, Level world, BlockPos pos, Player player, Hand hand,
|
||||
BlockHitResult hit) {
|
||||
if (player.getMainHandStack().getItem().isIn(FabricToolTags.AXES)) {
|
||||
world.playLocalSound(player, pos, SoundEvents.ITEM_AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.FurnaceBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
@ -42,7 +42,7 @@ public class EndFurnaceBlock extends FurnaceBlock implements BlockPatterned, IRe
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void openScreen(Level world, BlockPos pos, PlayerEntity player) {
|
||||
protected void openScreen(Level world, BlockPos pos, Player player) {
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
if (blockEntity instanceof EFurnaceBlockEntity) {
|
||||
player.openHandledScreen((NamedScreenHandlerFactory) blockEntity);
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.HorizontalFacingBlock;
|
||||
import net.minecraft.world.level.block.ShapeContext;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.item.ItemPlacementContext;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
|
|
|
@ -8,7 +8,7 @@ import net.minecraft.world.level.block.FluidFillable;
|
|||
import net.minecraft.world.level.block.Waterloggable;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.item.ItemPlacementContext;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.world.level.block.SoundType;
|
|||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.Level;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public abstract class EndPlantWithAgeBlock extends EndPlantBlock {
|
|||
stateManager.add(AGE);
|
||||
}
|
||||
|
||||
public abstract void growAdult(StructureWorldAccess world, Random random, BlockPos pos);
|
||||
public abstract void growAdult(WorldGenLevel world, Random random, BlockPos pos);
|
||||
|
||||
@Override
|
||||
public void grow(ServerLevel world, Random random, BlockPos pos, BlockState state) {
|
||||
|
|
|
@ -12,10 +12,10 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.ShapeContext;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.item.ItemPlacementContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
|
@ -79,10 +79,10 @@ public class EndSignBlock extends AbstractSignBlock implements BlockPatterned, I
|
|||
|
||||
@Override
|
||||
public void onPlaced(Level world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) {
|
||||
if (placer != null && placer instanceof PlayerEntity) {
|
||||
if (placer != null && placer instanceof Player) {
|
||||
ESignBlockEntity sign = (ESignBlockEntity) world.getBlockEntity(pos);
|
||||
if (!world.isClientSide) {
|
||||
sign.setEditor((PlayerEntity) placer);
|
||||
sign.setEditor((Player) placer);
|
||||
((ServerPlayer) placer).networkHandler.sendPacket(new SignEditorOpenS2CPacket(pos));
|
||||
} else {
|
||||
sign.setEditable(true);
|
||||
|
|
|
@ -7,7 +7,7 @@ import net.minecraft.world.level.block.FluidFillable;
|
|||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
|
|
@ -21,7 +21,7 @@ import net.minecraft.world.level.BlockGetter;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
@ -73,7 +73,7 @@ public abstract class FeatureSaplingBlock extends BlockBaseNotFull implements Fe
|
|||
|
||||
@Override
|
||||
public void grow(ServerLevel world, Random random, BlockPos pos, BlockState state) {
|
||||
getFeature().generate(world, world.getChunkManager().getChunkGenerator(), random, pos, null);
|
||||
getFeature().place(world, world.getChunkManager().getChunkGenerator(), random, pos, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,7 +13,7 @@ import net.minecraft.world.level.material.Material;
|
|||
import net.minecraft.world.level.block.ShapeContext;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.item.ItemConvertible;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
@ -29,17 +29,17 @@ import ru.betterend.util.MHelper;
|
|||
|
||||
public class FurBlock extends AttachedBlock implements IRenderTypeable {
|
||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||
private final ItemConvertible drop;
|
||||
private final ItemLike drop;
|
||||
private final int dropChance;
|
||||
|
||||
public FurBlock(ItemConvertible drop, int light, int dropChance, boolean wet) {
|
||||
public FurBlock(ItemLike drop, int light, int dropChance, boolean wet) {
|
||||
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT).breakByTool(FabricToolTags.SHEARS)
|
||||
.sounds(wet ? SoundType.WET_GRASS : SoundType.GRASS).luminance(light).breakByHand(true).noCollision());
|
||||
this.drop = drop;
|
||||
this.dropChance = dropChance;
|
||||
}
|
||||
|
||||
public FurBlock(ItemConvertible drop, int dropChance) {
|
||||
public FurBlock(ItemLike drop, int dropChance) {
|
||||
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT).breakByTool(FabricToolTags.SHEARS)
|
||||
.sounds(SoundType.GRASS).breakByHand(true).noCollision());
|
||||
this.drop = drop;
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.world.level.block.BlockEntityProvider;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.ShapeContext;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemPlacementContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
|
@ -100,7 +100,7 @@ public class PedestalBlock extends BlockBaseNotFull implements BlockEntityProvid
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult onUse(BlockState state, Level world, BlockPos pos, PlayerEntity player, Hand hand,
|
||||
public ActionResult onUse(BlockState state, Level world, BlockPos pos, Player player, Hand hand,
|
||||
BlockHitResult hit) {
|
||||
if (world.isClientSide || !state.is(this))
|
||||
return ActionResult.CONSUME;
|
||||
|
@ -286,7 +286,7 @@ public class PedestalBlock extends BlockBaseNotFull implements BlockEntityProvid
|
|||
for (int i = 2; i < Direction.values().length; i++) {
|
||||
dropPos = pos.relative(Direction.byId(i));
|
||||
if (world.getBlockState(dropPos).isAir()) {
|
||||
return dropPos.toImmutable();
|
||||
return dropPos.immutable();
|
||||
}
|
||||
}
|
||||
return getDropPos(world, pos.up());
|
||||
|
|
|
@ -10,7 +10,7 @@ import net.minecraft.world.level.block.Waterloggable;
|
|||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.item.ItemPlacementContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
|
|
|
@ -6,7 +6,7 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.level.block.RotatedPillarBlock;
|
||||
import net.minecraft.world.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
|
@ -25,7 +25,7 @@ public class StrippableBarkBlock extends BarkBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult onUse(BlockState state, Level world, BlockPos pos, PlayerEntity player, Hand hand,
|
||||
public ActionResult onUse(BlockState state, Level world, BlockPos pos, Player player, Hand hand,
|
||||
BlockHitResult hit) {
|
||||
if (player.getMainHandStack().getItem().isIn(FabricToolTags.AXES)) {
|
||||
world.playLocalSound(player, pos, SoundEvents.ITEM_AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemPlacementContext;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
|
@ -68,7 +68,7 @@ public class TripleTerrainBlock extends EndTerrainBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult onUse(BlockState state, Level world, BlockPos pos, PlayerEntity player, Hand hand,
|
||||
public ActionResult onUse(BlockState state, Level world, BlockPos pos, Player player, Hand hand,
|
||||
BlockHitResult hit) {
|
||||
TripleShape shape = state.getValue(SHAPE);
|
||||
if (shape == TripleShape.BOTTOM) {
|
||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraft.world.item.enchantment.Enchantments;
|
|||
import net.minecraft.world.entity.ItemEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.world.level.block.SoundType;
|
|||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
|
||||
public abstract class UnderwaterPlantWithAgeBlock extends UnderwaterPlantBlock {
|
||||
|
@ -28,7 +28,7 @@ public abstract class UnderwaterPlantWithAgeBlock extends UnderwaterPlantBlock {
|
|||
stateManager.add(AGE);
|
||||
}
|
||||
|
||||
public abstract void grow(StructureWorldAccess world, Random random, BlockPos pos);
|
||||
public abstract void grow(WorldGenLevel world, Random random, BlockPos pos);
|
||||
|
||||
@Override
|
||||
public void grow(ServerLevel world, Random random, BlockPos pos, BlockState state) {
|
||||
|
|
|
@ -14,7 +14,7 @@ import net.minecraft.world.level.block.ShapeContext;
|
|||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
@ -85,7 +85,7 @@ public class UpDownPlantBlock extends BlockBaseNotFull implements IRenderTypeabl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void afterBreak(Level world, PlayerEntity player, BlockPos pos, BlockState state, BlockEntity blockEntity,
|
||||
public void afterBreak(Level world, Player player, BlockPos pos, BlockState state, BlockEntity blockEntity,
|
||||
ItemStack stack) {
|
||||
super.afterBreak(world, player, pos, state, blockEntity, stack);
|
||||
world.updateNeighbor(pos, Blocks.AIR, pos.below());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue