Application of Behaviours and Tags as replacement for Materials
This commit is contained in:
parent
6713e03088
commit
4bf32937c1
60 changed files with 237 additions and 350 deletions
|
@ -1,5 +1,7 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.behaviours.BehaviourBuilders;
|
||||
import org.betterx.bclib.behaviours.interfaces.BehaviourWaterPlant;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||
|
||||
|
@ -19,14 +21,17 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
|||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
public class BubbleCoralBlock extends EndUnderwaterPlantBlock implements AddMineableShears {
|
||||
public class BubbleCoralBlock extends EndUnderwaterPlantBlock implements BehaviourWaterPlant, AddMineableShears {
|
||||
|
||||
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16);
|
||||
|
||||
public BubbleCoralBlock() {
|
||||
super(baseUnderwaterPlantSettings()
|
||||
.sound(SoundType.CORAL_BLOCK)
|
||||
.offsetType(BlockBehaviour.OffsetType.NONE)
|
||||
super(baseUnderwaterPlantSettings(
|
||||
BehaviourBuilders.createWaterPlant(),
|
||||
0
|
||||
)
|
||||
.sound(SoundType.CORAL_BLOCK)
|
||||
.offsetType(BlockBehaviour.OffsetType.NONE)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,8 +35,7 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
|||
public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
int age = state.getValue(AGE);
|
||||
BlockState down = world.getBlockState(pos.below());
|
||||
if (down.getMaterial()
|
||||
.isReplaceable() || (down.is(EndBlocks.CAVE_PUMPKIN) && down.getValue(BlockProperties.SMALL))) {
|
||||
if (down.canBeReplaced() || (down.is(EndBlocks.CAVE_PUMPKIN) && down.getValue(BlockProperties.SMALL))) {
|
||||
if (age < 3) {
|
||||
world.setBlockAndUpdate(pos, state.setValue(AGE, age + 1));
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.HalfTransparentBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
|
@ -57,8 +56,8 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements RenderLayer
|
|||
return;
|
||||
}
|
||||
|
||||
Material material = world.getBlockState(pos.below()).getMaterial();
|
||||
if (material.blocksMotion() || material.isLiquid()) {
|
||||
BlockState belowState = world.getBlockState(pos.below());
|
||||
if (belowState.blocksMotion() || belowState.liquid()) {
|
||||
world.setBlockAndUpdate(pos, Blocks.WATER.defaultBlockState());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.behaviours.BehaviourBuilders;
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||
|
@ -42,8 +43,11 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock implements AddMineable
|
|||
private static final VoxelShape SHAPE_TOP = Block.box(2, 0, 2, 14, 6, 14);
|
||||
|
||||
public EndLilyBlock() {
|
||||
super(baseUnderwaterPlantSettings()
|
||||
.lightLevel((state) -> state.getValue(SHAPE) == TripleShape.TOP ? 13 : 0)
|
||||
super(baseUnderwaterPlantSettings(
|
||||
BehaviourBuilders.createWaterPlant(),
|
||||
0
|
||||
)
|
||||
.lightLevel((state) -> state.getValue(SHAPE) == TripleShape.TOP ? 13 : 0)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.behaviours.BehaviourBuilders;
|
||||
import org.betterx.bclib.blocks.UnderwaterPlantBlock;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
|
@ -33,8 +34,11 @@ public class HydraluxBlock extends UnderwaterPlantBlock implements AddMineableSh
|
|||
public static final EnumProperty<HydraluxShape> SHAPE = EndBlockProperties.HYDRALUX_SHAPE;
|
||||
|
||||
public HydraluxBlock() {
|
||||
super(baseUnderwaterPlantSettings()
|
||||
.lightLevel((state) -> state.getValue(SHAPE).hasGlow() ? 15 : 0)
|
||||
super(baseUnderwaterPlantSettings(
|
||||
BehaviourBuilders.createWaterPlant(),
|
||||
0
|
||||
)
|
||||
.lightLevel((state) -> state.getValue(SHAPE).hasGlow() ? 15 : 0)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.betterx.bclib.client.render.BCLRenderLayer;
|
|||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableHoe;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
|
@ -73,14 +74,12 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerPr
|
|||
BlockPos blockPos2 = blockPos.relative(direction);
|
||||
BlockState blockState = world.getBlockState(blockPos2);
|
||||
FluidState fluidState = world.getFluidState(blockPos2);
|
||||
Material material = blockState.getMaterial();
|
||||
if (fluidState.is(FluidTags.WATER)) {
|
||||
if (blockState.getBlock() instanceof BucketPickup && !((BucketPickup) blockState.getBlock()).pickupBlock(
|
||||
world,
|
||||
blockPos2,
|
||||
blockState
|
||||
)
|
||||
.isEmpty()) {
|
||||
if (blockState.getBlock() instanceof BucketPickup
|
||||
&& !((BucketPickup) blockState.getBlock())
|
||||
.pickupBlock(world, blockPos2, blockState)
|
||||
.isEmpty()
|
||||
) {
|
||||
++i;
|
||||
if (j < 6) {
|
||||
queue.add(new Tuple<>(blockPos2, j + 1));
|
||||
|
@ -91,7 +90,7 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerPr
|
|||
if (j < 6) {
|
||||
queue.add(new Tuple<>(blockPos2, j + 1));
|
||||
}
|
||||
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
|
||||
} else if (blockState.is(CommonBlockTags.WATER_PLANT)) {
|
||||
BlockEntity blockEntity = blockState.hasBlockEntity() ? world.getBlockEntity(blockPos2) : null;
|
||||
dropResources(blockState, world, blockPos2, blockEntity);
|
||||
world.setBlock(blockPos2, Blocks.AIR.defaultBlockState(), 3);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.behaviours.BehaviourBuilders;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||
|
||||
|
@ -22,8 +23,11 @@ public class PondAnemoneBlock extends EndUnderwaterPlantBlock implements AddMine
|
|||
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);
|
||||
|
||||
public PondAnemoneBlock() {
|
||||
super(baseUnderwaterPlantSettings(13).sound(SoundType.CORAL_BLOCK)
|
||||
.offsetType(OffsetType.NONE)
|
||||
super(baseUnderwaterPlantSettings(
|
||||
BehaviourBuilders.createWaterPlant(),
|
||||
13
|
||||
).sound(SoundType.CORAL_BLOCK)
|
||||
.offsetType(OffsetType.NONE)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public class RespawnObeliskBlock extends BaseBlock.Stone implements CustomColorP
|
|||
@SuppressWarnings("deprecation")
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (!world.getBlockState(pos.above(i)).getMaterial().isReplaceable()) {
|
||||
if (!world.getBlockState(pos.above(i)).canBeReplaced()){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,14 @@ package org.betterx.betterend.blocks.basis;
|
|||
import org.betterx.bclib.blocks.BaseBlockNotFull;
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.client.models.ModelsHelper;
|
||||
import org.betterx.bclib.interfaces.TagProvider;
|
||||
import org.betterx.betterend.blocks.EndBlockProperties;
|
||||
import org.betterx.betterend.blocks.EndBlockProperties.PedestalState;
|
||||
import org.betterx.betterend.blocks.InfusionPedestal;
|
||||
import org.betterx.betterend.blocks.entities.InfusionPedestalEntity;
|
||||
import org.betterx.betterend.blocks.entities.PedestalBlockEntity;
|
||||
import org.betterx.betterend.client.models.Patterns;
|
||||
import org.betterx.betterend.registry.EndTags;
|
||||
import org.betterx.betterend.rituals.InfusionRitual;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||
|
@ -19,9 +21,11 @@ import net.minecraft.core.Direction;
|
|||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
|
@ -55,7 +59,7 @@ import java.util.Optional;
|
|||
import java.util.function.ToIntFunction;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||
public class PedestalBlock extends BaseBlockNotFull implements EntityBlock, TagProvider {
|
||||
public final static EnumProperty<PedestalState> STATE = EndBlockProperties.PEDESTAL_STATE;
|
||||
public static final BooleanProperty HAS_ITEM = EndBlockProperties.HAS_ITEM;
|
||||
public static final BooleanProperty HAS_LIGHT = BlockProperties.HAS_LIGHT;
|
||||
|
@ -462,6 +466,11 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
SHAPE_COLUMN = Shapes.or(basin, SHAPE_PILLAR, columnTop);
|
||||
SHAPE_BOTTOM = Shapes.or(basin, SHAPE_PILLAR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTags(List<TagKey<Block>> blockTags, List<TagKey<Item>> itemTags) {
|
||||
blockTags.add(EndTags.PEDESTALS);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
@Nullable
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.betterx.betterend.client;
|
||||
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.client.render.BetterEndSkyRenderer;
|
||||
import org.betterx.betterend.events.ItemTooltipCallback;
|
||||
import org.betterx.betterend.interfaces.MultiModelItem;
|
||||
|
@ -49,10 +48,10 @@ public class BetterEndClient implements ClientModInitializer {
|
|||
if (ClientOptions.isCustomSky()) {
|
||||
DimensionRenderingRegistry.registerSkyRenderer(Level.END, new BetterEndSkyRenderer());
|
||||
}
|
||||
|
||||
if (BetterEnd.RUNS_TRINKETS) {
|
||||
org.betterx.betterend.integration.trinkets.ElytraClient.register();
|
||||
}
|
||||
//TODO: 1.20 Re-Enable with Trinkets
|
||||
// if (BetterEnd.RUNS_TRINKETS) {
|
||||
// org.betterx.betterend.integration.trinkets.ElytraClient.register();
|
||||
// }
|
||||
}
|
||||
|
||||
public static void registerTooltips() {
|
||||
|
|
|
@ -51,7 +51,7 @@ public class EndStoneSmelterMenu extends RecipeBookMenu<Container> {
|
|||
super(EndMenuTypes.END_STONE_SMELTER, syncId);
|
||||
this.inventory = inventory;
|
||||
this.propertyDelegate = propertyDelegate;
|
||||
this.world = playerInventory.player.level;
|
||||
this.world = playerInventory.player.level();
|
||||
|
||||
addDataSlots(propertyDelegate);
|
||||
addSlot(new Slot(inventory, INGREDIENT_SLOT_A, 45, 17));
|
||||
|
|
|
@ -3,7 +3,7 @@ package org.betterx.betterend.client.gui;
|
|||
import org.betterx.betterend.BetterEnd;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.ImageButton;
|
||||
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||
import net.minecraft.client.gui.screens.recipebook.RecipeBookComponent;
|
||||
|
@ -61,19 +61,20 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen<EndStoneSmelt
|
|||
recipeBook.tick();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
renderBackground(matrices);
|
||||
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) {
|
||||
renderBackground(guiGraphics);
|
||||
if (recipeBook.isVisible() && narrow) {
|
||||
renderBg(matrices, delta, mouseX, mouseY);
|
||||
recipeBook.render(matrices, mouseX, mouseY, delta);
|
||||
renderBg(guiGraphics, delta, mouseX, mouseY);
|
||||
recipeBook.render(guiGraphics, mouseX, mouseY, delta);
|
||||
} else {
|
||||
recipeBook.render(matrices, mouseX, mouseY, delta);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
recipeBook.renderGhostRecipe(matrices, leftPos, topPos, true, delta);
|
||||
recipeBook.render(guiGraphics, mouseX, mouseY, delta);
|
||||
super.render(guiGraphics, mouseX, mouseY, delta);
|
||||
recipeBook.renderGhostRecipe(guiGraphics, leftPos, topPos, true, delta);
|
||||
}
|
||||
renderTooltip(matrices, mouseX, mouseY);
|
||||
recipeBook.renderTooltip(matrices, leftPos, topPos, mouseX, mouseY);
|
||||
renderTooltip(guiGraphics, mouseX, mouseY);
|
||||
recipeBook.renderTooltip(guiGraphics, leftPos, topPos, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -126,17 +127,24 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen<EndStoneSmelt
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void renderBg(PoseStack matrices, float delta, int mouseX, int mouseY) {
|
||||
protected void renderBg(GuiGraphics guiGraphics, float delta, int mouseX, int mouseY) {
|
||||
if (minecraft == null) return;
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.setShaderTexture(0, BACKGROUND_TEXTURE);
|
||||
blit(matrices, leftPos, topPos, 0, 0, imageWidth, imageHeight);
|
||||
guiGraphics.blit(BACKGROUND_TEXTURE, leftPos, topPos, 0, 0, imageWidth, imageHeight);
|
||||
int progress;
|
||||
if (menu.isBurning()) {
|
||||
progress = menu.getFuelProgress();
|
||||
blit(matrices, leftPos + 56, topPos + 36 + 12 - progress, 176, 12 - progress, 14, progress + 1);
|
||||
guiGraphics.blit(
|
||||
BACKGROUND_TEXTURE,
|
||||
leftPos + 56,
|
||||
topPos + 36 + 12 - progress,
|
||||
176,
|
||||
12 - progress,
|
||||
14,
|
||||
progress + 1
|
||||
);
|
||||
}
|
||||
progress = menu.getSmeltProgress();
|
||||
blit(matrices, leftPos + 92, topPos + 34, 176, 14, progress + 1, 16);
|
||||
guiGraphics.blit(BACKGROUND_TEXTURE, leftPos + 92, topPos + 34, 176, 14, progress + 1, 16);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,8 +40,8 @@ public class SmelterOutputSlot extends Slot {
|
|||
}
|
||||
|
||||
protected void checkTakeAchievements(ItemStack stack) {
|
||||
stack.onCraftedBy(this.player.level, this.player, this.amount);
|
||||
if (!this.player.level.isClientSide && this.container instanceof EndStoneSmelterBlockEntity) {
|
||||
stack.onCraftedBy(this.player.level(), this.player, this.amount);
|
||||
if (!this.player.level().isClientSide && this.container instanceof EndStoneSmelterBlockEntity) {
|
||||
((EndStoneSmelterBlockEntity) this.container).dropExperience(player);
|
||||
}
|
||||
this.amount = 0;
|
||||
|
|
|
@ -243,7 +243,7 @@ public class BetterEndSkyRenderer implements DimensionRenderingRegistry.SkyRende
|
|||
buffer.close();
|
||||
}
|
||||
|
||||
buffer = new VertexBuffer();
|
||||
buffer = new VertexBuffer(VertexBuffer.Usage.STATIC);
|
||||
fkt.make(bufferBuilder, minSize, maxSize, count, seed);
|
||||
BufferBuilder.RenderedBuffer renderedBuffer = bufferBuilder.end();
|
||||
buffer.bind();
|
||||
|
|
|
@ -106,8 +106,8 @@ public class CommandRegistry {
|
|||
return 0;
|
||||
}
|
||||
final BCLBiome biome = biomes.get(biomeIndex);
|
||||
source.sendSuccess(Component.literal("Locating Biome " + biome)
|
||||
.setStyle(Style.EMPTY.withColor(ChatFormatting.DARK_GREEN)), false);
|
||||
source.sendSuccess(() -> Component.literal("Locating Biome " + biome)
|
||||
.setStyle(Style.EMPTY.withColor(ChatFormatting.DARK_GREEN)), false);
|
||||
biomeIndex = (biomeIndex + 1) % biomes.size();
|
||||
|
||||
final BlockPos currentPosition = new BlockPos(
|
||||
|
@ -136,14 +136,15 @@ public class CommandRegistry {
|
|||
boolean didWrap = false;
|
||||
do {
|
||||
target = new BlockPos(biomePosition.getX(), (int) yPos, biomePosition.getZ());
|
||||
state = player.level.getBlockState(target);
|
||||
state = player.level().getBlockState(target);
|
||||
yPos--;
|
||||
if (yPos <= player.level.getMinBuildHeight() + 1) {
|
||||
if (yPos <= player.level().getMinBuildHeight() + 1) {
|
||||
if (didWrap) break;
|
||||
yPos = 127;
|
||||
didWrap = true;
|
||||
}
|
||||
} while (!state.isAir() && yPos > player.level.getMinBuildHeight() && yPos < player.level.getMaxBuildHeight());
|
||||
} while (!state.isAir() && yPos > player.level().getMinBuildHeight() && yPos < player.level()
|
||||
.getMaxBuildHeight());
|
||||
Vector3d targetPlayerPos = new Vector3d(target.getX() + 0.5, target.getY() - 1, target.getZ() + 0.5);
|
||||
|
||||
player.connection.teleport(
|
||||
|
|
|
@ -63,7 +63,7 @@ public class DragonflyEntity extends DespawnableAnimal implements FlyingAnimal {
|
|||
FlyingPathNavigation birdNavigation = new FlyingPathNavigation(this, world) {
|
||||
public boolean isStableDestination(BlockPos pos) {
|
||||
BlockState state = this.level.getBlockState(pos);
|
||||
return state.isAir() || !state.getMaterial().blocksMotion();
|
||||
return state.isAir() || !state.blocksMotion();
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
|
|
|
@ -118,7 +118,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
|||
FlyingPathNavigation birdNavigation = new FlyingPathNavigation(this, world) {
|
||||
public boolean isStableDestination(BlockPos pos) {
|
||||
BlockState state = this.level.getBlockState(pos);
|
||||
return state.isAir() || !state.getMaterial().blocksMotion();
|
||||
return state.isAir() || !state.blocksMotion();
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.betterx.betterend.integration.byg.features;
|
|||
|
||||
import org.betterx.bclib.api.v2.levelgen.features.features.DefaultFeature;
|
||||
import org.betterx.bclib.sdf.SDF;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.bclib.util.SplineHelper;
|
||||
import org.betterx.betterend.integration.Integrations;
|
||||
|
@ -14,7 +15,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
|
@ -34,9 +34,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
|
|||
return log;
|
||||
};
|
||||
Function<BlockState, Boolean> replace = (state) -> {
|
||||
return state.is(CommonBlockTags.END_STONES) || state.getMaterial()
|
||||
.equals(Material.PLANT) || state.getMaterial()
|
||||
.isReplaceable();
|
||||
return state.is(CommonBlockTags.END_STONES) || BlocksHelper.replaceableOrPlant(state);
|
||||
};
|
||||
|
||||
int height = MHelper.randRange(40, 60, random);
|
||||
|
@ -66,9 +64,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
sdf.setReplaceFunction((state) -> {
|
||||
return state.is(CommonBlockTags.END_STONES) || state.getMaterial()
|
||||
.equals(Material.PLANT) || state.getMaterial()
|
||||
.isReplaceable();
|
||||
return state.is(CommonBlockTags.END_STONES) || BlocksHelper.replaceableOrPlant(state);
|
||||
}).addPostProcess((info) -> {
|
||||
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {
|
||||
return wood;
|
||||
|
|
|
@ -25,7 +25,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
|
@ -48,9 +47,8 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
|||
BlockState leaves_flower = Integrations.BYG.getDefaultState("flowering_nightshade_leaves");
|
||||
|
||||
Function<BlockPos, BlockState> splinePlacer = (bpos) -> log;
|
||||
Function<BlockState, Boolean> replace = (state) -> state.is(CommonBlockTags.END_STONES) || state.getMaterial()
|
||||
.equals(Material.PLANT) || state.getMaterial()
|
||||
.isReplaceable();
|
||||
Function<BlockState, Boolean> replace = (state) -> state.is(CommonBlockTags.END_STONES)
|
||||
|| BlocksHelper.replaceableOrPlant(state);
|
||||
Function<PosInfo, BlockState> post = (info) -> {
|
||||
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {
|
||||
return wood;
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.betterx.bclib.sdf.operator.SDFSubtraction;
|
|||
import org.betterx.bclib.sdf.operator.SDFTranslate;
|
||||
import org.betterx.bclib.sdf.operator.SDFUnion;
|
||||
import org.betterx.bclib.sdf.primitive.SDFSphere;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.bclib.util.SplineHelper;
|
||||
import org.betterx.betterend.integration.Integrations;
|
||||
|
@ -21,7 +22,6 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
import net.minecraft.world.phys.AABB;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
@ -52,11 +52,10 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
BlockState glow = Integrations.BYG.getDefaultState("purple_shroomlight");
|
||||
|
||||
Function<BlockState, Boolean> replacement = (state) -> {
|
||||
if (state.equals(stem) || state.equals(wood) || state.is(CommonBlockTags.END_STONES) || state.getMaterial()
|
||||
.equals(Material.PLANT)) {
|
||||
if (state.equals(stem) || state.equals(wood) || state.is(CommonBlockTags.END_STONES)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
return BlocksHelper.replaceableOrPlant(state);
|
||||
};
|
||||
|
||||
float size = MHelper.randRange(10, 20, random);
|
||||
|
|
|
@ -26,7 +26,7 @@ import net.minecraft.world.level.Level;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
@ -79,9 +79,11 @@ public class EndHammerItem extends DiggerItem implements ItemModelProvider, TagP
|
|||
|
||||
@Override
|
||||
public boolean canAttackBlock(BlockState state, Level world, BlockPos pos, Player miner) {
|
||||
return state.getMaterial().equals(Material.STONE) || state.getMaterial().equals(Material.GLASS) || state.is(
|
||||
Blocks.DIAMOND_BLOCK) || state.is(Blocks.EMERALD_BLOCK) || state.is(Blocks.LAPIS_BLOCK) || state.is(
|
||||
Blocks.REDSTONE_BLOCK);
|
||||
return state.is(CommonBlockTags.MINABLE_WITH_HAMMER)
|
||||
|| state.is(Blocks.DIAMOND_BLOCK)
|
||||
|| state.is(Blocks.EMERALD_BLOCK)
|
||||
|| state.is(Blocks.LAPIS_BLOCK)
|
||||
|| state.is(Blocks.REDSTONE_BLOCK);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -102,13 +104,16 @@ public class EndHammerItem extends DiggerItem implements ItemModelProvider, TagP
|
|||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, BlockState state) {
|
||||
if (state.getMaterial().equals(Material.GLASS)) {
|
||||
//usually Glass Blocks
|
||||
if (state.instrument() == NoteBlockInstrument.HAT) {
|
||||
return this.getTier().getSpeed() * 2.0F;
|
||||
}
|
||||
if (isCorrectToolForDrops(state)) {
|
||||
float mult;
|
||||
if (state.is(Blocks.DIAMOND_BLOCK) || state.is(Blocks.EMERALD_BLOCK) || state.is(Blocks.LAPIS_BLOCK) || state
|
||||
.is(Blocks.REDSTONE_BLOCK)) {
|
||||
if (state.is(Blocks.DIAMOND_BLOCK)
|
||||
|| state.is(Blocks.EMERALD_BLOCK)
|
||||
|| state.is(Blocks.LAPIS_BLOCK)
|
||||
|| state.is(Blocks.REDSTONE_BLOCK)) {
|
||||
mult = this.getTier().getSpeed();
|
||||
} else {
|
||||
mult = this.getTier().getSpeed() / 2.0F;
|
||||
|
@ -118,30 +123,6 @@ public class EndHammerItem extends DiggerItem implements ItemModelProvider, TagP
|
|||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCorrectToolForDrops(BlockState state) {
|
||||
if (state.getMaterial().equals(Material.GLASS)) {
|
||||
return true;
|
||||
}
|
||||
if (!state.is(Blocks.REDSTONE_BLOCK) && !state.is(Blocks.DIAMOND_BLOCK) && !state.is(Blocks.EMERALD_BLOCK) && !state
|
||||
.is(Blocks.LAPIS_BLOCK) && !state.getMaterial().equals(Material.STONE)) {
|
||||
return false;
|
||||
}
|
||||
int level = this.getTier().getLevel();
|
||||
if (state.is(Blocks.IRON_ORE) || state.is(Blocks.LAPIS_BLOCK) || state.is(Blocks.LAPIS_ORE)) {
|
||||
return level >= 1;
|
||||
}
|
||||
if (state.is(Blocks.DIAMOND_BLOCK) && !state.is(Blocks.DIAMOND_ORE) || state.is(Blocks.EMERALD_ORE) || state.is(
|
||||
Blocks.EMERALD_BLOCK) || state.is(Blocks.GOLD_ORE) || state.is(Blocks.REDSTONE_ORE)) {
|
||||
return level >= 2;
|
||||
}
|
||||
if (state.is(Blocks.OBSIDIAN) || state.is(Blocks.CRYING_OBSIDIAN) || state.is(Blocks.RESPAWN_ANCHOR) || state.is(
|
||||
Blocks.ANCIENT_DEBRIS)) {
|
||||
return level >= 3;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot slot) {
|
||||
return slot == EquipmentSlot.MAINHAND ? this.attributeModifiers : super.getDefaultAttributeModifiers(slot);
|
||||
|
|
|
@ -60,7 +60,7 @@ public abstract class PlayerMixin extends LivingEntity {
|
|||
for (Direction dir : horizontal) {
|
||||
BlockPos p = pos.relative(dir);
|
||||
BlockState state2 = world.getBlockState(p);
|
||||
if (!state2.getMaterial().blocksMotion() && state2.getCollisionShape(world, pos).isEmpty()) {
|
||||
if (!state2.blocksMotion() && state2.getCollisionShape(world, pos).isEmpty()) {
|
||||
return Optional.of(Vec3.atLowerCornerOf(p).add(0.5, 0, 0.5));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public class SpikeFeatureMixin {
|
|||
if (x2 + z2 <= r2) {
|
||||
for (int py = minY; py < maxY; py++) {
|
||||
mut.setY(py);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()){
|
||||
if ((px == radius || px == -radius || pz == radius || pz == -radius) && random.nextInt(
|
||||
24) == 0) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, Blocks.CRYING_OBSIDIAN);
|
||||
|
@ -131,7 +131,7 @@ public class SpikeFeatureMixin {
|
|||
if (x2 + z2 <= r2) {
|
||||
for (int py = minY; py < maxY; py++) {
|
||||
mut.setY(py);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()){
|
||||
BlocksHelper.setWithoutUpdate(world, mut, Blocks.OBSIDIAN);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
package org.betterx.betterend.registry;
|
||||
|
||||
import org.betterx.bclib.api.v2.ComposterAPI;
|
||||
import org.betterx.bclib.blocks.BaseVineBlock;
|
||||
import org.betterx.bclib.blocks.SimpleLeavesBlock;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.blocks.basis.EndTerrainBlock;
|
||||
import org.betterx.betterend.blocks.basis.PedestalBlock;
|
||||
import org.betterx.betterend.item.tool.EndHammerItem;
|
||||
import org.betterx.betterend.world.biome.EndBiome;
|
||||
import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
||||
import org.betterx.worlds.together.tag.v3.CommonItemTags;
|
||||
import org.betterx.worlds.together.tag.v3.MineableTags;
|
||||
import org.betterx.worlds.together.tag.v3.TagManager;
|
||||
|
||||
import net.minecraft.tags.BlockTags;
|
||||
|
@ -20,12 +15,6 @@ import net.minecraft.world.food.FoodProperties;
|
|||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
|
||||
|
||||
import net.fabricmc.fabric.mixin.object.builder.AbstractBlockAccessor;
|
||||
import net.fabricmc.fabric.mixin.object.builder.AbstractBlockSettingsAccessor;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
|
@ -54,39 +43,6 @@ public class EndTags {
|
|||
addEndGround(EndBlocks.THALLASIUM.ore);
|
||||
addEndGround(EndBlocks.ENDSTONE_DUST);
|
||||
addEndGround(EndBlocks.AMBER_ORE);
|
||||
|
||||
EndBlocks.getModBlocks().forEach(block -> {
|
||||
Properties properties = ((AbstractBlockAccessor) block).getSettings();
|
||||
Material material = ((AbstractBlockSettingsAccessor) properties).getMaterial();
|
||||
final Item item = block.asItem();
|
||||
|
||||
if (material.equals(Material.STONE) || material.equals(Material.METAL) || material.equals(Material.HEAVY_METAL)) {
|
||||
TagManager.BLOCKS.add(MineableTags.PICKAXE, block);
|
||||
} else if (material.equals(Material.WOOD)) {
|
||||
TagManager.BLOCKS.add(MineableTags.AXE, block);
|
||||
} else if (material.equals(Material.LEAVES) || material.equals(Material.PLANT) || material.equals(Material.WATER_PLANT) || material.equals(
|
||||
Material.SPONGE)) {
|
||||
TagManager.BLOCKS.add(MineableTags.HOE, block);
|
||||
} else if (material.equals(Material.SAND)) {
|
||||
TagManager.BLOCKS.add(MineableTags.SHOVEL, block);
|
||||
}
|
||||
|
||||
if (block instanceof EndTerrainBlock) {
|
||||
addEndGround(block);
|
||||
} else if (block instanceof LeavesBlock || block instanceof SimpleLeavesBlock) {
|
||||
TagManager.BLOCKS.add(BlockTags.LEAVES, block);
|
||||
ComposterAPI.allowCompost(0.3f, item);
|
||||
} else if (block instanceof BaseVineBlock) {
|
||||
TagManager.BLOCKS.add(BlockTags.CLIMBABLE, block);
|
||||
} else if (block instanceof PedestalBlock) {
|
||||
TagManager.BLOCKS.add(PEDESTALS, block);
|
||||
}
|
||||
|
||||
Material mat = block.defaultBlockState().getMaterial();
|
||||
if (mat.equals(Material.PLANT) || mat.equals(Material.REPLACEABLE_PLANT)) {
|
||||
ComposterAPI.allowCompost(0.1F, item);
|
||||
}
|
||||
});
|
||||
addEndGround(EndBlocks.CAVE_MOSS);
|
||||
|
||||
List<Item> ITEM_HAMMERS = Lists.newArrayList();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.betterx.betterend.rituals;
|
||||
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.advancements.BECriteria;
|
||||
import org.betterx.betterend.blocks.EndPortalBlock;
|
||||
|
@ -14,6 +15,7 @@ import org.betterx.worlds.together.world.event.WorldBootstrap;
|
|||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.QuartPos;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.particles.BlockParticleOption;
|
||||
import net.minecraft.core.particles.ParticleOptions;
|
||||
|
@ -32,6 +34,7 @@ import net.minecraft.world.entity.ai.village.poi.PoiManager;
|
|||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelHeightAccessor;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
|
@ -42,7 +45,6 @@ import net.minecraft.world.level.dimension.DimensionType;
|
|||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.minecraft.world.level.levelgen.LegacyRandomSource;
|
||||
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import java.awt.*;
|
||||
|
@ -708,8 +710,7 @@ public class EternalRitual {
|
|||
|
||||
private static boolean isStateInvalid(BlockState state) {
|
||||
if (!state.getFluidState().isEmpty()) return true;
|
||||
Material material = state.getMaterial();
|
||||
return !material.isReplaceable() && !material.equals(Material.PLANT);
|
||||
return !BlocksHelper.replaceableOrPlant(state);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -744,7 +745,12 @@ public class EternalRitual {
|
|||
for (int i = 0; i < (step >> 1); i++) {
|
||||
ChunkAccess chunk = world.getChunk(checkPos);
|
||||
if (!(chunk instanceof LevelChunk) || ((LevelChunk) chunk).isEmpty()) continue;
|
||||
for (LevelChunkSection section : chunk.getSections()) {
|
||||
|
||||
final LevelHeightAccessor levelHeightAccessor = chunk.getHeightAccessorForGeneration();
|
||||
LevelChunkSection section;
|
||||
for (int k = levelHeightAccessor.getMinSection(); k < levelHeightAccessor.getMaxSection(); ++k) {
|
||||
section = chunk.getSection(chunk.getSectionIndexFromSectionY(k));
|
||||
|
||||
if (section == null || !section.getStates().maybeHas(condition)) continue;
|
||||
for (int x = 0; x < 16; x++) {
|
||||
for (int y = 0; y < 16; y++) {
|
||||
|
@ -752,7 +758,7 @@ public class EternalRitual {
|
|||
BlockState checkState = section.getBlockState(x, y, z);
|
||||
if (checkState.is(searchBlock)) {
|
||||
int worldX = (chunk.getPos().x << 4) + x;
|
||||
int worldY = section.bottomBlockY() + y;
|
||||
int worldY = QuartPos.fromSection(k) + y;
|
||||
int worldZ = (chunk.getPos().z << 4) + z;
|
||||
checkPos.set(worldX, worldY, worldZ);
|
||||
return checkPos;
|
||||
|
|
|
@ -62,8 +62,7 @@ public class BiomeIslandFeature extends DefaultFeature {
|
|||
return (float) simplexNoise.eval(CENTER.getX() + pos.x(), CENTER.getY() + pos.y(), CENTER.getZ() + pos.z());
|
||||
})
|
||||
.setSource(sdfCone)
|
||||
.setReplaceFunction(state -> BlocksHelper.isFluid(state) || state.getMaterial()
|
||||
.isReplaceable());
|
||||
.setReplaceFunction(state -> BlocksHelper.isFluid(state) || state.canBeReplaced());
|
||||
return sdfCone;
|
||||
}
|
||||
|
||||
|
|
|
@ -118,10 +118,10 @@ public class BuildingListFeature extends NBTFeature<BuildingListFeatureConfig> {
|
|||
StructureBlockInfo structureBlockInfo2,
|
||||
StructurePlaceSettings structurePlaceSettings
|
||||
) {
|
||||
BlockState blockState = structureBlockInfo2.state;
|
||||
BlockState blockState = structureBlockInfo2.state();
|
||||
if (blockState.getBlock() instanceof ChestBlock) {
|
||||
RandomSource random = structurePlaceSettings.getRandom(structureBlockInfo2.pos);
|
||||
BlockPos chestPos = structureBlockInfo2.pos;
|
||||
RandomSource random = structurePlaceSettings.getRandom(structureBlockInfo2.pos());
|
||||
BlockPos chestPos = structureBlockInfo2.pos();
|
||||
ChestBlock chestBlock = (ChestBlock) blockState.getBlock();
|
||||
BlockEntity entity = chestBlock.newBlockEntity(chestPos, blockState);
|
||||
levelReader.getChunk(chestPos).setBlockEntity(entity);
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.Mirror;
|
||||
import net.minecraft.world.level.block.Rotation;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
|
@ -137,9 +138,9 @@ public class CrashedShipFeature extends NBTFeature<NBTFeatureConfig> {
|
|||
StructureBlockInfo structureBlockInfo2,
|
||||
StructurePlaceSettings structurePlacementData
|
||||
) {
|
||||
BlockState state = structureBlockInfo2.state;
|
||||
if (state.is(Blocks.SPAWNER) || state.getMaterial().equals(Material.WOOL)) {
|
||||
return new StructureBlockInfo(structureBlockInfo2.pos, DefaultFeature.AIR, null);
|
||||
BlockState state = structureBlockInfo2.state();
|
||||
if (state.is(Blocks.SPAWNER) || state.getSoundType() == SoundType.WOOL) {
|
||||
return new StructureBlockInfo(structureBlockInfo2.pos(), DefaultFeature.AIR, null);
|
||||
}
|
||||
return structureBlockInfo2;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class MengerSpongeFeature extends UnderwaterPlantScatter<ScatterFeatureCo
|
|||
if (state.is(EndBlocks.END_LOTUS_STEM)) {
|
||||
return false;
|
||||
}
|
||||
return !state.getFluidState().isEmpty() || state.getMaterial().isReplaceable();
|
||||
return !state.getFluidState().isEmpty() || state.canBeReplaced();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ public abstract class NBTFeature<FC extends NBTFeatureConfig> extends Feature<FC
|
|||
BlockState stateSt = world.getBlockState(mut);
|
||||
if (!isTerrain(stateSt)) {
|
||||
if (merge == TerrainMerge.SURFACE) {
|
||||
boolean isTop = mut.getY() == surfMax && state.getMaterial().isSolidBlocking();
|
||||
boolean isTop = mut.getY() == surfMax && state.isSolid();
|
||||
Holder<Biome> b = world.getBiome(mut);
|
||||
BlockState top = (isTop
|
||||
? BiomeAPI.findTopMaterial(b)
|
||||
|
@ -160,7 +160,7 @@ public abstract class NBTFeature<FC extends NBTFeatureConfig> extends Feature<FC
|
|||
BlocksHelper.setWithoutUpdate(world, mut, state);
|
||||
}
|
||||
} else {
|
||||
if (isTerrain(state) && state.getMaterial().isSolidBlocking()) {
|
||||
if (isTerrain(state) && state.isSolid()) {
|
||||
if (merge == TerrainMerge.SURFACE) {
|
||||
Holder<Biome> b = world.getBiome(mut);
|
||||
BlockState bottom = BiomeAPI.findUnderMaterial(b).orElse(cfg.defaultBlock);
|
||||
|
|
|
@ -25,7 +25,7 @@ public class SilkMothNestFeature extends DefaultFeature {
|
|||
state = world.getBlockState(pos);
|
||||
if ((state.isAir() || state.is(EndBlocks.TENANEA_OUTER_LEAVES)) && world.isEmptyBlock(pos.below())) {
|
||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||
return !world.getBlockState(pos.below().relative(dir)).getMaterial().blocksMotion();
|
||||
return !world.getBlockState(pos.below().relative(dir)).blocksMotion();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public class VineFeature extends InvertedScatterFeature<VineFeatureConfig> {
|
|||
plant = cfg.getPlantState(random, blockPos);
|
||||
|
||||
BlockState state = world.getBlockState(blockPos);
|
||||
return state.getMaterial().isReplaceable() && canPlaceBlock(state, world, blockPos);
|
||||
return state.canBeReplaced() && canPlaceBlock(state, world, blockPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,7 +22,6 @@ 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 java.util.function.Function;
|
||||
|
||||
public class BushFeature extends Feature<BushFeatureConfig> {
|
||||
|
@ -89,11 +88,6 @@ public class BushFeature extends Feature<BushFeatureConfig> {
|
|||
}
|
||||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
};
|
||||
REPLACE = BlocksHelper::replaceableOrPlant;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
|||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public class BushWithOuterFeature extends Feature<BushWithOuterFeatureConfig> {
|
||||
|
@ -107,11 +106,6 @@ public class BushWithOuterFeature extends Feature<BushWithOuterFeatureConfig> {
|
|||
}
|
||||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
};
|
||||
REPLACE = BlocksHelper::replaceableOrPlant;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -128,11 +127,6 @@ public class TenaneaBushFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
};
|
||||
REPLACE = BlocksHelper::replaceableOrPlant;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
public class BigAuroraCrystalFeature extends DefaultFeature {
|
||||
|
@ -41,11 +40,9 @@ public class BigAuroraCrystalFeature extends DefaultFeature {
|
|||
Vector3f vec = MHelper.randomHorizontal(random);
|
||||
prism = new SDFRotation().setRotation(vec, random.nextFloat()).setSource(prism);
|
||||
prism.setReplaceFunction((bState) -> {
|
||||
return bState.getMaterial()
|
||||
.isReplaceable() || bState.is(CommonBlockTags.GEN_END_STONES) || bState.getMaterial()
|
||||
.equals(Material.PLANT) || bState
|
||||
.getMaterial()
|
||||
.equals(Material.LEAVES);
|
||||
return bState.is(CommonBlockTags.GEN_END_STONES)
|
||||
|| BlocksHelper.replaceableOrPlant(bState)
|
||||
|| bState.is(CommonBlockTags.LEAVES);
|
||||
});
|
||||
prism.fillRecursive(world, pos);
|
||||
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.AURORA_CRYSTAL);
|
||||
|
|
|
@ -237,12 +237,9 @@ public class DesertLakeFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
private boolean canReplace(BlockState state) {
|
||||
return state.getMaterial()
|
||||
.isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.ENDSTONE_DUST) || state
|
||||
.getMaterial()
|
||||
.equals(
|
||||
Material.PLANT) || state
|
||||
.getMaterial()
|
||||
.equals(Material.WATER_PLANT);
|
||||
return state.is(CommonBlockTags.GEN_END_STONES)
|
||||
|| state.is(EndBlocks.ENDSTONE_DUST)
|
||||
|| BlocksHelper.replaceableOrPlant(state)
|
||||
|| state.is(CommonBlockTags.WATER_PLANT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,12 +229,9 @@ public class EndLakeFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
private boolean canReplace(BlockState state) {
|
||||
return state.getMaterial()
|
||||
.isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.ENDSTONE_DUST) || state
|
||||
.getMaterial()
|
||||
.equals(
|
||||
Material.PLANT) || state
|
||||
.getMaterial()
|
||||
.equals(Material.WATER_PLANT);
|
||||
return state.is(CommonBlockTags.GEN_END_STONES)
|
||||
|| state.is(EndBlocks.ENDSTONE_DUST)
|
||||
|| BlocksHelper.replaceableOrPlant(state)
|
||||
|| state.is(CommonBlockTags.WATER_PLANT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.betterx.bclib.sdf.operator.SDFDisplacement;
|
|||
import org.betterx.bclib.sdf.operator.SDFRotation;
|
||||
import org.betterx.bclib.sdf.operator.SDFTranslate;
|
||||
import org.betterx.bclib.sdf.primitive.SDFCappedCone;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.betterend.noise.OpenSimplexNoise;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
@ -19,7 +20,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
public class FallenPillarFeature extends DefaultFeature {
|
||||
|
@ -59,9 +59,7 @@ public class FallenPillarFeature extends DefaultFeature {
|
|||
}
|
||||
return info.getState();
|
||||
}).setReplaceFunction((state) -> {
|
||||
return state.getMaterial()
|
||||
.isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.getMaterial()
|
||||
.equals(Material.PLANT);
|
||||
return state.is(CommonBlockTags.GEN_END_STONES) || BlocksHelper.replaceableOrPlant(state);
|
||||
}).fillRecursive(world, pos);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -30,7 +30,6 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
|
@ -192,7 +191,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
int dist = MHelper.floor(6 - distRaw) + random.nextInt(2);
|
||||
if (dist >= 0) {
|
||||
state = world.getBlockState(mut);
|
||||
while (!state.getFluidState().isEmpty() || state.getMaterial().equals(Material.WATER_PLANT)) {
|
||||
while (!state.getFluidState().isEmpty() || state.is(CommonBlockTags.WATER_PLANT)) {
|
||||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
|
@ -287,10 +286,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
if (state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
return BlocksHelper.replaceableOrPlant(state);
|
||||
};
|
||||
|
||||
IGNORE = (state) -> state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.betterx.bclib.sdf.SDF;
|
|||
import org.betterx.bclib.sdf.operator.SDFDisplacement;
|
||||
import org.betterx.bclib.sdf.operator.SDFScale3D;
|
||||
import org.betterx.bclib.sdf.primitive.SDFSphere;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.betterend.noise.OpenSimplexNoise;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
@ -68,9 +69,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
|
|||
}
|
||||
return info.getState();
|
||||
}).setReplaceFunction((state) -> {
|
||||
return state.getMaterial()
|
||||
.isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.getMaterial()
|
||||
.equals(Material.PLANT);
|
||||
return state.is(CommonBlockTags.GEN_END_STONES) || BlocksHelper.replaceableOrPlant(state);
|
||||
}).fillRecursive(world, pos);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.betterx.bclib.sdf.operator.SDFSubtraction;
|
|||
import org.betterx.bclib.sdf.operator.SDFTranslate;
|
||||
import org.betterx.bclib.sdf.primitive.SDFCappedCone;
|
||||
import org.betterx.bclib.sdf.primitive.SDFFlatland;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.betterend.noise.OpenSimplexNoise;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
@ -21,7 +22,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
public class ObsidianPillarBasementFeature extends DefaultFeature {
|
||||
|
@ -65,9 +65,7 @@ public class ObsidianPillarBasementFeature extends DefaultFeature {
|
|||
}
|
||||
return info.getState();
|
||||
}).setReplaceFunction((state) -> {
|
||||
return state.getMaterial()
|
||||
.isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.getMaterial()
|
||||
.equals(Material.PLANT);
|
||||
return state.is(CommonBlockTags.GEN_END_STONES) || BlocksHelper.replaceableOrPlant(state);
|
||||
}).fillRecursive(world, pos);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.betterx.bclib.sdf.operator.SDFDisplacement;
|
|||
import org.betterx.bclib.sdf.operator.SDFSmoothUnion;
|
||||
import org.betterx.bclib.sdf.operator.SDFTranslate;
|
||||
import org.betterx.bclib.sdf.primitive.SDFSphere;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.betterend.noise.OpenSimplexNoise;
|
||||
import org.betterx.betterend.registry.EndBiomes;
|
||||
|
@ -16,6 +17,7 @@ import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
|||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
|
@ -25,7 +27,6 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -114,13 +115,10 @@ public class SpireFeature extends DefaultFeature {
|
|||
if (state.is(CommonBlockTags.END_STONES)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getBlock() instanceof LeavesBlock) {
|
||||
if (state.getBlock() instanceof LeavesBlock || state.is(BlockTags.LEAVES)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
return BlocksHelper.replaceableOrPlant(state);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class StalactiteFeature extends Feature<StalactiteFeatureConfig> {
|
|||
for (int i = 1; i <= height; i++) {
|
||||
mut.setY(pos.getY() + i * dir);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (!state.getMaterial().isReplaceable()) {
|
||||
if (!state.canBeReplaced()){
|
||||
stalagnate = state.is(CommonBlockTags.GEN_END_STONES);
|
||||
height = i;
|
||||
break;
|
||||
|
|
|
@ -63,7 +63,7 @@ public class SulphurHillFeature extends DefaultFeature {
|
|||
int d = x2 + z2;
|
||||
mut.setY(pos.getY());
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (state.getMaterial().isReplaceable() || state.is(EndBlocks.HYDROTHERMAL_VENT)) {
|
||||
if (state.canBeReplaced() || state.is(EndBlocks.HYDROTHERMAL_VENT)){
|
||||
if (d < r2 * r2) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, Blocks.WATER);
|
||||
mut.move(Direction.DOWN);
|
||||
|
@ -75,7 +75,8 @@ public class SulphurHillFeature extends DefaultFeature {
|
|||
mut.move(Direction.DOWN);
|
||||
state = world.getBlockState(mut);
|
||||
int maxIt = MHelper.floor(10 - Math.sqrt(d)) + random.nextInt(1);
|
||||
for (int i = 0; i < maxIt && state.getMaterial().isReplaceable(); i++) {
|
||||
for (int i = 0; i < maxIt && state.canBeReplaced();
|
||||
i++){
|
||||
BlocksHelper.setWithoutUpdate(world, mut, rock);
|
||||
mut.move(Direction.DOWN);
|
||||
}
|
||||
|
@ -84,7 +85,8 @@ public class SulphurHillFeature extends DefaultFeature {
|
|||
mut.move(Direction.DOWN);
|
||||
state = world.getBlockState(mut);
|
||||
int maxIt = MHelper.floor(10 - Math.sqrt(d)) + random.nextInt(1);
|
||||
for (int i = 0; i < maxIt && state.getMaterial().isReplaceable(); i++) {
|
||||
for (int i = 0; i < maxIt && state.canBeReplaced();
|
||||
i++){
|
||||
BlocksHelper.setWithoutUpdate(world, mut, rock);
|
||||
mut.move(Direction.DOWN);
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
|
@ -22,7 +23,6 @@ import net.minecraft.world.level.levelgen.Heightmap;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import java.util.Set;
|
||||
|
@ -141,7 +141,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
)) + random.nextInt(2);
|
||||
if (dist > 0) {
|
||||
state = world.getBlockState(mut);
|
||||
while (!state.getFluidState().isEmpty() || state.getMaterial().equals(Material.WATER_PLANT)) {
|
||||
while (!state.getFluidState().isEmpty() || state.is(CommonBlockTags.WATER_PLANT)) {
|
||||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
|
@ -187,11 +187,14 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
private boolean isReplaceable(BlockState state) {
|
||||
return state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state
|
||||
.is(EndBlocks.SULPHUR_CRYSTAL) || state.getMaterial().isReplaceable() || state.getMaterial()
|
||||
.equals(Material.PLANT) || state
|
||||
.getMaterial()
|
||||
.equals(Material.WATER_PLANT) || state.getMaterial().equals(Material.LEAVES);
|
||||
return state.is(CommonBlockTags.GEN_END_STONES)
|
||||
|| state.is(EndBlocks.HYDROTHERMAL_VENT)
|
||||
|| state.is(EndBlocks.VENT_BUBBLE_COLUMN)
|
||||
|| state.is(EndBlocks.SULPHUR_CRYSTAL)
|
||||
|| BlocksHelper.replaceableOrPlant(state)
|
||||
|| state.is(CommonBlockTags.WATER_PLANT)
|
||||
|| state.is(BlockTags.LEAVES)
|
||||
;
|
||||
}
|
||||
|
||||
private void placeBrimstone(WorldGenLevel world, BlockPos pos, RandomSource random) {
|
||||
|
|
|
@ -69,7 +69,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
|
|||
Set<BlockPos> floorPositions = Sets.newConcurrentHashSet();
|
||||
Set<BlockPos> ceilPositions = Sets.newConcurrentHashSet();
|
||||
caveBlocks.parallelStream().forEach((bpos) -> {
|
||||
if (world.getBlockState(bpos).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(bpos).canBeReplaced()){
|
||||
BlockPos side = bpos.below();
|
||||
if (world.getBlockState(side).is(CommonBlockTags.GEN_END_STONES)) {
|
||||
floorPositions.add(side);
|
||||
|
|
|
@ -7,11 +7,11 @@ import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
|||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import java.util.Set;
|
||||
|
@ -56,13 +56,13 @@ public class RoundCaveFeature extends EndCaveFeature {
|
|||
if (isReplaceable(state) && !isWaterNear(world, bpos)) {
|
||||
blocks.add(bpos.immutable());
|
||||
|
||||
while (state.getMaterial().equals(Material.LEAVES)) {
|
||||
while (state.is(BlockTags.LEAVES)) {
|
||||
bpos.setY(bpos.getY() + 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
||||
bpos.setY(y - 1);
|
||||
while (state.getMaterial().equals(Material.LEAVES)) {
|
||||
while (state.is(BlockTags.LEAVES)) {
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
@ -77,8 +77,7 @@ public class RoundCaveFeature extends EndCaveFeature {
|
|||
|
||||
private boolean isReplaceable(BlockState state) {
|
||||
return state.is(CommonBlockTags.GEN_END_STONES) ||
|
||||
state.getMaterial().isReplaceable() ||
|
||||
state.getMaterial().equals(Material.PLANT) ||
|
||||
state.getMaterial().equals(Material.LEAVES);
|
||||
BlocksHelper.replaceableOrPlant(state) ||
|
||||
state.is(BlockTags.LEAVES);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ public class TunelCaveFeature extends EndCaveFeature {
|
|||
int height = world.getHeight(Types.WORLD_SURFACE, bpos.getX(), bpos.getZ());
|
||||
if (mut.getY() >= height) {
|
||||
remove.add(bpos);
|
||||
} else if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
} else if (world.getBlockState(mut).canBeReplaced()){
|
||||
mut.setY(bpos.getY() - 1);
|
||||
if (world.getBlockState(mut).is(CommonBlockTags.GEN_END_STONES)) {
|
||||
Set<BlockPos> floorPositions = floorSets.get(bio);
|
||||
|
|
|
@ -23,7 +23,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
|
@ -216,10 +215,7 @@ public class DragonTreeFeature extends DefaultFeature {
|
|||
if (state.getBlock() == EndBlocks.DRAGON_TREE_LEAVES) {
|
||||
return true;
|
||||
}
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
return BlocksHelper.replaceableOrPlant(state);
|
||||
};
|
||||
|
||||
IGNORE = EndBlocks.DRAGON_TREE::isTreeLog;
|
||||
|
|
|
@ -22,7 +22,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -80,31 +79,31 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
if (radius < 2) {
|
||||
for (int i = -1; i < 2; i++) {
|
||||
mut.set(pos).move(Direction.NORTH, 2).move(Direction.EAST, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.set(pos).move(Direction.SOUTH, 2).move(Direction.EAST, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.set(pos).move(Direction.EAST, 2).move(Direction.NORTH, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.set(pos).move(Direction.WEST, 2).move(Direction.NORTH, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
}
|
||||
for (int x = -1; x < 2; x++) {
|
||||
for (int z = -1; z < 2; z++) {
|
||||
mut.set(pos).move(x, 0, z);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_LANTERN);
|
||||
mut.move(Direction.DOWN);
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_LANTERN);
|
||||
mut.move(Direction.DOWN);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
mut,
|
||||
|
@ -123,7 +122,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
mut.setX(pos.getX() + x);
|
||||
for (int z = -1; z < 2; z++) {
|
||||
mut.setZ(pos.getZ() + z);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP);
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +134,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
mut.setX(pos.getX() + x);
|
||||
for (int z = -1; z < 2; z++) {
|
||||
mut.setZ(pos.getZ() + z);
|
||||
if ((x == 0 || z == 0) && world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if ((x == 0 || z == 0) && world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP);
|
||||
}
|
||||
}
|
||||
|
@ -144,26 +143,26 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
pos = pos.offset(-1, 0, -1);
|
||||
for (int i = -2; i < 2; i++) {
|
||||
mut.set(pos).move(Direction.NORTH, 2).move(Direction.WEST, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.set(pos).move(Direction.SOUTH, 3).move(Direction.WEST, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.set(pos).move(Direction.EAST, 3).move(Direction.NORTH, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.set(pos).move(Direction.WEST, 2).move(Direction.NORTH, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
}
|
||||
for (int x = -1; x < 3; x++) {
|
||||
for (int z = -1; z < 3; z++) {
|
||||
mut.set(pos).move(x, 0, z);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_LANTERN);
|
||||
mut.move(Direction.DOWN);
|
||||
if ((x >> 1) == 0 || (z >> 1) == 0) {
|
||||
|
@ -171,7 +170,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
Axis axis = x < 0 || x > 1 ? Axis.X : Axis.Z;
|
||||
int distance = axis == Axis.X ? x < 0 ? -1 : 1 : z < 0 ? -1 : 1;
|
||||
BlockPos offseted = mut.relative(axis, distance);
|
||||
if (world.getBlockState(offseted).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(offseted).canBeReplaced()) {
|
||||
Direction dir = Direction.fromAxisAndDirection(
|
||||
axis,
|
||||
distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE
|
||||
|
@ -185,7 +184,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
}
|
||||
mut.move(Direction.DOWN);
|
||||
}
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
mut,
|
||||
|
@ -204,7 +203,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
mut.setX(pos.getX() + x);
|
||||
for (int z = -1; z < 3; z++) {
|
||||
mut.setZ(pos.getZ() + z);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP);
|
||||
}
|
||||
}
|
||||
|
@ -216,7 +215,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
mut.setX(pos.getX() + x);
|
||||
for (int z = -1; z < 3; z++) {
|
||||
mut.setZ(pos.getZ() + z);
|
||||
if (((x >> 1) == 0 || (z >> 1) == 0) && world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (((x >> 1) == 0 || (z >> 1) == 0) && world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP);
|
||||
}
|
||||
}
|
||||
|
@ -224,54 +223,54 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
} else {
|
||||
for (int i = -2; i < 3; i++) {
|
||||
mut.set(pos).move(Direction.NORTH, 3).move(Direction.EAST, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.move(Direction.UP);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.move(Direction.NORTH);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
|
||||
mut.set(pos).move(Direction.SOUTH, 3).move(Direction.EAST, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.move(Direction.UP);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.move(Direction.SOUTH);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
|
||||
mut.set(pos).move(Direction.EAST, 3).move(Direction.NORTH, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.move(Direction.UP);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.move(Direction.EAST);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
|
||||
mut.set(pos).move(Direction.WEST, 3).move(Direction.NORTH, i);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.move(Direction.UP);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
mut.move(Direction.WEST);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
}
|
||||
|
@ -281,7 +280,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
.move(Direction.UP)
|
||||
.move(BlocksHelper.HORIZONTAL[i], 3)
|
||||
.move(BlocksHelper.HORIZONTAL[(i + 1) & 3], 3);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
|
||||
}
|
||||
}
|
||||
|
@ -289,7 +288,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
for (int x = -2; x < 3; x++) {
|
||||
for (int z = -2; z < 3; z++) {
|
||||
mut.set(pos).move(x, 0, z);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_LANTERN);
|
||||
mut.move(Direction.DOWN);
|
||||
if ((x / 2) == 0 || (z / 2) == 0) {
|
||||
|
@ -297,7 +296,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
Axis axis = x < 0 || x > 1 ? Axis.X : Axis.Z;
|
||||
int distance = axis == Axis.X ? x < 0 ? -1 : 1 : z < 0 ? -1 : 1;
|
||||
BlockPos offseted = mut.relative(axis, distance);
|
||||
if (world.getBlockState(offseted).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(offseted).canBeReplaced()) {
|
||||
Direction dir = Direction.fromAxisAndDirection(
|
||||
axis,
|
||||
distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE
|
||||
|
@ -311,7 +310,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
}
|
||||
mut.move(Direction.DOWN);
|
||||
}
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
mut,
|
||||
|
@ -329,7 +328,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
mut.setX(pos.getX() + x);
|
||||
for (int z = -2; z < 3; z++) {
|
||||
mut.setZ(pos.getZ() + z);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(mut).canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP);
|
||||
}
|
||||
}
|
||||
|
@ -345,14 +344,12 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
mut.setZ(pos.getZ() + z);
|
||||
if (y < 6) {
|
||||
if (((x / 2) == 0 || (z / 2) == 0) && world.getBlockState(mut)
|
||||
.getMaterial()
|
||||
.isReplaceable()) {
|
||||
.canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP);
|
||||
}
|
||||
} else {
|
||||
if ((x == 0 || z == 0) && (Math.abs(x) < 2 && Math.abs(z) < 2) && world.getBlockState(mut)
|
||||
.getMaterial()
|
||||
.isReplaceable()) {
|
||||
.canBeReplaced()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP);
|
||||
}
|
||||
}
|
||||
|
@ -363,12 +360,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (/*state.is(CommonBlockTags.END_STONES) || */state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
};
|
||||
REPLACE = BlocksHelper::replaceableOrPlant;
|
||||
|
||||
IGNORE = EndBlocks.DRAGON_TREE::isTreeLog;
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
world,
|
||||
EndBlocks.HELIX_TREE.getBark().defaultBlockState(),
|
||||
pos,
|
||||
(state) -> state.getMaterial().isReplaceable()
|
||||
(state) -> state.canBeReplaced()
|
||||
);
|
||||
SplineHelper.rotateSpline(spline, (float) Math.PI);
|
||||
SplineHelper.fillSplineForce(
|
||||
|
@ -94,7 +94,7 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
world,
|
||||
EndBlocks.HELIX_TREE.getBark().defaultBlockState(),
|
||||
pos,
|
||||
(state) -> state.getMaterial().isReplaceable()
|
||||
(state) -> state.canBeReplaced()
|
||||
);
|
||||
SplineHelper.scale(spline2, scale);
|
||||
BlockPos leafStart = pos.offset(
|
||||
|
@ -107,7 +107,7 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
world,
|
||||
EndBlocks.HELIX_TREE.getLog().defaultBlockState(),
|
||||
leafStart,
|
||||
(state) -> state.getMaterial().isReplaceable()
|
||||
(state) -> state.canBeReplaced()
|
||||
);
|
||||
|
||||
spline.clear();
|
||||
|
@ -197,7 +197,7 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
bPos.set(x + pos.getX(), y + pos.getY(), z + pos.getZ());
|
||||
int color = MHelper.floor((float) i / (float) count * 7F + 0.5F) + offset;
|
||||
color = Mth.clamp(color, 0, 7);
|
||||
if (world.getBlockState(bPos).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(bPos).canBeReplaced()){
|
||||
BlocksHelper.setWithoutUpdate(world, bPos, state.setValue(HelixTreeLeavesBlock.COLOR, color));
|
||||
}
|
||||
x += dx;
|
||||
|
@ -205,7 +205,7 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
z += dz;
|
||||
}
|
||||
bPos.set(end.x() + pos.getX(), end.y() + pos.getY(), end.z() + pos.getZ());
|
||||
if (world.getBlockState(bPos).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(bPos).canBeReplaced()){
|
||||
BlocksHelper.setWithoutUpdate(world, bPos, state.setValue(HelixTreeLeavesBlock.COLOR, 7));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.betterx.bclib.api.v2.levelgen.features.features.DefaultFeature;
|
|||
import org.betterx.bclib.sdf.SDF;
|
||||
import org.betterx.bclib.sdf.operator.*;
|
||||
import org.betterx.bclib.sdf.primitive.SDFSphere;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.bclib.util.SplineHelper;
|
||||
import org.betterx.betterend.blocks.JellyshroomCapBlock;
|
||||
|
@ -19,7 +20,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
|
@ -118,11 +118,6 @@ public class JellyshroomFeature extends DefaultFeature {
|
|||
);
|
||||
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
|
||||
|
||||
REPLACE = (state) -> {
|
||||
if (/*state.is(CommonBlockTags.END_STONES) || */state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
};
|
||||
REPLACE = BlocksHelper::replaceableOrPlant;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -98,9 +97,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
for (int y = top; y >= minY; y--) {
|
||||
mut.setY(y);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (state.getMaterial().isReplaceable() || state.getMaterial()
|
||||
.equals(Material.PLANT) || state.is(
|
||||
CommonBlockTags.END_STONES)) {
|
||||
if (BlocksHelper.replaceableOrPlant(state) || state.is(CommonBlockTags.END_STONES)) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
mut,
|
||||
|
@ -209,10 +206,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
if (state.getBlock() == EndBlocks.LACUGROVE_LEAVES) {
|
||||
return true;
|
||||
}
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
return BlocksHelper.replaceableOrPlant(state);
|
||||
};
|
||||
|
||||
IGNORE = EndBlocks.LACUGROVE::isTreeLog;
|
||||
|
|
|
@ -25,7 +25,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
|
@ -219,10 +218,7 @@ public class LucerniaFeature extends DefaultFeature {
|
|||
if (state.getBlock() == EndBlocks.LUCERNIA_LEAVES) {
|
||||
return true;
|
||||
}
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
return BlocksHelper.replaceableOrPlant(state);
|
||||
};
|
||||
|
||||
IGNORE = EndBlocks.LUCERNIA::isTreeLog;
|
||||
|
|
|
@ -22,7 +22,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -161,14 +160,6 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
FUNCTION = new SDFSmoothUnion().setRadius(4)
|
||||
.setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT));
|
||||
|
||||
REPLACE = (state) -> {
|
||||
/*if (state.is(CommonBlockTags.END_STONES)) {
|
||||
return true;
|
||||
}*/
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
};
|
||||
REPLACE = BlocksHelper::replaceableOrPlant;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -208,10 +207,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
|
|||
if (state.getBlock() == EndBlocks.PYTHADENDRON_LEAVES) {
|
||||
return true;
|
||||
}
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
return BlocksHelper.replaceableOrPlant(state);
|
||||
};
|
||||
|
||||
IGNORE = EndBlocks.PYTHADENDRON::isTreeLog;
|
||||
|
|
|
@ -24,7 +24,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
|
@ -184,10 +183,7 @@ public class TenaneaFeature extends DefaultFeature {
|
|||
if (state.getBlock() == EndBlocks.TENANEA_LEAVES) {
|
||||
return true;
|
||||
}
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
return BlocksHelper.replaceableOrPlant(state);
|
||||
};
|
||||
|
||||
IGNORE = EndBlocks.TENANEA::isTreeLog;
|
||||
|
|
|
@ -23,7 +23,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
|
@ -218,11 +217,10 @@ public class UmbrellaTreeFeature extends DefaultFeature {
|
|||
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
|
||||
|
||||
REPLACE = (state) -> {
|
||||
if (/*state.is(CommonBlockTags.END_STONES) || */state.getMaterial().equals(Material.PLANT) || state.is(
|
||||
EndBlocks.UMBRELLA_TREE_MEMBRANE)) {
|
||||
if (state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
return BlocksHelper.replaceableOrPlant(state);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ public class CavePiece extends BasePiece {
|
|||
BlocksHelper.setWithoutUpdate(world, pos, CAVE_AIR);
|
||||
}
|
||||
} else if (dist < r * r) {
|
||||
if (world.getBlockState(pos).getMaterial().isReplaceable()) {
|
||||
if (world.getBlockState(pos).canBeReplaced()){
|
||||
BlocksHelper.setWithoutUpdate(world, pos, Blocks.END_STONE);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue