Fixed AABB
usage
This commit is contained in:
parent
5a2513d0a9
commit
95a1a21f04
3 changed files with 19 additions and 9 deletions
|
@ -72,7 +72,11 @@ public class BlockEntityHydrothermalVent extends BlockEntity {
|
|||
boolean active = state.getValue(HydrothermalVentBlock.ACTIVATED);
|
||||
POS.set(worldPosition).move(Direction.UP);
|
||||
int height = active ? 85 : 25;
|
||||
AABB box = new AABB(POS.offset(-1, 0, -1), POS.offset(1, height, 1));
|
||||
AABB box = new AABB(
|
||||
new Vec3(POS.getX() - 1, POS.getY(), POS.getZ() - 1),
|
||||
new Vec3(POS.getX() + 1, POS.getY() + height, POS.getZ() + 1)
|
||||
);
|
||||
|
||||
List<LivingEntity> entities = level.getEntitiesOfClass(LivingEntity.class, box);
|
||||
if (entities.size() > 0) {
|
||||
while (POS.getY() < box.maxY) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.world.level.block.state.pattern.BlockPattern;
|
|||
import net.minecraft.world.level.dimension.end.DragonRespawnAnimation;
|
||||
import net.minecraft.world.level.dimension.end.EndDragonFight;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -72,7 +73,10 @@ public class EndDragonFightMixin {
|
|||
BlockPos central = BlockPos.ZERO.relative(dir, 4);
|
||||
List<EndCrystal> crystalList = level.getEntitiesOfClass(
|
||||
EndCrystal.class,
|
||||
new AABB(central.below(255).south().west(), central.above(255).north().east())
|
||||
new AABB(
|
||||
new Vec3(central.getX() - 1, central.getY() - 255, central.getZ() + 1),
|
||||
new Vec3(central.getX() - 1, central.getY() + 255, central.getZ() + 1)
|
||||
)
|
||||
);
|
||||
|
||||
int count = crystalList.size();
|
||||
|
|
|
@ -17,10 +17,12 @@ import net.minecraft.tags.BlockTags;
|
|||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
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 net.minecraft.world.phys.Vec3;
|
||||
|
||||
import org.joml.Vector3f;
|
||||
|
||||
|
@ -76,8 +78,8 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
world,
|
||||
pos,
|
||||
new AABB(
|
||||
pos.offset((int) -dx, (int) dy1, (int) -dx),
|
||||
pos.offset((int) dx, (int) dy2, (int) dx)
|
||||
new Vec3(pos.getX() - dx, pos.getY() + dy1, pos.getZ() - dx),
|
||||
new Vec3(pos.getX() + dx, pos.getY() + dy2, pos.getZ() + dx)
|
||||
)
|
||||
);
|
||||
SplineHelper.scale(spline, scale);
|
||||
|
@ -86,7 +88,7 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
world,
|
||||
EndBlocks.HELIX_TREE.getBark().defaultBlockState(),
|
||||
pos,
|
||||
(state) -> state.canBeReplaced()
|
||||
BlockBehaviour.BlockStateBase::canBeReplaced
|
||||
);
|
||||
SplineHelper.rotateSpline(spline, (float) Math.PI);
|
||||
SplineHelper.fillSplineForce(
|
||||
|
@ -94,7 +96,7 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
world,
|
||||
EndBlocks.HELIX_TREE.getBark().defaultBlockState(),
|
||||
pos,
|
||||
(state) -> state.canBeReplaced()
|
||||
BlockBehaviour.BlockStateBase::canBeReplaced
|
||||
);
|
||||
SplineHelper.scale(spline2, scale);
|
||||
BlockPos leafStart = pos.offset(
|
||||
|
@ -107,7 +109,7 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
world,
|
||||
EndBlocks.HELIX_TREE.getLog().defaultBlockState(),
|
||||
leafStart,
|
||||
(state) -> state.canBeReplaced()
|
||||
BlockBehaviour.BlockStateBase::canBeReplaced
|
||||
);
|
||||
|
||||
spline.clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue