mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-15 06:54:38 +01:00
Merge branch 'mc1.15/dev' into mc1.16/dev
# Conflicts: # src/main/java/com/simibubi/create/content/curiosities/ChromaticCompoundItem.java
This commit is contained in:
commit
f499122ae5
@ -1,15 +1,11 @@
|
|||||||
package com.simibubi.create.content.curiosities;
|
package com.simibubi.create.content.curiosities;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.foundation.advancement.AllTriggers;
|
import com.simibubi.create.foundation.advancement.AllTriggers;
|
||||||
import com.simibubi.create.foundation.config.AllConfigs;
|
import com.simibubi.create.foundation.config.AllConfigs;
|
||||||
import com.simibubi.create.foundation.config.CRecipes;
|
import com.simibubi.create.foundation.config.CRecipes;
|
||||||
import com.simibubi.create.foundation.utility.ColorHelper;
|
import com.simibubi.create.foundation.utility.ColorHelper;
|
||||||
import com.simibubi.create.foundation.utility.VecHelper;
|
import com.simibubi.create.foundation.utility.VecHelper;
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.entity.item.ItemEntity;
|
import net.minecraft.entity.item.ItemEntity;
|
||||||
@ -21,16 +17,16 @@ import net.minecraft.particles.ParticleTypes;
|
|||||||
import net.minecraft.tileentity.BeaconTileEntity;
|
import net.minecraft.tileentity.BeaconTileEntity;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
import net.minecraft.util.math.*;
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
import net.minecraft.util.math.RayTraceContext;
|
|
||||||
import net.minecraft.util.math.RayTraceContext.BlockMode;
|
import net.minecraft.util.math.RayTraceContext.BlockMode;
|
||||||
import net.minecraft.util.math.RayTraceContext.FluidMode;
|
import net.minecraft.util.math.RayTraceContext.FluidMode;
|
||||||
import net.minecraft.util.math.vector.Vector3d;
|
import net.minecraft.util.math.vector.Vector3d;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.gen.Heightmap;
|
import net.minecraft.world.gen.Heightmap;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class ChromaticCompoundItem extends Item {
|
public class ChromaticCompoundItem extends Item {
|
||||||
|
|
||||||
public ChromaticCompoundItem(Properties properties) {
|
public ChromaticCompoundItem(Properties properties) {
|
||||||
@ -122,22 +118,27 @@ public class ChromaticCompoundItem extends Item {
|
|||||||
int entityX = MathHelper.floor(entity.getX());
|
int entityX = MathHelper.floor(entity.getX());
|
||||||
int entityZ = MathHelper.floor(entity.getZ());
|
int entityZ = MathHelper.floor(entity.getZ());
|
||||||
int localWorldHeight = world.getHeight(Heightmap.Type.WORLD_SURFACE, entityX, entityZ);
|
int localWorldHeight = world.getHeight(Heightmap.Type.WORLD_SURFACE, entityX, entityZ);
|
||||||
if (entity.getY() > localWorldHeight) {
|
|
||||||
BlockPos.Mutable testPos = new BlockPos.Mutable(entityX, localWorldHeight, entityZ);
|
BlockPos.Mutable testPos = new BlockPos.Mutable(
|
||||||
while (testPos.getY() > 0) {
|
entityX,
|
||||||
testPos.move(Direction.DOWN);
|
Math.min(MathHelper.floor(entity.getY()), localWorldHeight),
|
||||||
BlockState state = world.getBlockState(testPos);
|
entityZ);
|
||||||
if (state.getOpacity(world, testPos) >= 15 && state.getBlock() != Blocks.BEDROCK)
|
|
||||||
break;
|
while (testPos.getY() > 0) {
|
||||||
if (state.getBlock() == Blocks.BEACON) {
|
testPos.move(Direction.DOWN);
|
||||||
TileEntity te = world.getTileEntity(testPos);
|
BlockState state = world.getBlockState(testPos);
|
||||||
if (!(te instanceof BeaconTileEntity))
|
if (state.getOpacity(world, testPos) >= 15 && state.getBlock() != Blocks.BEDROCK)
|
||||||
break;
|
break;
|
||||||
BeaconTileEntity bte = (BeaconTileEntity) te;
|
if (state.getBlock() == Blocks.BEACON) {
|
||||||
if (bte.getLevels() != 0)
|
TileEntity te = world.getTileEntity(testPos);
|
||||||
isOverBeacon = true;
|
|
||||||
break;
|
if (!(te instanceof BeaconTileEntity)) break;
|
||||||
}
|
|
||||||
|
BeaconTileEntity bte = (BeaconTileEntity) te;
|
||||||
|
|
||||||
|
if (!bte.getBeamSegments().isEmpty()) isOverBeacon = true;
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user