More compiler fixes
This commit is contained in:
parent
6097311ca6
commit
dca9f84ccf
23 changed files with 110 additions and 106 deletions
|
@ -15,8 +15,7 @@ public class DragonTreeSaplingBlock extends PottableFeatureSapling {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
protected Feature<?> getFeature(BlockState state) {
|
||||||
protected Feature<?> getFeature() {
|
|
||||||
return EndFeatures.DRAGON_TREE.getFeature();
|
return EndFeatures.DRAGON_TREE.getFeature();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -29,8 +32,6 @@ import ru.bclib.client.render.BCLRenderLayer;
|
||||||
import ru.bclib.interfaces.RenderLayerProvider;
|
import ru.bclib.interfaces.RenderLayerProvider;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlock, RenderLayerProvider {
|
public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlock, RenderLayerProvider {
|
||||||
public static final EnumProperty<Direction> FACING = BlockStateProperties.FACING;
|
public static final EnumProperty<Direction> FACING = BlockStateProperties.FACING;
|
||||||
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
||||||
|
@ -88,7 +89,7 @@ public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlo
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
||||||
if (state.getValue(WATERLOGGED)) {
|
if (state.getValue(WATERLOGGED)) {
|
||||||
world.getLiquidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,7 @@ import ru.betterend.registry.EndFeatures;
|
||||||
|
|
||||||
public class HelixTreeSaplingBlock extends PottableFeatureSapling {
|
public class HelixTreeSaplingBlock extends PottableFeatureSapling {
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
protected Feature<?> getFeature(BlockState state) {
|
||||||
protected Feature<?> getFeature() {
|
|
||||||
return EndFeatures.HELIX_TREE.getFeature();
|
return EndFeatures.HELIX_TREE.getFeature();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -34,15 +38,12 @@ import net.minecraft.world.level.material.Fluids;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
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;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
import ru.bclib.blocks.BaseBlockNotFull;
|
import ru.bclib.blocks.BaseBlockNotFull;
|
||||||
import ru.bclib.blocks.BlockProperties;
|
import ru.bclib.blocks.BlockProperties;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.blocks.entities.BlockEntityHydrothermalVent;
|
import ru.betterend.blocks.entities.BlockEntityHydrothermalVent;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlock, LiquidBlockContainer, SimpleWaterloggedBlock {
|
public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlock, LiquidBlockContainer, SimpleWaterloggedBlock {
|
||||||
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
||||||
|
@ -90,7 +91,8 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
||||||
return Blocks.WATER.defaultBlockState();
|
return Blocks.WATER.defaultBlockState();
|
||||||
}
|
}
|
||||||
else if (state.getValue(WATERLOGGED) && facing == Direction.UP && neighborState.is(Blocks.WATER)) {
|
else if (state.getValue(WATERLOGGED) && facing == Direction.UP && neighborState.is(Blocks.WATER)) {
|
||||||
world.getBlockTicks().scheduleTick(pos, this, 20);
|
//TODO: 1.18 see if it still ticks
|
||||||
|
world./*getBlockTicks().*/scheduleTick(pos, this, 20);
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -118,7 +120,8 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
||||||
BlockPos up = pos.above();
|
BlockPos up = pos.above();
|
||||||
if (world.getBlockState(up).is(Blocks.WATER)) {
|
if (world.getBlockState(up).is(Blocks.WATER)) {
|
||||||
BlocksHelper.setWithoutUpdate(world, up, EndBlocks.VENT_BUBBLE_COLUMN);
|
BlocksHelper.setWithoutUpdate(world, up, EndBlocks.VENT_BUBBLE_COLUMN);
|
||||||
world.getBlockTicks().scheduleTick(up, EndBlocks.VENT_BUBBLE_COLUMN, 5);
|
//TODO: 1.18 see if it still ticks
|
||||||
|
world./*getBlockTicks().*/scheduleTick(up, EndBlocks.VENT_BUBBLE_COLUMN, 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,7 @@ public class LacugroveSaplingBlock extends PottableFeatureSapling {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
protected Feature<?> getFeature(BlockState state) {
|
||||||
protected Feature<?> getFeature() {
|
|
||||||
return EndFeatures.LACUGROVE.getFeature();
|
return EndFeatures.LACUGROVE.getFeature();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,7 @@ public class LucerniaSaplingBlock extends PottableFeatureSapling {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
protected Feature<?> getFeature(BlockState state) {
|
||||||
protected Feature<?> getFeature() {
|
|
||||||
return EndFeatures.LUCERNIA.getFeature();
|
return EndFeatures.LUCERNIA.getFeature();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,39 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.WorldGenLevel;
|
import net.minecraft.world.level.WorldGenLevel;
|
||||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||||
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||||
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 LumecornSeedBlock extends EndPlantWithAgeBlock {
|
public class LumecornSeedBlock extends EndPlantWithAgeBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||||
EndFeatures.LUMECORN.getFeature().place(new FeaturePlaceContext<>(world, null, random, pos, null));
|
((Feature<NoneFeatureConfiguration>) (EndFeatures.LUMECORN.getFeature())).place(new FeaturePlaceContext<>(
|
||||||
}
|
Optional.empty(),
|
||||||
|
world,
|
||||||
|
null,
|
||||||
|
random,
|
||||||
|
pos,
|
||||||
|
(NoneFeatureConfiguration) null));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
return state.is(EndBlocks.END_MOSS);
|
return state.is(EndBlocks.END_MOSS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockBehaviour.OffsetType getOffsetType() {
|
public BlockBehaviour.OffsetType getOffsetType() {
|
||||||
return BlockBehaviour.OffsetType.NONE;
|
return BlockBehaviour.OffsetType.NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,7 @@ public class MossyGlowshroomSaplingBlock extends PottableFeatureSapling {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
protected Feature<?> getFeature(BlockState state) {
|
||||||
protected Feature<?> getFeature() {
|
|
||||||
return EndFeatures.MOSSY_GLOWSHROOM.getFeature();
|
return EndFeatures.MOSSY_GLOWSHROOM.getFeature();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -46,10 +51,6 @@ import ru.betterend.blocks.EndBlockProperties.CactusBottom;
|
||||||
import ru.betterend.interfaces.PottablePlant;
|
import ru.betterend.interfaces.PottablePlant;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
import java.util.EnumMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, RenderLayerProvider, PottablePlant {
|
public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, RenderLayerProvider, PottablePlant {
|
||||||
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||||
|
@ -115,9 +116,10 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
||||||
world.getBlockTicks().scheduleTick(pos, this, 2);
|
//TODO: 1.18 Check if this still workd
|
||||||
|
world./*getBlockTicks().*/scheduleTick(pos, this, 2);
|
||||||
if (state.getValue(WATERLOGGED)) {
|
if (state.getValue(WATERLOGGED)) {
|
||||||
world.getLiquidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
||||||
}
|
}
|
||||||
Direction dir = state.getValue(FACING);
|
Direction dir = state.getValue(FACING);
|
||||||
BlockState downState = world.getBlockState(pos.relative(dir.getOpposite()));
|
BlockState downState = world.getBlockState(pos.relative(dir.getOpposite()));
|
||||||
|
|
|
@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.LevelReader;
|
import net.minecraft.world.level.LevelReader;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
|
||||||
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
|
|
||||||
public class PythadendronSaplingBlock extends PottableFeatureSapling {
|
public class PythadendronSaplingBlock extends PottableFeatureSapling {
|
||||||
public PythadendronSaplingBlock() {
|
public PythadendronSaplingBlock() {
|
||||||
super();
|
super((state)->EndFeatures.PYTHADENDRON_TREE.getFeature());
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
protected Feature<?> getFeature() {
|
|
||||||
return EndFeatures.PYTHADENDRON_TREE.getFeature();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
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;
|
||||||
|
@ -7,7 +10,9 @@ 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.Feature;
|
||||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||||
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
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;
|
||||||
|
@ -16,8 +21,6 @@ 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);
|
||||||
|
|
||||||
|
@ -30,8 +33,8 @@ 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()
|
if (((Feature<NoneFeatureConfiguration>)EndFeatures.GIGANTIC_AMARANITA.getFeature())
|
||||||
.place(new FeaturePlaceContext<>(world, null, random, bigPos, null))) {
|
.place(new FeaturePlaceContext<>(Optional.empty(), 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());
|
||||||
|
@ -39,7 +42,7 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
EndFeatures.LARGE_AMARANITA.getFeature().place(new FeaturePlaceContext<>(world, null, random, pos, null));
|
((Feature<NoneFeatureConfiguration>)EndFeatures.LARGE_AMARANITA.getFeature()).place( new FeaturePlaceContext<>(Optional.empty(), world, null, random, pos, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -20,7 +26,9 @@ 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.Feature;
|
||||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||||
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
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;
|
||||||
|
@ -35,10 +43,6 @@ import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.interfaces.PottablePlant;
|
import ru.betterend.interfaces.PottablePlant;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
|
|
||||||
import java.util.EnumMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLayerProvider, BonemealableBlock, PottablePlant {
|
public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLayerProvider, BonemealableBlock, PottablePlant {
|
||||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||||
|
|
||||||
|
@ -101,7 +105,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa
|
||||||
@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(new FeaturePlaceContext<>(world, null, random, pos, null));
|
((Feature<NoneFeatureConfiguration>)EndFeatures.JELLYSHROOM.getFeature()).place(new FeaturePlaceContext<>(Optional.empty(), world, null, random, pos, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.LevelReader;
|
import net.minecraft.world.level.LevelReader;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
|
||||||
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
|
|
||||||
public class TenaneaSaplingBlock extends PottableFeatureSapling {
|
public class TenaneaSaplingBlock extends PottableFeatureSapling {
|
||||||
public TenaneaSaplingBlock() {
|
public TenaneaSaplingBlock() {
|
||||||
super();
|
super((state)->EndFeatures.TENANEA.getFeature());
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
protected Feature<?> getFeature() {
|
|
||||||
return EndFeatures.TENANEA.getFeature();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,7 +4,6 @@ import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.LevelReader;
|
import net.minecraft.world.level.LevelReader;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
|
||||||
import ru.bclib.client.render.BCLRenderLayer;
|
import ru.bclib.client.render.BCLRenderLayer;
|
||||||
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
@ -12,13 +11,7 @@ import ru.betterend.registry.EndFeatures;
|
||||||
|
|
||||||
public class UmbrellaTreeSaplingBlock extends PottableFeatureSapling {
|
public class UmbrellaTreeSaplingBlock extends PottableFeatureSapling {
|
||||||
public UmbrellaTreeSaplingBlock() {
|
public UmbrellaTreeSaplingBlock() {
|
||||||
super();
|
super((state)-> EndFeatures.UMBRELLA_TREE.getFeature());
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
protected Feature<?> getFeature() {
|
|
||||||
return EndFeatures.UMBRELLA_TREE.getFeature();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -33,9 +36,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class VentBubbleColumnBlock extends Block implements BucketPickup, LiquidBlockContainer {
|
public class VentBubbleColumnBlock extends Block implements BucketPickup, LiquidBlockContainer {
|
||||||
public VentBubbleColumnBlock() {
|
public VentBubbleColumnBlock() {
|
||||||
super(FabricBlockSettings.of(Material.BUBBLE_COLUMN).noOcclusion().noCollission().noDrops());
|
super(FabricBlockSettings.of(Material.BUBBLE_COLUMN).noOcclusion().noCollission().noDrops());
|
||||||
|
@ -76,7 +76,8 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid
|
||||||
BlockPos up = pos.above();
|
BlockPos up = pos.above();
|
||||||
if (world.getBlockState(up).is(Blocks.WATER)) {
|
if (world.getBlockState(up).is(Blocks.WATER)) {
|
||||||
BlocksHelper.setWithoutUpdate(world, up, this);
|
BlocksHelper.setWithoutUpdate(world, up, this);
|
||||||
world.getBlockTicks().scheduleTick(up, this, 5);
|
//TODO: 1.18 check if this ticks
|
||||||
|
world./*getBlockTicks().*/scheduleTick(up, this, 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
package ru.betterend.blocks.basis;
|
package ru.betterend.blocks.basis;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||||
import ru.bclib.blocks.FeatureSaplingBlock;
|
import ru.bclib.blocks.FeatureSaplingBlock;
|
||||||
import ru.betterend.interfaces.PottablePlant;
|
import ru.betterend.interfaces.PottablePlant;
|
||||||
|
|
||||||
public abstract class PottableFeatureSapling extends FeatureSaplingBlock implements PottablePlant {
|
public abstract class PottableFeatureSapling extends FeatureSaplingBlock implements PottablePlant {
|
||||||
public PottableFeatureSapling() {
|
public PottableFeatureSapling(Function<BlockState, Feature<?>> featureSupplier) {
|
||||||
super();
|
super(featureSupplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PottableFeatureSapling(int light) {
|
public PottableFeatureSapling(int light, Function<BlockState, Feature<?>> featureSupplier) {
|
||||||
super(light);
|
super(light, featureSupplier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
package ru.betterend.blocks.entities;
|
package ru.betterend.blocks.entities;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry;
|
import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||||
import net.fabricmc.fabric.api.registry.FuelRegistry;
|
import net.fabricmc.fabric.api.registry.FuelRegistry;
|
||||||
|
@ -41,10 +46,6 @@ import ru.betterend.client.gui.EndStoneSmelterScreenHandler;
|
||||||
import ru.betterend.recipe.builders.AlloyingRecipe;
|
import ru.betterend.recipe.builders.AlloyingRecipe;
|
||||||
import ru.betterend.registry.EndBlockEntities;
|
import ru.betterend.registry.EndBlockEntities;
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity implements WorldlyContainer, RecipeHolder, StackedContentsCompatible {
|
public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity implements WorldlyContainer, RecipeHolder, StackedContentsCompatible {
|
||||||
|
|
||||||
private static final int[] TOP_SLOTS = new int[] {0, 1};
|
private static final int[] TOP_SLOTS = new int[] {0, 1};
|
||||||
|
@ -429,8 +430,9 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompoundTag save(CompoundTag tag) {
|
public void saveAdditional(CompoundTag tag) {
|
||||||
super.save(tag);
|
super.saveAdditional(tag);
|
||||||
|
|
||||||
tag.putShort("BurnTime", (short) burnTime);
|
tag.putShort("BurnTime", (short) burnTime);
|
||||||
tag.putShort("FuelTime", (short) fuelTime);
|
tag.putShort("FuelTime", (short) fuelTime);
|
||||||
tag.putShort("SmeltTime", (short) smeltTime);
|
tag.putShort("SmeltTime", (short) smeltTime);
|
||||||
|
@ -439,8 +441,6 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
CompoundTag usedRecipes = new CompoundTag();
|
CompoundTag usedRecipes = new CompoundTag();
|
||||||
recipesUsed.forEach((identifier, integer) -> usedRecipes.putInt(identifier.toString(), integer));
|
recipesUsed.forEach((identifier, integer) -> usedRecipes.putInt(identifier.toString(), integer));
|
||||||
tag.put("RecipesUsed", usedRecipes);
|
tag.put("RecipesUsed", usedRecipes);
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canPlaceItem(int slot, ItemStack stack) {
|
public boolean canPlaceItem(int slot, ItemStack stack) {
|
||||||
|
|
|
@ -35,11 +35,11 @@ public class EternalPedestalEntity extends PedestalBlockEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompoundTag save(CompoundTag tag) {
|
public void saveAdditional(CompoundTag tag) {
|
||||||
if (hasRitual()) {
|
if (hasRitual()) {
|
||||||
tag.put("ritual", linkedRitual.toTag(new CompoundTag()));
|
tag.put("ritual", linkedRitual.toTag(new CompoundTag()));
|
||||||
}
|
}
|
||||||
return super.save(tag);
|
super.saveAdditional(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -40,11 +40,11 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompoundTag save(CompoundTag tag) {
|
public void saveAdditional(CompoundTag tag) {
|
||||||
if (hasRitual()) {
|
if (hasRitual()) {
|
||||||
tag.put("ritual", linkedRitual.toTag(new CompoundTag()));
|
tag.put("ritual", linkedRitual.toTag(new CompoundTag()));
|
||||||
}
|
}
|
||||||
return super.save(tag);
|
super.saveAdditional(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class MetalMaterial {
|
||||||
final int level = material.getLevel();
|
final int level = material.getLevel();
|
||||||
|
|
||||||
rawOre = hasOre ? EndItems.registerEndItem(name + "_raw", new ModelProviderItem(itemSettings)) : null;
|
rawOre = hasOre ? EndItems.registerEndItem(name + "_raw", new ModelProviderItem(itemSettings)) : null;
|
||||||
ore = hasOre ? EndBlocks.registerBlock(name + "_ore", new BaseOreBlock(rawOre, 1, 3, 1)) : null;
|
ore = hasOre ? EndBlocks.registerBlock(name + "_ore", new BaseOreBlock(()->rawOre, 1, 3, 1)) : null;
|
||||||
alloyingOre = hasOre ? TagAPI.makeItemTag(BetterEnd.MOD_ID, name + "_alloying") : null;
|
alloyingOre = hasOre ? TagAPI.makeItemTag(BetterEnd.MOD_ID, name + "_alloying") : null;
|
||||||
if (hasOre) {
|
if (hasOre) {
|
||||||
TagAPI.addTag(alloyingOre, ore, rawOre);
|
TagAPI.addTag(alloyingOre, ore, rawOre);
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package ru.betterend.mixin.common;
|
package ru.betterend.mixin.common;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Vec3i;
|
import net.minecraft.core.Vec3i;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
@ -23,8 +26,6 @@ import ru.bclib.util.StructureHelper;
|
||||||
import ru.betterend.BetterEnd;
|
import ru.betterend.BetterEnd;
|
||||||
import ru.betterend.world.generator.GeneratorOptions;
|
import ru.betterend.world.generator.GeneratorOptions;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
@Mixin(EndPodiumFeature.class)
|
@Mixin(EndPodiumFeature.class)
|
||||||
public class EndPodiumFeatureMixin {
|
public class EndPodiumFeatureMixin {
|
||||||
private static BlockPos be_portalPosition;
|
private static BlockPos be_portalPosition;
|
||||||
|
@ -56,7 +57,8 @@ public class EndPodiumFeatureMixin {
|
||||||
private FeaturePlaceContext<NoneFeatureConfiguration> be_setPosOnGround(FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceContext) {
|
private FeaturePlaceContext<NoneFeatureConfiguration> be_setPosOnGround(FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceContext) {
|
||||||
WorldGenLevel world = featurePlaceContext.level();
|
WorldGenLevel world = featurePlaceContext.level();
|
||||||
BlockPos pos = be_updatePortalPos(world);
|
BlockPos pos = be_updatePortalPos(world);
|
||||||
return new FeaturePlaceContext<>(
|
return new FeaturePlaceContext<NoneFeatureConfiguration>(
|
||||||
|
Optional.empty(),
|
||||||
world,
|
world,
|
||||||
featurePlaceContext.chunkGenerator(),
|
featurePlaceContext.chunkGenerator(),
|
||||||
featurePlaceContext.random(),
|
featurePlaceContext.random(),
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
package ru.betterend.util;
|
package ru.betterend.util;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -19,9 +23,6 @@ import ru.betterend.blocks.BlueVineBlock;
|
||||||
import ru.betterend.blocks.basis.FurBlock;
|
import ru.betterend.blocks.basis.FurBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.IntStream;
|
|
||||||
|
|
||||||
public class BlockFixer {
|
public class BlockFixer {
|
||||||
private static final BlockState AIR = Blocks.AIR.defaultBlockState();
|
private static final BlockState AIR = Blocks.AIR.defaultBlockState();
|
||||||
private static final BlockState WATER = Blocks.WATER.defaultBlockState();
|
private static final BlockState WATER = Blocks.WATER.defaultBlockState();
|
||||||
|
@ -75,7 +76,7 @@ public class BlockFixer {
|
||||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||||
if (level.isEmptyBlock(POS.relative(dir))) {
|
if (level.isEmptyBlock(POS.relative(dir))) {
|
||||||
try {
|
try {
|
||||||
level.getLiquidTicks().scheduleTick(POS, state.getFluidState().getType(), 0);
|
level.scheduleTick(POS, state.getFluidState().getType(), 0);
|
||||||
}
|
}
|
||||||
catch (Exception e) {}
|
catch (Exception e) {}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue