Continue migration
This commit is contained in:
parent
47ed597358
commit
33dbfbe633
263 changed files with 1450 additions and 1486 deletions
|
@ -6,7 +6,7 @@ import net.minecraft.world.level.block.AbstractBlock;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
import ru.betterend.blocks.basis.FurBlock;
|
||||
|
@ -16,7 +16,7 @@ import ru.betterend.util.MHelper;
|
|||
|
||||
public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
|
||||
@Override
|
||||
public void growAdult(StructureWorldAccess world, Random random, BlockPos pos) {
|
||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||
int height = MHelper.randRange(2, 5, random);
|
||||
int h = BlocksHelper.upRay(world, pos, height + 2);
|
||||
if (h < height + 1) {
|
||||
|
@ -33,7 +33,7 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
|
|||
placeLantern(world, pos.up(height + 1));
|
||||
}
|
||||
|
||||
private void placeLantern(StructureWorldAccess world, BlockPos pos) {
|
||||
private void placeLantern(WorldGenLevel world, BlockPos pos) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos,
|
||||
EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().with(BlueVineLanternBlock.NATURAL, true));
|
||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Random;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.WorldView;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
|
@ -21,7 +21,7 @@ public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void growAdult(StructureWorldAccess world, Random random, BlockPos pos) {
|
||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||
int h = BlocksHelper.downRay(world, pos, random.nextInt(24)) - 1;
|
||||
if (h > 2) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos,
|
||||
|
|
|
@ -11,7 +11,7 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.WorldView;
|
||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
|
@ -45,7 +45,7 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void growAdult(StructureWorldAccess world, Random random, BlockPos pos) {
|
||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.WorldView;
|
||||
|
|
|
@ -3,7 +3,7 @@ package ru.betterend.blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.FeatureSaplingBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraft.world.level.block.TransparentBlock;
|
|||
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.server.level.ServerLevel;
|
||||
|
@ -40,7 +40,7 @@ public class EmeraldIceBlock extends TransparentBlock implements IRenderTypeable
|
|||
}
|
||||
|
||||
@Override
|
||||
public void afterBreak(Level world, PlayerEntity player, BlockPos pos, BlockState state,
|
||||
public void afterBreak(Level world, Player player, BlockPos pos, BlockState state,
|
||||
@Nullable BlockEntity blockEntity, ItemStack stack) {
|
||||
super.afterBreak(world, player, pos, state, blockEntity, stack);
|
||||
if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) == 0) {
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.material.Material;
|
||||
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.ItemStack;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
|
|
|
@ -2,9 +2,9 @@ package ru.betterend.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.blocks.basis.UnderwaterPlantWithAgeBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
@ -12,7 +12,7 @@ import ru.betterend.util.BlocksHelper;
|
|||
|
||||
public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||
@Override
|
||||
public void grow(StructureWorldAccess world, Random random, BlockPos pos) {
|
||||
public void grow(WorldGenLevel world, Random random, BlockPos pos) {
|
||||
if (canGrow(world, pos)) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos,
|
||||
EndBlocks.END_LILY.defaultBlockState().with(EndLilyBlock.SHAPE, TripleShape.BOTTOM));
|
||||
|
@ -27,7 +27,7 @@ public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean canGrow(StructureWorldAccess world, BlockPos pos) {
|
||||
private boolean canGrow(WorldGenLevel world, BlockPos pos) {
|
||||
BlockPos up = pos.up();
|
||||
while (world.getBlockState(up).getFluidState().getFluid().equals(Fluids.WATER.getStill())) {
|
||||
up = up.up();
|
||||
|
|
|
@ -3,11 +3,11 @@ package ru.betterend.blocks;
|
|||
import java.util.Random;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.blocks.basis.UnderwaterPlantWithAgeBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
@ -15,7 +15,7 @@ import ru.betterend.util.BlocksHelper;
|
|||
|
||||
public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||
@Override
|
||||
public void grow(StructureWorldAccess world, Random random, BlockPos pos) {
|
||||
public void grow(WorldGenLevel world, Random random, BlockPos pos) {
|
||||
if (canGrow(world, pos)) {
|
||||
BlockState startLeaf = EndBlocks.END_LOTUS_STEM.defaultBlockState().with(EndLotusStemBlock.LEAF, true);
|
||||
BlockState roots = EndBlocks.END_LOTUS_STEM.defaultBlockState()
|
||||
|
@ -34,7 +34,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
|||
int height = random.nextBoolean() ? 0 : random.nextBoolean() ? 1 : random.nextBoolean() ? 1 : -1;
|
||||
TripleShape shape = (height == 0) ? TripleShape.TOP : TripleShape.MIDDLE;
|
||||
Direction dir = BlocksHelper.randomHorizontal(random);
|
||||
BlockPos leafCenter = bpos.toImmutable().offset(dir);
|
||||
BlockPos leafCenter = bpos.immutable().offset(dir);
|
||||
if (hasLeaf(world, leafCenter)) {
|
||||
generateLeaf(world, leafCenter);
|
||||
BlocksHelper.setWithoutUpdate(world, bpos,
|
||||
|
@ -79,7 +79,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean canGrow(StructureWorldAccess world, BlockPos pos) {
|
||||
private boolean canGrow(WorldGenLevel world, BlockPos pos) {
|
||||
MutableBlockPos bpos = new MutableBlockPos();
|
||||
bpos.set(pos);
|
||||
while (world.getBlockState(bpos).getFluidState().getFluid().equals(Fluids.WATER.getStill())) {
|
||||
|
@ -88,7 +88,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
|||
return world.isAir(bpos) && world.isAir(bpos.up());
|
||||
}
|
||||
|
||||
private void generateLeaf(StructureWorldAccess world, BlockPos pos) {
|
||||
private void generateLeaf(WorldGenLevel world, BlockPos pos) {
|
||||
MutableBlockPos p = new MutableBlockPos();
|
||||
BlockState leaf = EndBlocks.END_LOTUS_LEAF.defaultBlockState();
|
||||
BlocksHelper.setWithoutUpdate(world, pos, leaf.with(EndLotusLeafBlock.SHAPE, TripleShape.BOTTOM));
|
||||
|
@ -104,7 +104,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean hasLeaf(StructureWorldAccess world, BlockPos pos) {
|
||||
private boolean hasLeaf(WorldGenLevel world, BlockPos pos) {
|
||||
MutableBlockPos p = new MutableBlockPos();
|
||||
p.setY(pos.getY());
|
||||
int count = 0;
|
||||
|
|
|
@ -11,7 +11,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.ShapeContext;
|
||||
import net.minecraft.world.level.block.Waterloggable;
|
||||
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;
|
||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraft.world.level.block.HorizontalFacingBlock;
|
|||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
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;
|
||||
|
@ -52,7 +52,7 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
|||
this.setDefaultState(this.stateManager.defaultBlockState().with(FACING, Direction.NORTH).with(LIT, false));
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -62,7 +62,7 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
|||
}
|
||||
}
|
||||
|
||||
private void openScreen(Level world, BlockPos pos, PlayerEntity player) {
|
||||
private void openScreen(Level world, BlockPos pos, Player player) {
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
if (blockEntity instanceof EndStoneSmelterBlockEntity) {
|
||||
player.openHandledScreen((EndStoneSmelterBlockEntity) blockEntity);
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.world.level.material.MaterialColor;
|
|||
import net.minecraft.world.level.block.SnowBlock;
|
||||
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;
|
||||
|
@ -50,7 +50,7 @@ public class EndTerrainBlock extends BlockBase {
|
|||
}
|
||||
|
||||
@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 (pathBlock != null && player.getMainHandStack().getItem().isIn(FabricToolTags.SHOVELS)) {
|
||||
world.playLocalSound(player, pos, SoundEvents.ITEM_SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||
|
|
|
@ -8,7 +8,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.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;
|
||||
|
@ -86,7 +86,7 @@ public class EternalPedestal extends PedestalBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) {
|
||||
public float calcBlockBreakingDelta(BlockState state, Player player, BlockView world, BlockPos pos) {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.google.common.collect.Lists;
|
|||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
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.core.BlockPos;
|
||||
|
@ -16,7 +16,7 @@ import net.minecraft.world.explosion.Explosion;
|
|||
public class EternalRunedFlavolite extends RunedFlavolite {
|
||||
|
||||
@Override
|
||||
public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) {
|
||||
public float calcBlockBreakingDelta(BlockState state, Player player, BlockView world, BlockPos pos) {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.state.property.Properties;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
@ -27,7 +27,7 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void growAdult(StructureWorldAccess world, Random random, BlockPos pos) {
|
||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||
int height = MHelper.randRange(1, 2, random);
|
||||
int h = BlocksHelper.upRay(world, pos, height + 2);
|
||||
if (h < height) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.FeatureSaplingBlock;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import ru.betterend.blocks.BlockProperties.HydraluxShape;
|
||||
import ru.betterend.blocks.basis.UnderwaterPlantWithAgeBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
@ -15,7 +15,7 @@ import ru.betterend.util.MHelper;
|
|||
|
||||
public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock {
|
||||
@Override
|
||||
public void grow(StructureWorldAccess world, Random random, BlockPos pos) {
|
||||
public void grow(WorldGenLevel world, Random random, BlockPos pos) {
|
||||
int h = MHelper.randRange(4, 8, random);
|
||||
MutableBlockPos mut = new MutableBlockPos().set(pos);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
|||
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.core.particles.ParticleTypes;
|
||||
|
|
|
@ -3,7 +3,7 @@ package ru.betterend.blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.FeatureSaplingBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
|
|
@ -7,7 +7,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import ru.betterend.blocks.BlockProperties.PentaShape;
|
||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
@ -16,7 +16,7 @@ import ru.betterend.util.MHelper;
|
|||
|
||||
public class LanceleafSeedBlock extends EndPlantWithAgeBlock {
|
||||
@Override
|
||||
public void growAdult(StructureWorldAccess world, Random random, BlockPos pos) {
|
||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||
int height = MHelper.randRange(4, 6, random);
|
||||
int h = BlocksHelper.upRay(world, pos, height + 2);
|
||||
if (h < height + 1) {
|
||||
|
|
|
@ -5,15 +5,15 @@ import java.util.Random;
|
|||
import net.minecraft.world.level.block.AbstractBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
public class LumecornSeedBlock extends EndPlantWithAgeBlock {
|
||||
@Override
|
||||
public void growAdult(StructureWorldAccess world, Random random, BlockPos pos) {
|
||||
EndFeatures.LUMECORN.getFeature().generate(world, null, random, pos, null);
|
||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||
EndFeatures.LUMECORN.getFeature().place(world, null, random, pos, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.world.level.block.FluidDrainable;
|
|||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.tags.FluidTags;
|
||||
import net.minecraft.util.Pair;
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
|
|
@ -8,9 +8,9 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.entity.ItemEntity;
|
||||
import net.minecraft.world.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
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.core.particles.ParticleTypes;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
|
@ -35,7 +35,7 @@ public class MengerSpongeWetBlock extends BlockBaseNotFull implements IRenderTyp
|
|||
if (world.getDimension().isUltrawarm()) {
|
||||
world.setBlockAndUpdate(pos, EndBlocks.MENGER_SPONGE.defaultBlockState(), 3);
|
||||
world.syncWorldEvent(2009, pos, 0);
|
||||
world.playLocalSound((PlayerEntity) null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundSource.BLOCKS, 1.0F,
|
||||
world.playLocalSound((Player) null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundSource.BLOCKS, 1.0F,
|
||||
(1.0F + world.getRandom().nextFloat() * 0.2F) * 0.7F);
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ public class MengerSpongeWetBlock extends BlockBaseNotFull implements IRenderTyp
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onBreak(Level world, BlockPos pos, BlockState state, PlayerEntity player) {
|
||||
public void onBreak(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
BlocksHelper.setWithUpdate(world, pos, Blocks.AIR);
|
||||
if (!world.isClientSide()) {
|
||||
world.syncWorldEvent(2001, pos, getRawIdFromState(state));
|
||||
|
|
|
@ -3,7 +3,7 @@ package ru.betterend.blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.FeatureSaplingBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
|
|
@ -8,8 +8,8 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.ai.pathing.NavigationType;
|
||||
import net.minecraft.world.entity.effect.StatusEffectInstance;
|
||||
import net.minecraft.world.entity.effect.StatusEffects;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
@ -30,8 +30,8 @@ public class MurkweedBlock extends EndPlantBlock {
|
|||
|
||||
@Override
|
||||
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
||||
if (entity instanceof LivingEntity && !((LivingEntity) entity).hasStatusEffect(StatusEffects.BLINDNESS)) {
|
||||
((LivingEntity) entity).addStatusEffect(new StatusEffectInstance(StatusEffects.BLINDNESS, 50));
|
||||
if (entity instanceof LivingEntity && !((LivingEntity) entity).hasMobEffect(MobEffects.BLINDNESS)) {
|
||||
((LivingEntity) entity).addMobEffect(new MobEffectInstance(MobEffects.BLINDNESS, 50));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.ShapeContext;
|
||||
import net.minecraft.world.level.block.Waterloggable;
|
||||
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;
|
||||
|
|
|
@ -3,7 +3,7 @@ package ru.betterend.blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.FeatureSaplingBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
|
|
@ -14,7 +14,7 @@ import net.minecraft.world.level.block.ShapeContext;
|
|||
import net.minecraft.client.color.block.BlockColor;
|
||||
import net.minecraft.client.color.item.ItemColor;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
|
@ -113,7 +113,7 @@ public class RespawnObeliskBlock extends BlockBase implements IColorProvider, IR
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onBreak(Level world, BlockPos pos, BlockState state, PlayerEntity player) {
|
||||
public void onBreak(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
if (player.isCreative()) {
|
||||
TripleShape shape = state.getValue(SHAPE);
|
||||
if (shape == TripleShape.MIDDLE) {
|
||||
|
@ -152,7 +152,7 @@ public class RespawnObeliskBlock extends BlockBase implements IColorProvider, IR
|
|||
}
|
||||
|
||||
@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) {
|
||||
ItemStack itemStack = player.getStackInHand(hand);
|
||||
boolean canActivate = itemStack.getItem() == EndItems.AMBER_GEM && itemStack.getCount() > 5;
|
||||
|
|
|
@ -8,7 +8,7 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.entity.ItemEntity;
|
||||
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.server.level.ServerLevel;
|
||||
|
@ -89,7 +89,7 @@ public class SilkMothHiveBlock extends BlockBase {
|
|||
}
|
||||
|
||||
@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 (hand == Hand.MAIN_HAND) {
|
||||
ItemStack stack = player.getMainHandStack();
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.block.ShapeContext;
|
||||
import net.minecraft.world.entity.ItemEntity;
|
||||
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;
|
||||
|
@ -112,7 +112,7 @@ public class SilkMothNestBlock extends BlockBase implements IRenderTypeable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onBreak(Level world, BlockPos pos, BlockState state, PlayerEntity player) {
|
||||
public void onBreak(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
if (!state.getValue(ACTIVE) && player.isCreative()) {
|
||||
BlocksHelper.setWithUpdate(world, pos.below(), Blocks.AIR);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ public class SilkMothNestBlock extends BlockBase implements IRenderTypeable {
|
|||
}
|
||||
|
||||
@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 (hand == Hand.MAIN_HAND) {
|
||||
ItemStack stack = player.getMainHandStack();
|
||||
|
|
|
@ -30,7 +30,7 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
|
|||
public void grow(ServerLevel world, Random random, BlockPos pos, BlockState state) {
|
||||
BlockPos bigPos = growBig(world, pos);
|
||||
if (bigPos != null) {
|
||||
if (EndFeatures.GIGANTIC_AMARANITA.getFeature().generate(world, null, random, bigPos, null)) {
|
||||
if (EndFeatures.GIGANTIC_AMARANITA.getFeature().place(world, null, random, bigPos, null)) {
|
||||
replaceMushroom(world, bigPos);
|
||||
replaceMushroom(world, bigPos.south());
|
||||
replaceMushroom(world, bigPos.east());
|
||||
|
@ -38,7 +38,7 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
|
|||
}
|
||||
return;
|
||||
}
|
||||
EndFeatures.LARGE_AMARANITA.getFeature().generate(world, null, random, pos, null);
|
||||
EndFeatures.LARGE_AMARANITA.getFeature().place(world, null, random, pos, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -95,6 +95,6 @@ public class SmallJellyshroomBlock extends AttachedBlock implements IRenderTypea
|
|||
@Override
|
||||
public void grow(ServerLevel world, Random random, BlockPos pos, BlockState state) {
|
||||
BlocksHelper.setWithUpdate(world, pos, Blocks.AIR);
|
||||
EndFeatures.JELLYSHROOM.getFeature().generate(world, null, random, pos, null);
|
||||
EndFeatures.JELLYSHROOM.getFeature().place(world, null, random, pos, null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraft.world.level.block.ShapeContext;
|
|||
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.SoundType;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
|
|
|
@ -18,7 +18,7 @@ import net.minecraft.world.level.block.ShapeContext;
|
|||
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.item.ItemStack;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
|
|
|
@ -3,7 +3,7 @@ package ru.betterend.blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.FeatureSaplingBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
|
|
@ -5,7 +5,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.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
|
@ -37,7 +37,7 @@ public class UmbrellaTreeClusterBlock extends BlockBase {
|
|||
}
|
||||
|
||||
@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) {
|
||||
ItemStack stack = player.getMainHandStack();
|
||||
if (stack.getItem() == Items.GLASS_BOTTLE) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package ru.betterend.blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.FeatureSaplingBlock;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.world.level.block.ShapeContext;
|
|||
import net.minecraft.world.entity.Entity;
|
||||
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.core.particles.ParticleTypes;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.item.DyeItem;
|
||||
import net.minecraft.world.item.ItemConvertible;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.util.DyeColor;
|
||||
import net.minecraft.core.Registry;
|
||||
import ru.betterend.recipe.builders.GridRecipe;
|
||||
|
@ -17,7 +17,7 @@ import ru.betterend.registry.EndBlocks;
|
|||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class ColoredMaterial {
|
||||
private static final Map<Integer, ItemConvertible> DYES = Maps.newHashMap();
|
||||
private static final Map<Integer, ItemLike> DYES = Maps.newHashMap();
|
||||
private static final Map<Integer, String> COLORS = Maps.newHashMap();
|
||||
private final Map<Integer, Block> colors = Maps.newHashMap();
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class ColoredMaterial {
|
|||
}
|
||||
|
||||
public ColoredMaterial(Function<FabricBlockSettings, Block> constructor, Block source, Map<Integer, String> colors,
|
||||
Map<Integer, ItemConvertible> dyes, boolean craftEight) {
|
||||
Map<Integer, ItemLike> dyes, boolean craftEight) {
|
||||
String id = Registry.BLOCK.getKey(source).getPath();
|
||||
colors.forEach((color, name) -> {
|
||||
String blockName = id + "_" + name;
|
||||
|
|
|
@ -62,8 +62,8 @@ public class WoodenMaterial {
|
|||
public final Block shelf;
|
||||
public final Block composter;
|
||||
|
||||
public final Tag.Identified<Block> logBlockTag;
|
||||
public final Tag.Identified<Item> logItemTag;
|
||||
public final Tag.Named<Block> logBlockTag;
|
||||
public final Tag.Named<Item> logItemTag;
|
||||
|
||||
public WoodenMaterial(String name, MaterialColor woodColor, MaterialColor planksColor) {
|
||||
FabricBlockSettings materialPlanks = FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).materialColor(planksColor);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue