diff --git a/build.gradle b/build.gradle index b8cf8d5e0..9b123c007 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ archivesBaseName = 'create' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' minecraft { - mappings channel: 'snapshot', version: '20200301-mixed-1.15.2' + mappings channel: 'snapshot', version: '20200722-mixed-1.16.1' accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') runs { diff --git a/gradle.properties b/gradle.properties index 14cb1efe7..d621ce308 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,12 +5,12 @@ org.gradle.daemon=false # mod version info mod_version=0.3 -minecraft_version=1.15.2 -forge_version=31.2.31 +minecraft_version=1.16.1 +forge_version=32.0.70 # dependency versions -registrate_version=0.0.4.18 -jei_version=6.0.0.2 +registrate_version=1.0.0-beta.1 +jei_version=7.0.0.6 # curseforge information projectId=328085 diff --git a/src/main/java/com/simibubi/create/AllBlockPartials.java b/src/main/java/com/simibubi/create/AllBlockPartials.java index 6dbff9bca..a9bed6b2a 100644 --- a/src/main/java/com/simibubi/create/AllBlockPartials.java +++ b/src/main/java/com/simibubi/create/AllBlockPartials.java @@ -111,7 +111,7 @@ public class AllBlockPartials { private static void populateMaps() { for (Direction d : Iterate.directions) { - PIPE_RIMS.put(d, get("fluid_pipe/rim/" + d.getName())); + PIPE_RIMS.put(d, get("fluid_pipe/rim/" + d.getString())); } } diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index c30771a51..b3a37a50c 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -137,6 +137,7 @@ import com.simibubi.create.foundation.worldgen.OxidizingBlock; import com.tterrag.registrate.util.DataIngredient; import com.tterrag.registrate.util.entry.BlockEntry; +import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.block.SoundType; @@ -212,7 +213,7 @@ public class AllBlocks { public static final BlockEntry ENCASED_SHAFT = REGISTRATE.block("encased_shaft", EncasedShaftBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate(BlockStateGen.axisBlockProvider(true)) .item() @@ -221,7 +222,7 @@ public class AllBlocks { public static final BlockEntry GEARBOX = REGISTRATE.block("gearbox", GearboxBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate(BlockStateGen.axisBlockProvider(true)) .item() @@ -230,7 +231,7 @@ public class AllBlocks { public static final BlockEntry CLUTCH = REGISTRATE.block("clutch", ClutchBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> BlockStateGen.axisBlock(c, p, AssetLookup.forPowered(c, p))) .item() @@ -239,7 +240,7 @@ public class AllBlocks { public static final BlockEntry GEARSHIFT = REGISTRATE.block("gearshift", GearshiftBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> BlockStateGen.axisBlock(c, p, AssetLookup.forPowered(c, p))) .item() @@ -249,7 +250,7 @@ public class AllBlocks { public static final BlockEntry ENCASED_BELT = REGISTRATE.block("encased_belt", EncasedBeltBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> new EncasedBeltGenerator((state, suffix) -> p.models() .getExistingFile(p.modLoc("block/" + c.getName() + "/" + suffix))).generate(c, p)) @@ -260,7 +261,7 @@ public class AllBlocks { public static final BlockEntry ADJUSTABLE_PULLEY = REGISTRATE.block("adjustable_pulley", AdjustablePulleyBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> new EncasedBeltGenerator((state, suffix) -> { String powered = state.get(AdjustablePulleyBlock.POWERED) ? "_powered" : ""; @@ -295,7 +296,7 @@ public class AllBlocks { public static final BlockEntry WATER_WHEEL = REGISTRATE.block("water_wheel", WaterWheelBlock::new) .initialProperties(SharedProperties::wooden) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .blockstate(BlockStateGen.horizontalWheelProvider(false)) .addLayer(() -> RenderType::getCutoutMipped) .transform(StressConfigDefaults.setCapacity(16.0)) @@ -359,7 +360,7 @@ public class AllBlocks { public static final BlockEntry CRUSHING_WHEEL = REGISTRATE.block("crushing_wheel", CrushingWheelBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .blockstate(BlockStateGen.axisBlockProvider(false)) .addLayer(() -> RenderType::getCutoutMipped) .transform(StressConfigDefaults.setImpact(8.0)) @@ -379,7 +380,7 @@ public class AllBlocks { public static final BlockEntry MECHANICAL_PRESS = REGISTRATE.block("mechanical_press", MechanicalPressBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .blockstate(BlockStateGen.horizontalBlockProvider(true)) .transform(StressConfigDefaults.setImpact(8.0)) .item(BasinOperatorBlockItem::new) @@ -389,7 +390,7 @@ public class AllBlocks { public static final BlockEntry MECHANICAL_MIXER = REGISTRATE.block("mechanical_mixer", MechanicalMixerBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p))) .addLayer(() -> RenderType::getCutoutMipped) .transform(StressConfigDefaults.setImpact(4.0)) @@ -464,7 +465,7 @@ public class AllBlocks { public static final BlockEntry FLUID_TANK = REGISTRATE.block("fluid_tank", FluidTankBlock::new) .initialProperties(SharedProperties::softMetal) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .blockstate(new FluidTankGenerator()::generate) .onRegister(CreateRegistrate.blockModel(() -> FluidTankModel::new)) .addLayer(() -> RenderType::getCutoutMipped) @@ -541,7 +542,7 @@ public class AllBlocks { public static final BlockEntry CART_ASSEMBLER = REGISTRATE.block("cart_assembler", CartAssemblerBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .blockstate(BlockStateGen.cartAssembler()) .addLayer(() -> RenderType::getCutoutMipped) .tag(BlockTags.RAILS) @@ -552,7 +553,7 @@ public class AllBlocks { public static final BlockEntry REINFORCED_RAIL = REGISTRATE.block("reinforced_rail", ReinforcedRailBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .blockstate(BlockStateGen.reinforcedRail()) .addLayer(() -> RenderType::getCutoutMipped) .tag(BlockTags.RAILS) @@ -679,7 +680,7 @@ public class AllBlocks { public static final BlockEntry MECHANICAL_CRAFTER = REGISTRATE.block("mechanical_crafter", MechanicalCrafterBlock::new) .initialProperties(SharedProperties::softMetal) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .blockstate(BlockStateGen.horizontalBlockProvider(true)) .transform(StressConfigDefaults.setImpact(2.0)) .onRegister(CreateRegistrate.connectedTextures(new CrafterCTBehaviour())) @@ -691,7 +692,7 @@ public class AllBlocks { public static final BlockEntry SEQUENCED_GEARSHIFT = REGISTRATE.block("sequenced_gearshift", SequencedGearshiftBlock::new) .initialProperties(SharedProperties::stone) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate(new SequencedGearshiftGenerator()::generate) .item() @@ -700,7 +701,7 @@ public class AllBlocks { public static final BlockEntry FLYWHEEL = REGISTRATE.block("flywheel", FlywheelBlock::new) .initialProperties(SharedProperties::softMetal) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate(new FlywheelGenerator()::generate) .item() @@ -851,7 +852,7 @@ public class AllBlocks { public static final BlockEntry PACKAGER = REGISTRATE.block("packager", PackagerBlock::new) .initialProperties(SharedProperties::softMetal) .transform(StressConfigDefaults.setImpact(4.0)) - .properties(Block.Properties::nonOpaque) + .properties(AbstractBlock.Properties::nonOpaque) .blockstate((c, p) -> p.getVariantBuilder(c.get()) .forAllStates(s -> ConfiguredModel.builder() .modelFile(AssetLookup.partialBaseModel(c, p)) diff --git a/src/main/java/com/simibubi/create/AllColorHandlers.java b/src/main/java/com/simibubi/create/AllColorHandlers.java index b6e9d9167..6c0b87d6f 100644 --- a/src/main/java/com/simibubi/create/AllColorHandlers.java +++ b/src/main/java/com/simibubi/create/AllColorHandlers.java @@ -17,7 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IItemProvider; import net.minecraft.util.math.BlockPos; import net.minecraft.world.GrassColors; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; import net.minecraft.world.biome.BiomeColors; public class AllColorHandlers { @@ -92,7 +92,7 @@ public class AllColorHandlers { @FunctionalInterface interface Function { - int apply(BlockState state, ILightReader world, BlockPos pos, int layer); + int apply(BlockState state, IBlockDisplayReader world, BlockPos pos, int layer); } public BlockColor(Function function) { @@ -100,7 +100,7 @@ public class AllColorHandlers { } @Override - public int getColor(BlockState state, ILightReader world, BlockPos pos, int layer) { + public int getColor(BlockState state, IBlockDisplayReader world, BlockPos pos, int layer) { return function.apply(state, world, pos, layer); } diff --git a/src/main/java/com/simibubi/create/AllKeys.java b/src/main/java/com/simibubi/create/AllKeys.java index 60bba93ca..400ff4319 100644 --- a/src/main/java/com/simibubi/create/AllKeys.java +++ b/src/main/java/com/simibubi/create/AllKeys.java @@ -45,8 +45,9 @@ public enum AllKeys { return keybind.isKeyDown(); } + // TODO this should return ITextComponent public String getBoundKey() { - return keybind.getLocalizedName().toUpperCase(); + return keybind.getBoundKeyLocalizedText().getUnformattedComponentText().toUpperCase(); } public int getBoundCode() { diff --git a/src/main/java/com/simibubi/create/ClientEvents.java b/src/main/java/com/simibubi/create/ClientEvents.java index c38981966..7944f63a3 100644 --- a/src/main/java/com/simibubi/create/ClientEvents.java +++ b/src/main/java/com/simibubi/create/ClientEvents.java @@ -20,7 +20,7 @@ import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.item.ItemStack; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.text.ITextComponent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.InputEvent.KeyInputEvent; @@ -65,7 +65,7 @@ public class ClientEvents { public static void onRenderWorld(RenderWorldLastEvent event) { MatrixStack ms = event.getMatrixStack(); ActiveRenderInfo info = Minecraft.getInstance().gameRenderer.getActiveRenderInfo(); - Vec3d view = info.getProjectedView(); + Vector3d view = info.getProjectedView(); ms.push(); ms.translate(-view.getX(), -view.getY(), -view.getZ()); diff --git a/src/main/java/com/simibubi/create/compat/jei/ScreenResourceWrapper.java b/src/main/java/com/simibubi/create/compat/jei/ScreenResourceWrapper.java index b18961cde..374f52c65 100644 --- a/src/main/java/com/simibubi/create/compat/jei/ScreenResourceWrapper.java +++ b/src/main/java/com/simibubi/create/compat/jei/ScreenResourceWrapper.java @@ -26,7 +26,7 @@ public class ScreenResourceWrapper implements IDrawable { @Override public void draw(int xOffset, int yOffset) { resource.bind(); - AbstractGui.blit(xOffset, yOffset, 0, resource.startX, resource.startY, resource.width, resource.height, 256, + AbstractGui.drawTexture(xOffset, yOffset, 0, resource.startX, resource.startY, resource.width, resource.height, 256, 256); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/KineticDebugger.java b/src/main/java/com/simibubi/create/content/contraptions/KineticDebugger.java index 74a5e515f..242c363b5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/KineticDebugger.java +++ b/src/main/java/com/simibubi/create/content/contraptions/KineticDebugger.java @@ -17,7 +17,7 @@ import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.World; @@ -44,9 +44,9 @@ public class KineticDebugger { if (state.getBlock() instanceof IRotate) { Axis axis = ((IRotate) state.getBlock()).getRotationAxis(state); - Vec3d vec = new Vec3d(Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis) + Vector3d vec = Vector3d.of(Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis) .getDirectionVec()); - Vec3d center = VecHelper.getCenterOf(te.getPos()); + Vector3d center = VecHelper.getCenterOf(te.getPos()); CreateClient.outliner.showLine("rotationAxis", center.add(vec), center.subtract(vec)) .lineWidth(1 / 16f); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalAxisKineticBlock.java b/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalAxisKineticBlock.java index dc6e004a9..be8d5d604 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalAxisKineticBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalAxisKineticBlock.java @@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.base; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.Direction; @@ -16,7 +16,7 @@ import net.minecraft.world.IWorldReader; public abstract class HorizontalAxisKineticBlock extends KineticBlock { - public static final IProperty HORIZONTAL_AXIS = BlockStateProperties.HORIZONTAL_AXIS; + public static final Property HORIZONTAL_AXIS = BlockStateProperties.HORIZONTAL_AXIS; public HorizontalAxisKineticBlock(Properties properties) { super(properties); diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalKineticBlock.java b/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalKineticBlock.java index 0de1bc213..71d0ea54f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalKineticBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalKineticBlock.java @@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.base; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.Direction; @@ -12,7 +12,7 @@ import net.minecraft.util.Rotation; public abstract class HorizontalKineticBlock extends KineticBlock { - public static final IProperty HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING; + public static final Property HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING; public HorizontalKineticBlock(Properties properties) { super(properties); diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticEffectHandler.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticEffectHandler.java index a24750752..b898910a7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticEffectHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticEffectHandler.java @@ -13,7 +13,7 @@ import net.minecraft.particles.IParticleData; import net.minecraft.particles.ParticleTypes; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; @@ -66,8 +66,8 @@ public class KineticEffectHandler { return; Random r = world.rand; for (int i = 0; i < amount; i++) { - Vec3d motion = VecHelper.offsetRandomly(Vec3d.ZERO, r, maxMotion); - Vec3d position = VecHelper.getCenterOf(kte.getPos()); + Vector3d motion = VecHelper.offsetRandomly(Vector3d.ZERO, r, maxMotion); + Vector3d position = VecHelper.getCenterOf(kte.getPos()); world.addParticle(particle, position.x, position.y, position.z, motion.x, motion.y, motion.z); } } @@ -95,7 +95,7 @@ public class KineticEffectHandler { return; char axisChar = axis.name().charAt(0); - Vec3d vec = VecHelper.getCenterOf(pos); + Vector3d vec = VecHelper.getCenterOf(pos); SpeedLevel speedLevel = SpeedLevel.of(speed); int color = speedLevel.getColor(); int particleSpeed = speedLevel.getParticleSpeed(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java index 5ac4e1b75..6d8e97a5f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java @@ -9,7 +9,7 @@ import net.minecraft.block.AirBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.item.ItemEntity; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.NBTUtil; @@ -17,7 +17,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.GameRules; import net.minecraft.world.server.ServerWorld; @@ -135,17 +135,17 @@ public abstract class BlockBreakingKineticTileEntity extends KineticTileEntity { } public void onBlockBroken(BlockState stateToBreak) { - IFluidState ifluidstate = world.getFluidState(breakingPos); + FluidState ifluidstate = world.getFluidState(breakingPos); world.playEvent(2001, breakingPos, Block.getStateId(stateToBreak)); TileEntity tileentity = stateToBreak.hasTileEntity() ? world.getTileEntity(breakingPos) : null; - Vec3d vec = VecHelper.offsetRandomly(VecHelper.getCenterOf(breakingPos), world.rand, .125f); + Vector3d vec = VecHelper.offsetRandomly(VecHelper.getCenterOf(breakingPos), world.rand, .125f); Block.getDrops(stateToBreak, (ServerWorld) world, breakingPos, tileentity).forEach((stack) -> { if (!stack.isEmpty() && world.getGameRules().getBoolean(GameRules.DO_TILE_DROPS) && !world.restoringBlockSnapshots) { ItemEntity itementity = new ItemEntity(world, vec.x, vec.y, vec.z, stack); itementity.setDefaultPickupDelay(); - itementity.setMotion(Vec3d.ZERO); + itementity.setMotion(Vector3d.ZERO); world.addEntity(itementity); } }); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingMovementBehaviour.java index d562d43c9..89cde6402 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingMovementBehaviour.java @@ -17,7 +17,7 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; public class BlockBreakingMovementBehaviour extends MovementBehaviour { @@ -64,7 +64,7 @@ public class BlockBreakingMovementBehaviour extends MovementBehaviour { if (damageSource != null && !world.isRemote) entity.attackEntityFrom(damageSource, damage); if (throwsEntities() && (world.isRemote == (entity instanceof PlayerEntity))) { - Vec3d motionBoost = context.motion.add(0, context.motion.length() / 4f, 0); + Vector3d motionBoost = context.motion.add(0, context.motion.length() / 4f, 0); int maxBoost = 4; if (motionBoost.length() > maxBoost) { motionBoost = motionBoost.subtract(motionBoost.normalize().scale(motionBoost.length() - maxBoost)); @@ -131,7 +131,7 @@ public class BlockBreakingMovementBehaviour extends MovementBehaviour { return; if (!data.contains("BreakingPos")) return; - if (context.relativeMotion.equals(Vec3d.ZERO)) { + if (context.relativeMotion.equals(Vector3d.ZERO)) { context.stall = false; return; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java index 62f8c319d..20aee63f0 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java @@ -8,7 +8,7 @@ import net.minecraft.block.BlockState; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.util.DamageSource; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -22,8 +22,8 @@ public class DrillMovementBehaviour extends BlockBreakingMovementBehaviour { } @Override - public Vec3d getActiveAreaOffset(MovementContext context) { - return new Vec3d(context.state.get(DrillBlock.FACING) + public Vector3d getActiveAreaOffset(MovementContext context) { + return Vector3d.of(context.state.get(DrillBlock.FACING) .getDirectionVec()).scale(.65f); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java index 9044e57bb..855304f00 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java @@ -18,11 +18,11 @@ import net.minecraft.block.KelpBlock; import net.minecraft.block.SugarCaneBlock; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.item.ItemStack; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.IntegerProperty; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; @@ -41,8 +41,8 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { } @Override - public Vec3d getActiveAreaOffset(MovementContext context) { - return new Vec3d(context.state.get(HORIZONTAL_FACING) + public Vector3d getActiveAreaOffset(MovementContext context) { + return Vector3d.of(context.state.get(HORIZONTAL_FACING) .getDirectionVec()).scale(.45); } @@ -84,7 +84,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { } if (state.getCollisionShape(world, pos) .isEmpty() || state.getBlock() instanceof CocoaBlock) { - for (IProperty property : state.getProperties()) { + for (Property property : state.getProperties()) { if (!(property instanceof IntegerProperty)) continue; if (!property.getName() @@ -109,7 +109,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { if (state.getCollisionShape(world, pos) .isEmpty() || state.getBlock() instanceof CocoaBlock) { - for (IProperty property : state.getProperties()) { + for (Property property : state.getProperties()) { if (!(property instanceof IntegerProperty)) continue; if (!property.getName() @@ -141,7 +141,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { } if (state.getCollisionShape(world, pos) .isEmpty() || state.getBlock() instanceof CocoaBlock) { - for (IProperty property : state.getProperties()) { + for (Property property : state.getProperties()) { if (!(property instanceof IntegerProperty)) continue; if (!property.getName() diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java index 71ecfdbc6..f9f2411de 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java @@ -17,7 +17,7 @@ import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class HarvesterRenderer extends SafeTileEntityRenderer { @@ -48,7 +48,7 @@ public class HarvesterRenderer extends SafeTileEntityRenderer 30 && isSurprise) { - Vec3d pos = VecHelper.offsetRandomly(VecHelper.getCenterOf(this.pos), world.rand, .5f); + Vector3d pos = VecHelper.offsetRandomly(VecHelper.getCenterOf(this.pos), world.rand, .5f); world.addParticle(ParticleTypes.LARGE_SMOKE, pos.x, pos.y, pos.z, 0, 0, 0); } if (value == 40 && isSurprise) @@ -163,7 +163,7 @@ public class CuckooClockTileEntity extends KineticTileEntity { } private void playSound(SoundEvent sound, float volume, float pitch) { - Vec3d vec = VecHelper.getCenterOf(pos); + Vector3d vec = VecHelper.getCenterOf(pos); world.playSound(vec.x, vec.y, vec.z, sound, SoundCategory.BLOCKS, volume, pitch, false); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterCTBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterCTBehaviour.java index 7ff7153ae..479157d38 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterCTBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterCTBehaviour.java @@ -12,12 +12,12 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; public class CrafterCTBehaviour extends ConnectedTextureBehaviour { @Override - public boolean connectsTo(BlockState state, BlockState other, ILightReader reader, BlockPos pos, BlockPos otherPos, + public boolean connectsTo(BlockState state, BlockState other, IBlockDisplayReader reader, BlockPos pos, BlockPos otherPos, Direction face) { if (state.getBlock() != other.getBlock()) return false; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterHelper.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterHelper.java index 6d9fd80e9..ed41f7c3a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterHelper.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/CrafterHelper.java @@ -2,18 +2,18 @@ package com.simibubi.create.content.contraptions.components.crafter; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; public class CrafterHelper { - public static MechanicalCrafterTileEntity getCrafter(ILightReader reader, BlockPos pos) { + public static MechanicalCrafterTileEntity getCrafter(IBlockDisplayReader reader, BlockPos pos) { TileEntity te = reader.getTileEntity(pos); if (!(te instanceof MechanicalCrafterTileEntity)) return null; return (MechanicalCrafterTileEntity) te; } - public static ConnectedInputHandler.ConnectedInput getInput(ILightReader reader, BlockPos pos) { + public static ConnectedInputHandler.ConnectedInput getInput(IBlockDisplayReader reader, BlockPos pos) { MechanicalCrafterTileEntity crafter = getCrafter(reader, pos); return crafter == null ? null : crafter.input; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java index 4d34fd6a7..befe198b2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java @@ -28,7 +28,7 @@ import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; @@ -243,7 +243,7 @@ public class MechanicalCrafterBlock extends HorizontalKineticBlock implements IT return Direction.UP; Direction facing = state.get(HORIZONTAL_FACING); Pointing point = state.get(POINTING); - Vec3d targetVec = new Vec3d(0, 1, 0); + Vector3d targetVec = new Vector3d(0, 1, 0); targetVec = VecHelper.rotate(targetVec, -point.getXRotation(), Axis.Z); targetVec = VecHelper.rotate(targetVec, AngleHelper.horizontalAngle(facing), Axis.Y); return Direction.getFacingFromVector(targetVec.x, targetVec.y, targetVec.z); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterRenderer.java index 260f344c7..022cc645e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterRenderer.java @@ -19,7 +19,7 @@ import net.minecraft.block.BlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; @@ -28,7 +28,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class MechanicalCrafterRenderer extends SafeTileEntityRenderer { @@ -42,14 +42,14 @@ public class MechanicalCrafterRenderer extends SafeTileEntityRenderer dropItem(ejectPos, stack)); if (!inventory.getStackInSlot(0) @@ -404,7 +404,7 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity { sendData(); } - public void dropItem(Vec3d ejectPos, ItemStack stack) { + public void dropItem(Vector3d ejectPos, ItemStack stack) { ItemEntity itemEntity = new ItemEntity(world, ejectPos.x, ejectPos.y, ejectPos.z, stack); itemEntity.setDefaultPickupDelay(); world.addEntity(itemEntity); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java index f5dc51ac1..474e93e1d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerBlock.java @@ -24,7 +24,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; @@ -73,7 +73,7 @@ public class CrushingWheelControllerBlock extends Block return; withTileEntityDo(worldIn, pos, te -> { if (te.processingEntity == entityIn) - entityIn.setMotionMultiplier(state, new Vec3d(0.25D, (double) 0.05F, 0.25D)); + entityIn.setMotionMultiplier(state, new Vector3d(0.25D, (double) 0.05F, 0.25D)); }); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java index 3f5eeec54..f30fc9e22 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java @@ -30,7 +30,7 @@ import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.CapabilityItemHandler; @@ -87,7 +87,7 @@ public class CrushingWheelControllerTileEntity extends SmartTileEntity { return; float speed = crushingspeed * 4; - Vec3d outPos = VecHelper.getCenterOf(pos); + Vector3d outPos = VecHelper.getCenterOf(pos); if (!hasEntity()) { @@ -113,7 +113,7 @@ public class CrushingWheelControllerTileEntity extends SmartTileEntity { if (stack.isEmpty()) continue; ItemEntity entityIn = new ItemEntity(world, outPos.x, outPos.y, outPos.z, stack); - entityIn.setMotion(Vec3d.ZERO); + entityIn.setMotion(Vector3d.ZERO); entityIn.getPersistentData() .put("BypassCrushingWheel", NBTUtil.writeBlockPos(pos)); world.addEntity(entityIn); @@ -137,7 +137,7 @@ public class CrushingWheelControllerTileEntity extends SmartTileEntity { if (processingEntity.isSneaking()) xMotion = zMotion = 0; - processingEntity.setMotion(new Vec3d(xMotion, Math.max(-speed / 4f, -.5f), zMotion)); + processingEntity.setMotion(new Vector3d(xMotion, Math.max(-speed / 4f, -.5f), zMotion)); if (world.isRemote) return; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java index 9d632361b..a2ee81d99 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java @@ -27,7 +27,7 @@ import net.minecraft.network.play.ServerPlayNetHandler; import net.minecraft.server.MinecraftServer; import net.minecraft.util.EntityDamageSource; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraft.world.World; @@ -74,8 +74,8 @@ public class DeployerFakePlayer extends FakePlayer { } @Override - public Vec3d getPositionVector() { - return new Vec3d(getX(), getY(), getZ()); + public Vector3d getPositionVector() { + return new Vector3d(getX(), getY(), getZ()); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFilterSlot.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFilterSlot.java index 91dc8dc4a..b5c071b12 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFilterSlot.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFilterSlot.java @@ -9,14 +9,14 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class DeployerFilterSlot extends ValueBoxTransform { @Override - protected Vec3d getLocalOffset(BlockState state) { + protected Vector3d getLocalOffset(BlockState state) { Direction facing = state.get(DeployerBlock.FACING); - Vec3d vec = VecHelper.voxelSpace(8f, 13.5f, 11.5f); + Vector3d vec = VecHelper.voxelSpace(8f, 13.5f, 11.5f); float yRot = AngleHelper.horizontalAngle(facing); float zRot = facing == Direction.UP ? 270 : facing == Direction.DOWN ? 90 : 0; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerHandler.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerHandler.java index cd80bce22..d5eaadf8d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerHandler.java @@ -43,7 +43,7 @@ import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceContext; import net.minecraft.util.math.RayTraceContext.BlockMode; import net.minecraft.util.math.RayTraceContext.FluidMode; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.common.ForgeHooks; @@ -99,7 +99,7 @@ public class DeployerHandler { return true; } - static void activate(DeployerFakePlayer player, Vec3d vec, BlockPos clickedPos, Vec3d extensionVector, Mode mode) { + static void activate(DeployerFakePlayer player, Vector3d vec, BlockPos clickedPos, Vector3d extensionVector, Mode mode) { Multimap attributeModifiers = player.getHeldItemMainhand() .getAttributeModifiers(EquipmentSlotType.MAINHAND); player.getAttributes() @@ -109,11 +109,11 @@ public class DeployerHandler { .removeAttributeModifiers(attributeModifiers); } - private static void activateInner(DeployerFakePlayer player, Vec3d vec, BlockPos clickedPos, Vec3d extensionVector, + private static void activateInner(DeployerFakePlayer player, Vector3d vec, BlockPos clickedPos, Vector3d extensionVector, Mode mode) { - Vec3d rayOrigin = vec.add(extensionVector.scale(3 / 2f + 1 / 64f)); - Vec3d rayTarget = vec.add(extensionVector.scale(5 / 2f - 1 / 64f)); + Vector3d rayOrigin = vec.add(extensionVector.scale(3 / 2f + 1 / 64f)); + Vector3d rayTarget = vec.add(extensionVector.scale(5 / 2f - 1 / 64f)); player.setPosition(rayOrigin.x, rayOrigin.y, rayOrigin.z); BlockPos pos = new BlockPos(vec); ItemStack stack = player.getHeldItemMainhand(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java index 11a175391..0ad3f873f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java @@ -21,15 +21,15 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.ListNBT; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.common.util.Constants.NBT; public class DeployerMovementBehaviour extends MovementBehaviour { @Override - public Vec3d getActiveAreaOffset(MovementContext context) { - return new Vec3d(context.state.get(DeployerBlock.FACING) + public Vector3d getActiveAreaOffset(MovementContext context) { + return Vector3d.of(context.state.get(DeployerBlock.FACING) .getDirectionVec()).scale(2); } @@ -50,10 +50,10 @@ public class DeployerMovementBehaviour extends MovementBehaviour { } public void activate(MovementContext context, BlockPos pos, DeployerFakePlayer player, Mode mode) { - Vec3d facingVec = new Vec3d(context.state.get(DeployerBlock.FACING) + Vector3d facingVec = Vector3d.of(context.state.get(DeployerBlock.FACING) .getDirectionVec()); facingVec = VecHelper.rotate(facingVec, context.rotation.x, context.rotation.y, context.rotation.z); - Vec3d vec = context.position.subtract(facingVec.scale(2)); + Vector3d vec = context.position.subtract(facingVec.scale(2)); player.rotationYaw = ContraptionEntity.yawFromVector(facingVec); player.rotationPitch = ContraptionEntity.pitchFromVector(facingVec) - 90; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java index 8482b8529..4ef7829a6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java @@ -23,9 +23,9 @@ import net.minecraft.block.BlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Matrix4f; +import net.minecraft.util.math.vector.Matrix4f; import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; @@ -34,7 +34,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; public class DeployerRenderer extends SafeTileEntityRenderer { @@ -54,7 +54,7 @@ public class DeployerRenderer extends SafeTileEntityRenderer protected void renderItem(DeployerTileEntity te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) { BlockState deployerState = te.getBlockState(); - Vec3d offset = getHandOffset(te, partialTicks, deployerState).add(VecHelper.getCenterOf(BlockPos.ZERO)); + Vector3d offset = getHandOffset(te, partialTicks, deployerState).add(VecHelper.getCenterOf(BlockPos.ZERO)); ms.push(); ms.translate(offset.x, offset.y, offset.z); @@ -106,7 +106,7 @@ public class DeployerRenderer extends SafeTileEntityRenderer BlockState blockState = te.getBlockState(); BlockPos pos = te.getPos(); - Vec3d offset = getHandOffset(te, partialTicks, blockState); + Vector3d offset = getHandOffset(te, partialTicks, blockState); SuperByteBuffer pole = AllBlockPartials.DEPLOYER_POLE.renderOn(blockState); SuperByteBuffer hand = te.getHandPose() @@ -118,7 +118,7 @@ public class DeployerRenderer extends SafeTileEntityRenderer vb); } - protected Vec3d getHandOffset(DeployerTileEntity te, float partialTicks, BlockState blockState) { + protected Vector3d getHandOffset(DeployerTileEntity te, float partialTicks, BlockState blockState) { float progress = 0; if (te.state == State.EXPANDING) progress = 1 - (te.timer - partialTicks * te.getTimerSpeed()) / 1000f; @@ -128,7 +128,7 @@ public class DeployerRenderer extends SafeTileEntityRenderer float handLength = te.getHandPose() == AllBlockPartials.DEPLOYER_HAND_POINTING ? 0 : te.getHandPose() == AllBlockPartials.DEPLOYER_HAND_HOLDING ? 4 / 16f : 3 / 16f; float distance = Math.min(MathHelper.clamp(progress, 0, 1) * (te.reach + handLength), 21 / 16f); - Vec3d offset = new Vec3d(blockState.get(FACING) + Vector3d offset = Vector3d.of(blockState.get(FACING) .getDirectionVec()).scale(distance); return offset; } @@ -174,7 +174,7 @@ public class DeployerRenderer extends SafeTileEntityRenderer if (context.contraption.stalled || context.position == null || context.data.contains("StationaryTimer")) { factor = MathHelper.sin(AnimationTickHolder.getRenderTick() * .5f) * .25f + .25f; } else { - Vec3d center = VecHelper.getCenterOf(new BlockPos(context.position)); + Vector3d center = VecHelper.getCenterOf(new BlockPos(context.position)); double distance = context.position.distanceTo(center); double nextDistance = context.position.add(context.motion) .distanceTo(center); @@ -182,7 +182,7 @@ public class DeployerRenderer extends SafeTileEntityRenderer .getRenderPartialTicks(), distance, nextDistance), 0, 1); } - Vec3d offset = new Vec3d(blockState.get(FACING) + Vector3d offset = Vector3d.of(blockState.get(FACING) .getDirectionVec()).scale(factor); Matrix4f lighting = msLocal.peek() diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java index 825b15add..e88c00e24 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java @@ -39,7 +39,7 @@ 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.FluidMode; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.Constants.NBT; @@ -106,7 +106,7 @@ public class DeployerTileEntity extends KineticTileEntity { heldItem = player.getHeldItemMainhand(); sendData(); } - Vec3d initialPos = VecHelper.getCenterOf(pos.offset(getBlockState().get(FACING))); + Vector3d initialPos = VecHelper.getCenterOf(pos.offset(getBlockState().get(FACING))); player.setPosition(initialPos.x, initialPos.y, initialPos.z); } invHandler = LazyOptional.of(this::createHandler); @@ -181,9 +181,9 @@ public class DeployerTileEntity extends KineticTileEntity { return; state = State.EXPANDING; - Vec3d movementVector = getMovementVector(); - Vec3d rayOrigin = VecHelper.getCenterOf(pos).add(movementVector.scale(3 / 2f)); - Vec3d rayTarget = VecHelper.getCenterOf(pos).add(movementVector.scale(5 / 2f)); + Vector3d movementVector = getMovementVector(); + Vector3d rayOrigin = VecHelper.getCenterOf(pos).add(movementVector.scale(3 / 2f)); + Vector3d rayTarget = VecHelper.getCenterOf(pos).add(movementVector.scale(5 / 2f)); RayTraceContext rayTraceContext = new RayTraceContext(rayOrigin, rayTarget, BlockMode.OUTLINE, FluidMode.NONE, player); BlockRayTraceResult result = world.rayTraceBlocks(rayTraceContext); @@ -262,9 +262,9 @@ public class DeployerTileEntity extends KineticTileEntity { } protected void activate() { - Vec3d movementVector = getMovementVector(); + Vector3d movementVector = getMovementVector(); Direction direction = getBlockState().get(FACING); - Vec3d center = VecHelper.getCenterOf(pos); + Vector3d center = VecHelper.getCenterOf(pos); BlockPos clickedPos = pos.offset(direction, 2); player.rotationYaw = direction.getHorizontalAngle(); player.rotationPitch = direction == Direction.UP ? -90 : direction == Direction.DOWN ? 90 : 0; @@ -300,9 +300,9 @@ public class DeployerTileEntity extends KineticTileEntity { ItemStack itemStack = iterator.next(); if (noInv) { - Vec3d offset = getMovementVector(); - Vec3d outPos = VecHelper.getCenterOf(pos).add(offset.scale(-.65f)); - Vec3d motion = offset.scale(-.25f); + Vector3d offset = getMovementVector(); + Vector3d outPos = VecHelper.getCenterOf(pos).add(offset.scale(-.65f)); + Vector3d motion = offset.scale(-.25f); ItemEntity e = new ItemEntity(world, outPos.x, outPos.y, outPos.z, itemStack.copy()); e.setMotion(motion); world.addEntity(e); @@ -325,10 +325,10 @@ public class DeployerTileEntity extends KineticTileEntity { return stack; } - protected Vec3d getMovementVector() { + protected Vector3d getMovementVector() { if (!AllBlocks.DEPLOYER.has(getBlockState())) - return Vec3d.ZERO; - return new Vec3d(getBlockState().get(FACING).getDirectionVec()); + return Vector3d.ZERO; + return Vector3d.of(getBlockState().get(FACING).getDirectionVec()); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java index 8331bcf87..96826342d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/AirCurrent.java @@ -32,8 +32,8 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; -import net.minecraft.util.math.Vec3i; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.vector.Vector3i; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; @@ -67,8 +67,8 @@ public class AirCurrent { Direction facing = direction; if (world.isRemote) { float offset = pushing ? 0.5f : maxDistance + .5f; - Vec3d pos = VecHelper.getCenterOf(source.getPos()) - .add(new Vec3d(facing.getDirectionVec()).scale(offset)); + Vector3d pos = VecHelper.getCenterOf(source.getPos()) + .add(Vector3d.of(facing.getDirectionVec()).scale(offset)); if (world.rand.nextFloat() < AllConfigs.CLIENT.fanParticleDensity.get()) world.addParticle(new AirFlowParticleData(source.getPos()), pos.x, pos.y, pos.z, 0, 0, 0); } @@ -81,15 +81,15 @@ public class AirCurrent { continue; } - Vec3d center = VecHelper.getCenterOf(source.getPos()); - Vec3i flow = (pushing ? facing : facing.getOpposite()).getDirectionVec(); + Vector3d center = VecHelper.getCenterOf(source.getPos()); + Vector3i flow = (pushing ? facing : facing.getOpposite()).getDirectionVec(); float sneakModifier = entity.isSneaking() ? 4096f : 512f; float speed = Math.abs(source.getSpeed()); double entityDistance = entity.getPositionVec() .distanceTo(center); float acceleration = (float) (speed / sneakModifier / (entityDistance / maxDistance)); - Vec3d previousMotion = entity.getMotion(); + Vector3d previousMotion = entity.getMotion(); float maxAcceleration = 5; double xIn = @@ -99,7 +99,7 @@ public class AirCurrent { double zIn = MathHelper.clamp(flow.getZ() * acceleration - previousMotion.z, -maxAcceleration, maxAcceleration); - entity.setMotion(previousMotion.add(new Vec3d(xIn, yIn, zIn).scale(1 / 8f))); + entity.setMotion(previousMotion.add(new Vector3d(xIn, yIn, zIn).scale(1 / 8f))); entity.fallDistance = 0; if (entity instanceof ServerPlayerEntity) @@ -166,12 +166,12 @@ public class AirCurrent { direction = source.getBlockState() .get(BlockStateProperties.FACING); pushing = source.getAirFlowDirection() == direction; - Vec3d directionVec = new Vec3d(direction.getDirectionVec()); - Vec3d planeVec = VecHelper.planeByNormal(directionVec); + Vector3d directionVec = Vector3d.of(direction.getDirectionVec()); + Vector3d planeVec = VecHelper.planeByNormal(directionVec); // 4 Rays test for holes in the shapes blocking the flow float offsetDistance = .25f; - Vec3d[] offsets = new Vec3d[] { planeVec.mul(offsetDistance, offsetDistance, offsetDistance), + Vector3d[] offsets = Vector3d.of[] { planeVec.mul(offsetDistance, offsetDistance, offsetDistance), planeVec.mul(-offsetDistance, -offsetDistance, offsetDistance), planeVec.mul(offsetDistance, -offsetDistance, -offsetDistance), planeVec.mul(-offsetDistance, offsetDistance, -offsetDistance), }; @@ -195,11 +195,11 @@ public class AirCurrent { break; } - for (Vec3d offset : offsets) { - Vec3d rayStart = VecHelper.getCenterOf(currentPos) + for (Vector3d offset : offsets) { + Vector3d rayStart = VecHelper.getCenterOf(currentPos) .subtract(directionVec.scale(.5f + 1 / 32f)) .add(offset); - Vec3d rayEnd = rayStart.add(directionVec.scale(1 + 1 / 32f)); + Vector3d rayEnd = rayStart.add(directionVec.scale(1 + 1 / 32f)); BlockRayTraceResult blockraytraceresult = world.rayTraceBlocks(rayStart, rayEnd, currentPos, voxelshape, state); if (blockraytraceresult == null) @@ -248,7 +248,7 @@ public class AirCurrent { bounds = new AxisAlignedBB(0, 0, 0, 0, 0, 0); else { float factor = maxDistance - 1; - Vec3d scale = directionVec.scale(factor); + Vector3d scale = directionVec.scale(factor); if (factor > 0) bounds = new AxisAlignedBB(start.offset(direction)).expand(scale); else { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java index 81ce41fb2..3c4ca74fb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java @@ -22,7 +22,7 @@ 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.FluidMode; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.Explosion.Mode; public class NozzleTileEntity extends SmartTileEntity { @@ -69,12 +69,12 @@ public class NozzleTileEntity extends SmartTileEntity { if (this.range != range) setRange(range); - Vec3d center = VecHelper.getCenterOf(pos); + Vector3d center = VecHelper.getCenterOf(pos); if (world.isRemote && range != 0) { if (world.rand.nextInt( MathHelper.clamp((AllConfigs.SERVER.kinetics.fanPushDistance.get() - (int) range), 1, 10)) == 0) { - Vec3d start = VecHelper.offsetRandomly(center, world.rand, pushing ? 1 : range / 2); - Vec3d motion = center.subtract(start).normalize() + Vector3d start = VecHelper.offsetRandomly(center, world.rand, pushing ? 1 : range / 2); + Vector3d motion = center.subtract(start).normalize() .scale(MathHelper.clamp(range * (pushing ? .025f : 1f), 0, .5f) * (pushing ? -1 : 1)); world.addParticle(ParticleTypes.POOF, start.x, start.y, start.z, motion.x, motion.y, motion.z); } @@ -82,7 +82,7 @@ public class NozzleTileEntity extends SmartTileEntity { for (Iterator iterator = pushingEntities.iterator(); iterator.hasNext();) { Entity entity = iterator.next(); - Vec3d diff = entity.getPositionVec().subtract(center); + Vector3d diff = entity.getPositionVec().subtract(center); if (!(entity instanceof PlayerEntity) && world.isRemote) continue; @@ -98,7 +98,7 @@ public class NozzleTileEntity extends SmartTileEntity { continue; float factor = (entity instanceof ItemEntity) ? 1 / 128f : 1 / 32f; - Vec3d pushVec = diff.normalize().scale((range - distance) * (pushing ? 1 : -1)); + Vector3d pushVec = diff.normalize().scale((range - distance) * (pushing ? 1 : -1)); entity.setMotion(entity.getMotion().add(pushVec.scale(factor))); entity.fallDistance = 0; entity.velocityChanged = true; @@ -136,11 +136,11 @@ public class NozzleTileEntity extends SmartTileEntity { if (range == 0) return; - Vec3d center = VecHelper.getCenterOf(pos); + Vector3d center = VecHelper.getCenterOf(pos); AxisAlignedBB bb = new AxisAlignedBB(center, center).grow(range / 2f); for (Entity entity : world.getEntitiesWithinAABB(Entity.class, bb)) { - Vec3d diff = entity.getPositionVec().subtract(center); + Vector3d diff = entity.getPositionVec().subtract(center); double distance = diff.length(); if (distance > range || entity.isSneaking() diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelBlock.java index 618ba7a37..955cc6990 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelBlock.java @@ -86,7 +86,7 @@ public class FlywheelBlock extends HorizontalKineticBlock { NONE, LEFT, RIGHT; @Override - public String getName() { + public String getString() { return Lang.asId(name()); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java index 434c6883c..149f038d4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java @@ -14,7 +14,7 @@ import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.CapabilityItemHandler; @@ -106,11 +106,11 @@ public class MillstoneTileEntity extends KineticTileEntity { ItemParticleData data = new ItemParticleData(ParticleTypes.ITEM, stackInSlot); float angle = world.rand.nextFloat() * 360; - Vec3d offset = new Vec3d(0, 0, 0.5f); + Vector3d offset = new Vector3d(0, 0, 0.5f); offset = VecHelper.rotate(offset, angle, Axis.Y); - Vec3d target = VecHelper.rotate(offset, getSpeed() > 0 ? 25 : -25, Axis.Y); + Vector3d target = VecHelper.rotate(offset, getSpeed() > 0 ? 25 : -25, Axis.Y); - Vec3d center = offset.add(VecHelper.getCenterOf(pos)); + Vector3d center = offset.add(VecHelper.getCenterOf(pos)); target = VecHelper.offsetRandomly(target.subtract(offset), world.rand, 1 / 128f); world.addParticle(data, center.x, center.y, center.z, target.x, target.y, target.z); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java index 6cf5041bd..faa2aab1c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java @@ -32,7 +32,7 @@ import net.minecraft.util.Direction.Axis; import net.minecraft.util.NonNullList; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.items.IItemHandler; import static com.simibubi.create.content.contraptions.processing.HeaterBlock.getHeaterLevel; @@ -58,7 +58,7 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { .isHorizontal()) { @Override - protected Vec3d getSouthLocation() { + protected Vector3d getSouthLocation() { return super.getSouthLocation().add(0, 4 / 16f, 0); } @@ -180,12 +180,12 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { ItemParticleData data = new ItemParticleData(ParticleTypes.ITEM, stackInSlot); float angle = world.rand.nextFloat() * 360; - Vec3d offset = new Vec3d(0, 0, 0.25f); + Vector3d offset = new Vector3d(0, 0, 0.25f); offset = VecHelper.rotate(offset, angle, Axis.Y); - Vec3d target = VecHelper.rotate(offset, getSpeed() > 0 ? 25 : -25, Axis.Y) + Vector3d target = VecHelper.rotate(offset, getSpeed() > 0 ? 25 : -25, Axis.Y) .add(0, .25f, 0); - Vec3d center = offset.add(VecHelper.getCenterOf(pos)); + Vector3d center = offset.add(VecHelper.getCenterOf(pos)); target = VecHelper.offsetRandomly(target.subtract(offset), world.rand, 1 / 128f); world.addParticle(data, center.x, center.y - 2, center.z, target.x, target.y, target.z); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java index 94ffcfdd2..b20362530 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java @@ -33,7 +33,7 @@ import net.minecraft.util.NonNullList; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.common.util.Constants.NBT; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; @@ -251,10 +251,10 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity { pressedItems.clear(); } - public void makePressingParticleEffect(Vec3d pos, ItemStack stack) { + public void makePressingParticleEffect(Vector3d pos, ItemStack stack) { if (world != null && world.isRemote) { for (int i = 0; i < 20; i++) { - Vec3d motion = VecHelper.offsetRandomly(Vec3d.ZERO, world.rand, .125f) + Vector3d motion = VecHelper.offsetRandomly(Vector3d.ZERO, world.rand, .125f) .mul(1, 0, 1); world.addParticle(new ItemParticleData(ParticleTypes.ITEM, stack), pos.x, pos.y - .25f, pos.z, motion.x, motion.y + .125f, motion.z); @@ -262,10 +262,10 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity { } } - public void makeCompactingParticleEffect(Vec3d pos, ItemStack stack) { + public void makeCompactingParticleEffect(Vector3d pos, ItemStack stack) { if (world != null && world.isRemote) { for (int i = 0; i < 20; i++) { - Vec3d motion = VecHelper.offsetRandomly(Vec3d.ZERO, world.rand, .175f) + Vector3d motion = VecHelper.offsetRandomly(Vector3d.ZERO, world.rand, .175f) .mul(1, 0, 1); world.addParticle(new ItemParticleData(ParticleTypes.ITEM, stack), pos.x, pos.y, pos.z, motion.x, motion.y + .25f, motion.z); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawFilterSlot.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawFilterSlot.java index a75f347d4..a9c13fa6c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawFilterSlot.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawFilterSlot.java @@ -7,16 +7,16 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.util.Direction; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class SawFilterSlot extends ValueBoxTransform { @Override - protected Vec3d getLocalOffset(BlockState state) { + protected Vector3d getLocalOffset(BlockState state) { if (state.get(SawBlock.FACING) != Direction.UP) return null; - Vec3d x = VecHelper.voxelSpace(8f, 12.5f, 12.25f); - Vec3d z = VecHelper.voxelSpace(12.25f, 12.5f, 8f); + Vector3d x = VecHelper.voxelSpace(8f, 12.5f, 12.25f); + Vector3d z = VecHelper.voxelSpace(12.25f, 12.5f, 8f); return state.get(SawBlock.AXIS_ALONG_FIRST_COORDINATE) ? z : x; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java index a8e1197ad..73f3c343f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java @@ -16,7 +16,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java index e127b162b..b43f0b2c4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java @@ -47,7 +47,7 @@ import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.CapabilityItemHandler; @@ -139,7 +139,7 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity { return; } - Vec3d itemMovement = getItemMovementVec(); + Vector3d itemMovement = getItemMovementVec(); Direction itemMovementFacing = Direction.getFacingFromVector(itemMovement.x, itemMovement.y, itemMovement.z); if (inventory.remainingTime > 0) return; @@ -169,10 +169,10 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity { } // Eject Items - Vec3d outPos = VecHelper.getCenterOf(pos) + Vector3d outPos = VecHelper.getCenterOf(pos) .add(itemMovement.scale(.5f) .add(0, .5, 0)); - Vec3d outMotion = itemMovement.scale(.0625) + Vector3d outMotion = itemMovement.scale(.0625) .add(0, .125, 0); for (int slot = 0; slot < inventory.getSlots(); slot++) { ItemStack stack = inventory.getStackInSlot(slot); @@ -217,18 +217,18 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity { } Random r = world.rand; - Vec3d vec = getItemMovementVec(); - Vec3d pos = VecHelper.getCenterOf(this.pos); + Vector3d vec = getItemMovementVec(); + Vector3d pos = VecHelper.getCenterOf(this.pos); float offset = inventory.recipeDuration != 0 ? (float) (inventory.remainingTime) / inventory.recipeDuration : 0; offset -= .5f; world.addParticle(particleData, pos.getX() + -vec.x * offset, pos.getY() + .45f, pos.getZ() + -vec.z * offset, -vec.x * speed, r.nextFloat() * speed, -vec.z * speed); } - public Vec3d getItemMovementVec() { + public Vector3d getItemMovementVec() { boolean alongX = !getBlockState().get(SawBlock.AXIS_ALONG_FIRST_COORDINATE); int offset = getSpeed() < 0 ? -1 : 1; - return new Vec3d(offset * (alongX ? 1 : 0), 0, offset * (alongX ? 0 : -1)); + return new Vector3d(offset * (alongX ? 1 : 0), 0, offset * (alongX ? 0 : -1)); } private void applyRecipe() { @@ -354,9 +354,9 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity { public void dropItemFromCutTree(BlockPos pos, ItemStack stack) { float distance = (float) Math.sqrt(pos.distanceSq(breakingPos)); - Vec3d dropPos = VecHelper.getCenterOf(pos); + Vector3d dropPos = VecHelper.getCenterOf(pos); ItemEntity entity = new ItemEntity(world, dropPos.x, dropPos.y, dropPos.z, stack); - entity.setMotion(new Vec3d(breakingPos.subtract(this.pos)).scale(distance / 20f)); + entity.setMotion(Vector3d.of(breakingPos.subtract(this.pos)).scale(distance / 20f)); world.addEntity(entity); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java index 4989e3d36..ea1e13db9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java @@ -58,7 +58,7 @@ import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderTypeLookup; import net.minecraft.entity.Entity; import net.minecraft.fluid.Fluids; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.ListNBT; import net.minecraft.nbt.NBTUtil; @@ -72,7 +72,7 @@ import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.Rotation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IWorld; import net.minecraft.world.World; import net.minecraft.world.gen.feature.template.Template.BlockInfo; @@ -762,9 +762,9 @@ public abstract class Contraption { foreachActor(world, (behaviour, ctx) -> { behaviour.stopMoving(ctx); ctx.position = null; - ctx.motion = Vec3d.ZERO; - ctx.relativeMotion = Vec3d.ZERO; - ctx.rotation = Vec3d.ZERO; + ctx.motion = Vector3d.ZERO; + ctx.relativeMotion = Vector3d.ZERO; + ctx.rotation = Vector3d.ZERO; }); } @@ -787,12 +787,12 @@ public abstract class Contraption { if (axis == Axis.Z) maxDiff = Math.max(maxXDiff, maxYDiff); - Vec3d vec = new Vec3d(Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis) + Vector3d vec = Vector3d.of(Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis) .getDirectionVec()); - Vec3d planeByNormal = VecHelper.planeByNormal(vec); - Vec3d min = vec.mul(bb.minX, bb.minY, bb.minZ) + Vector3d planeByNormal = VecHelper.planeByNormal(vec); + Vector3d min = vec.mul(bb.minX, bb.minY, bb.minZ) .add(planeByNormal.scale(-maxDiff)); - Vec3d max = vec.mul(bb.maxX, bb.maxY, bb.maxZ) + Vector3d max = vec.mul(bb.maxX, bb.maxY, bb.maxZ) .add(planeByNormal.scale(maxDiff + 1)); bounds = new AxisAlignedBB(min, max); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java index e8369ef14..3b06e9af2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionCollider.java @@ -46,7 +46,7 @@ import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.ReuseableStream; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.IBooleanFunction; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; @@ -117,7 +117,7 @@ public class ContraptionCollider { CompoundNBT data = entityLiving.getPersistentData(); if (!data.contains("ContraptionDismountLocation")) return; - Vec3d position = VecHelper.readNBT(data.getList("ContraptionDismountLocation", NBT.TAG_DOUBLE)); + Vector3d position = VecHelper.readNBT(data.getList("ContraptionDismountLocation", NBT.TAG_DOUBLE)); if (entityLiving.getRidingEntity() == null) entityLiving.setPositionAndUpdate(position.x, position.y, position.z); data.remove("ContraptionDismountLocation"); @@ -142,9 +142,9 @@ public class ContraptionCollider { World world = contraptionEntity.getEntityWorld(); Contraption contraption = contraptionEntity.getContraption(); AxisAlignedBB bounds = contraptionEntity.getBoundingBox(); - Vec3d contraptionPosition = contraptionEntity.getPositionVec(); - Vec3d contraptionRotation = contraptionEntity.getRotationVec(); - Vec3d contraptionMotion = contraptionEntity.stationary ? Vec3d.ZERO + Vector3d contraptionPosition = contraptionEntity.getPositionVec(); + Vector3d contraptionRotation = contraptionEntity.getRotationVec(); + Vector3d contraptionMotion = contraptionEntity.stationary ? Vector3d.ZERO : contraptionPosition.subtract(contraptionEntity.getPrevPositionVec()); contraptionEntity.collidingEntities.clear(); @@ -153,12 +153,12 @@ public class ContraptionCollider { if (bounds == null) return; - Vec3d centerOfBlock = VecHelper.getCenterOf(BlockPos.ZERO); + Vector3d centerOfBlock = VecHelper.getCenterOf(BlockPos.ZERO); double conRotX = contraptionRotation.x; double conRotY = contraptionRotation.y; double conRotZ = contraptionRotation.z; - Vec3d contraptionCentreOffset = contraptionEntity.stationary ? centerOfBlock : Vec3d.ZERO.add(0, 0.5, 0); - boolean axisAlignedCollision = contraptionRotation.equals(Vec3d.ZERO); + Vector3d contraptionCentreOffset = contraptionEntity.stationary ? centerOfBlock : Vector3d.ZERO.add(0, 0.5, 0); + boolean axisAlignedCollision = contraptionRotation.equals(Vector3d.ZERO); Matrix3d rotation = null; for (Entity entity : world.getEntitiesWithinAABB((EntityType) null, bounds.grow(2) @@ -177,12 +177,12 @@ public class ContraptionCollider { } // Transform entity position and motion to local space - Vec3d entityPosition = entity.getPositionVec(); + Vector3d entityPosition = entity.getPositionVec(); AxisAlignedBB entityBounds = entity.getBoundingBox(); - Vec3d centerY = new Vec3d(0, entityBounds.getYSize() / 2, 0); - Vec3d motion = entity.getMotion(); + Vector3d centerY = new Vector3d(0, entityBounds.getYSize() / 2, 0); + Vector3d motion = entity.getMotion(); - Vec3d position = entityPosition.subtract(contraptionCentreOffset) + Vector3d position = entityPosition.subtract(contraptionCentreOffset) .add(centerY); position = position.subtract(contraptionPosition); position = rotation.transform(position); @@ -205,15 +205,15 @@ public class ContraptionCollider { motion = rotation.transform(motion); motion = motion.subtract(contraptionMotion); -// Vec3d visualizerOrigin = new Vec3d(10, 64, 0); +// Vector3d visualizerOrigin = new Vector3d(10, 64, 0); // CollisionDebugger.OBB = obb.copy(); // CollisionDebugger.OBB.move(visualizerOrigin); - MutableObject collisionResponse = new MutableObject<>(Vec3d.ZERO); - MutableObject allowedMotion = new MutableObject<>(motion); + MutableObject collisionResponse = new MutableObject<>(Vector3d.ZERO); + MutableObject allowedMotion = new MutableObject<>(motion); MutableBoolean futureCollision = new MutableBoolean(false); MutableBoolean surfaceCollision = new MutableBoolean(false); - Vec3d obbCenter = obb.getCenter(); + Vector3d obbCenter = obb.getCenter(); // Apply separation maths List bbs = new ArrayList<>(); @@ -225,7 +225,7 @@ public class ContraptionCollider { for (boolean horizontalPass : Iterate.trueAndFalse) { for (AxisAlignedBB bb : bbs) { - Vec3d currentResponse = collisionResponse.getValue(); + Vector3d currentResponse = collisionResponse.getValue(); obb.setCenter(obbCenter.add(currentResponse)); ContinuousSeparationManifold intersect = obb.intersect(bb, allowedMotion.getValue()); @@ -241,8 +241,8 @@ public class ContraptionCollider { continue; } - Vec3d separation = intersect.asSeparationVec(entity.stepHeight); - if (separation != null && !separation.equals(Vec3d.ZERO)) + Vector3d separation = intersect.asSeparationVec(entity.stepHeight); + if (separation != null && !separation.equals(Vector3d.ZERO)) collisionResponse.setValue(currentResponse.add(separation)); } @@ -264,10 +264,10 @@ public class ContraptionCollider { } // Resolve collision - Vec3d entityMotion = entity.getMotion(); - Vec3d totalResponse = collisionResponse.getValue(); - Vec3d motionResponse = allowedMotion.getValue(); - boolean hardCollision = !totalResponse.equals(Vec3d.ZERO); + Vector3d entityMotion = entity.getMotion(); + Vector3d totalResponse = collisionResponse.getValue(); + Vector3d motionResponse = allowedMotion.getValue(); + boolean hardCollision = !totalResponse.equals(Vector3d.ZERO); rotation.transpose(); motionResponse = rotation.transform(motionResponse) @@ -283,7 +283,7 @@ public class ContraptionCollider { } } - Vec3d contactPointMotion = Vec3d.ZERO; + Vector3d contactPointMotion = Vector3d.ZERO; if (surfaceCollision.isTrue()) { entity.fallDistance = 0; entity.onGround = true; @@ -318,7 +318,7 @@ public class ContraptionCollider { } totalResponse = totalResponse.add(contactPointMotion); - Vec3d allowedMovement = getAllowedMovement(totalResponse, entity); + Vector3d allowedMovement = getAllowedMovement(totalResponse, entity); contraptionEntity.collidingEntities.add(entity); entity.velocityChanged = true; entity.setPosition(entityPosition.x + allowedMovement.x, entityPosition.y + allowedMovement.y, @@ -332,7 +332,7 @@ public class ContraptionCollider { } /** From Entity#getAllowedMovement **/ - static Vec3d getAllowedMovement(Vec3d movement, Entity e) { + static Vector3d getAllowedMovement(Vector3d movement, Entity e) { AxisAlignedBB bb = e.getBoundingBox(); ISelectionContext ctx = ISelectionContext.forEntity(e); World world = e.world; @@ -344,39 +344,39 @@ public class ContraptionCollider { : Stream.of(voxelshape); Stream stream1 = world.getEmptyCollisionShapes(e, bb.expand(movement), ImmutableSet.of()); ReuseableStream reuseablestream = new ReuseableStream<>(Stream.concat(stream1, stream)); - Vec3d vec3d = movement.lengthSquared() == 0.0D ? movement + Vector3d Vector3d = movement.lengthSquared() == 0.0D ? movement : collideBoundingBoxHeuristically(e, movement, bb, world, ctx, reuseablestream); - boolean flag = movement.x != vec3d.x; - boolean flag1 = movement.y != vec3d.y; - boolean flag2 = movement.z != vec3d.z; + boolean flag = movement.x != Vector3d.x; + boolean flag1 = movement.y != Vector3d.y; + boolean flag2 = movement.z != Vector3d.z; boolean flag3 = e.onGround || flag1 && movement.y < 0.0D; if (e.stepHeight > 0.0F && flag3 && (flag || flag2)) { - Vec3d vec3d1 = collideBoundingBoxHeuristically(e, new Vec3d(movement.x, (double) e.stepHeight, movement.z), + Vector3d Vector3d1 = collideBoundingBoxHeuristically(e, new Vector3d(movement.x, (double) e.stepHeight, movement.z), bb, world, ctx, reuseablestream); - Vec3d vec3d2 = collideBoundingBoxHeuristically(e, new Vec3d(0.0D, (double) e.stepHeight, 0.0D), + Vector3d Vector3d2 = collideBoundingBoxHeuristically(e, new Vector3d(0.0D, (double) e.stepHeight, 0.0D), bb.expand(movement.x, 0.0D, movement.z), world, ctx, reuseablestream); - if (vec3d2.y < (double) e.stepHeight) { - Vec3d vec3d3 = collideBoundingBoxHeuristically(e, new Vec3d(movement.x, 0.0D, movement.z), - bb.offset(vec3d2), world, ctx, reuseablestream).add(vec3d2); - if (horizontalMag(vec3d3) > horizontalMag(vec3d1)) { - vec3d1 = vec3d3; + if (Vector3d2.y < (double) e.stepHeight) { + Vector3d Vector3d3 = collideBoundingBoxHeuristically(e, new Vector3d(movement.x, 0.0D, movement.z), + bb.offset(Vector3d2), world, ctx, reuseablestream).add(Vector3d2); + if (horizontalMag(Vector3d3) > horizontalMag(Vector3d1)) { + Vector3d1 = Vector3d3; } } - if (horizontalMag(vec3d1) > horizontalMag(vec3d)) { - return vec3d1.add(collideBoundingBoxHeuristically(e, new Vec3d(0.0D, -vec3d1.y + movement.y, 0.0D), - bb.offset(vec3d1), world, ctx, reuseablestream)); + if (horizontalMag(Vector3d1) > horizontalMag(Vector3d)) { + return Vector3d1.add(collideBoundingBoxHeuristically(e, new Vector3d(0.0D, -Vector3d1.y + movement.y, 0.0D), + bb.offset(Vector3d1), world, ctx, reuseablestream)); } } - return vec3d; + return Vector3d; } - public static void pushEntityOutOfShape(Entity entity, VoxelShape voxelShape, Vec3d positionOffset, - Vec3d shapeMotion) { + public static void pushEntityOutOfShape(Entity entity, VoxelShape voxelShape, Vector3d positionOffset, + Vector3d shapeMotion) { AxisAlignedBB entityBB = entity.getBoundingBox() .offset(positionOffset); - Vec3d entityMotion = entity.getMotion(); + Vector3d entityMotion = entity.getMotion(); if (!voxelShape.toBoundingBoxList() .stream() @@ -394,7 +394,7 @@ public class ContraptionCollider { : axis == Axis.Y ? entityBB.getYSize() + shapeBB.getYSize() : entityBB.getZSize() + shapeBB.getZSize(); d = d + .5f; - Vec3d nudge = new Vec3d(face.getDirectionVec()).scale(d); + Vector3d nudge = Vector3d.of(face.getDirectionVec()).scale(d); AxisAlignedBB nudgedBB = entityBB.offset(nudge.getX(), nudge.getY(), nudge.getZ()); double nudgeDistance = face.getAxisDirection() == AxisDirection.POSITIVE ? -d : d; double offset = voxelShape.getAllowedOffset(face.getAxis(), nudgedBB, nudgeDistance); @@ -407,7 +407,7 @@ public class ContraptionCollider { } if (bestOffset != 0) { - entity.move(MoverType.SELF, new Vec3d(bestSide.getDirectionVec()).scale(finalOffset)); + entity.move(MoverType.SELF, Vector3d.of(bestSide.getDirectionVec()).scale(finalOffset)); boolean positive = bestSide.getAxisDirection() == AxisDirection.POSITIVE; double clamped; @@ -466,17 +466,17 @@ public class ContraptionCollider { return false; World world = contraptionEntity.getEntityWorld(); - Vec3d motion = contraptionEntity.getMotion(); + Vector3d motion = contraptionEntity.getMotion(); Contraption contraption = contraptionEntity.getContraption(); AxisAlignedBB bounds = contraptionEntity.getBoundingBox(); - Vec3d position = contraptionEntity.getPositionVec(); + Vector3d position = contraptionEntity.getPositionVec(); BlockPos gridPos = new BlockPos(position); if (contraption == null) return false; if (bounds == null) return false; - if (motion.equals(Vec3d.ZERO)) + if (motion.equals(Vector3d.ZERO)) return false; Direction movementDirection = Direction.getFacingFromVector(motion.x, motion.y, motion.z); @@ -494,10 +494,10 @@ public class ContraptionCollider { if (!otherContraptionEntity.collisionEnabled()) continue; - Vec3d otherMotion = otherContraptionEntity.getMotion(); + Vector3d otherMotion = otherContraptionEntity.getMotion(); Contraption otherContraption = otherContraptionEntity.getContraption(); AxisAlignedBB otherBounds = otherContraptionEntity.getBoundingBox(); - Vec3d otherPosition = otherContraptionEntity.getPositionVec(); + Vector3d otherPosition = otherContraptionEntity.getPositionVec(); if (otherContraption == null) return false; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java index 2f468a4e8..a428d6c00 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntity.java @@ -50,7 +50,11 @@ import net.minecraft.util.Hand; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.IBooleanFunction; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.world.World; import net.minecraft.world.gen.feature.template.Template.BlockInfo; import net.minecraftforge.api.distmarker.Dist; @@ -65,7 +69,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD protected float initialAngle; protected float forcedAngle; protected BlockPos controllerPos; - protected Vec3d motionBeforeStall; + protected Vector3d motionBeforeStall; protected boolean stationary; protected boolean initialized; final List collidingEntities = new ArrayList<>(); @@ -88,7 +92,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD public ContraptionEntity(EntityType entityTypeIn, World worldIn) { super(entityTypeIn, worldIn); - motionBeforeStall = Vec3d.ZERO; + motionBeforeStall = Vector3d.ZERO; stationary = entityTypeIn == AllEntityTypes.STATIONARY_CONTRAPTION.get(); forcedAngle = -1; } @@ -172,7 +176,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD @Override protected void removePassenger(Entity passenger) { - Vec3d transformedVector = getPassengerPosition(passenger); + Vector3d transformedVector = getPassengerPosition(passenger); super.removePassenger(passenger); if (world.isRemote) return; @@ -189,19 +193,19 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD public void updatePassengerPosition(Entity passenger, IMoveCallback callback) { if (!isPassenger(passenger)) return; - Vec3d transformedVector = getPassengerPosition(passenger); + Vector3d transformedVector = getPassengerPosition(passenger); if (transformedVector == null) return; callback.accept(passenger, transformedVector.x, transformedVector.y, transformedVector.z); } - protected Vec3d getPassengerPosition(Entity passenger) { + protected Vector3d getPassengerPosition(Entity passenger) { AxisAlignedBB bb = passenger.getBoundingBox(); double ySize = bb.getYSize(); BlockPos seat = contraption.getSeat(passenger.getUniqueID()); if (seat == null) return null; - Vec3d transformedVector = toGlobalVector(new Vec3d(seat).add(.5, passenger.getYOffset() + ySize - .15f, .5)) + Vector3d transformedVector = toGlobalVector(Vector3d.of(seat).add(.5, passenger.getYOffset() + ySize - .15f, .5)) .add(VecHelper.getCenterOf(BlockPos.ZERO)) .subtract(0.5, ySize, 0.5); return transformedVector; @@ -237,7 +241,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD } if (toDismount != null && !world.isRemote) { - Vec3d transformedVector = getPassengerPosition(toDismount); + Vector3d transformedVector = getPassengerPosition(toDismount); toDismount.stopRiding(); if (transformedVector != null) toDismount.setPositionAndUpdate(transformedVector.x, transformedVector.y, transformedVector.z); @@ -249,8 +253,8 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD return true; } - public Vec3d toGlobalVector(Vec3d localVec) { - Vec3d rotationOffset = VecHelper.getCenterOf(BlockPos.ZERO); + public Vector3d toGlobalVector(Vector3d localVec) { + Vector3d rotationOffset = VecHelper.getCenterOf(BlockPos.ZERO); localVec = localVec.subtract(rotationOffset); localVec = VecHelper.rotate(localVec, getRotationVec()); localVec = localVec.add(rotationOffset) @@ -258,8 +262,8 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD return localVec; } - public Vec3d toLocalVector(Vec3d globalVec) { - Vec3d rotationOffset = VecHelper.getCenterOf(BlockPos.ZERO); + public Vector3d toLocalVector(Vector3d globalVec) { + Vector3d rotationOffset = VecHelper.getCenterOf(BlockPos.ZERO); globalVec = globalVec.subtract(getAnchorVec()) .subtract(rotationOffset); globalVec = VecHelper.rotate(globalVec, getRotationVec().scale(-1)); @@ -286,7 +290,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD } if (getMotion().length() < 1 / 4098f) - setMotion(Vec3d.ZERO); + setMotion(Vector3d.ZERO); move(getMotion().x, getMotion().y, getMotion().z); if (ContraptionCollider.collideBlocks(this)) @@ -313,10 +317,10 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD Entity riding = e; while (riding.getRidingEntity() != null) riding = riding.getRidingEntity(); - Vec3d movementVector = riding.getMotion(); + Vector3d movementVector = riding.getMotion(); if (riding instanceof BoatEntity) movementVector = getPositionVec().subtract(prevPosX, prevPosY, prevPosZ); - Vec3d motion = movementVector.normalize(); + Vector3d motion = movementVector.normalize(); boolean rotating = false; if (!rotationLock) { @@ -347,7 +351,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD if (wasStalled && !isStalled()) { riding.setMotion(motionBeforeStall); - motionBeforeStall = Vec3d.ZERO; + motionBeforeStall = Vector3d.ZERO; } if (!isStalled() && (riding instanceof FurnaceMinecartEntity)) { @@ -389,10 +393,10 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD super.tick(); } - public void tickActors(Vec3d movementVector) { - Vec3d rotationVec = getRotationVec(); - Vec3d reversedRotationVec = rotationVec.scale(-1); - Vec3d rotationOffset = VecHelper.getCenterOf(BlockPos.ZERO); + public void tickActors(Vector3d movementVector) { + Vector3d rotationVec = getRotationVec(); + Vector3d reversedRotationVec = rotationVec.scale(-1); + Vector3d rotationOffset = VecHelper.getCenterOf(BlockPos.ZERO); boolean stalledPreviously = contraption.stalled; if (!world.isRemote) @@ -403,7 +407,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD BlockInfo blockInfo = pair.left; MovementBehaviour actor = Contraption.getMovement(blockInfo.state); - Vec3d actorPosition = new Vec3d(blockInfo.pos); + Vector3d actorPosition = Vector3d.of(blockInfo.pos); actorPosition = actorPosition.add(actor.getActiveAreaOffset(context)); actorPosition = VecHelper.rotate(actorPosition, rotationVec); actorPosition = actorPosition.add(rotationOffset) @@ -413,10 +417,10 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD BlockPos gridPosition = new BlockPos(actorPosition); if (!context.stall) { - Vec3d previousPosition = context.position; + Vector3d previousPosition = context.position; if (previousPosition != null) { context.motion = actorPosition.subtract(previousPosition); - Vec3d relativeMotion = context.motion; + Vector3d relativeMotion = context.motion; relativeMotion = VecHelper.rotate(relativeMotion, reversedRotationVec); context.relativeMotion = relativeMotion; newPosVisited = !new BlockPos(previousPosition).equals(gridPosition) @@ -426,11 +430,11 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD if (getContraption() instanceof BearingContraption) { BearingContraption bc = (BearingContraption) getContraption(); Direction facing = bc.getFacing(); - Vec3d activeAreaOffset = actor.getActiveAreaOffset(context); - if (activeAreaOffset.mul(VecHelper.planeByNormal(new Vec3d(facing.getDirectionVec()))) - .equals(Vec3d.ZERO)) { + Vector3d activeAreaOffset = actor.getActiveAreaOffset(context); + if (activeAreaOffset.mul(VecHelper.planeByNormal(Vector3d.of(facing.getDirectionVec()))) + .equals(Vector3d.ZERO)) { if (VecHelper.onSameAxis(blockInfo.pos, BlockPos.ZERO, facing.getAxis())) { - context.motion = new Vec3d(facing.getDirectionVec()).scale(facing.getAxis() + context.motion = Vector3d.of(facing.getDirectionVec()).scale(facing.getAxis() .getCoordinate(roll - prevRoll, yaw - prevYaw, pitch - prevPitch)); context.relativeMotion = context.motion; int timer = context.data.getInt("StationaryTimer"); @@ -459,7 +463,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD if (!world.isRemote) { if (!stalledPreviously && contraption.stalled) { - setMotion(Vec3d.ZERO); + setMotion(Vector3d.ZERO); if (getController() != null) getController().onStall(); AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> this), @@ -475,9 +479,9 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD setPosition(x + getX(), getY() + y, getZ() + z); } - private Vec3d getAnchorVec() { + private Vector3d getAnchorVec() { if (contraption != null && contraption.getType() == AllContraptionTypes.MOUNTED) - return new Vec3d(getX() - .5, getY(), getZ() - .5); + return new Vector3d(getX() - .5, getY(), getZ() - .5); return getPositionVec(); } @@ -503,7 +507,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD if (contraption != null) { AxisAlignedBB cbox = contraption.getBoundingBox(); if (cbox != null) { - Vec3d actualVec = getAnchorVec(); + Vector3d actualVec = getAnchorVec(); this.setBoundingBox(cbox.offset(actualVec)); } } @@ -517,11 +521,11 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD super.stopRiding(); } - public static float yawFromVector(Vec3d vec) { + public static float yawFromVector(Vector3d vec) { return (float) ((3 * Math.PI / 2 + Math.atan2(vec.z, vec.x)) / Math.PI * 180); } - public static float pitchFromVector(Vec3d vec) { + public static float pitchFromVector(Vector3d vec) { return (float) ((Math.acos(vec.y)) / Math.PI * 180); } @@ -558,10 +562,10 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD dataManager.set(STALLED, compound.getBoolean("Stalled")); ListNBT vecNBT = compound.getList("CachedMotion", 6); if (!vecNBT.isEmpty()) { - motionBeforeStall = new Vec3d(vecNBT.getDouble(0), vecNBT.getDouble(1), vecNBT.getDouble(2)); - if (!motionBeforeStall.equals(Vec3d.ZERO)) + motionBeforeStall = new Vector3d(vecNBT.getDouble(0), vecNBT.getDouble(1), vecNBT.getDouble(2)); + if (!motionBeforeStall.equals(Vector3d.ZERO)) targetYaw = prevYaw = yaw += yawFromVector(motionBeforeStall); - setMotion(Vec3d.ZERO); + setMotion(Vector3d.ZERO); } if (compound.contains("Controller")) controllerPos = NBTUtil.readBlockPos(compound.getCompound("Controller")); @@ -628,18 +632,18 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD if (getContraption() != null) { remove(); BlockPos offset = new BlockPos(getAnchorVec().add(.5, .5, .5)); - Vec3d rotation = getRotationVec(); + Vector3d rotation = getRotationVec(); StructureTransform transform = new StructureTransform(offset, rotation); contraption.addBlocksToWorld(world, transform); contraption.addPassengersToWorld(world, transform, getPassengers()); removePassengers(); for (Entity entity : collidingEntities) { - Vec3d positionVec = getPositionVec(); - Vec3d localVec = entity.getPositionVec() + Vector3d positionVec = getPositionVec(); + Vector3d localVec = entity.getPositionVec() .subtract(positionVec); localVec = VecHelper.rotate(localVec, getRotationVec().scale(-1)); - Vec3d transformed = transform.apply(localVec); + Vector3d transformed = transform.apply(localVec); entity.setPositionAndUpdate(transformed.x, transformed.y, transformed.z); } @@ -672,7 +676,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD @SuppressWarnings("deprecation") @Override public CompoundNBT writeWithoutTypeId(CompoundNBT nbt) { - Vec3d vec = getPositionVec(); + Vector3d vec = getPositionVec(); List passengers = getPassengers(); for (Entity entity : passengers) { @@ -680,7 +684,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD entity.removed = true; // Gather passengers into same chunk when saving - Vec3d prevVec = entity.getPositionVec(); + Vector3d prevVec = entity.getPositionVec(); entity.setPos(vec.x, prevVec.y, vec.z); // Super requires all passengers to not be removed in order to write them to the @@ -727,7 +731,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD @Override // Make sure nothing can move contraptions out of the way - public void setMotion(Vec3d motionIn) {} + public void setMotion(Vector3d motionIn) {} @Override public void setPositionAndUpdate(double x, double y, double z) { @@ -740,7 +744,7 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD return PushReaction.IGNORE; } - public void setContraptionMotion(Vec3d vec) { + public void setContraptionMotion(Vector3d vec) { super.setMotion(vec); } @@ -758,24 +762,24 @@ public class ContraptionEntity extends Entity implements IEntityAdditionalSpawnD return initialAngle; } - public Vec3d getRotationVec() { - return new Vec3d(getRoll(1), getYaw(1), getPitch(1)); + public Vector3d getRotationVec() { + return new Vector3d(getRoll(1), getYaw(1), getPitch(1)); } - public Vec3d getPrevRotationVec() { - return new Vec3d(getRoll(0), getYaw(0), getPitch(0)); + public Vector3d getPrevRotationVec() { + return new Vector3d(getRoll(0), getYaw(0), getPitch(0)); } - public Vec3d getPrevPositionVec() { - return new Vec3d(prevPosX, prevPosY, prevPosZ); + public Vector3d getPrevPositionVec() { + return new Vector3d(prevPosX, prevPosY, prevPosZ); } - public Vec3d getContactPointMotion(Vec3d globalContactPoint) { - Vec3d positionVec = getPositionVec(); - Vec3d conMotion = positionVec.subtract(getPrevPositionVec()); - Vec3d conAngularMotion = getRotationVec().subtract(getPrevRotationVec()); - Vec3d contraptionCentreOffset = stationary ? VecHelper.getCenterOf(BlockPos.ZERO) : Vec3d.ZERO.add(0, 0.5, 0); - Vec3d contactPoint = globalContactPoint.subtract(contraptionCentreOffset) + public Vector3d getContactPointMotion(Vector3d globalContactPoint) { + Vector3d positionVec = getPositionVec(); + Vector3d conMotion = positionVec.subtract(getPrevPositionVec()); + Vector3d conAngularMotion = getRotationVec().subtract(getPrevRotationVec()); + Vector3d contraptionCentreOffset = stationary ? VecHelper.getCenterOf(BlockPos.ZERO) : Vector3d.ZERO.add(0, 0.5, 0); + Vector3d contactPoint = globalContactPoint.subtract(contraptionCentreOffset) .subtract(positionVec); contactPoint = VecHelper.rotate(contactPoint, conAngularMotion.x, conAngularMotion.y, conAngularMotion.z); contactPoint = contactPoint.add(positionVec) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntityRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntityRenderer.java index af7aff573..c33f6014c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntityRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntityRenderer.java @@ -11,7 +11,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.item.minecart.AbstractMinecartEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class ContraptionEntityRenderer extends EntityRenderer { @@ -54,14 +54,14 @@ public class ContraptionEntityRenderer extends EntityRenderer double cartX = MathHelper.lerp(partialTicks, cart.lastTickPosX, cart.getX()); double cartY = MathHelper.lerp(partialTicks, cart.lastTickPosY, cart.getY()); double cartZ = MathHelper.lerp(partialTicks, cart.lastTickPosZ, cart.getZ()); - Vec3d cartPos = cart.getPos(cartX, cartY, cartZ); + Vector3d cartPos = cart.getPos(cartX, cartY, cartZ); for (MatrixStack stack : matrixStacks) stack.translate(-.5f, 0, -.5f); if (cartPos != null) { - Vec3d cartPosFront = cart.getPosOffset(cartX, cartY, cartZ, (double) 0.3F); - Vec3d cartPosBack = cart.getPosOffset(cartX, cartY, cartZ, (double) -0.3F); + Vector3d cartPosFront = cart.getPosOffset(cartX, cartY, cartZ, (double) 0.3F); + Vector3d cartPosBack = cart.getPosOffset(cartX, cartY, cartZ, (double) -0.3F); if (cartPosFront == null) cartPosFront = cartPos; if (cartPosBack == null) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java index ead238993..845791577 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java @@ -21,7 +21,7 @@ import net.minecraft.client.renderer.BlockModelRenderer; import net.minecraft.client.renderer.BlockRendererDispatcher; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.IRenderTypeBuffer; -import net.minecraft.client.renderer.Matrix4f; +import net.minecraft.util.math.vector.Matrix4f; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.texture.OverlayTexture; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/DirectionalExtenderScrollOptionSlot.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/DirectionalExtenderScrollOptionSlot.java index b8892c6cd..bb0a20b5e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/DirectionalExtenderScrollOptionSlot.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/DirectionalExtenderScrollOptionSlot.java @@ -10,7 +10,7 @@ import com.simibubi.create.foundation.utility.MatrixStacker; import net.minecraft.block.BlockState; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.Direction; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class DirectionalExtenderScrollOptionSlot extends CenteredSideValueBoxTransform { @@ -19,9 +19,9 @@ public class DirectionalExtenderScrollOptionSlot extends CenteredSideValueBoxTra } @Override - protected Vec3d getLocalOffset(BlockState state) { + protected Vector3d getLocalOffset(BlockState state) { return super.getLocalOffset(state) - .add(new Vec3d(state.get(BlockStateProperties.FACING).getDirectionVec()).scale(-2 / 16f)); + .add(Vector3d.of(state.get(BlockStateProperties.FACING).getDirectionVec()).scale(-2 / 16f)); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java index 1be0ada51..2e282a09d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java @@ -6,7 +6,7 @@ import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.items.ItemHandlerHelper; @@ -23,8 +23,8 @@ public abstract class MovementBehaviour { public void visitNewPosition(MovementContext context, BlockPos pos) {} - public Vec3d getActiveAreaOffset(MovementContext context) { - return Vec3d.ZERO; + public Vector3d getActiveAreaOffset(MovementContext context) { + return Vector3d.ZERO; } public void dropItem(MovementContext context, ItemStack stack) { @@ -32,7 +32,7 @@ public abstract class MovementBehaviour { if (remainder.isEmpty()) return; - Vec3d vec = context.position; + Vector3d vec = context.position; ItemEntity itemEntity = new ItemEntity(context.world, vec.x, vec.y, vec.z, remainder); itemEntity.setMotion(context.motion.add(0, 0.5f, 0) .scale(context.world.rand.nextFloat() * .3f)); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementContext.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementContext.java index c3228b4c5..a869c5ead 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementContext.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementContext.java @@ -5,17 +5,17 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraft.world.gen.feature.template.Template.BlockInfo; import net.minecraftforge.common.util.Constants.NBT; public class MovementContext { - public Vec3d position; - public Vec3d motion; - public Vec3d relativeMotion; - public Vec3d rotation; + public Vector3d position; + public Vector3d motion; + public Vector3d relativeMotion; + public Vector3d rotation; public World world; public BlockState state; public BlockPos localPos; @@ -34,9 +34,9 @@ public class MovementContext { localPos = info.pos; firstMovement = true; - motion = Vec3d.ZERO; - relativeMotion = Vec3d.ZERO; - rotation = Vec3d.ZERO; + motion = Vector3d.ZERO; + relativeMotion = Vector3d.ZERO; + rotation = Vector3d.ZERO; position = null; data = new CompoundNBT(); stall = false; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/StructureTransform.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/StructureTransform.java index ded55dfad..4f885887b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/StructureTransform.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/StructureTransform.java @@ -30,7 +30,7 @@ import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class StructureTransform { @@ -40,7 +40,7 @@ public class StructureTransform { Axis rotationAxis; BlockPos offset; - public StructureTransform(BlockPos offset, Vec3d rotation) { + public StructureTransform(BlockPos offset, Vector3d rotation) { this.offset = offset; if (rotation.x != 0) { rotationAxis = Axis.X; @@ -77,7 +77,7 @@ public class StructureTransform { } public BlockPos apply(BlockPos localPos) { - Vec3d vec = VecHelper.getCenterOf(localPos); + Vector3d vec = VecHelper.getCenterOf(localPos); vec = VecHelper.rotateCentered(vec, angle, rotationAxis); localPos = new BlockPos(vec); return localPos.add(offset); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java index d137d9c31..fd608f76e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java @@ -17,7 +17,7 @@ import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class ClockworkBearingTileEntity extends KineticTileEntity implements IBearingTileEntity { @@ -84,13 +84,13 @@ public class ClockworkBearingTileEntity extends KineticTileEntity implements IBe protected void applyRotations() { Axis axis = getBlockState().get(BlockStateProperties.FACING).getAxis(); Direction direction = Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis); - Vec3d directionVec = new Vec3d(direction.getDirectionVec()); + Vector3d directionVec = Vector3d.of(direction.getDirectionVec()); if (hourHand != null) { - Vec3d vec = new Vec3d(1, 1, 1).scale(hourAngle).mul(directionVec); + Vector3d vec = new Vector3d(1, 1, 1).scale(hourAngle).mul(directionVec); hourHand.rotateTo(vec.x, vec.y, vec.z); } if (minuteHand != null) { - Vec3d vec = new Vec3d(1, 1, 1).scale(minuteAngle).mul(directionVec); + Vector3d vec = new Vector3d(1, 1, 1).scale(minuteAngle).mul(directionVec); minuteHand.rotateTo(vec.x, vec.y, vec.z); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java index 9a013ba7d..37fc4cc6f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java @@ -23,7 +23,7 @@ import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity implements IBearingTileEntity { @@ -260,8 +260,8 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity imp Axis axis = getBlockState().get(FACING) .getAxis(); Direction direction = Direction.getFacingFromAxis(AxisDirection.POSITIVE, axis); - Vec3d vec = new Vec3d(1, 1, 1).scale(angle) - .mul(new Vec3d(direction.getDirectionVec())); + Vector3d vec = new Vector3d(1, 1, 1).scale(angle) + .mul(Vector3d.of(direction.getDirectionVec())); movedContraption.rotateTo(vec.x, vec.y, vec.z); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/AbstractChassisBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/AbstractChassisBlock.java index 3b1b599ae..6faa70def 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/AbstractChassisBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/AbstractChassisBlock.java @@ -20,7 +20,7 @@ import net.minecraft.util.Rotation; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraftforge.common.Tags; @@ -60,7 +60,7 @@ public abstract class AbstractChassisBlock extends RotatedPillarBlock implements BooleanProperty glueableSide = getGlueableSide(state, face); if (glueableSide != null && !state.get(glueableSide)) { if (worldIn.isRemote) { - Vec3d vec = hit.getHitVec(); + Vector3d vec = hit.getHitVec(); worldIn.addParticle(ParticleTypes.ITEM_SLIME, vec.x, vec.y, vec.z, 0, 0, 0); return ActionResultType.SUCCESS; } @@ -78,7 +78,7 @@ public abstract class AbstractChassisBlock extends RotatedPillarBlock implements if (state.get(affectedSide) == isSlimeBall) return ActionResultType.PASS; if (worldIn.isRemote) { - Vec3d vec = hit.getHitVec(); + Vector3d vec = hit.getHitVec(); worldIn.addParticle(ParticleTypes.ITEM_SLIME, vec.x, vec.y, vec.z, 0, 0, 0); return ActionResultType.SUCCESS; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/LinearChassisBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/LinearChassisBlock.java index 30c6f95db..21f53b4f8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/LinearChassisBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/LinearChassisBlock.java @@ -14,7 +14,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; public class LinearChassisBlock extends AbstractChassisBlock { @@ -86,7 +86,7 @@ public class LinearChassisBlock extends AbstractChassisBlock { } @Override - public boolean connectsTo(BlockState state, BlockState other, ILightReader reader, BlockPos pos, + public boolean connectsTo(BlockState state, BlockState other, IBlockDisplayReader reader, BlockPos pos, BlockPos otherPos, Direction face) { return sameKind(state, other) && state.get(AXIS) == other.get(AXIS); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueEffectPacket.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueEffectPacket.java index d2d6c6917..9602ecfe3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueEffectPacket.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/GlueEffectPacket.java @@ -41,7 +41,7 @@ public class GlueEffectPacket extends SimplePacketBase { public void handle(Supplier context) { context.get().enqueueWork(() -> DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> { Minecraft mc = Minecraft.getInstance(); - if (!mc.player.getPosition().withinDistance(pos, 100)) + if (!mc.player.getBlockPos().withinDistance(pos, 100)) return; SuperGlueItem.spawnParticles(mc.world, pos, direction, fullBlock); })); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueEntity.java index 27b3a6cdc..c714b28da 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueEntity.java @@ -42,7 +42,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -216,7 +216,7 @@ public class SuperGlueEntity extends Entity implements IEntityAdditionalSpawnDat } @Override - public void move(MoverType typeIn, Vec3d pos) { + public void move(MoverType typeIn, Vector3d pos) { if (!world.isRemote && isAlive() && pos.lengthSquared() > 0.0D) { remove(); onBroken(null); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueHandler.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueHandler.java index ba638028b..35d2f5ffb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueHandler.java @@ -20,7 +20,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceContext; import net.minecraft.util.math.RayTraceResult.Type; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IWorld; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent.EntityPlaceEvent; @@ -68,9 +68,9 @@ public class SuperGlueHandler { double distance = placer.getAttribute(PlayerEntity.REACH_DISTANCE) .getValue(); - Vec3d start = placer.getEyePosition(1); - Vec3d look = placer.getLook(1); - Vec3d end = start.add(look.x * distance, look.y * distance, look.z * distance); + Vector3d start = placer.getEyePosition(1); + Vector3d look = placer.getLook(1); + Vector3d end = start.add(look.x * distance, look.y * distance, look.z * distance); World world = placer.world; RayTraceWorld rayTraceWorld = diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueItem.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueItem.java index 515aa8867..3b58e92d9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueItem.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueItem.java @@ -15,7 +15,7 @@ import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -80,9 +80,9 @@ public class SuperGlueItem extends Item { @OnlyIn(Dist.CLIENT) public static void spawnParticles(World world, BlockPos pos, Direction direction, boolean fullBlock) { - Vec3d vec = new Vec3d(direction.getDirectionVec()); - Vec3d plane = VecHelper.planeByNormal(vec); - Vec3d facePos = VecHelper.getCenterOf(pos) + Vector3d vec = Vector3d.of(direction.getDirectionVec()); + Vector3d plane = VecHelper.planeByNormal(vec); + Vector3d facePos = VecHelper.getCenterOf(pos) .add(vec.scale(.5f)); float distance = fullBlock ? 1f : .25f + .25f * (world.rand.nextFloat() - .5f); @@ -90,13 +90,13 @@ public class SuperGlueItem extends Item { ItemStack stack = new ItemStack(Items.SLIME_BALL); for (int i = fullBlock ? 40 : 15; i > 0; i--) { - Vec3d offset = VecHelper.rotate(plane, 360 * world.rand.nextFloat(), direction.getAxis()); - Vec3d motion = offset.normalize() + Vector3d offset = VecHelper.rotate(plane, 360 * world.rand.nextFloat(), direction.getAxis()); + Vector3d motion = offset.normalize() .scale(1 / 16f); if (fullBlock) - offset = new Vec3d(MathHelper.clamp(offset.x, -.5, .5), MathHelper.clamp(offset.y, -.5, .5), + offset = new Vector3d(MathHelper.clamp(offset.x, -.5, .5), MathHelper.clamp(offset.y, -.5, .5), MathHelper.clamp(offset.z, -.5, .5)); - Vec3d particlePos = facePos.add(offset); + Vector3d particlePos = facePos.add(offset); world.addParticle(new ItemParticleData(ParticleTypes.ITEM, stack), particlePos.x, particlePos.y, particlePos.z, motion.x, motion.y, motion.z); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java index 097daf419..e7c29e47f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/glue/SuperGlueRenderer.java @@ -20,7 +20,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -30,8 +30,8 @@ public class SuperGlueRenderer extends EntityRenderer { private ResourceLocation regular = new ResourceLocation(Create.ID, "textures/entity/super_glue/slime.png"); - private Vec3d[] quad1; - private Vec3d[] quad2; + private Vector3d[] quad1; + private Vector3d[] quad2; private float[] u = { 0, 1, 1, 0 }; private float[] v = { 0, 0, 1, 1 }; @@ -66,10 +66,10 @@ public class SuperGlueRenderer extends EntityRenderer { AngleHelper.applyRotation(face, ms); Entry peek = ms.peek(); - Vec3d[][] quads = { quad1, quad2 }; - for (Vec3d[] quad : quads) { + Vector3d[][] quads = { quad1, quad2 }; + for (Vector3d[] quad : quads) { for (int i = 0; i < 4; i++) { - Vec3d vertex = quad[i]; + Vector3d vertex = quad[i]; builder.vertex(peek.getModel(), (float) vertex.x, (float) vertex.y, (float) vertex.z) .color(255, 255, 255, 255) .texture(u[i], v[i]) @@ -84,31 +84,31 @@ public class SuperGlueRenderer extends EntityRenderer { } private void initQuads() { - Vec3d diff = new Vec3d(Direction.SOUTH.getDirectionVec()); - Vec3d extension = diff.normalize() + Vector3d diff = Vector3d.of(Direction.SOUTH.getDirectionVec()); + Vector3d extension = diff.normalize() .scale(1 / 32f - 1 / 128f); - Vec3d plane = VecHelper.planeByNormal(diff); + Vector3d plane = VecHelper.planeByNormal(diff); Axis axis = Direction.getFacingFromVector(diff.x, diff.y, diff.z) .getAxis(); - Vec3d start = Vec3d.ZERO.subtract(extension); - Vec3d end = Vec3d.ZERO.add(extension); + Vector3d start = Vector3d.ZERO.subtract(extension); + Vector3d end = Vector3d.ZERO.add(extension); plane = plane.scale(1 / 2f); - Vec3d a1 = plane.add(start); - Vec3d b1 = plane.add(end); + Vector3d a1 = plane.add(start); + Vector3d b1 = plane.add(end); plane = VecHelper.rotate(plane, -90, axis); - Vec3d a2 = plane.add(start); - Vec3d b2 = plane.add(end); + Vector3d a2 = plane.add(start); + Vector3d b2 = plane.add(end); plane = VecHelper.rotate(plane, -90, axis); - Vec3d a3 = plane.add(start); - Vec3d b3 = plane.add(end); + Vector3d a3 = plane.add(start); + Vector3d b3 = plane.add(end); plane = VecHelper.rotate(plane, -90, axis); - Vec3d a4 = plane.add(start); - Vec3d b4 = plane.add(end); + Vector3d a4 = plane.add(start); + Vector3d b4 = plane.add(end); - quad1 = new Vec3d[] { a2, a3, a4, a1 }; - quad2 = new Vec3d[] { b3, b2, b1, b4 }; + quad1 = new Vector3d[] { a2, a3, a4, a1 }; + quad2 = new Vector3d[] { b3, b2, b1, b4 }; } private int getBrightnessForRender(SuperGlueEntity entity) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssembleRailType.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssembleRailType.java index d6caae50a..a05de16ab 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssembleRailType.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssembleRailType.java @@ -25,7 +25,7 @@ public enum CartAssembleRailType implements IStringSerializable { } @Override - public String getName() { + public String getString() { return Lang.asId(name()); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java index f44b9dc8f..fa4631e25 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerBlock.java @@ -32,7 +32,7 @@ import net.minecraft.item.ItemUseContext; import net.minecraft.nbt.CompoundNBT; import net.minecraft.state.BooleanProperty; import net.minecraft.state.EnumProperty; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.RailShape; @@ -45,7 +45,7 @@ import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvents; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; @@ -53,15 +53,15 @@ import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; -import net.minecraft.world.storage.loot.LootContext; -import net.minecraft.world.storage.loot.LootParameters; +import net.minecraft.loot.LootContext; +import net.minecraft.loot.LootParameters; public class CartAssemblerBlock extends AbstractRailBlock implements ITE, IWrenchable, ISpecialBlockItemRequirement { - public static final IProperty RAIL_SHAPE = + public static final Property RAIL_SHAPE = EnumProperty.create("shape", RailShape.class, RailShape.EAST_WEST, RailShape.NORTH_SOUTH); - public static final IProperty RAIL_TYPE = + public static final Property RAIL_TYPE = EnumProperty.create("rail_type", CartAssembleRailType.class); public static final BooleanProperty POWERED = BlockStateProperties.POWERED; @@ -126,7 +126,7 @@ public class CartAssemblerBlock extends AbstractRailBlock facing.getZOffset() * speed); } else { disassemble(world, pos, cart); - Vec3d diff = VecHelper.getCenterOf(pos) + Vector3d diff = VecHelper.getCenterOf(pos) .subtract(cart.getPositionVec()); cart.setMotion(diff.x / 16f, 0, diff.z / 16f); } @@ -253,7 +253,7 @@ public class CartAssemblerBlock extends AbstractRailBlock @Override @Nonnull - public IProperty getShapeProperty() { + public Property getShapeProperty() { return RAIL_SHAPE; } @@ -299,7 +299,7 @@ public class CartAssemblerBlock extends AbstractRailBlock @SuppressWarnings("deprecation") @Nonnull public List getDrops(@Nonnull BlockState state, - @Nonnull net.minecraft.world.storage.loot.LootContext.Builder builder) { + @Nonnull net.minecraft.loot.LootContext.Builder builder) { List drops = super.getDrops(state, builder); drops.addAll(getRailBlock(state).getDrops(builder)); return drops; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java index 928eff3c8..d26800f77 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java @@ -20,6 +20,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IWorld; import net.minecraft.world.World; import net.minecraft.world.gen.feature.template.Template.BlockInfo; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java index b9c4ea478..8c64b3f73 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java @@ -14,7 +14,7 @@ import com.simibubi.create.foundation.utility.ServerSpeedProvider; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public abstract class LinearActuatorTileEntity extends KineticTileEntity implements IControlContraption { @@ -64,7 +64,7 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity impleme movedContraption.setContraptionMotion(toMotionVector(syncSpeed)); return; } - movedContraption.setContraptionMotion(Vec3d.ZERO); + movedContraption.setContraptionMotion(Vector3d.ZERO); return; } @@ -201,9 +201,9 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity impleme protected abstract ValueBoxTransform getMovementModeSlot(); - protected abstract Vec3d toMotionVector(float speed); + protected abstract Vector3d toMotionVector(float speed); - protected abstract Vec3d toPosition(float offset); + protected abstract Vector3d toPosition(float offset); protected void visitNewPosition() {} @@ -239,7 +239,7 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity impleme if (movedContraption == null) return; if (movedContraption.isStalled()) { - movedContraption.setContraptionMotion(Vec3d.ZERO); + movedContraption.setContraptionMotion(Vector3d.ZERO); return; } movedContraption.setContraptionMotion(getMotionVector()); @@ -248,10 +248,10 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity impleme protected void applyContraptionPosition() { if (movedContraption == null) return; - Vec3d vec = toPosition(offset); + Vector3d vec = toPosition(offset); movedContraption.setPosition(vec.x, vec.y, vec.z); if (getSpeed() == 0 || waitingForSpeedChange) - movedContraption.setContraptionMotion(Vec3d.ZERO); + movedContraption.setContraptionMotion(Vector3d.ZERO); } public float getMovementSpeed() { @@ -261,7 +261,7 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity impleme return movementSpeed; } - public Vec3d getMotionVector() { + public Vector3d getMotionVector() { return toMotionVector(getMovementSpeed()); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonBlock.java index cba8045e6..25148136c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonBlock.java @@ -25,7 +25,7 @@ import net.minecraft.util.IStringSerializable; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; @@ -84,7 +84,7 @@ public class MechanicalPistonBlock extends DirectionalAxisKineticBlock implement if (((MechanicalPistonBlock) state.getBlock()).isSticky) return ActionResultType.PASS; if (worldIn.isRemote) { - Vec3d vec = hit.getHitVec(); + Vector3d vec = hit.getHitVec(); worldIn.addParticle(ParticleTypes.ITEM_SLIME, vec.x, vec.y, vec.z, 0, 0, 0); return ActionResultType.SUCCESS; } @@ -114,7 +114,7 @@ public class MechanicalPistonBlock extends DirectionalAxisKineticBlock implement RETRACTED, MOVING, EXTENDED; @Override - public String getName() { + public String getString() { return Lang.asId(name()); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonHeadBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonHeadBlock.java index 5c21f6c80..42f5aac91 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonHeadBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonHeadBlock.java @@ -10,7 +10,7 @@ import net.minecraft.block.IWaterLoggable; import net.minecraft.block.material.PushReaction; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.Fluids; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; import net.minecraft.state.EnumProperty; @@ -92,7 +92,7 @@ public class MechanicalPistonHeadBlock extends ProperDirectionalBlock implements } @Override - public IFluidState getFluidState(BlockState state) { + public FluidState getFluidState(BlockState state) { return state.get(BlockStateProperties.WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : Fluids.EMPTY.getDefaultState(); } @@ -107,7 +107,7 @@ public class MechanicalPistonHeadBlock extends ProperDirectionalBlock implements @Override public BlockState getStateForPlacement(BlockItemUseContext context) { - IFluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); + FluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); return super.getStateForPlacement(context).with(BlockStateProperties.WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER)); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java index 7433a9407..37252c721 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java @@ -17,7 +17,7 @@ import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { @@ -138,16 +138,16 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { protected void visitNewPosition() {} @Override - protected Vec3d toMotionVector(float speed) { + protected Vector3d toMotionVector(float speed) { Direction pistonDirection = getBlockState().get(BlockStateProperties.FACING); - return new Vec3d(pistonDirection.getDirectionVec()).scale(speed); + return Vector3d.of(pistonDirection.getDirectionVec()).scale(speed); } @Override - protected Vec3d toPosition(float offset) { - Vec3d position = new Vec3d(getBlockState().get(BlockStateProperties.FACING) + protected Vector3d toPosition(float offset) { + Vector3d position = Vector3d.of(getBlockState().get(BlockStateProperties.FACING) .getDirectionVec()).scale(offset); - return position.add(new Vec3d(movedContraption.getContraption() + return position.add(Vector3d.of(movedContraption.getContraption() .getAnchor())); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java index 379d3c202..c7c1b9146 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonExtensionPoleBlock.java @@ -10,7 +10,7 @@ import net.minecraft.block.IWaterLoggable; import net.minecraft.block.material.PushReaction; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.Fluids; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; @@ -91,13 +91,13 @@ public class PistonExtensionPoleBlock extends ProperDirectionalBlock implements @Override public BlockState getStateForPlacement(BlockItemUseContext context) { - IFluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); + FluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); return getDefaultState().with(FACING, context.getFace().getOpposite()) .with(BlockStateProperties.WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER)); } @Override - public IFluidState getFluidState(BlockState state) { + public FluidState getFluidState(BlockState state) { return state.get(BlockStateProperties.WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : Fluids.EMPTY.getDefaultState(); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java index 2f650d4e9..fd63be6da 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyBlock.java @@ -11,7 +11,7 @@ import net.minecraft.block.IWaterLoggable; import net.minecraft.block.material.PushReaction; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.Fluids; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; import net.minecraft.state.EnumProperty; @@ -128,7 +128,7 @@ public class PulleyBlock extends HorizontalAxisKineticBlock implements ITE 0) { BlockPos magnetPos = pos.down((int) offset); - IFluidState ifluidstate = world.getFluidState(magnetPos); + FluidState ifluidstate = world.getFluidState(magnetPos); world.destroyBlock(magnetPos, world.getBlockState(magnetPos) .getCollisionShape(world, magnetPos) .isEmpty()); @@ -115,7 +115,7 @@ public class PulleyTileEntity extends LinearActuatorTileEntity { for (int i = 1; i <= ((int) offset) - 1; i++) { BlockPos ropePos = pos.down(i); - IFluidState ifluidstate = world.getFluidState(ropePos); + FluidState ifluidstate = world.getFluidState(ropePos); waterlog[i] = ifluidstate.getFluid() == Fluids.WATER; world.destroyBlock(ropePos, world.getBlockState(ropePos) .getCollisionShape(world, ropePos) @@ -138,13 +138,13 @@ public class PulleyTileEntity extends LinearActuatorTileEntity { } @Override - protected Vec3d toPosition(float offset) { + protected Vector3d toPosition(float offset) { if (movedContraption.getContraption() instanceof PulleyContraption) { PulleyContraption contraption = (PulleyContraption) movedContraption.getContraption(); - return new Vec3d(contraption.getAnchor()).add(0, contraption.initialOffset - offset, 0); + return Vector3d.of(contraption.getAnchor()).add(0, contraption.initialOffset - offset, 0); } - return Vec3d.ZERO; + return Vector3d.ZERO; } @Override @@ -190,8 +190,8 @@ public class PulleyTileEntity extends LinearActuatorTileEntity { } @Override - protected Vec3d toMotionVector(float speed) { - return new Vec3d(0, -speed, 0); + protected Vector3d toMotionVector(float speed) { + return new Vector3d(0, -speed, 0); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/tracks/ReinforcedRailBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/tracks/ReinforcedRailBlock.java index 7d713c155..7f04b5687 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/tracks/ReinforcedRailBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/tracks/ReinforcedRailBlock.java @@ -10,7 +10,7 @@ import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.state.BooleanProperty; import net.minecraft.state.EnumProperty; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.RailShape; import net.minecraft.util.NonNullList; @@ -27,11 +27,11 @@ import javax.annotation.Nonnull; public class ReinforcedRailBlock extends AbstractRailBlock { - public static IProperty RAIL_SHAPE = + public static Property RAIL_SHAPE = EnumProperty.create("shape", RailShape.class, RailShape.EAST_WEST, RailShape.NORTH_SOUTH); - public static IProperty CONNECTS_N = BooleanProperty.create("connects_n"); - public static IProperty CONNECTS_S = BooleanProperty.create("connects_s"); + public static Property CONNECTS_N = BooleanProperty.create("connects_n"); + public static Property CONNECTS_S = BooleanProperty.create("connects_s"); public ReinforcedRailBlock(Properties properties) { super(true, properties); @@ -44,7 +44,7 @@ public class ReinforcedRailBlock extends AbstractRailBlock { @Nonnull @Override - public IProperty getShapeProperty() { + public Property getShapeProperty() { return RAIL_SHAPE; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/turntable/TurntableBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/turntable/TurntableBlock.java index afad3ab05..a981a9c00 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/turntable/TurntableBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/turntable/TurntableBlock.java @@ -17,7 +17,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; @@ -62,11 +62,11 @@ public class TurntableBlock extends KineticBlock implements ITE 1/4f) speed *= MathHelper.clamp((1/2f - offset.length()) * 2, 0, 1); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java index e5923468e..880faa1b7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelBlock.java @@ -11,14 +11,14 @@ import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld; import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; import net.minecraft.fluid.Fluids; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.IWorldReader; @@ -85,16 +85,16 @@ public class WaterWheelBlock extends HorizontalKineticBlock implements ITE { double flowStrength = 0; diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeBlock.java index f3cc7c6de..bd2126a78 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeBlock.java @@ -6,7 +6,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.IWaterLoggable; import net.minecraft.block.SixWayBlock; import net.minecraft.fluid.Fluids; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; @@ -15,7 +15,7 @@ import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; import net.minecraft.world.IWorld; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; @@ -37,14 +37,14 @@ public class FluidPipeBlock extends SixWayBlock implements IWaterLoggable { } // TODO: more generic pipe connection handling. Ideally without marker interface - public static boolean canConnectTo(ILightReader world, BlockPos pos, BlockState neighbour, Direction blockFace) { + public static boolean canConnectTo(IBlockDisplayReader world, BlockPos pos, BlockState neighbour, Direction blockFace) { if (isPipe(neighbour) || isTank(neighbour, world, pos, blockFace)) return true; return neighbour.getBlock() instanceof PumpBlock && blockFace.getAxis() == neighbour.get(PumpBlock.FACING) .getAxis(); } - public static boolean shouldDrawRim(ILightReader world, BlockPos pos, BlockState state, Direction direction) { + public static boolean shouldDrawRim(IBlockDisplayReader world, BlockPos pos, BlockState state, Direction direction) { if (!isPipe(state)) return false; if (!state.get(FACING_TO_PROPERTY_MAP.get(direction))) @@ -67,11 +67,11 @@ public class FluidPipeBlock extends SixWayBlock implements IWaterLoggable { return false; } - public static boolean isCornerOrEndPipe(ILightReader world, BlockPos pos, BlockState state) { + public static boolean isCornerOrEndPipe(IBlockDisplayReader world, BlockPos pos, BlockState state) { return isPipe(state) && !isStraightPipe(world, pos, state) && !shouldDrawCasing(world, pos, state); } - public static boolean isStraightPipe(ILightReader world, BlockPos pos, BlockState state) { + public static boolean isStraightPipe(IBlockDisplayReader world, BlockPos pos, BlockState state) { if (!isPipe(state)) return false; boolean axisFound = false; @@ -87,7 +87,7 @@ public class FluidPipeBlock extends SixWayBlock implements IWaterLoggable { return axisFound; } - public static boolean shouldDrawCasing(ILightReader world, BlockPos pos, BlockState state) { + public static boolean shouldDrawCasing(IBlockDisplayReader world, BlockPos pos, BlockState state) { if (!isPipe(state)) return false; for (Axis axis : Iterate.axes) { @@ -109,7 +109,7 @@ public class FluidPipeBlock extends SixWayBlock implements IWaterLoggable { @Override public BlockState getStateForPlacement(BlockItemUseContext context) { - IFluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); + FluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); return updateBlockState(getDefaultState(), context.getNearestLookingDirection(), null, context.getWorld(), context.getPos()).with(BlockStateProperties.WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER)); } @@ -124,7 +124,7 @@ public class FluidPipeBlock extends SixWayBlock implements IWaterLoggable { } public BlockState updateBlockState(BlockState state, Direction preferredDirection, @Nullable Direction ignore, - ILightReader world, BlockPos pos) { + IBlockDisplayReader world, BlockPos pos) { // Update sides that are not ignored for (Direction d : Iterate.directions) if (d != ignore) @@ -151,7 +151,7 @@ public class FluidPipeBlock extends SixWayBlock implements IWaterLoggable { } @Override - public IFluidState getFluidState(BlockState state) { + public FluidState getFluidState(BlockState state) { return state.get(BlockStateProperties.WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : Fluids.EMPTY.getDefaultState(); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeModel.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeModel.java index dd78d40d6..6d7723a38 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeModel.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidPipeModel.java @@ -13,7 +13,7 @@ import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.ModelDataMap; import net.minecraftforge.client.model.data.ModelProperty; @@ -27,7 +27,7 @@ public class FluidPipeModel extends WrappedBakedModel { } @Override - public IModelData getModelData(ILightReader world, BlockPos pos, BlockState state, IModelData tileData) { + public IModelData getModelData(IBlockDisplayReader world, BlockPos pos, BlockState state, IModelData tileData) { PipeModelData data = new PipeModelData(); for (Direction d : Iterate.directions) data.putRim(d, FluidPipeBlock.shouldDrawRim(world, pos, state, d)); diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidTankBlock.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidTankBlock.java index c2ec41026..35a482a47 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidTankBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/FluidTankBlock.java @@ -31,7 +31,7 @@ import net.minecraft.util.SoundEvents; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; @@ -171,10 +171,10 @@ public class FluidTankBlock extends Block implements IWrenchable, ITE source.airCurrent.maxDistance + 1 || distance < -.25f) { dissipate(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/particle/AirFlowParticleData.java b/src/main/java/com/simibubi/create/content/contraptions/particle/AirFlowParticleData.java index db604f367..725f2d8ef 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/particle/AirFlowParticleData.java +++ b/src/main/java/com/simibubi/create/content/contraptions/particle/AirFlowParticleData.java @@ -10,7 +10,7 @@ import net.minecraft.client.particle.ParticleManager.IParticleMetaFactory; import net.minecraft.network.PacketBuffer; import net.minecraft.particles.IParticleData; import net.minecraft.particles.ParticleType; -import net.minecraft.util.math.Vec3i; +import net.minecraft.util.math.vector.Vector3i; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -37,7 +37,7 @@ public class AirFlowParticleData implements IParticleData, ICustomParticle { for (int i = 0; i <= stack.getCount() / 8; i++) { ms.push(); - Vec3d vec = VecHelper.offsetRandomly(Vec3d.ZERO, r, .25f); - Vec3d vec2 = VecHelper.offsetRandomly(Vec3d.ZERO, r, .5f); + Vector3d vec = VecHelper.offsetRandomly(Vector3d.ZERO, r, .25f); + Vector3d vec2 = VecHelper.offsetRandomly(Vector3d.ZERO, r, .5f); ms.translate(vec.x, vec.y, vec.z); ms.multiply(new Vector3f((float) vec2.z, (float) vec2.y, 0).getDegreesQuaternion((float) vec2.x * 180)); diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java index f5721df2e..71530f5fa 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java @@ -15,7 +15,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; import net.minecraft.nbt.CompoundNBT; import net.minecraft.state.EnumProperty; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; @@ -33,8 +33,8 @@ import net.minecraft.world.World; @ParametersAreNonnullByDefault public class HeaterBlock extends Block implements ITE { - //public static IProperty BLAZE_LEVEL = IntegerProperty.create("blaze_level", 0, 4); - public static IProperty BLAZE_LEVEL = EnumProperty.create("blaze", HeatLevel.class); + //public static Property BLAZE_LEVEL = IntegerProperty.create("blaze_level", 0, 4); + public static Property BLAZE_LEVEL = EnumProperty.create("blaze", HeatLevel.class); public HeaterBlock(Properties properties) { super(properties); @@ -133,7 +133,7 @@ public class HeaterBlock extends Block implements ITE { ; @Override - public String getName() { + public String getString() { return Lang.asId(name()); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterRenderer.java index bb4750280..2dbd9e2d8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterRenderer.java @@ -8,7 +8,7 @@ import com.simibubi.create.foundation.utility.SuperByteBuffer; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.Direction; diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterTileEntity.java index cae5645e7..94306fc13 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterTileEntity.java @@ -21,7 +21,7 @@ import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.event.entity.ProjectileImpactEvent; @@ -157,22 +157,22 @@ public class HeaterTileEntity extends SmartTileEntity { if (r.nextDouble() > 0.25) return; - Vec3d color = randomColor(heatLevel); + Vector3d color = randomColor(heatLevel); spawnParticle(new CubeParticleData((float) color.x,(float) color.y,(float) color.z, 0.03F, 15), 0.015, 0.1); } else if (heatLevel == HeaterBlock.HeatLevel.FADING) { if (r.nextDouble() > 0.5) return; - Vec3d color = randomColor(heatLevel); + Vector3d color = randomColor(heatLevel); spawnParticle(new CubeParticleData((float) color.x,(float) color.y,(float) color.z, 0.035F, 18), 0.03, 0.15); } else if (heatLevel == HeaterBlock.HeatLevel.KINDLED) { - Vec3d color = randomColor(heatLevel); + Vector3d color = randomColor(heatLevel); spawnParticle(new CubeParticleData((float) color.x,(float) color.y,(float) color.z, 0.04F, 21), 0.05, 0.2); }else if (heatLevel == HeaterBlock.HeatLevel.SEETHING) { for (int i = 0; i < 2; i++) { if (r.nextDouble() > 0.6) return; - Vec3d color = randomColor(heatLevel); + Vector3d color = randomColor(heatLevel); spawnParticle(new CubeParticleData((float) color.x,(float) color.y,(float) color.z, 0.045F, 24), 0.06, 0.22); } } @@ -191,9 +191,9 @@ public class HeaterTileEntity extends SmartTileEntity { 0.0D); } - private static Vec3d randomColor(HeaterBlock.HeatLevel heatLevel) { + private static Vector3d randomColor(HeaterBlock.HeatLevel heatLevel) { if (heatLevel == HeaterBlock.HeatLevel.NONE) - return new Vec3d(0,0,0); + return new Vector3d(0,0,0); return ColorHelper.getRGB(heatParticleColors[heatLevel.ordinal()-1][(int) (Math.random()*4)]); } @@ -212,7 +212,7 @@ public class HeaterTileEntity extends SmartTileEntity { } event.setCanceled(true); - event.getThrowable().setMotion(Vec3d.ZERO); + event.getThrowable().setMotion(Vector3d.ZERO); event.getThrowable().remove(); HeaterTileEntity heater = (HeaterTileEntity) tile; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerTileEntity.java index ed827e517..c6956e514 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerTileEntity.java @@ -15,7 +15,7 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class SpeedControllerTileEntity extends KineticTileEntity { @@ -35,7 +35,7 @@ public class SpeedControllerTileEntity extends KineticTileEntity { new ScrollValueBehaviour(Lang.translate("generic.speed"), this, new ControllerValueBoxTransform()); targetSpeed.between(-max, max); targetSpeed.value = DEFAULT_SPEED; - targetSpeed.moveText(new Vec3d(9, 0, 10)); + targetSpeed.moveText(new Vector3d(9, 0, 10)); targetSpeed.withUnit(i -> Lang.translate("generic.unit.rpm")); targetSpeed.withCallback(i -> this.updateTargetRotation()); targetSpeed.withStepFunction(CreativeMotorTileEntity::step); @@ -106,7 +106,7 @@ public class SpeedControllerTileEntity extends KineticTileEntity { private class ControllerValueBoxTransform extends ValueBoxTransform.Sided { @Override - protected Vec3d getSouthLocation() { + protected Vector3d getSouthLocation() { return VecHelper.voxelSpace(8, 11.5f, 14); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java index 8116171dc..a29629416 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java @@ -39,7 +39,7 @@ import net.minecraft.item.ItemUseContext; import net.minecraft.pathfinding.PathNodeType; import net.minecraft.state.BooleanProperty; import net.minecraft.state.EnumProperty; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; @@ -62,7 +62,7 @@ import net.minecraft.world.IWorld; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; import net.minecraft.world.WorldType; -import net.minecraft.world.storage.loot.LootParameters; +import net.minecraft.loot.LootParameters; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.Tags; @@ -71,8 +71,8 @@ import net.minecraftforge.items.IItemHandler; public class BeltBlock extends HorizontalKineticBlock implements ITE, ISpecialBlockItemRequirement { - public static final IProperty SLOPE = EnumProperty.create("slope", BeltSlope.class); - public static final IProperty PART = EnumProperty.create("part", BeltPart.class); + public static final Property SLOPE = EnumProperty.create("slope", BeltSlope.class); + public static final Property PART = EnumProperty.create("part", BeltPart.class); public static final BooleanProperty CASING = BooleanProperty.create("casing"); public BeltBlock(Properties properties) { @@ -120,7 +120,7 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE getDrops(BlockState state, net.minecraft.world.storage.loot.LootContext.Builder builder) { + public List getDrops(BlockState state, net.minecraft.loot.LootContext.Builder builder) { List drops = super.getDrops(state, builder); TileEntity tileEntity = builder.get(LootParameters.BLOCK_ENTITY); if (tileEntity instanceof BeltTileEntity && ((BeltTileEntity) tileEntity).hasPulley()) @@ -203,7 +203,7 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE { @@ -154,9 +154,9 @@ public class BeltRenderer extends SafeTileEntityRenderer { ms.push(); - Vec3i directionVec = te.getBeltFacing() + Vector3i directionVec = te.getBeltFacing() .getDirectionVec(); - Vec3d beltStartOffset = new Vec3d(directionVec).scale(-.5) + Vector3d beltStartOffset = Vector3d.of(directionVec).scale(-.5) .add(.5, 13 / 16f + .125f, .5); ms.translate(beltStartOffset.x, beltStartOffset.y, beltStartOffset.z); BeltSlope slope = te.getBlockState() @@ -182,7 +182,7 @@ public class BeltRenderer extends SafeTileEntityRenderer { if (offset < .5) verticalMovement = 0; verticalMovement = verticalMovement * (Math.min(offset, te.beltLength - .5f) - .5f); - Vec3d offsetVec = new Vec3d(directionVec).scale(offset) + Vector3d offsetVec = Vector3d.of(directionVec).scale(offset) .add(0, verticalMovement, 0); boolean onSlope = slope != BeltSlope.HORIZONTAL && MathHelper.clamp(offset, .5f, te.beltLength - .5f) == offset; @@ -205,7 +205,7 @@ public class BeltRenderer extends SafeTileEntityRenderer { boolean blockItem = itemRenderer.getItemModelWithOverrides(transported.stack, te.getWorld(), null) .isGui3d(); if (Minecraft.getInstance().gameSettings.fancyGraphics) { - Vec3d shadowPos = new Vec3d(te.getPos()).add(beltStartOffset.scale(1) + Vector3d shadowPos = Vector3d.of(te.getPos()).add(beltStartOffset.scale(1) .add(offsetVec) .add(alongX ? sideOffset : 0, .39, alongX ? 0 : sideOffset)); ShadowRenderHelper.renderShadow(ms, buffer, shadowPos, .75f, blockItem ? .2f : .2f); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltShapes.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltShapes.java index 07658e8da..4066fba07 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltShapes.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltShapes.java @@ -11,7 +11,7 @@ import com.simibubi.create.foundation.utility.VoxelShaper; import net.minecraft.block.BlockState; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.IBooleanFunction; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; @@ -249,10 +249,10 @@ public class BeltShapes { public static VoxelShaper make(VoxelShape southBeltShape){ return forDirectionsWithRotation( - rotatedCopy(southBeltShape, new Vec3d(-90,0,0)), + rotatedCopy(southBeltShape, new Vector3d(-90,0,0)), Direction.SOUTH, Direction.Plane.HORIZONTAL,//idk, this can probably be improved :S - direction -> new Vec3d( + direction -> new Vector3d( direction.getAxisDirection() == Direction.AxisDirection.POSITIVE ? 0 : 180, -direction.getHorizontalAngle(), 0)); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltSlope.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltSlope.java index 8f934e10f..4afd10af1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltSlope.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltSlope.java @@ -8,7 +8,7 @@ public enum BeltSlope implements IStringSerializable { HORIZONTAL, UPWARD, DOWNWARD, VERTICAL, SIDEWAYS; @Override - public String getName() { + public String getString() { return Lang.asId(name()); } } \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java index dc6ae7376..ef8209a63 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java @@ -39,8 +39,8 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.util.math.Vec3i; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.vector.Vector3i; import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.ModelDataMap; import net.minecraftforge.client.model.data.ModelProperty; @@ -301,15 +301,15 @@ public class BeltTileEntity extends KineticTileEntity { return part == BeltPart.START ^ movingPositively; } - public Vec3i getMovementDirection(boolean firstHalf) { + public Vector3i getMovementDirection(boolean firstHalf) { return this.getMovementDirection(firstHalf, false); } - public Vec3i getBeltChainDirection() { + public Vector3i getBeltChainDirection() { return this.getMovementDirection(true, true); } - protected Vec3i getMovementDirection(boolean firstHalf, boolean ignoreHalves) { + protected Vector3i getMovementDirection(boolean firstHalf, boolean ignoreHalves) { if (getSpeed() == 0) return BlockPos.ZERO; @@ -323,7 +323,7 @@ public class BeltTileEntity extends KineticTileEntity { boolean notHorizontal = blockState.get(BeltBlock.SLOPE) != HORIZONTAL; if (getSpeed() < 0) movementFacing = movementFacing.getOpposite(); - Vec3i movement = movementFacing.getDirectionVec(); + Vector3i movement = movementFacing.getDirectionVec(); boolean slopeBeforeHalf = (part == BeltPart.END) == (beltFacing.getAxisDirection() == POSITIVE); boolean onSlope = notHorizontal && (part == MIDDLE || slopeBeforeHalf == firstHalf || ignoreHalves); @@ -332,7 +332,7 @@ public class BeltTileEntity extends KineticTileEntity { if (!onSlope) return movement; - return new Vec3i(movement.getX(), movingUp ? 1 : -1, movement.getZ()); + return new Vector3i(movement.getX(), movingUp ? 1 : -1, movement.getZ()); } public Direction getMovementFacing() { @@ -366,10 +366,10 @@ public class BeltTileEntity extends KineticTileEntity { .applyToEachWithin(index + .5f, maxDistanceFromCenter, processFunction); } - private Vec3d getWorldPositionOf(TransportedItemStack transported) { + private Vector3d getWorldPositionOf(TransportedItemStack transported) { BeltTileEntity controllerTE = getControllerTE(); if (controllerTE == null) - return Vec3d.ZERO; + return Vector3d.ZERO; return BeltHelper.getVectorForOffset(controllerTE, transported.beltPosition); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/item/BeltConnectorHandler.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/item/BeltConnectorHandler.java index 2c9c15812..9ada79856 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/item/BeltConnectorHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/item/BeltConnectorHandler.java @@ -20,7 +20,7 @@ import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; public class BeltConnectorHandler { @@ -80,22 +80,22 @@ public class BeltConnectorHandler { boolean canConnect = BeltConnectorItem.validateAxis(world, selected) && BeltConnectorItem.canConnect(world, first, selected); - Vec3d start = new Vec3d(first); - Vec3d end = new Vec3d(selected); - Vec3d actualDiff = end.subtract(start); + Vector3d start = Vector3d.of(first); + Vector3d end = Vector3d.of(selected); + Vector3d actualDiff = end.subtract(start); end = end.subtract(axis.getCoordinate(actualDiff.x, 0, 0), axis.getCoordinate(0, actualDiff.y, 0), axis.getCoordinate(0, 0, actualDiff.z)); - Vec3d diff = end.subtract(start); + Vector3d diff = end.subtract(start); double x = Math.abs(diff.x); double y = Math.abs(diff.y); double z = Math.abs(diff.z); float length = (float) Math.max(x, Math.max(y, z)); - Vec3d step = diff.normalize(); + Vector3d step = diff.normalize(); int sames = ((x == y) ? 1 : 0) + ((y == z) ? 1 : 0) + ((z == x) ? 1 : 0); if (sames == 0) { - List validDiffs = new LinkedList<>(); + List validDiffs = new LinkedList<>(); for (int i = -1; i <= 1; i++) for (int j = -1; j <= 1; j++) for (int k = -1; k <= 1; k++) { @@ -105,11 +105,11 @@ public class BeltConnectorHandler { continue; if (i == 0 && j == 0 && k == 0) continue; - validDiffs.add(new Vec3d(i, j, k)); + validDiffs.add(new Vector3d(i, j, k)); } int closestIndex = 0; float closest = Float.MAX_VALUE; - for (Vec3d validDiff : validDiffs) { + for (Vector3d validDiff : validDiffs) { double distanceTo = step.distanceTo(validDiff); if (distanceTo < closest) { closest = (float) distanceTo; @@ -122,9 +122,9 @@ public class BeltConnectorHandler { if (axis == Axis.Y && step.x != 0 && step.z != 0) return; - step = new Vec3d(Math.signum(step.x), Math.signum(step.y), Math.signum(step.z)); + step = new Vector3d(Math.signum(step.x), Math.signum(step.y), Math.signum(step.z)); for (float f = 0; f < length; f += .0625f) { - Vec3d position = start.add(step.scale(f)); + Vector3d position = start.add(step.scale(f)); if (r.nextInt(10) == 0) { world.addParticle(new RedstoneParticleData(canConnect ? .3f : .9f, canConnect ? .9f : .3f, .5f, 1), position.x + .5f, position.y + .5f, position.z + .5f, 0, 0, 0); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltInventory.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltInventory.java index 2efb20fdf..134b4c41b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltInventory.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltInventory.java @@ -28,7 +28,7 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.ListNBT; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants.NBT; @@ -381,9 +381,9 @@ public class BeltInventory { public void eject(TransportedItemStack stack) { ItemStack ejected = stack.stack; - Vec3d outPos = BeltHelper.getVectorForOffset(belt, stack.beltPosition); + Vector3d outPos = BeltHelper.getVectorForOffset(belt, stack.beltPosition); float movementSpeed = Math.max(Math.abs(belt.getBeltMovementSpeed()), 1 / 8f); - Vec3d outMotion = new Vec3d(belt.getBeltChainDirection()).scale(movementSpeed) + Vector3d outMotion = Vector3d.of(belt.getBeltChainDirection()).scale(movementSpeed) .add(0, 1 / 8f, 0); outPos.add(outMotion.normalize()); ItemEntity entity = new ItemEntity(belt.getWorld(), outPos.x, outPos.y + 6 / 16f, outPos.z, ejected); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltMovementHandler.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltMovementHandler.java index cbea2b1dc..c50da55a7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltMovementHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltMovementHandler.java @@ -26,8 +26,8 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.util.math.Vec3i; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.vector.Vector3i; import net.minecraft.world.World; public class BeltMovementHandler { @@ -104,9 +104,9 @@ public class BeltMovementHandler { float movementSpeed = beltTe.getBeltMovementSpeed(); final Direction movementDirection = Direction.getFacingFromAxis(axis == Axis.X ? NEGATIVE : POSITIVE, axis); - Vec3i centeringDirection = + Vector3i centeringDirection = Direction.getFacingFromAxis(POSITIVE, beltFacing.rotateY().getAxis()).getDirectionVec(); - Vec3d movement = new Vec3d(movementDirection.getDirectionVec()).scale(movementSpeed); + Vector3d movement = Vector3d.of(movementDirection.getDirectionVec()).scale(movementSpeed); double diffCenter = axis == Axis.Z ? (pos.getX() + .5f - entityIn.getX()) : (pos.getZ() + .5f - entityIn.getZ()); if (Math.abs(diffCenter) > 48 / 64f) @@ -132,7 +132,7 @@ public class BeltMovementHandler { if (movingDown) movement = movement.add(0, -Math.abs(axis.getCoordinate(movement.x, movement.y, movement.z)), 0); - Vec3d centering = new Vec3d(centeringDirection).scale(diffCenter * Math.min(Math.abs(movementSpeed), .1f) * 4); + Vector3d centering = Vector3d.of(centeringDirection).scale(diffCenter * Math.min(Math.abs(movementSpeed), .1f) * 4); movement = movement.add(centering); float step = entityIn.stepHeight; @@ -141,7 +141,7 @@ public class BeltMovementHandler { // Entity Collisions if (Math.abs(movementSpeed) < .5f) { - Vec3d checkDistance = movement.normalize().scale(0.5); + Vector3d checkDistance = movement.normalize().scale(0.5); AxisAlignedBB bb = entityIn.getBoundingBox(); AxisAlignedBB checkBB = new AxisAlignedBB(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ); checkBB = checkBB.offset(checkDistance).grow(-Math.abs(checkDistance.x), -Math.abs(checkDistance.y), @@ -160,7 +160,7 @@ public class BeltMovementHandler { if (movingUp) { float minVelocity = .13f; float yMovement = (float) -(Math.max(Math.abs(movement.y), minVelocity)); - entityIn.move(SELF, new Vec3d(0, yMovement, 0)); + entityIn.move(SELF, new Vector3d(0, yMovement, 0)); entityIn.move(SELF, movement.mul(1, 0, 1)); } else if (movingDown) { entityIn.move(SELF, movement.mul(1, 0, 1)); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/CogWheelBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/CogWheelBlock.java index e8d7e1310..ebc34a3fd 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/CogWheelBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/CogWheelBlock.java @@ -7,7 +7,7 @@ import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerB import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.fluid.Fluids; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; @@ -76,7 +76,7 @@ public class CogWheelBlock extends ShaftBlock { BlockState stateBelow = world.getBlockState(context.getPos() .down()); - IFluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); + FluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); if (AllBlocks.ROTATION_SPEED_CONTROLLER.has(stateBelow) && isLarge) { return this.getDefaultState().with(BlockStateProperties.WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER)) .with(AXIS, stateBelow.get(SpeedControllerBlock.HORIZONTAL_AXIS) == Axis.X ? Axis.Z : Axis.X); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/CogwheelBlockItem.java b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/CogwheelBlockItem.java index c468242d2..6eb38d9db 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/CogwheelBlockItem.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/CogwheelBlockItem.java @@ -14,7 +14,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; public class CogwheelBlockItem extends BlockItem { @@ -53,9 +53,9 @@ public class CogwheelBlockItem extends BlockItem { if (largeOnLarge) offsetAxis = placedOnState.get(CogWheelBlock.AXIS); - Vec3d hitVec = context.getHitVec().subtract(VecHelper.getCenterOf(placedOnPos)); + Vector3d hitVec = context.getHitVec().subtract(VecHelper.getCenterOf(placedOnPos)); hitVec = hitVec - .mul(new Vec3d(Direction.getFacingFromAxis(AxisDirection.POSITIVE, offsetAxis).getDirectionVec())); + .mul(Vector3d.of(Direction.getFacingFromAxis(AxisDirection.POSITIVE, offsetAxis).getDirectionVec())); BlockPos correctPos = context.getPos().add(Math.signum(hitVec.x), Math.signum(hitVec.y), Math.signum(hitVec.z)); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/ShaftBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/ShaftBlock.java index e13efbdd8..08cffc2eb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/ShaftBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/ShaftBlock.java @@ -10,7 +10,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.IWaterLoggable; import net.minecraft.block.material.PushReaction; import net.minecraft.fluid.Fluids; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; @@ -86,7 +86,7 @@ public class ShaftBlock extends RotatedPillarKineticBlock implements IWaterLogga } @Override - public IFluidState getFluidState(BlockState state) { + public FluidState getFluidState(BlockState state) { return state.get(BlockStateProperties.WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : Fluids.EMPTY.getDefaultState(); } @@ -107,7 +107,7 @@ public class ShaftBlock extends RotatedPillarKineticBlock implements IWaterLogga @Override public BlockState getStateForPlacement(BlockItemUseContext context) { - IFluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); + FluidState ifluidstate = context.getWorld().getFluidState(context.getPos()); return super.getStateForPlacement(context).with(BlockStateProperties.WATERLOGGED, Boolean.valueOf(ifluidstate.getFluid() == Fluids.WATER)); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedBeltBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedBeltBlock.java index 46d0891c0..e357f1c34 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedBeltBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedBeltBlock.java @@ -14,7 +14,7 @@ import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemUseContext; import net.minecraft.state.BooleanProperty; import net.minecraft.state.EnumProperty; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; @@ -28,7 +28,7 @@ import net.minecraft.world.IWorldReader; public class EncasedBeltBlock extends RotatedPillarKineticBlock { - public static final IProperty PART = EnumProperty.create("part", Part.class); + public static final Property PART = EnumProperty.create("part", Part.class); public static final BooleanProperty CONNECTED_ALONG_FIRST_COORDINATE = DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE; @@ -195,7 +195,7 @@ public class EncasedBeltBlock extends RotatedPillarKineticBlock { START, MIDDLE, END, NONE; @Override - public String getName() { + public String getString() { return Lang.asId(name()); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java index b9d4378f1..77cf273ff 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeBlock.java @@ -24,7 +24,7 @@ import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.IStringSerializable; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; @@ -39,7 +39,7 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { SPEED, STRESS; @Override - public String getName() { + public String getString() { return Lang.asId(name()); } } @@ -147,22 +147,22 @@ public class GaugeBlock extends DirectionalAxisKineticBlock { if (!shouldRenderHeadOnFace(worldIn, pos, stateIn, face)) continue; - Vec3d rgb = ColorHelper.getRGB(color); - Vec3d faceVec = new Vec3d(face.getDirectionVec()); + Vector3d rgb = ColorHelper.getRGB(color); + Vector3d faceVec = Vector3d.of(face.getDirectionVec()); Direction positiveFacing = Direction.getFacingFromAxis(AxisDirection.POSITIVE, face.getAxis()); - Vec3d positiveFaceVec = new Vec3d(positiveFacing.getDirectionVec()); + Vector3d positiveFaceVec = Vector3d.of(positiveFacing.getDirectionVec()); int particleCount = gaugeTE.dialTarget > 1 ? 4 : 1; if (particleCount == 1 && rand.nextFloat() > 1 / 4f) continue; for (int i = 0; i < particleCount; i++) { - Vec3d mul = VecHelper - .offsetRandomly(Vec3d.ZERO, rand, .25f) - .mul(new Vec3d(1, 1, 1).subtract(positiveFaceVec)) + Vector3d mul = VecHelper + .offsetRandomly(Vector3d.ZERO, rand, .25f) + .mul(new Vector3d(1, 1, 1).subtract(positiveFaceVec)) .normalize() .scale(.3f); - Vec3d offset = VecHelper.getCenterOf(pos).add(faceVec.scale(.55)).add(mul); + Vector3d offset = VecHelper.getCenterOf(pos).add(faceVec.scale(.55)).add(mul); worldIn .addParticle(new RedstoneParticleData((float) rgb.x, (float) rgb.y, (float) rgb.z, 1), offset.x, offset.y, offset.z, mul.x, mul.y, mul.z); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeShaper.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeShaper.java index 0c3fb8568..cdab69a68 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeShaper.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeShaper.java @@ -6,7 +6,7 @@ import com.simibubi.create.AllShapes; import com.simibubi.create.foundation.utility.VoxelShaper; import net.minecraft.util.Direction; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.VoxelShape; public class GaugeShaper extends VoxelShaper { @@ -16,7 +16,7 @@ public class GaugeShaper extends VoxelShaper { static GaugeShaper make(){ GaugeShaper shaper = new GaugeShaper(); shaper.axisFalse = forDirectional(AllShapes.GAUGE_SHAPE_UP, Direction.UP); - shaper.axisTrue = forDirectional(rotatedCopy(AllShapes.GAUGE_SHAPE_UP, new Vec3d(0, 90, 0)), Direction.UP); + shaper.axisTrue = forDirectional(rotatedCopy(AllShapes.GAUGE_SHAPE_UP, new Vector3d(0, 90, 0)), Direction.UP); //shapes for X axis need to be swapped Arrays.asList(Direction.EAST, Direction.WEST).forEach(direction -> { VoxelShape mem = shaper.axisFalse.get(direction); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxBlock.java index 1edffcf63..d024e2808 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxBlock.java @@ -21,7 +21,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; -import net.minecraft.world.storage.loot.LootContext.Builder; +import net.minecraft.loot.LootContext.Builder; public class GearboxBlock extends RotatedPillarKineticBlock { diff --git a/src/main/java/com/simibubi/create/content/contraptions/wrench/WrenchItemRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/wrench/WrenchItemRenderer.java index 6bd89f42a..731d39ef4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/wrench/WrenchItemRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/wrench/WrenchItemRenderer.java @@ -6,7 +6,7 @@ import com.simibubi.create.foundation.item.PartialItemModelRenderer; import com.simibubi.create.foundation.utility.AnimationTickHolder; import net.minecraft.client.renderer.IRenderTypeBuffer; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.item.ItemStack; public class WrenchItemRenderer extends CustomRenderedItemModelRenderer { diff --git a/src/main/java/com/simibubi/create/content/curiosities/ChromaticCompoundItem.java b/src/main/java/com/simibubi/create/content/curiosities/ChromaticCompoundItem.java index ae5687f98..20a694ae6 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/ChromaticCompoundItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/ChromaticCompoundItem.java @@ -26,7 +26,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceContext; import net.minecraft.util.math.RayTraceContext.BlockMode; import net.minecraft.util.math.RayTraceContext.FluidMode; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; public class ChromaticCompoundItem extends Item { @@ -73,13 +73,13 @@ public class ChromaticCompoundItem extends Item { CompoundNBT itemData = entity.getItem() .getOrCreateTag(); - Vec3d positionVec = entity.getPositionVec(); + Vector3d positionVec = entity.getPositionVec(); CCuriosities config = AllConfigs.SERVER.curiosities; if (world.isRemote) { int light = itemData.getInt("CollectingLight"); if (random.nextInt(config.lightSourceCountForRefinedRadiance.get() + 20) < light) { - Vec3d start = VecHelper.offsetRandomly(positionVec, random, 3); - Vec3d motion = positionVec.subtract(start) + Vector3d start = VecHelper.offsetRandomly(positionVec, random, 3); + Vector3d motion = positionVec.subtract(start) .normalize() .scale(.2f); world.addParticle(ParticleTypes.END_ROD, start.x, start.y, start.z, motion.x, motion.y, motion.z); diff --git a/src/main/java/com/simibubi/create/content/curiosities/RefinedRadianceItem.java b/src/main/java/com/simibubi/create/content/curiosities/RefinedRadianceItem.java index 32b5a6e98..25a38db43 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/RefinedRadianceItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/RefinedRadianceItem.java @@ -7,7 +7,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.particles.ParticleTypes; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; public class RefinedRadianceItem extends Item { @@ -24,19 +24,19 @@ public class RefinedRadianceItem extends Item { @Override public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) { World world = entity.world; - Vec3d pos = entity.getPositionVec(); + Vector3d pos = entity.getPositionVec(); if (world.isRemote && entity.hasNoGravity()) { if (world.rand.nextFloat() < MathHelper.clamp(entity.getItem().getCount() - 10, 1, 100) / 64f) { - Vec3d ppos = VecHelper.offsetRandomly(pos, world.rand, .5f); + Vector3d ppos = VecHelper.offsetRandomly(pos, world.rand, .5f); world.addParticle(ParticleTypes.END_ROD, ppos.x, pos.y, ppos.z, 0, -.1f, 0); } if (!entity.getPersistentData().contains("ClientAnimationPlayed")) { - Vec3d basemotion = new Vec3d(0, 1, 0); + Vector3d basemotion = new Vector3d(0, 1, 0); world.addParticle(ParticleTypes.FLASH, pos.x, pos.y, pos.z, 0, 0, 0); for (int i = 0; i < 20; i++) { - Vec3d motion = VecHelper.offsetRandomly(basemotion, world.rand, 1); + Vector3d motion = VecHelper.offsetRandomly(basemotion, world.rand, 1); world.addParticle(ParticleTypes.WITCH, pos.x, pos.y, pos.z, motion.x, motion.y, motion.z); world.addParticle(ParticleTypes.END_ROD, pos.x, pos.y, pos.z, motion.x, motion.y, motion.z); } diff --git a/src/main/java/com/simibubi/create/content/curiosities/ShadowSteelItem.java b/src/main/java/com/simibubi/create/content/curiosities/ShadowSteelItem.java index 5508f5e1d..af71309fa 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/ShadowSteelItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/ShadowSteelItem.java @@ -7,7 +7,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.particles.ParticleTypes; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; public class ShadowSteelItem extends Item { @@ -19,20 +19,20 @@ public class ShadowSteelItem extends Item { @Override public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) { World world = entity.world; - Vec3d pos = entity.getPositionVec(); + Vector3d pos = entity.getPositionVec(); if (world.isRemote && entity.hasNoGravity()) { if (world.rand.nextFloat() < MathHelper.clamp(entity.getItem().getCount() - 10, Math.min(entity.getMotion().y * 20, 20), 100) / 64f) { - Vec3d ppos = VecHelper.offsetRandomly(pos, world.rand, .5f); + Vector3d ppos = VecHelper.offsetRandomly(pos, world.rand, .5f); world.addParticle(ParticleTypes.END_ROD, ppos.x, pos.y, ppos.z, 0, -.1f, 0); } if (!entity.getPersistentData().contains("ClientAnimationPlayed")) { - Vec3d basemotion = new Vec3d(0, 1, 0); + Vector3d basemotion = new Vector3d(0, 1, 0); world.addParticle(ParticleTypes.FLASH, pos.x, pos.y, pos.z, 0, 0, 0); for (int i = 0; i < 20; i++) { - Vec3d motion = VecHelper.offsetRandomly(basemotion, world.rand, 1); + Vector3d motion = VecHelper.offsetRandomly(basemotion, world.rand, 1); world.addParticle(ParticleTypes.WITCH, pos.x, pos.y, pos.z, motion.x, motion.y, motion.z); world.addParticle(ParticleTypes.END_ROD, pos.x, pos.y, pos.z, motion.x, motion.y, motion.z); } diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryEffectPacket.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryEffectPacket.java index 55b3c1138..764f8ab37 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryEffectPacket.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryEffectPacket.java @@ -9,7 +9,7 @@ import com.simibubi.create.foundation.networking.SimplePacketBase; import net.minecraft.client.Minecraft; import net.minecraft.network.PacketBuffer; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.network.NetworkEvent.Context; @@ -43,7 +43,7 @@ public class SymmetryEffectPacket extends SimplePacketBase { public void handle(Supplier ctx) { ctx.get().enqueueWork(() -> DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> { - if (Minecraft.getInstance().player.getPositionVector().distanceTo(new Vec3d(mirror)) > 100) + if (Minecraft.getInstance().player.getPositionVector().distanceTo(Vector3d.of(mirror)) > 100) return; for (BlockPos to : positions) SymmetryHandler.drawEffect(mirror, to); diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryHandler.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryHandler.java index f3efe5f37..2c5e1f875 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryHandler.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryHandler.java @@ -25,7 +25,7 @@ import net.minecraft.particles.ParticleTypes; import net.minecraft.particles.RedstoneParticleData; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.event.RenderWorldLastEvent; @@ -107,7 +107,7 @@ public class SymmetryHandler { .getBufferBuilders() .getEntityVertexConsumers(); ActiveRenderInfo info = mc.gameRenderer.getActiveRenderInfo(); - Vec3d view = info.getProjectedView(); + Vector3d view = info.getProjectedView(); MatrixStack ms = event.getMatrixStack(); ms.push(); @@ -164,9 +164,9 @@ public class SymmetryHandler { double offsetX = (r.nextDouble() - 0.5) * 0.3; double offsetZ = (r.nextDouble() - 0.5) * 0.3; - Vec3d pos = mirror.getPosition() + Vector3d pos = mirror.getPosition() .add(0.5 + offsetX, 1 / 4d, 0.5 + offsetZ); - Vec3d speed = new Vec3d(0, r.nextDouble() * 1 / 8f, 0); + Vector3d speed = new Vector3d(0, r.nextDouble() * 1 / 8f, 0); mc.world.addParticle(ParticleTypes.END_ROD, pos.x, pos.y, pos.z, speed.x, speed.y, speed.z); } } @@ -176,29 +176,29 @@ public class SymmetryHandler { public static void drawEffect(BlockPos from, BlockPos to) { double density = 0.8f; - Vec3d start = new Vec3d(from).add(0.5, 0.5, 0.5); - Vec3d end = new Vec3d(to).add(0.5, 0.5, 0.5); - Vec3d diff = end.subtract(start); + Vector3d start = Vector3d.of(from).add(0.5, 0.5, 0.5); + Vector3d end = Vector3d.of(to).add(0.5, 0.5, 0.5); + Vector3d diff = end.subtract(start); - Vec3d step = diff.normalize() + Vector3d step = diff.normalize() .scale(density); int steps = (int) (diff.length() / step.length()); Random r = new Random(); for (int i = 3; i < steps - 1; i++) { - Vec3d pos = start.add(step.scale(i)); - Vec3d speed = new Vec3d(0, r.nextDouble() * -40f, 0); + Vector3d pos = start.add(step.scale(i)); + Vector3d speed = new Vector3d(0, r.nextDouble() * -40f, 0); Minecraft.getInstance().world.addParticle(new RedstoneParticleData(1, 1, 1, 1), pos.x, pos.y, pos.z, speed.x, speed.y, speed.z); } - Vec3d speed = new Vec3d(0, r.nextDouble() * 1 / 32f, 0); - Vec3d pos = start.add(step.scale(2)); + Vector3d speed = new Vector3d(0, r.nextDouble() * 1 / 32f, 0); + Vector3d pos = start.add(step.scale(2)); Minecraft.getInstance().world.addParticle(ParticleTypes.END_ROD, pos.x, pos.y, pos.z, speed.x, speed.y, speed.z); - speed = new Vec3d(0, r.nextDouble() * 1 / 32f, 0); + speed = new Vector3d(0, r.nextDouble() * 1 / 32f, 0); pos = start.add(step.scale(steps)); Minecraft.getInstance().world.addParticle(ParticleTypes.END_ROD, pos.x, pos.y, pos.z, speed.x, speed.y, speed.z); diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java index 5ee1ba62a..f450b272f 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java @@ -30,7 +30,7 @@ import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; @@ -85,7 +85,7 @@ public class SymmetryWandItem extends Item { // No Shift -> Make / Move Mirror wand.getTag() .putBoolean(ENABLE, true); - Vec3d pos3d = new Vec3d(pos.getX(), pos.getY(), pos.getZ()); + Vector3d pos3d = new Vector3d(pos.getX(), pos.getY(), pos.getZ()); SymmetryMirror newElement = new PlaneMirror(pos3d); if (previousElement instanceof EmptyMirror) { @@ -159,7 +159,7 @@ public class SymmetryWandItem extends Item { .contains(SYMMETRY)) { wand.setTag(new CompoundNBT()); wand.getTag() - .put(SYMMETRY, new EmptyMirror(new Vec3d(0, 0, 0)).writeToNbt()); + .put(SYMMETRY, new EmptyMirror(new Vector3d(0, 0, 0)).writeToNbt()); wand.getTag() .putBoolean(ENABLE, false); } @@ -189,8 +189,8 @@ public class SymmetryWandItem extends Item { SymmetryMirror symmetry = SymmetryMirror.fromNBT((CompoundNBT) wand.getTag() .getCompound(SYMMETRY)); - Vec3d mirrorPos = symmetry.getPosition(); - if (mirrorPos.distanceTo(new Vec3d(pos)) > AllConfigs.SERVER.curiosities.maxSymmetryWandRange.get()) + Vector3d mirrorPos = symmetry.getPosition(); + if (mirrorPos.distanceTo(Vector3d.of(pos)) > AllConfigs.SERVER.curiosities.maxSymmetryWandRange.get()) return; if (!player.isCreative() && isHoldingBlock(player, block) && BlockHelper.findAndRemoveInInventory(block, player, 1) == 0) @@ -255,8 +255,8 @@ public class SymmetryWandItem extends Item { SymmetryMirror symmetry = SymmetryMirror.fromNBT((CompoundNBT) wand.getTag() .getCompound(SYMMETRY)); - Vec3d mirrorPos = symmetry.getPosition(); - if (mirrorPos.distanceTo(new Vec3d(pos)) > AllConfigs.SERVER.curiosities.maxSymmetryWandRange.get()) + Vector3d mirrorPos = symmetry.getPosition(); + if (mirrorPos.distanceTo(Vector3d.of(pos)) > AllConfigs.SERVER.curiosities.maxSymmetryWandRange.get()) return; symmetry.process(blockSet); diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java index 0a09edd4b..04916432c 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandScreen.java @@ -17,11 +17,11 @@ import com.simibubi.create.foundation.networking.AllPackets; import com.simibubi.create.foundation.networking.NbtPacket; import com.simibubi.create.foundation.utility.Lang; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.Hand; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.fml.network.PacketDistributor; public class SymmetryWandScreen extends AbstractSimiScreen { @@ -43,7 +43,7 @@ public class SymmetryWandScreen extends AbstractSimiScreen { currentElement = SymmetryWandItem.getMirror(wand); if (currentElement instanceof EmptyMirror) { - currentElement = new PlaneMirror(Vec3d.ZERO); + currentElement = new PlaneMirror(Vector3d.ZERO); } this.hand = hand; this.wand = wand; diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/client/SymmetryWandItemRenderer.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/client/SymmetryWandItemRenderer.java index 74fc534da..745cbd369 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/client/SymmetryWandItemRenderer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/client/SymmetryWandItemRenderer.java @@ -6,7 +6,7 @@ import com.simibubi.create.foundation.item.PartialItemModelRenderer; import com.simibubi.create.foundation.utility.AnimationTickHolder; import net.minecraft.client.renderer.IRenderTypeBuffer; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.item.ItemStack; import net.minecraft.util.math.MathHelper; diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/CrossPlaneMirror.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/CrossPlaneMirror.java index fb1af8ad7..88ac57745 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/CrossPlaneMirror.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/CrossPlaneMirror.java @@ -13,7 +13,7 @@ import com.simibubi.create.foundation.utility.MatrixStacker; import net.minecraft.block.BlockState; import net.minecraft.util.IStringSerializable; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class CrossPlaneMirror extends SymmetryMirror { @@ -27,7 +27,7 @@ public class CrossPlaneMirror extends SymmetryMirror { } @Override - public String getName() { + public String getString() { return name; } @@ -37,7 +37,7 @@ public class CrossPlaneMirror extends SymmetryMirror { } } - public CrossPlaneMirror(Vec3d pos) { + public CrossPlaneMirror(Vector3d pos) { super(pos); orientation = Align.Y; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/EmptyMirror.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/EmptyMirror.java index 9a9db2f92..65f3546c4 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/EmptyMirror.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/EmptyMirror.java @@ -10,7 +10,7 @@ import com.simibubi.create.AllBlockPartials; import net.minecraft.block.BlockState; import net.minecraft.util.IStringSerializable; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class EmptyMirror extends SymmetryMirror { @@ -19,11 +19,11 @@ public class EmptyMirror extends SymmetryMirror { private final String name; private Align(String name) { this.name = name; } - @Override public String getName() { return name; } + @Override public String getString() { return name; } @Override public String toString() { return name; } } - public EmptyMirror(Vec3d pos) { + public EmptyMirror(Vector3d pos) { super(pos); orientation = Align.None; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/PlaneMirror.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/PlaneMirror.java index 5f23ba763..5b409f2bc 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/PlaneMirror.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/PlaneMirror.java @@ -13,7 +13,7 @@ import com.simibubi.create.foundation.utility.MatrixStacker; import net.minecraft.block.BlockState; import net.minecraft.util.IStringSerializable; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class PlaneMirror extends SymmetryMirror { @@ -27,7 +27,7 @@ public class PlaneMirror extends SymmetryMirror { } @Override - public String getName() { + public String getString() { return name; } @@ -37,7 +37,7 @@ public class PlaneMirror extends SymmetryMirror { } } - public PlaneMirror(Vec3d pos) { + public PlaneMirror(Vector3d pos) { super(pos); orientation = Align.XY; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java index 1eb65dc91..00e899fa9 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java @@ -14,14 +14,14 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.FloatNBT; import net.minecraft.nbt.ListNBT; import net.minecraft.state.DirectionProperty; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.Direction; import net.minecraft.util.IStringSerializable; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public abstract class SymmetryMirror { @@ -30,12 +30,12 @@ public abstract class SymmetryMirror { public static final String CROSS_PLANE = "cross_plane"; public static final String TRIPLE_PLANE = "triple_plane"; - protected Vec3d position; + protected Vector3d position; protected IStringSerializable orientation; protected int orientationIndex; public boolean enable; - public SymmetryMirror(Vec3d pos) { + public SymmetryMirror(Vector3d pos) { position = pos; enable = true; orientationIndex = 0; @@ -50,7 +50,7 @@ public abstract class SymmetryMirror { return orientation; } - public Vec3d getPosition() { + public Vector3d getPosition() { return position; } @@ -105,7 +105,7 @@ public abstract class SymmetryMirror { public static SymmetryMirror fromNBT(CompoundNBT nbt) { ListNBT floatList = nbt.getList($POSITION, 5); - Vec3d pos = new Vec3d(floatList.getFloat(0), floatList.getFloat(1), floatList.getFloat(2)); + Vector3d pos = new Vector3d(floatList.getFloat(0), floatList.getFloat(1), floatList.getFloat(2)); SymmetryMirror element; switch (nbt.getString($TYPE)) { @@ -129,13 +129,13 @@ public abstract class SymmetryMirror { return element; } - protected Vec3d getDiff(BlockPos position) { + protected Vector3d getDiff(BlockPos position) { return this.position.scale(-1) .add(position.getX(), position.getY(), position.getZ()); } protected BlockPos getIDiff(BlockPos position) { - Vec3d diff = getDiff(position); + Vector3d diff = getDiff(position); return new BlockPos((int) diff.x, (int) diff.y, (int) diff.z); } @@ -144,7 +144,7 @@ public abstract class SymmetryMirror { } protected BlockState flipY(BlockState in) { - for (IProperty property : in.getProperties()) { + for (Property property : in.getProperties()) { if (property == BlockStateProperties.HALF) return in.cycle(property); @@ -201,7 +201,7 @@ public abstract class SymmetryMirror { position.getZ() - diff.getZ() - diff.getX()); } - public void setPosition(Vec3d pos3d) { + public void setPosition(Vector3d pos3d) { this.position = pos3d; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/TriplePlaneMirror.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/TriplePlaneMirror.java index fc8ab7cc0..e152974b5 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/TriplePlaneMirror.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/TriplePlaneMirror.java @@ -11,11 +11,11 @@ import com.simibubi.create.foundation.utility.Lang; import net.minecraft.block.BlockState; import net.minecraft.util.IStringSerializable; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class TriplePlaneMirror extends SymmetryMirror { - public TriplePlaneMirror(Vec3d pos) { + public TriplePlaneMirror(Vector3d pos) { super(pos); orientationIndex = 0; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/DeforesterItem.java b/src/main/java/com/simibubi/create/content/curiosities/tools/DeforesterItem.java index da83b5d1e..ab33f1689 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/DeforesterItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/DeforesterItem.java @@ -14,7 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tags.BlockTags; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IWorld; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent; @@ -42,7 +42,7 @@ public class DeforesterItem extends AxeItem { if (world == null) return; - Vec3d vec = player.getLookVec(); + Vector3d vec = player.getLookVec(); for (BlockPos log : tree.logs) BlockHelper.destroyBlock(world, log, 1 / 2f, item -> { if (dropBlock) { @@ -65,10 +65,10 @@ public class DeforesterItem extends AxeItem { destroyTree(heldItemMainhand, event.getWorld(), event.getState(), event.getPos(), event.getPlayer()); } - public static void dropItemFromCutTree(World world, BlockPos breakingPos, Vec3d fallDirection, BlockPos pos, + public static void dropItemFromCutTree(World world, BlockPos breakingPos, Vector3d fallDirection, BlockPos pos, ItemStack stack) { float distance = (float) Math.sqrt(pos.distanceSq(breakingPos)); - Vec3d dropPos = VecHelper.getCenterOf(pos); + Vector3d dropPos = VecHelper.getCenterOf(pos); ItemEntity entity = new ItemEntity(world, dropPos.x, dropPos.y, dropPos.z, stack); entity.setMotion(fallDirection.scale(distance / 20f)); world.addEntity(entity); diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/DeforesterItemRenderer.java b/src/main/java/com/simibubi/create/content/curiosities/tools/DeforesterItemRenderer.java index 3d3fc9fef..7267c3c65 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/DeforesterItemRenderer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/DeforesterItemRenderer.java @@ -6,7 +6,7 @@ import com.simibubi.create.foundation.item.PartialItemModelRenderer; import com.simibubi.create.foundation.utility.AnimationTickHolder; import net.minecraft.client.renderer.IRenderTypeBuffer; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.item.ItemStack; public class DeforesterItemRenderer extends CustomRenderedItemModelRenderer { diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripInteractionPacket.java b/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripInteractionPacket.java index 63739b632..f61f016ec 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripInteractionPacket.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripInteractionPacket.java @@ -8,14 +8,14 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.network.PacketBuffer; import net.minecraft.util.Hand; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.fml.network.NetworkEvent.Context; public class ExtendoGripInteractionPacket extends SimplePacketBase { private Hand interactionHand; private int target; - private Vec3d specificPoint; + private Vector3d specificPoint; public ExtendoGripInteractionPacket(Entity target) { this(target, null); @@ -25,7 +25,7 @@ public class ExtendoGripInteractionPacket extends SimplePacketBase { this(target, hand, null); } - public ExtendoGripInteractionPacket(Entity target, Hand hand, Vec3d specificPoint) { + public ExtendoGripInteractionPacket(Entity target, Hand hand, Vector3d specificPoint) { interactionHand = hand; this.specificPoint = specificPoint; this.target = target.getEntityId(); @@ -36,7 +36,7 @@ public class ExtendoGripInteractionPacket extends SimplePacketBase { int handId = buffer.readInt(); interactionHand = handId == -1 ? null : Hand.values()[handId]; if (buffer.readBoolean()) - specificPoint = new Vec3d(buffer.readDouble(), buffer.readDouble(), buffer.readDouble()); + specificPoint = new Vector3d(buffer.readDouble(), buffer.readDouble(), buffer.readDouble()); } @Override diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java b/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java index 324390eba..92165ed8d 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java @@ -25,7 +25,7 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.EntityRayTraceResult; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult.Type; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.event.InputEvent.ClickInputEvent; @@ -125,9 +125,9 @@ public class ExtendoGripItem extends Item { .getValue(); if (!player.isCreative()) d0 -= 0.5f; - Vec3d vec3d = player.getEyePosition(mc.getRenderPartialTicks()); - Vec3d vec3d1 = player.getLook(1.0F); - Vec3d vec3d2 = vec3d.add(vec3d1.x * d0, vec3d1.y * d0, vec3d1.z * d0); + Vector3d vec3d = player.getEyePosition(mc.getRenderPartialTicks()); + Vector3d vec3d1 = player.getLook(1.0F); + Vector3d vec3d2 = vec3d.add(vec3d1.x * d0, vec3d1.y * d0, vec3d1.z * d0); AxisAlignedBB axisalignedbb = player.getBoundingBox() .expand(vec3d1.scale(d0)) .grow(1.0D, 1.0D, 1.0D); @@ -137,7 +137,7 @@ public class ExtendoGripItem extends Item { }, d0 * d0); if (entityraytraceresult != null) { Entity entity1 = entityraytraceresult.getEntity(); - Vec3d vec3d3 = entityraytraceresult.getHitVec(); + Vector3d vec3d3 = entityraytraceresult.getHitVec(); double d2 = vec3d.squareDistanceTo(vec3d3); if (d2 < d0 * d0 || mc.objectMouseOver == null || mc.objectMouseOver.getType() == Type.MISS) { mc.objectMouseOver = entityraytraceresult; diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItemRenderer.java b/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItemRenderer.java index 3788d6000..2ad10edab 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItemRenderer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItemRenderer.java @@ -12,12 +12,12 @@ import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; import net.minecraft.item.ItemStack; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class ExtendoGripItemRenderer extends CustomRenderedItemModelRenderer { - private static final Vec3d rotationOffset = new Vec3d(0, 1 / 2f, 1 / 2f); - private static final Vec3d cogRotationOffset = new Vec3d(0, 1 / 16f, 0); + private static final Vector3d rotationOffset = new Vector3d(0, 1 / 2f, 1 / 2f); + private static final Vector3d cogRotationOffset = new Vector3d(0, 1 / 16f, 0); @Override protected void render(ItemStack stack, ExtendoGripModel model, PartialItemModelRenderer renderer, MatrixStack ms, diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItem.java b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItem.java index d06c16b4c..e2009bc4c 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItem.java @@ -21,7 +21,7 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceContext; import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; @@ -72,7 +72,7 @@ public class SandPaperItem extends Item { if (!(raytraceresult instanceof BlockRayTraceResult)) return FAIL; BlockRayTraceResult ray = (BlockRayTraceResult) raytraceresult; - Vec3d hitVec = ray.getHitVec(); + Vector3d hitVec = ray.getHitVec(); AxisAlignedBB bb = new AxisAlignedBB(hitVec, hitVec).grow(1f); ItemEntity pickUp = null; @@ -151,9 +151,9 @@ public class SandPaperItem extends Item { return stack; } - public static void spawnParticles(Vec3d location, ItemStack polishedStack, World world) { + public static void spawnParticles(Vector3d location, ItemStack polishedStack, World world) { for (int i = 0; i < 20; i++) { - Vec3d motion = VecHelper.offsetRandomly(Vec3d.ZERO, world.rand, 1 / 8f); + Vector3d motion = VecHelper.offsetRandomly(Vector3d.ZERO, world.rand, 1 / 8f); world.addParticle(new ItemParticleData(ParticleTypes.ITEM, polishedStack), location.x, location.y, location.z, motion.x, motion.y, motion.z); } diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItemRenderer.java b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItemRenderer.java index 78b741a2b..4614b19f7 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItemRenderer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItemRenderer.java @@ -9,7 +9,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.ClientPlayerEntity; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java index c2a752b41..f5b924abf 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java @@ -8,7 +8,7 @@ import com.simibubi.create.content.curiosities.tools.SandPaperPolishingRecipe.Sa import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.wrapper.RecipeWrapper; @@ -28,7 +28,7 @@ public class SandPaperPolishingRecipe extends ProcessingRecipe { return !getMatchingRecipes(world, stack).isEmpty(); } - public static ItemStack applyPolish(World world, Vec3d position, ItemStack stack, ItemStack sandPaperStack) { + public static ItemStack applyPolish(World world, Vector3d position, ItemStack stack, ItemStack sandPaperStack) { List> matchingRecipes = getMatchingRecipes(world, stack); if (!matchingRecipes.isEmpty()) return matchingRecipes.get(0) diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperBeamPacket.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperBeamPacket.java index 3fc30e373..3e45bdd04 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperBeamPacket.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperBeamPacket.java @@ -9,19 +9,19 @@ import net.minecraft.client.Minecraft; import net.minecraft.network.PacketBuffer; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.network.NetworkEvent.Context; public class ZapperBeamPacket extends SimplePacketBase { - public Vec3d start; - public Vec3d target; + public Vector3d start; + public Vector3d target; public Hand hand; public boolean self; - public ZapperBeamPacket(Vec3d start, Vec3d target, Hand hand, boolean self) { + public ZapperBeamPacket(Vector3d start, Vector3d target, Hand hand, boolean self) { this.start = start; this.target = target; this.hand = hand; @@ -29,8 +29,8 @@ public class ZapperBeamPacket extends SimplePacketBase { } public ZapperBeamPacket(PacketBuffer buffer) { - start = new Vec3d(buffer.readDouble(), buffer.readDouble(), buffer.readDouble()); - target = new Vec3d(buffer.readDouble(), buffer.readDouble(), buffer.readDouble()); + start = new Vector3d(buffer.readDouble(), buffer.readDouble(), buffer.readDouble()); + target = new Vector3d(buffer.readDouble(), buffer.readDouble(), buffer.readDouble()); hand = buffer.readBoolean()? Hand.MAIN_HAND : Hand.OFF_HAND; self = buffer.readBoolean(); } diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperInteractionHandler.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperInteractionHandler.java index ccc010a83..729876ac3 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperInteractionHandler.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperInteractionHandler.java @@ -20,7 +20,7 @@ import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceContext; import net.minecraft.util.math.RayTraceContext.BlockMode; import net.minecraft.util.math.RayTraceContext.FluidMode; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -52,9 +52,9 @@ public class ZapperInteractionHandler { if (player.isSneaking()) return false; - Vec3d start = player.getPositionVec() + Vector3d start = player.getPositionVec() .add(0, player.getEyeHeight(), 0); - Vec3d range = player.getLookVec() + Vector3d range = player.getLookVec() .scale(getRange(stack)); BlockRayTraceResult raytrace = player.world .rayTraceBlocks(new RayTraceContext(start, start.add(range), BlockMode.OUTLINE, FluidMode.NONE, player)); diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java index 952e42022..51ba4e83d 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java @@ -30,7 +30,7 @@ import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceContext; import net.minecraft.util.math.RayTraceContext.BlockMode; import net.minecraft.util.math.RayTraceContext.FluidMode; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; @@ -149,9 +149,9 @@ public abstract class ZapperItem extends Item { stateToUse = NBTUtil.readBlockState(nbt.getCompound("BlockUsed")); // Raytrace - Find the target - Vec3d start = player.getPositionVec() + Vector3d start = player.getPositionVec() .add(0, player.getEyeHeight(), 0); - Vec3d range = player.getLookVec() + Vector3d range = player.getLookVec() .scale(getZappingRange(item)); BlockRayTraceResult raytrace = world .rayTraceBlocks(new RayTraceContext(start, start.add(range), BlockMode.OUTLINE, FluidMode.NONE, player)); @@ -167,9 +167,9 @@ public abstract class ZapperItem extends Item { // Find exact position of gun barrel for VFX float yaw = (float) ((player.rotationYaw) / -180 * Math.PI); float pitch = (float) ((player.rotationPitch) / -180 * Math.PI); - Vec3d barrelPosNoTransform = - new Vec3d(mainHand == (player.getPrimaryHand() == HandSide.RIGHT) ? -.35f : .35f, -0.1f, 1); - Vec3d barrelPos = start.add(barrelPosNoTransform.rotatePitch(pitch) + Vector3d barrelPosNoTransform = + new Vector3d(mainHand == (player.getPrimaryHand() == HandSide.RIGHT) ? -.35f : .35f, -0.1f, 1); + Vector3d barrelPos = start.add(barrelPosNoTransform.rotatePitch(pitch) .rotateYaw(yaw)); // Client side diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperRenderHandler.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperRenderHandler.java index 1093c1be4..6f62dab8b 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperRenderHandler.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperRenderHandler.java @@ -13,7 +13,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.AbstractClientPlayerEntity; import net.minecraft.client.entity.player.ClientPlayerEntity; import net.minecraft.client.renderer.FirstPersonRenderer; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.client.renderer.entity.PlayerRenderer; import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.client.world.ClientWorld; @@ -24,7 +24,7 @@ import net.minecraft.util.HandSide; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.RenderHandEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -44,12 +44,12 @@ public class ZapperRenderHandler { public static class LaserBeam { float itensity; - Vec3d start; - Vec3d end; + Vector3d start; + Vector3d end; boolean follow; boolean mainHand; - public LaserBeam(Vec3d start, Vec3d end) { + public LaserBeam(Vector3d start, Vector3d end) { this.start = start; this.end = end; itensity = 1; @@ -62,7 +62,7 @@ public class ZapperRenderHandler { } } - public static Vec3d getExactBarrelPos(boolean mainHand) { + public static Vector3d getExactBarrelPos(boolean mainHand) { float partialTicks = Minecraft.getInstance() .getRenderPartialTicks(); ClientPlayerEntity player = Minecraft.getInstance().player; @@ -70,8 +70,8 @@ public class ZapperRenderHandler { float pitch = (float) ((player.getPitch(partialTicks)) / -180 * Math.PI); boolean rightHand = mainHand == (player.getPrimaryHand() == HandSide.RIGHT); float zOffset = ((float) Minecraft.getInstance().gameSettings.fov - 70) / -100; - Vec3d barrelPosNoTransform = new Vec3d(rightHand ? -.35f : .35f, -0.115f, .75f + zOffset); - Vec3d barrelPos = player.getEyePosition(partialTicks) + Vector3d barrelPosNoTransform = new Vector3d(rightHand ? -.35f : .35f, -0.115f, .75f + zOffset); + Vector3d barrelPos = player.getEyePosition(partialTicks) .add(barrelPosNoTransform.rotatePitch(pitch) .rotateYaw(yaw)); return barrelPos; diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItem.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItem.java index b06e9864f..0d980fdc9 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItem.java @@ -26,7 +26,7 @@ import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; @@ -38,7 +38,7 @@ import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceContext; import net.minecraft.util.math.RayTraceContext.BlockMode; import net.minecraft.util.math.RayTraceContext.FluidMode; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; @@ -123,7 +123,7 @@ public class BlockzapperItem extends ZapperItem { world.getBlockState(placed.offset(updateDirection)), world, placed, placed.offset(updateDirection)); BlockSnapshot blocksnapshot = BlockSnapshot.getBlockSnapshot(world, placed); - IFluidState ifluidstate = world.getFluidState(placed); + FluidState ifluidstate = world.getFluidState(placed); world.setBlockState(placed, ifluidstate.getBlockState(), 18); world.setBlockState(placed, selectedState); if (ForgeEventFactory.onBlockPlace(player, blocksnapshot, Direction.UP)) { @@ -187,9 +187,9 @@ public class BlockzapperItem extends ZapperItem { Set visited = new HashSet<>(); List frontier = new LinkedList<>(); - Vec3d start = player.getPositionVec() + Vector3d start = player.getPositionVec() .add(0, player.getEyeHeight(), 0); - Vec3d range = player.getLookVec() + Vector3d range = player.getLookVec() .scale(ZapperInteractionHandler.getRange(stack)); BlockRayTraceResult raytrace = player.world .rayTraceBlocks(new RayTraceContext(start, start.add(range), BlockMode.COLLIDER, FluidMode.NONE, player)); diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItemRenderer.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItemRenderer.java index 3f05fca7f..0b39d9c64 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItemRenderer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItemRenderer.java @@ -19,7 +19,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.ClientPlayerEntity; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.LightTexture; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.item.ItemStack; import net.minecraft.util.HandSide; diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/Brush.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/Brush.java index 255e36ea5..d44399076 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/Brush.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/Brush.java @@ -6,7 +6,7 @@ import com.simibubi.create.foundation.utility.Lang; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public abstract class Brush { @@ -42,7 +42,7 @@ public abstract class Brush { return paramIndex == 0 ? param0 : paramIndex == 1 ? param1 : param2; } - public BlockPos getOffset(Vec3d ray, Direction face, PlacementOptions option) { + public BlockPos getOffset(Vector3d ray, Direction face, PlacementOptions option) { return BlockPos.ZERO; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/CuboidBrush.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/CuboidBrush.java index d9ee56215..67e0f82c3 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/CuboidBrush.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/CuboidBrush.java @@ -7,7 +7,7 @@ import java.util.stream.Collectors; import net.minecraft.util.Direction; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class CuboidBrush extends Brush { @@ -44,7 +44,7 @@ public class CuboidBrush extends Brush { } @Override - public BlockPos getOffset(Vec3d ray, Direction face, PlacementOptions option) { + public BlockPos getOffset(Vector3d ray, Direction face, PlacementOptions option) { if (option == PlacementOptions.Merged) return BlockPos.ZERO; diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/CylinderBrush.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/CylinderBrush.java index 75c5a4192..3cfeb9137 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/CylinderBrush.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/CylinderBrush.java @@ -14,7 +14,7 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.util.Direction; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class CylinderBrush extends Brush { @@ -47,7 +47,7 @@ public class CylinderBrush extends Brush { } @Override - public BlockPos getOffset(Vec3d ray, Direction face, PlacementOptions option) { + public BlockPos getOffset(Vector3d ray, Direction face, PlacementOptions option) { if (option == PlacementOptions.Merged) return BlockPos.ZERO; diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/SphereBrush.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/SphereBrush.java index 42c5adf68..a5686c6a7 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/SphereBrush.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/SphereBrush.java @@ -10,7 +10,7 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class SphereBrush extends Brush { @@ -33,7 +33,7 @@ public class SphereBrush extends Brush { } @Override - public BlockPos getOffset(Vec3d ray, Direction face, PlacementOptions option) { + public BlockPos getOffset(Vector3d ray, Direction face, PlacementOptions option) { if (option == PlacementOptions.Merged) return BlockPos.ZERO; diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItemRenderer.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItemRenderer.java index 2224a75ed..01e0b3d18 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItemRenderer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItemRenderer.java @@ -12,7 +12,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.ClientPlayerEntity; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.LightTexture; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.item.ItemStack; import net.minecraft.util.HandSide; import net.minecraft.util.math.MathHelper; diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperRenderHandler.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperRenderHandler.java index aa1c55b60..30566128b 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperRenderHandler.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperRenderHandler.java @@ -19,7 +19,7 @@ import net.minecraft.util.math.RayTraceContext; import net.minecraft.util.math.RayTraceContext.BlockMode; import net.minecraft.util.math.RayTraceContext.FluidMode; import net.minecraft.util.math.RayTraceResult.Type; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class WorldshaperRenderHandler { @@ -76,9 +76,9 @@ public class WorldshaperRenderHandler { brush.set(params.getX(), params.getY(), params.getZ()); renderedShape = brush.getIncludedPositions(); - Vec3d start = player.getPositionVec() + Vector3d start = player.getPositionVec() .add(0, player.getEyeHeight(), 0); - Vec3d range = player.getLookVec() + Vector3d range = player.getLookVec() .scale(128); BlockRayTraceResult raytrace = player.world .rayTraceBlocks(new RayTraceContext(start, start.add(range), BlockMode.OUTLINE, FluidMode.NONE, player)); diff --git a/src/main/java/com/simibubi/create/content/logistics/InWorldProcessing.java b/src/main/java/com/simibubi/create/content/logistics/InWorldProcessing.java index ccae9be56..51de3c0f8 100644 --- a/src/main/java/com/simibubi/create/content/logistics/InWorldProcessing.java +++ b/src/main/java/com/simibubi/create/content/logistics/InWorldProcessing.java @@ -19,7 +19,7 @@ import net.minecraft.block.Blocks; import net.minecraft.block.CampfireBlock; import net.minecraft.entity.item.ItemEntity; import net.minecraft.fluid.Fluids; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.BlastingRecipe; import net.minecraft.item.crafting.FurnaceRecipe; @@ -33,7 +33,7 @@ import net.minecraft.tileentity.BlastFurnaceTileEntity; import net.minecraft.tileentity.FurnaceTileEntity; import net.minecraft.tileentity.SmokerTileEntity; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraftforge.items.ItemHandlerHelper; @@ -59,7 +59,7 @@ public class InWorldProcessing { public static Type byBlock(IBlockReader reader, BlockPos pos) { BlockState blockState = reader.getBlockState(pos); - IFluidState fluidState = reader.getFluidState(pos); + FluidState fluidState = reader.getFluidState(pos); if (fluidState.getFluid() == Fluids.WATER || fluidState.getFluid() == Fluids.FLOWING_WATER) return Type.SPLASHING; if (blockState.getBlock() == Blocks.FIRE @@ -294,7 +294,7 @@ public class InWorldProcessing { return stacks; } - public static void spawnParticlesForProcessing(World world, Vec3d vec, Type type) { + public static void spawnParticlesForProcessing(World world, Vector3d vec, Type type) { if (!world.isRemote) return; if (world.rand.nextInt(8) != 0) @@ -308,7 +308,7 @@ public class InWorldProcessing { world.addParticle(ParticleTypes.POOF, vec.x, vec.y + .25f, vec.z, 0, 1 / 16f, 0); break; case SPLASHING: - Vec3d color = ColorHelper.getRGB(0x0055FF); + Vector3d color = ColorHelper.getRGB(0x0055FF); world.addParticle(new RedstoneParticleData((float) color.x, (float) color.y, (float) color.z, 1), vec.x + (world.rand.nextFloat() - .5f) * .5f, vec.y + .5f, vec.z + (world.rand.nextFloat() - .5f) * .5f, 0, 1 / 8f, 0); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverBlock.java index 99949c701..542cb1830 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverBlock.java @@ -158,7 +158,7 @@ public class BeltObserverBlock extends HorizontalBlock DETECT, PULSE, EJECT, SPLIT; @Override - public String getName() { + public String getString() { return Lang.asId(name()); } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverFilterSlot.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverFilterSlot.java index 01ee5b54c..19c3e9074 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverFilterSlot.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverFilterSlot.java @@ -8,14 +8,14 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.block.HorizontalBlock; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class BeltObserverFilterSlot extends ValueBoxTransform { - Vec3d position = VecHelper.voxelSpace(8f, 14.5f, 16f); + Vector3d position = VecHelper.voxelSpace(8f, 14.5f, 16f); @Override - protected Vec3d getLocalOffset(BlockState state) { + protected Vector3d getLocalOffset(BlockState state) { return rotateHorizontally(state, position); } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java index b423dadfa..0ab4808ca 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java @@ -12,7 +12,7 @@ import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBe import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class BeltObserverTileEntity extends SmartTileEntity { @@ -26,7 +26,7 @@ public class BeltObserverTileEntity extends SmartTileEntity { @Override public void addBehaviours(List behaviours) { - filtering = new FilteringBehaviour(this, new BeltObserverFilterSlot()).moveText(new Vec3d(0, 5, 0)); + filtering = new FilteringBehaviour(this, new BeltObserverFilterSlot()).moveText(new Vector3d(0, 5, 0)); behaviours.add(filtering); } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java index 35b8f287d..263b0dc89 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelBlock.java @@ -17,7 +17,7 @@ import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemUseContext; import net.minecraft.state.EnumProperty; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; @@ -36,8 +36,8 @@ import net.minecraft.world.World; public class BeltTunnelBlock extends Block implements ITE, IWrenchable { - public static final IProperty SHAPE = EnumProperty.create("shape", Shape.class); - public static final IProperty HORIZONTAL_AXIS = BlockStateProperties.HORIZONTAL_AXIS; + public static final Property SHAPE = EnumProperty.create("shape", Shape.class); + public static final Property HORIZONTAL_AXIS = BlockStateProperties.HORIZONTAL_AXIS; public BeltTunnelBlock(Properties properties) { super(properties); @@ -48,7 +48,7 @@ public class BeltTunnelBlock extends Block implements ITE, STRAIGHT, WINDOW, CLOSED, T_LEFT, T_RIGHT, CROSS; @Override - public String getName() { + public String getString() { return Lang.asId(name()); } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java index 943837c91..302213afd 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java @@ -15,7 +15,7 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class BeltTunnelRenderer extends SmartTileEntityRenderer { @@ -29,7 +29,7 @@ public class BeltTunnelRenderer extends SmartTileEntityRenderer 0 ? 1 : 0; - Vec3d outPos = BeltHelper.getVectorForOffset(controllerTE, below.index + additionalOffset); - Vec3d outMotion = new Vec3d(side.getDirectionVec()).scale(movementSpeed) + Vector3d outPos = BeltHelper.getVectorForOffset(controllerTE, below.index + additionalOffset); + Vector3d outMotion = Vector3d.of(side.getDirectionVec()).scale(movementSpeed) .add(0, 1 / 8f, 0); outPos.add(outMotion.normalize()); ItemEntity entity = new ItemEntity(world, outPos.x, outPos.y + 6 / 16f, outPos.z, ejected); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java index e8a978360..161a04a15 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteBlock.java @@ -22,7 +22,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; import net.minecraft.state.DirectionProperty; import net.minecraft.state.EnumProperty; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.StateContainer.Builder; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; @@ -40,14 +40,14 @@ import net.minecraft.world.IWorldReader; import net.minecraft.world.World; public class ChuteBlock extends Block implements IWrenchable, ITE { - public static final IProperty SHAPE = EnumProperty.create("shape", Shape.class); + public static final Property SHAPE = EnumProperty.create("shape", Shape.class); public static final DirectionProperty FACING = BlockStateProperties.FACING_EXCEPT_UP; public enum Shape implements IStringSerializable { START(), WINDOW_STRAIGHT(), NORMAL(); @Override - public String getName() { + public String getString() { return Lang.asId(name()); } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java index 0e65b0f99..c968bbdfc 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java @@ -33,7 +33,7 @@ import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; @@ -173,7 +173,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor return false; if (!simulate) { - Vec3d dropVec = VecHelper.getCenterOf(pos) + Vector3d dropVec = VecHelper.getCenterOf(pos) .add(0, -12 / 16f, 0); ItemEntity dropped = new ItemEntity(world, dropVec.x, dropVec.y, dropVec.z, item.copy()); dropped.setDefaultPickupDelay(); @@ -226,7 +226,7 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor return false; if (!simulate) { - Vec3d dropVec = VecHelper.getCenterOf(pos) + Vector3d dropVec = VecHelper.getCenterOf(pos) .add(0, 8 / 16f, 0); ItemEntity dropped = new ItemEntity(world, dropVec.x, dropVec.y, dropVec.z, item.copy()); dropped.setDefaultPickupDelay(); @@ -297,9 +297,9 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor if (hasWorld() && world.isRemote && !previousItem.equals(item, false) && !item.isEmpty()) { if (world.rand.nextInt(3) != 0) return; - Vec3d p = VecHelper.getCenterOf(pos); + Vector3d p = VecHelper.getCenterOf(pos); p = VecHelper.offsetRandomly(p, world.rand, .5f); - Vec3d m = Vec3d.ZERO; + Vector3d m = Vector3d.ZERO; world.addParticle(new ItemParticleData(ParticleTypes.ITEM, item), p.x, p.y, p.z, m.x, m.y, m.z); } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotRenderer.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotRenderer.java index 4d428f935..68fab50ad 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotRenderer.java @@ -15,7 +15,7 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.item.ItemStack; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class DepotRenderer extends SafeTileEntityRenderer { @@ -42,7 +42,7 @@ public class DepotRenderer extends SafeTileEntityRenderer { if (transported.insertedFrom.getAxis() .isHorizontal()) { - Vec3d offsetVec = new Vec3d(transported.insertedFrom.getOpposite() + Vector3d offsetVec = Vector3d.of(transported.insertedFrom.getOpposite() .getDirectionVec()).scale(.5f - offset); ms.translate(offsetVec.x, offsetVec.y, offsetVec.z); boolean alongX = transported.insertedFrom.rotateY() diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java index c813c00c9..2f6c021fd 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java @@ -16,7 +16,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.CapabilityItemHandler; @@ -206,9 +206,9 @@ public class DepotTileEntity extends SmartTileEntity { return true; } - private Vec3d getWorldPositionOf(TransportedItemStack transported) { - Vec3d offsetVec = new Vec3d(.5f, 14 / 16f, .5f); - return offsetVec.add(new Vec3d(pos)); + private Vector3d getWorldPositionOf(TransportedItemStack transported) { + Vector3d offsetVec = new Vector3d(.5f, 14 / 16f, .5f); + return offsetVec.add(Vector3d.of(pos)); } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterScrollSlot.java b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterScrollSlot.java index bbb4807dc..54d084788 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterScrollSlot.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterScrollSlot.java @@ -8,12 +8,12 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.state.properties.BlockStateProperties; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class AdjustableRepeaterScrollSlot extends ValueBoxTransform { @Override - protected Vec3d getLocalOffset(BlockState state) { + protected Vector3d getLocalOffset(BlockState state) { return VecHelper.voxelSpace(8, 3f, 8); } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorBlock.java index 11c53eec1..a2094ee5e 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorBlock.java @@ -19,7 +19,7 @@ import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; @@ -95,13 +95,13 @@ public class ExtractorBlock extends BeltAttachableLogisticalBlock implements IPo return AllShapes.EXTRACTOR.get(getBlockFacing(state)); } - public static Vec3d getFilterSlotPosition(BlockState state) { + public static Vector3d getFilterSlotPosition(BlockState state) { float verticalOffset = (state.getBlock() instanceof ExtractorBlock) ? 10.5f : 12.5f; - Vec3d offsetForHorizontal = VecHelper.voxelSpace(8f, verticalOffset, 14f); - Vec3d offsetForUpward = VecHelper.voxelSpace(8f, 14.15f, 3.5f); - Vec3d offsetForDownward = VecHelper.voxelSpace(8f, 1.85f, 3.5f); - Vec3d vec = offsetForHorizontal; + Vector3d offsetForHorizontal = VecHelper.voxelSpace(8f, verticalOffset, 14f); + Vector3d offsetForUpward = VecHelper.voxelSpace(8f, 14.15f, 3.5f); + Vector3d offsetForDownward = VecHelper.voxelSpace(8f, 1.85f, 3.5f); + Vector3d vec = offsetForHorizontal; float yRot = AngleHelper.horizontalAngle(state.get(ExtractorBlock.HORIZONTAL_FACING)); if (AttachedLogisticalBlock.isVertical(state)) @@ -110,10 +110,10 @@ public class ExtractorBlock extends BeltAttachableLogisticalBlock implements IPo return VecHelper.rotateCentered(vec, yRot, Axis.Y); } - public static Vec3d getFilterSlotOrientation(BlockState state) { + public static Vector3d getFilterSlotOrientation(BlockState state) { float yRot = AngleHelper.horizontalAngle(state.get(ExtractorBlock.HORIZONTAL_FACING)); float zRot = (AttachedLogisticalBlock.isVertical(state)) ? 0 : 90; - return new Vec3d(0, yRot, zRot); + return new Vector3d(0, yRot, zRot); } public static class Vertical extends ExtractorBlock { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorMovementBehaviour.java b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorMovementBehaviour.java index d4a7b4fa8..fa1465daa 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorMovementBehaviour.java @@ -14,7 +14,7 @@ import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvents; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.World; @@ -41,14 +41,14 @@ public class ExtractorMovementBehaviour extends MovementBehaviour { if (world.isRemote) return; - Vec3d entityPos = context.position; + Vector3d entityPos = context.position; Entity entityIn = null; Direction facing = AttachedLogisticalBlock.getBlockFacing(context.state); if (facing != Direction.DOWN) entityPos = entityPos.add(0, -0.5f, 0); entityIn = new ItemEntity(world, entityPos.x, entityPos.y, entityPos.z, dropped); - entityIn.setMotion(Vec3d.ZERO); + entityIn.setMotion(Vector3d.ZERO); ((ItemEntity) entityIn).setPickupDelay(5); world.playSound(null, pos, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.BLOCKS, 1/16f, .1f); world.addEntity(entityIn); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorSlots.java b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorSlots.java index 3d547498a..41e689e36 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorSlots.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorSlots.java @@ -12,19 +12,19 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.util.Direction.Axis; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class ExtractorSlots { static class Filter extends ValueBoxTransform { - Vec3d offsetForHorizontal = VecHelper.voxelSpace(8f, 10.5f, 14f); - Vec3d offsetForUpward = VecHelper.voxelSpace(8f, 14.15f, 3.5f); - Vec3d offsetForDownward = VecHelper.voxelSpace(8f, 1.85f, 3.5f); + Vector3d offsetForHorizontal = VecHelper.voxelSpace(8f, 10.5f, 14f); + Vector3d offsetForUpward = VecHelper.voxelSpace(8f, 14.15f, 3.5f); + Vector3d offsetForDownward = VecHelper.voxelSpace(8f, 1.85f, 3.5f); @Override - protected Vec3d getLocalOffset(BlockState state) { - Vec3d location = offsetForHorizontal; + protected Vector3d getLocalOffset(BlockState state) { + Vector3d location = offsetForHorizontal; if (state.getBlock() instanceof TransposerBlock) location = location.add(0, 2 / 16f, 0); if (AttachedLogisticalBlock.isVertical(state)) @@ -49,13 +49,13 @@ public class ExtractorSlots { super(first); } - Vec3d offsetForHorizontal = VecHelper.voxelSpace(11.5f, 4f, 14f); - Vec3d offsetForUpward = VecHelper.voxelSpace(10f, 14f, 11.5f); - Vec3d offsetForDownward = VecHelper.voxelSpace(10f, 2f, 11.5f); + Vector3d offsetForHorizontal = VecHelper.voxelSpace(11.5f, 4f, 14f); + Vector3d offsetForUpward = VecHelper.voxelSpace(10f, 14f, 11.5f); + Vector3d offsetForDownward = VecHelper.voxelSpace(10f, 2f, 11.5f); @Override - protected Vec3d getLocalOffset(BlockState state) { - Vec3d location = offsetForHorizontal; + protected Vector3d getLocalOffset(BlockState state) { + Vector3d location = offsetForHorizontal; if (state.getBlock() instanceof TransposerBlock) location = location.add(0, 2 / 16f, 0); if (!isFirst()) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorTileEntity.java index 2cdb2e2b6..9edfeff9f 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/extractor/ExtractorTileEntity.java @@ -25,7 +25,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvents; import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class ExtractorTileEntity extends SmartTileEntity { @@ -59,14 +59,14 @@ public class ExtractorTileEntity extends SmartTileEntity { } } - Vec3d entityPos = VecHelper.getCenterOf(getPos()).add(0, -0.5f, 0); + Vector3d entityPos = VecHelper.getCenterOf(getPos()).add(0, -0.5f, 0); Entity entityIn = null; Direction facing = AttachedLogisticalBlock.getBlockFacing(getBlockState()); if (facing == Direction.DOWN) entityPos = entityPos.add(0, .5, 0); entityIn = new ItemEntity(world, entityPos.x, entityPos.y, entityPos.z, stack); - entityIn.setMotion(Vec3d.ZERO); + entityIn.setMotion(Vector3d.ZERO); ((ItemEntity) entityIn).setPickupDelay(5); world.playSound(null, getPos(), SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.BLOCKS, .125f, .1f); world.addEntity(entityIn); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorBlock.java index 0b027ca9d..5df46e135 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/extractor/LinkedExtractorBlock.java @@ -11,7 +11,7 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction.Axis; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IBlockReader; public class LinkedExtractorBlock extends ExtractorBlock { @@ -40,16 +40,16 @@ public class LinkedExtractorBlock extends ExtractorBlock { return false; } - public static Pair getFrequencySlotPosition(BlockState state) { + public static Pair getFrequencySlotPosition(BlockState state) { float verticalOffset = (state.getBlock() instanceof ExtractorBlock) ? 4f : 6f; - Vec3d first = VecHelper.voxelSpace(11.5f, verticalOffset, 14f); - Vec3d second = VecHelper.voxelSpace(11.5f, 4f + verticalOffset, 14f); + Vector3d first = VecHelper.voxelSpace(11.5f, verticalOffset, 14f); + Vector3d second = VecHelper.voxelSpace(11.5f, 4f + verticalOffset, 14f); - Vec3d firstUpward = VecHelper.voxelSpace(10f, 14f, 11.5f); - Vec3d secondUpward = VecHelper.voxelSpace(6f, 14f, 11.5f); - Vec3d firstDownward = VecHelper.voxelSpace(10f, 2f, 11.5f); - Vec3d secondDownward = VecHelper.voxelSpace(6f, 2f, 11.5f); + Vector3d firstUpward = VecHelper.voxelSpace(10f, 14f, 11.5f); + Vector3d secondUpward = VecHelper.voxelSpace(6f, 14f, 11.5f); + Vector3d firstDownward = VecHelper.voxelSpace(10f, 2f, 11.5f); + Vector3d secondDownward = VecHelper.voxelSpace(6f, 2f, 11.5f); float yRot = AngleHelper.horizontalAngle(state.get(ExtractorBlock.HORIZONTAL_FACING)); if (AttachedLogisticalBlock.isVertical(state)) { @@ -63,7 +63,7 @@ public class LinkedExtractorBlock extends ExtractorBlock { return Pair.of(first, second); } - public static Vec3d getFrequencySlotOrientation(BlockState state) { + public static Vector3d getFrequencySlotOrientation(BlockState state) { boolean vertical = AttachedLogisticalBlock.isVertical(state); float horizontalAngle = AngleHelper.horizontalAngle(state.get(ExtractorBlock.HORIZONTAL_FACING)); @@ -71,7 +71,7 @@ public class LinkedExtractorBlock extends ExtractorBlock { float yRot = vertical ? horizontalAngle + 180 : horizontalAngle + 270; float zRot = vertical ? 0 : 0; - return new Vec3d(xRot, yRot, zRot); + return new Vector3d(xRot, yRot, zRot); } public static class Vertical extends LinkedExtractorBlock { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java index c0b721908..83e38be78 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/BeltFunnelBlock.java @@ -14,7 +14,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.EnumProperty; -import net.minecraft.state.IProperty; +import net.minecraft.state.Property; import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; @@ -29,7 +29,7 @@ import net.minecraft.world.World; public abstract class BeltFunnelBlock extends HorizontalInteractionFunnelBlock { - public static final IProperty SHAPE = EnumProperty.create("shape", Shape.class); + public static final Property SHAPE = EnumProperty.create("shape", Shape.class); public enum Shape implements IStringSerializable { RETRACTED(AllShapes.BELT_FUNNEL_RETRACTED), EXTENDED(AllShapes.BELT_FUNNEL_EXTENDED); @@ -41,7 +41,7 @@ public abstract class BeltFunnelBlock extends HorizontalInteractionFunnelBlock { } @Override - public String getName() { + public String getString() { return Lang.asId(name()); } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java index aa414f12a..108272edb 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelBlock.java @@ -28,7 +28,7 @@ import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; @@ -88,7 +88,7 @@ public abstract class FunnelBlock extends ProperDirectionalBlock implements ITE< ItemEntity itemEntity = (ItemEntity) entityIn; Direction direction = state.get(FACING); - Vec3d diff = entityIn.getPositionVec() + Vector3d diff = entityIn.getPositionVec() .subtract(VecHelper.getCenterOf(pos)); double projectedDiff = direction.getAxis() .getCoordinate(diff.x, diff.y, diff.z); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelFilterSlotPositioning.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelFilterSlotPositioning.java index add0d05e1..1ea967c79 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelFilterSlotPositioning.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelFilterSlotPositioning.java @@ -13,29 +13,29 @@ import net.minecraft.block.BlockState; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class FunnelFilterSlotPositioning extends ValueBoxTransform.Sided { @Override - protected Vec3d getLocalOffset(BlockState state) { + protected Vector3d getLocalOffset(BlockState state) { if (AllBlocks.BRASS_BELT_FUNNEL.has(state)) if (state.get(BeltFunnelBlock.SHAPE) == Shape.RETRACTED) return VecHelper.rotateCentered(VecHelper.voxelSpace(8, 13, 7.5f), AngleHelper.horizontalAngle(getSide()), Axis.Y); - Vec3d localOffset = + Vector3d localOffset = getSide() == Direction.UP ? VecHelper.voxelSpace(8, 14.5f, 8) : VecHelper.voxelSpace(8, 1.5f, 8); if (getSide().getAxis() .isHorizontal()) { - Vec3d southLocation = VecHelper.voxelSpace(8, 8, 14.5f); + Vector3d southLocation = VecHelper.voxelSpace(8, 8, 14.5f); localOffset = VecHelper.rotateCentered(southLocation, AngleHelper.horizontalAngle(getSide()), Axis.Y); } if (AllBlocks.BRASS_CHUTE_FUNNEL.has(state)) { Direction facing = state.get(ChuteFunnelBlock.HORIZONTAL_FACING); - localOffset = localOffset.subtract(new Vec3d(facing.getDirectionVec()).scale(2 / 16f)); + localOffset = localOffset.subtract(Vector3d.of(facing.getDirectionVec()).scale(2 / 16f)); } return localOffset; @@ -89,8 +89,8 @@ public class FunnelFilterSlotPositioning extends ValueBoxTransform.Sided { } @Override - protected Vec3d getSouthLocation() { - return Vec3d.ZERO; + protected Vector3d getSouthLocation() { + return Vector3d.ZERO; } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelRenderer.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelRenderer.java index 2c49402db..e8cf67778 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelRenderer.java @@ -13,7 +13,7 @@ import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class FunnelRenderer extends SmartTileEntityRenderer { @@ -31,7 +31,7 @@ public class FunnelRenderer extends SmartTileEntityRenderer { IVertexBuilder vb = buffer.getBuffer(RenderType.getSolid()); SuperByteBuffer flapBuffer = AllBlockPartials.BELT_FUNNEL_FLAP.renderOn(te.getBlockState()); - Vec3d pivot = VecHelper.voxelSpace(0, 10, 9.5f); + Vector3d pivot = VecHelper.voxelSpace(0, 10, 9.5f); MatrixStacker msr = MatrixStacker.of(ms); float horizontalAngle = AngleHelper.horizontalAngle(FunnelBlock.getFunnelFacing(te.getBlockState()) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/inventories/CreativeCrateTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/inventories/CreativeCrateTileEntity.java index af0fba545..44d9f10e6 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/inventories/CreativeCrateTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/inventories/CreativeCrateTileEntity.java @@ -14,7 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.CapabilityItemHandler; @@ -102,8 +102,8 @@ public class CreativeCrateTileEntity extends CrateTileEntity { } @Override - protected Vec3d getLocalOffset(BlockState state) { - return new Vec3d(0.5, 13 / 16d, 0.5); + protected Vector3d getLocalOffset(BlockState state) { + return new Vector3d(0.5, 13 / 16d, 0.5); } protected float getScale() { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmAngleTarget.java b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmAngleTarget.java index 696b987f0..713e9e623 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmAngleTarget.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmAngleTarget.java @@ -7,7 +7,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class ArmAngleTarget { @@ -24,18 +24,18 @@ public class ArmAngleTarget { headAngle = -15; } - public ArmAngleTarget(BlockPos armPos, Vec3d pointTarget, Direction clawFacing, boolean ceiling) { + public ArmAngleTarget(BlockPos armPos, Vector3d pointTarget, Direction clawFacing, boolean ceiling) { // if (ceiling) // clawFacing = clawFacing.getOpposite(); - Vec3d target = pointTarget; - Vec3d origin = VecHelper.getCenterOf(armPos) + Vector3d target = pointTarget; + Vector3d origin = VecHelper.getCenterOf(armPos) .add(0, ceiling ? -4 / 16f : 4 / 16f, 0); - Vec3d clawTarget = target; - target = target.add(new Vec3d(clawFacing.getOpposite() + Vector3d clawTarget = target; + target = target.add(Vector3d.of(clawFacing.getOpposite() .getDirectionVec()).scale(.5f)); - Vec3d diff = target.subtract(origin); + Vector3d diff = target.subtract(origin); float horizontalDistance = (float) diff.mul(1, 0, 1) .length(); @@ -65,13 +65,13 @@ public class ArmAngleTarget { if (Float.isNaN(beta)) beta = 0; - Vec3d headPos = new Vec3d(0, 0, 0); + Vector3d headPos = new Vector3d(0, 0, 0); headPos = VecHelper.rotate(headPos.add(0, b, 0), beta + 180, Axis.X); headPos = VecHelper.rotate(headPos.add(0, a, 0), alpha - 90, Axis.X); headPos = VecHelper.rotate(headPos, baseAngle, Axis.Y); headPos = VecHelper.rotate(headPos, ceiling ? 180 : 0, Axis.X); headPos = headPos.add(origin); - Vec3d headDiff = clawTarget.subtract(headPos); + Vector3d headDiff = clawTarget.subtract(headPos); if (ceiling) headDiff = headDiff.mul(1, -1, 1); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPoint.java b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPoint.java index 7923b5adf..a41985373 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPoint.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInteractionPoint.java @@ -30,7 +30,7 @@ import net.minecraft.tileentity.JukeboxTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; @@ -81,7 +81,7 @@ public abstract class ArmInteractionPoint { mode = mode == Mode.DEPOSIT ? Mode.TAKE : Mode.DEPOSIT; } - Vec3d getInteractionPositionVector() { + Vector3d getInteractionPositionVector() { return VecHelper.getCenterOf(pos); } @@ -179,8 +179,8 @@ public abstract class ArmInteractionPoint { static abstract class TopFaceArmInteractionPoint extends ArmInteractionPoint { @Override - Vec3d getInteractionPositionVector() { - return new Vec3d(pos).add(.5f, 1, .5f); + Vector3d getInteractionPositionVector() { + return Vector3d.of(pos).add(.5f, 1, .5f); } } @@ -188,8 +188,8 @@ public abstract class ArmInteractionPoint { static class Depot extends ArmInteractionPoint { @Override - Vec3d getInteractionPositionVector() { - return new Vec3d(pos).add(.5f, 14 / 16f, .5f); + Vector3d getInteractionPositionVector() { + return Vector3d.of(pos).add(.5f, 14 / 16f, .5f); } @Override @@ -311,9 +311,9 @@ public abstract class ArmInteractionPoint { static class Funnel extends ArmInteractionPoint { @Override - Vec3d getInteractionPositionVector() { + Vector3d getInteractionPositionVector() { return VecHelper.getCenterOf(pos) - .add(new Vec3d(FunnelBlock.getFunnelFacing(state) + .add(Vector3d.of(FunnelBlock.getFunnelFacing(state) .getDirectionVec()).scale(.5f)); } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/ContactMovementBehaviour.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/ContactMovementBehaviour.java index 368758376..ef06c5ec2 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/ContactMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/ContactMovementBehaviour.java @@ -9,15 +9,15 @@ import net.minecraft.block.BlockState; import net.minecraft.nbt.NBTUtil; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.TickPriority; import net.minecraft.world.World; public class ContactMovementBehaviour extends MovementBehaviour { @Override - public Vec3d getActiveAreaOffset(MovementContext context) { - return new Vec3d(context.state.get(RedstoneContactBlock.FACING).getDirectionVec()).scale(.65f); + public Vector3d getActiveAreaOffset(MovementContext context) { + return Vector3d.of(context.state.get(RedstoneContactBlock.FACING).getDirectionVec()).scale(.65f); } @Override @@ -35,7 +35,7 @@ public class ContactMovementBehaviour extends MovementBehaviour { if (!AllBlocks.REDSTONE_CONTACT.has(visitedState)) return; - Vec3d contact = new Vec3d(block.get(RedstoneContactBlock.FACING).getDirectionVec()); + Vector3d contact = Vector3d.of(block.get(RedstoneContactBlock.FACING).getDirectionVec()); contact = VecHelper.rotate(contact, context.rotation.x, context.rotation.y, context.rotation.z); Direction direction = Direction.getFacingFromVector(contact.x, contact.y, contact.z); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/NixieTubeBlock.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/NixieTubeBlock.java index 0efc5957e..449ef6cce 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/NixieTubeBlock.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/NixieTubeBlock.java @@ -14,7 +14,7 @@ import net.minecraft.state.StateContainer.Builder; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; @@ -46,7 +46,7 @@ public class NixieTubeBlock extends HorizontalBlock implements ITE .5f; return getDefaultState().with(HORIZONTAL_FACING, context.getPlacementHorizontalFacing() diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkFrequencySlot.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkFrequencySlot.java index 313f5ac4a..a2c8785d3 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkFrequencySlot.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkFrequencySlot.java @@ -9,7 +9,7 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class RedstoneLinkFrequencySlot extends ValueBoxTransform.Dual { @@ -17,13 +17,13 @@ public class RedstoneLinkFrequencySlot extends ValueBoxTransform.Dual { super(first); } - Vec3d horizontal = VecHelper.voxelSpace(10f, 5.5f, 2.5f); - Vec3d vertical = VecHelper.voxelSpace(10f, 2.5f, 5.5f); + Vector3d horizontal = VecHelper.voxelSpace(10f, 5.5f, 2.5f); + Vector3d vertical = VecHelper.voxelSpace(10f, 2.5f, 5.5f); @Override - protected Vec3d getLocalOffset(BlockState state) { + protected Vector3d getLocalOffset(BlockState state) { Direction facing = state.get(RedstoneLinkBlock.FACING); - Vec3d location = vertical; + Vector3d location = vertical; if (facing.getAxis() .isHorizontal()) { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchScreen.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchScreen.java index da70e21b9..45c337bf2 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchScreen.java @@ -87,22 +87,22 @@ public class StockpileSwitchScreen extends AbstractSimiScreen { int hFontColor = 0xD3CBBE; int fontColor = 0x4B3A22; STOCKSWITCH.draw(this, guiLeft, guiTop); - font.drawStringWithShadow(title, guiLeft - 3 + (STOCKSWITCH.width - font.getStringWidth(title)) / 2, + textRenderer.drawWithShadow(title, guiLeft - 3 + (STOCKSWITCH.width - textRenderer.getStringWidth(title)) / 2, guiTop + 10, hFontColor); - font.drawString(onAbove.getState() == 100 ? startAt : startAbove, guiLeft + 13, guiTop + 55, fontColor); - font.drawString(offBelow.getState() == 0 ? stopAt : stopBelow, guiLeft + 13, guiTop + 72, fontColor); + textRenderer.draw(onAbove.getState() == 100 ? startAt : startAbove, guiLeft + 13, guiTop + 55, fontColor); + textRenderer.draw(offBelow.getState() == 0 ? stopAt : stopBelow, guiLeft + 13, guiTop + 72, fontColor); AllGuiTextures sprite = AllGuiTextures.STOCKSWITCH_INTERVAL; float lowerBound = offBelow.getState() / 100f * (sprite.width - 20) + 10; float upperBound = onAbove.getState() / 100f * (sprite.width - 20) + 10; sprite.bind(); - blit((int) (guiLeft + lowerBound), guiTop + 26, (int) (sprite.startX + lowerBound), sprite.startY, + drawTexture((int) (guiLeft + lowerBound), guiTop + 26, (int) (sprite.startX + lowerBound), sprite.startY, (int) (upperBound - lowerBound), sprite.height); sprite = AllGuiTextures.STOCKSWITCH_INTERVAL_END; sprite.bind(); - blit((int) (guiLeft + upperBound), guiTop + 26, (int) (sprite.startX + upperBound), sprite.startY, + drawTexture((int) (guiLeft + upperBound), guiTop + 26, (int) (sprite.startX + upperBound), sprite.startY, (int) (sprite.width - upperBound), sprite.height); AllGuiTextures.STOCKSWITCH_BOUND_LEFT.draw(this, (int) (guiLeft + lowerBound) - 1, guiTop + 24); diff --git a/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPartial.java b/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPartial.java index 04658f84b..482969ac4 100644 --- a/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPartial.java +++ b/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPartial.java @@ -14,7 +14,7 @@ import com.tterrag.registrate.util.DataIngredient; import com.tterrag.registrate.util.nullness.NonnullType; import net.minecraft.block.Block; -import net.minecraft.block.Block.Properties; +import net.minecraft.block.AbstractBlock.Properties; import net.minecraft.block.SlabBlock; import net.minecraft.block.StairsBlock; import net.minecraft.block.WallBlock; diff --git a/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPatterns.java b/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPatterns.java index 3fb86b44e..eb76550c4 100644 --- a/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPatterns.java +++ b/src/main/java/com/simibubi/create/content/palettes/PaletteBlockPatterns.java @@ -25,7 +25,7 @@ import com.tterrag.registrate.util.nullness.NonNullBiConsumer; import com.tterrag.registrate.util.nullness.NonNullFunction; import net.minecraft.block.Block; -import net.minecraft.block.Block.Properties; +import net.minecraft.block.AbstractBlock.Properties; import net.minecraft.block.RotatedPillarBlock; import net.minecraft.client.renderer.RenderType; import net.minecraft.data.ShapedRecipeBuilder; diff --git a/src/main/java/com/simibubi/create/content/palettes/StandardFoliageColorHandler.java b/src/main/java/com/simibubi/create/content/palettes/StandardFoliageColorHandler.java index b876f3c0f..061ff32aa 100644 --- a/src/main/java/com/simibubi/create/content/palettes/StandardFoliageColorHandler.java +++ b/src/main/java/com/simibubi/create/content/palettes/StandardFoliageColorHandler.java @@ -4,7 +4,7 @@ import net.minecraft.block.BlockState; import net.minecraft.client.renderer.color.IBlockColor; import net.minecraft.util.math.BlockPos; import net.minecraft.world.GrassColors; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; import net.minecraft.world.biome.BiomeColors; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -13,7 +13,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; public class StandardFoliageColorHandler implements IBlockColor { @Override - public int getColor(BlockState state, ILightReader light, BlockPos pos, int layer) { + public int getColor(BlockState state, IBlockDisplayReader light, BlockPos pos, int layer) { return pos != null && light != null ? BiomeColors.getGrassColor(light, pos) : GrassColors.get(0.5D, 1.0D); } diff --git a/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java b/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java index 0cb77977b..67d55ce44 100644 --- a/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java +++ b/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java @@ -18,7 +18,7 @@ import net.minecraft.entity.item.ArmorStandEntity; import net.minecraft.entity.item.ItemFrameEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.Fluid; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.AxisAlignedBB; @@ -114,7 +114,7 @@ public class SchematicWorld extends WrappedWorld { } @Override - public IFluidState getFluidState(BlockPos pos) { + public FluidState getFluidState(BlockPos pos) { return getBlockState(pos).getFluidState(); } diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java index ea4b09f9d..92ce288d8 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java @@ -123,7 +123,7 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen zOrigin; float xIn = (xGreaterZ ? 0 : .5f); @@ -87,15 +87,15 @@ public class SchematicTransformation { xIn *= getMirrorModifier(Axis.X); zIn *= getMirrorModifier(Axis.Z); } - rotationOffset = new Vec3d(xIn, 0, zIn); + rotationOffset = new Vector3d(xIn, 0, zIn); } return rotationOffset; } - public Vec3d toLocalSpace(Vec3d vec) { + public Vector3d toLocalSpace(Vector3d vec) { float pt = Minecraft.getInstance() .getRenderPartialTicks(); - Vec3d rotationOffset = getRotationOffset(true); + Vector3d rotationOffset = getRotationOffset(true); vec = vec.subtract(x.get(pt), y.get(pt), z.get(pt)); vec = vec.subtract(xOrigin + rotationOffset.x, 0, zOrigin + rotationOffset.z); @@ -146,8 +146,8 @@ public class SchematicTransformation { } public BlockPos getAnchor() { - Vec3d vec = Vec3d.ZERO.add(.5, 0, .5); - Vec3d rotationOffset = getRotationOffset(false); + Vector3d vec = Vector3d.ZERO.add(.5, 0, .5); + Vector3d rotationOffset = getRotationOffset(false); vec = vec.subtract(xOrigin, 0, zOrigin); vec = vec.subtract(rotationOffset.x, 0, rotationOffset.z); vec = vec.mul(getScaleFB().getTarget(), 1, getScaleLR().getTarget()); @@ -158,16 +158,16 @@ public class SchematicTransformation { return new BlockPos(vec.x, vec.y, vec.z); } - public Vec3d fromAnchor(BlockPos pos) { - Vec3d vec = Vec3d.ZERO.add(.5, 0, .5); - Vec3d rotationOffset = getRotationOffset(false); + public Vector3d fromAnchor(BlockPos pos) { + Vector3d vec = Vector3d.ZERO.add(.5, 0, .5); + Vector3d rotationOffset = getRotationOffset(false); vec = vec.subtract(xOrigin, 0, zOrigin); vec = vec.subtract(rotationOffset.x, 0, rotationOffset.z); vec = vec.mul(getScaleFB().getTarget(), 1, getScaleLR().getTarget()); vec = VecHelper.rotate(vec, rotation.getTarget(), Axis.Y); vec = vec.add(xOrigin, 0, zOrigin); - return new Vec3d(pos.subtract(new BlockPos(vec.x, vec.y, vec.z))); + return Vector3d.of(pos.subtract(new BlockPos(vec.x, vec.y, vec.z))); } public int getRotationTarget() { diff --git a/src/main/java/com/simibubi/create/content/schematics/client/tools/DeployTool.java b/src/main/java/com/simibubi/create/content/schematics/client/tools/DeployTool.java index e58e5cd85..52d7dade6 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/tools/DeployTool.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/tools/DeployTool.java @@ -13,7 +13,7 @@ import net.minecraft.nbt.NBTUtil; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class DeployTool extends PlacementToolBase { @@ -51,13 +51,13 @@ public class DeployTool extends PlacementToolBase { SchematicTransformation transformation = schematicHandler.getTransformation(); AxisAlignedBB bounds = schematicHandler.getBounds(); - Vec3d center = bounds.getCenter(); - Vec3d rotationOffset = transformation.getRotationOffset(true); + Vector3d center = bounds.getCenter(); + Vector3d rotationOffset = transformation.getRotationOffset(true); int centerX = (int) center.x; int centerZ = (int) center.z; double xOrigin = bounds.getXSize() / 2f; double zOrigin = bounds.getZSize() / 2f; - Vec3d origin = new Vec3d(xOrigin, 0, zOrigin); + Vector3d origin = new Vector3d(xOrigin, 0, zOrigin); ms.translate(x - centerX, y, z - centerZ); MatrixStacker.of(ms) @@ -87,7 +87,7 @@ public class DeployTool extends PlacementToolBase { public boolean handleRightClick() { if (selectedPos == null) return super.handleRightClick(); - Vec3d center = schematicHandler.getBounds() + Vector3d center = schematicHandler.getBounds() .getCenter(); BlockPos target = selectedPos.add(-((int) center.x), 0, -((int) center.z)); diff --git a/src/main/java/com/simibubi/create/content/schematics/client/tools/FlipTool.java b/src/main/java/com/simibubi/create/content/schematics/client/tools/FlipTool.java index 32eb4c7fd..e77b7c35e 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/tools/FlipTool.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/tools/FlipTool.java @@ -9,7 +9,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class FlipTool extends PlacementToolBase { @@ -58,10 +58,10 @@ public class FlipTool extends PlacementToolBase { Direction facing = selectedFace.rotateY(); AxisAlignedBB bounds = schematicHandler.getBounds(); - Vec3d directionVec = new Vec3d(Direction.getFacingFromAxis(AxisDirection.POSITIVE, facing.getAxis()) + Vector3d directionVec = Vector3d.of(Direction.getFacingFromAxis(AxisDirection.POSITIVE, facing.getAxis()) .getDirectionVec()); - Vec3d boundsSize = new Vec3d(bounds.getXSize(), bounds.getYSize(), bounds.getZSize()); - Vec3d vec = boundsSize.mul(directionVec); + Vector3d boundsSize = new Vector3d(bounds.getXSize(), bounds.getYSize(), bounds.getZSize()); + Vector3d vec = boundsSize.mul(directionVec); bounds = bounds.contract(vec.x, vec.y, vec.z) .grow(1 - directionVec.x, 1 - directionVec.y, 1 - directionVec.z); bounds = bounds.offset(directionVec.scale(.5f) diff --git a/src/main/java/com/simibubi/create/content/schematics/client/tools/MoveTool.java b/src/main/java/com/simibubi/create/content/schematics/client/tools/MoveTool.java index b6be5f60a..4fcaf8659 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/tools/MoveTool.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/tools/MoveTool.java @@ -4,7 +4,7 @@ import com.simibubi.create.content.schematics.client.SchematicTransformation; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.util.Direction.Axis; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class MoveTool extends PlacementToolBase { @@ -25,7 +25,7 @@ public class MoveTool extends PlacementToolBase { return true; SchematicTransformation transformation = schematicHandler.getTransformation(); - Vec3d vec = new Vec3d(selectedFace.getDirectionVec()).scale(-Math.signum(delta)); + Vector3d vec = Vector3d.of(selectedFace.getDirectionVec()).scale(-Math.signum(delta)); vec = vec.mul(transformation.getMirrorModifier(Axis.X), 1, transformation.getMirrorModifier(Axis.Z)); vec = VecHelper.rotate(vec, transformation.getRotationTarget(), Axis.Y); transformation.move((float) vec.x, 0, (float) vec.z); diff --git a/src/main/java/com/simibubi/create/content/schematics/client/tools/RotateTool.java b/src/main/java/com/simibubi/create/content/schematics/client/tools/RotateTool.java index 8c34beb39..e76135f63 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/tools/RotateTool.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/tools/RotateTool.java @@ -5,7 +5,7 @@ import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer; import com.simibubi.create.foundation.utility.outliner.LineOutline; import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class RotateTool extends PlacementToolBase { @@ -23,11 +23,11 @@ public class RotateTool extends PlacementToolBase { public void renderOnSchematic(MatrixStack ms, SuperRenderTypeBuffer buffer) { AxisAlignedBB bounds = schematicHandler.getBounds(); double height = bounds.getYSize() + Math.max(20, bounds.getYSize()); - Vec3d center = bounds.getCenter() + Vector3d center = bounds.getCenter() .add(schematicHandler.getTransformation() .getRotationOffset(false)); - Vec3d start = center.subtract(0, height / 2, 0); - Vec3d end = center.add(0, height / 2, 0); + Vector3d start = center.subtract(0, height / 2, 0); + Vector3d end = center.add(0, height / 2, 0); line.getParams() .disableCull() diff --git a/src/main/java/com/simibubi/create/content/schematics/client/tools/SchematicToolBase.java b/src/main/java/com/simibubi/create/content/schematics/client/tools/SchematicToolBase.java index c20606a52..1b246eafc 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/tools/SchematicToolBase.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/tools/SchematicToolBase.java @@ -23,15 +23,15 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult.Type; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public abstract class SchematicToolBase implements ISchematicTool { protected SchematicHandler schematicHandler; protected BlockPos selectedPos; - protected Vec3d chasingSelectedPos; - protected Vec3d lastChasingSelectedPos; + protected Vector3d chasingSelectedPos; + protected Vector3d lastChasingSelectedPos; protected boolean selectIgnoreBlocks; protected int selectionRange; @@ -48,8 +48,8 @@ public abstract class SchematicToolBase implements ISchematicTool { selectedPos = null; selectedFace = null; schematicSelected = false; - chasingSelectedPos = Vec3d.ZERO; - lastChasingSelectedPos = Vec3d.ZERO; + chasingSelectedPos = Vector3d.ZERO; + lastChasingSelectedPos = Vector3d.ZERO; } @Override @@ -59,7 +59,7 @@ public abstract class SchematicToolBase implements ISchematicTool { if (selectedPos == null) return; lastChasingSelectedPos = chasingSelectedPos; - Vec3d target = new Vec3d(selectedPos); + Vector3d target = Vector3d.of(selectedPos); if (target.distanceTo(chasingSelectedPos) < 1 / 512f) { chasingSelectedPos = target; return; @@ -77,9 +77,9 @@ public abstract class SchematicToolBase implements ISchematicTool { SchematicTransformation transformation = schematicHandler.getTransformation(); AxisAlignedBB localBounds = schematicHandler.getBounds(); - Vec3d traceOrigin = RaycastHelper.getTraceOrigin(player); - Vec3d start = transformation.toLocalSpace(traceOrigin); - Vec3d end = transformation.toLocalSpace(RaycastHelper.getTraceTarget(player, 70, traceOrigin)); + Vector3d traceOrigin = RaycastHelper.getTraceOrigin(player); + Vector3d start = transformation.toLocalSpace(traceOrigin); + Vector3d end = transformation.toLocalSpace(RaycastHelper.getTraceTarget(player, 70, traceOrigin)); PredicateTraceResult result = RaycastHelper.rayTraceUntil(start, end, pos -> localBounds.contains(VecHelper.getCenterOf(pos))); @@ -97,7 +97,7 @@ public abstract class SchematicToolBase implements ISchematicTool { .add(player.getLookVec() .scale(selectionRange))); if (snap) - lastChasingSelectedPos = chasingSelectedPos = new Vec3d(selectedPos); + lastChasingSelectedPos = chasingSelectedPos = Vector3d.of(selectedPos); return; } @@ -117,7 +117,7 @@ public abstract class SchematicToolBase implements ISchematicTool { hit = hit.offset(trace.getFace()); selectedPos = hit; if (snap) - lastChasingSelectedPos = chasingSelectedPos = new Vec3d(selectedPos); + lastChasingSelectedPos = chasingSelectedPos = Vector3d.of(selectedPos); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/block/connected/CTModel.java b/src/main/java/com/simibubi/create/foundation/block/connected/CTModel.java index 6a76326b2..230c93366 100644 --- a/src/main/java/com/simibubi/create/foundation/block/connected/CTModel.java +++ b/src/main/java/com/simibubi/create/foundation/block/connected/CTModel.java @@ -15,7 +15,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; import net.minecraftforge.client.model.BakedModelWrapper; import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.ModelDataMap; @@ -50,15 +50,15 @@ public class CTModel extends BakedModelWrapper { } @Override - public IModelData getModelData(ILightReader world, BlockPos pos, BlockState state, IModelData tileData) { + public IModelData getModelData(IBlockDisplayReader world, BlockPos pos, BlockState state, IModelData tileData) { return getCTDataMapBuilder(world, pos, state).build(); } - protected Builder getCTDataMapBuilder(ILightReader world, BlockPos pos, BlockState state) { + protected Builder getCTDataMapBuilder(IBlockDisplayReader world, BlockPos pos, BlockState state) { return new ModelDataMap.Builder().withInitial(CT_PROPERTY, createCTData(world, pos, state)); } - protected CTData createCTData(ILightReader world, BlockPos pos, BlockState state) { + protected CTData createCTData(IBlockDisplayReader world, BlockPos pos, BlockState state) { CTData data = new CTData(); for (Direction face : Direction.values()) { if (!Block.shouldSideBeRendered(state, world, pos, face) && !behaviour.buildContextForOccludedDirections()) diff --git a/src/main/java/com/simibubi/create/foundation/block/connected/ConnectedTextureBehaviour.java b/src/main/java/com/simibubi/create/foundation/block/connected/ConnectedTextureBehaviour.java index ffea6e247..fca5fac4e 100644 --- a/src/main/java/com/simibubi/create/foundation/block/connected/ConnectedTextureBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/block/connected/ConnectedTextureBehaviour.java @@ -7,7 +7,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; public abstract class ConnectedTextureBehaviour { @@ -34,7 +34,7 @@ public abstract class ConnectedTextureBehaviour { return false; } - public boolean connectsTo(BlockState state, BlockState other, ILightReader reader, BlockPos pos, BlockPos otherPos, + public boolean connectsTo(BlockState state, BlockState other, IBlockDisplayReader reader, BlockPos pos, BlockPos otherPos, Direction face) { BlockPos blockingPos = otherPos.offset(face); @@ -47,7 +47,7 @@ public abstract class ConnectedTextureBehaviour { return state.getBlock() == other.getBlock(); } - public CTContext buildContext(ILightReader reader, BlockPos pos, BlockState state, Direction face) { + public CTContext buildContext(IBlockDisplayReader reader, BlockPos pos, BlockState state, Direction face) { CTContext context = new CTContext(); CTSpriteShiftEntry textureEntry = get(state, face); @@ -94,7 +94,7 @@ public abstract class ConnectedTextureBehaviour { return context; } - private boolean testConnection(ILightReader reader, BlockPos pos, BlockState state, Direction face, + private boolean testConnection(IBlockDisplayReader reader, BlockPos pos, BlockState state, Direction face, final Direction horizontal, final Direction vertical, int sh, int sv) { BlockPos p = pos.offset(horizontal, sh) .offset(vertical, sv); diff --git a/src/main/java/com/simibubi/create/foundation/block/connected/GlassPaneCTBehaviour.java b/src/main/java/com/simibubi/create/foundation/block/connected/GlassPaneCTBehaviour.java index a5cd78378..c07a2811c 100644 --- a/src/main/java/com/simibubi/create/foundation/block/connected/GlassPaneCTBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/block/connected/GlassPaneCTBehaviour.java @@ -4,7 +4,7 @@ import net.minecraft.block.BlockState; import net.minecraft.util.Direction; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; public class GlassPaneCTBehaviour extends StandardCTBehaviour { @@ -18,7 +18,7 @@ public class GlassPaneCTBehaviour extends StandardCTBehaviour { } @Override - public boolean connectsTo(BlockState state, BlockState other, ILightReader reader, BlockPos pos, BlockPos otherPos, + public boolean connectsTo(BlockState state, BlockState other, IBlockDisplayReader reader, BlockPos pos, BlockPos otherPos, Direction face) { return state.getBlock() == other.getBlock(); } diff --git a/src/main/java/com/simibubi/create/foundation/block/render/ColoredVertexModel.java b/src/main/java/com/simibubi/create/foundation/block/render/ColoredVertexModel.java index 391801a9b..f39a720b5 100644 --- a/src/main/java/com/simibubi/create/foundation/block/render/ColoredVertexModel.java +++ b/src/main/java/com/simibubi/create/foundation/block/render/ColoredVertexModel.java @@ -14,7 +14,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; import net.minecraftforge.client.model.BakedModelWrapper; import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.ModelDataMap; @@ -31,7 +31,7 @@ public class ColoredVertexModel extends BakedModelWrapper { } @Override - public IModelData getModelData(ILightReader world, BlockPos pos, BlockState state, IModelData tileData) { + public IModelData getModelData(IBlockDisplayReader world, BlockPos pos, BlockState state, IModelData tileData) { return new ModelDataMap.Builder().withInitial(POSITION_PROPERTY, pos).build(); } diff --git a/src/main/java/com/simibubi/create/foundation/collision/Matrix3d.java b/src/main/java/com/simibubi/create/foundation/collision/Matrix3d.java index 05e24b0f2..3e0fcae60 100644 --- a/src/main/java/com/simibubi/create/foundation/collision/Matrix3d.java +++ b/src/main/java/com/simibubi/create/foundation/collision/Matrix3d.java @@ -1,8 +1,8 @@ package com.simibubi.create.foundation.collision; -import net.minecraft.client.renderer.Matrix4f; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Matrix4f; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -112,11 +112,11 @@ public class Matrix3d { return this; } - public Vec3d transform(Vec3d vec) { + public Vector3d transform(Vector3d vec) { double x = vec.x * m00 + vec.y * m01 + vec.z * m02; double y = vec.x * m10 + vec.y * m11 + vec.z * m12; double z = vec.x * m20 + vec.y * m21 + vec.z * m22; - return new Vec3d(x, y, z); + return new Vector3d(x, y, z); } public Matrix3d copy() { diff --git a/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java b/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java index 47390a57f..ba14dfc39 100644 --- a/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java +++ b/src/main/java/com/simibubi/create/foundation/data/CreateRegistrate.java @@ -25,7 +25,7 @@ import com.tterrag.registrate.util.nullness.NonNullSupplier; import com.tterrag.registrate.util.nullness.NonNullUnaryOperator; import net.minecraft.block.Block; -import net.minecraft.block.Block.Properties; +import net.minecraft.block.AbstractBlock.Properties; import net.minecraft.client.renderer.color.IBlockColor; import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.client.renderer.model.IBakedModel; diff --git a/src/main/java/com/simibubi/create/foundation/data/WindowGen.java b/src/main/java/com/simibubi/create/foundation/data/WindowGen.java index 5409a8f36..179343daf 100644 --- a/src/main/java/com/simibubi/create/foundation/data/WindowGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/WindowGen.java @@ -24,7 +24,7 @@ import com.tterrag.registrate.util.nullness.NonNullConsumer; import com.tterrag.registrate.util.nullness.NonNullFunction; import net.minecraft.block.Block; -import net.minecraft.block.Block.Properties; +import net.minecraft.block.AbstractBlock.Properties; import net.minecraft.block.Blocks; import net.minecraft.block.WoodType; import net.minecraft.client.renderer.RenderType; diff --git a/src/main/java/com/simibubi/create/foundation/fluid/FluidRenderer.java b/src/main/java/com/simibubi/create/foundation/fluid/FluidRenderer.java index 4e5e7c41e..b9d3a845e 100644 --- a/src/main/java/com/simibubi/create/foundation/fluid/FluidRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/fluid/FluidRenderer.java @@ -15,8 +15,8 @@ import net.minecraft.inventory.container.PlayerContainer; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; -import net.minecraft.util.math.Vec3d; -import net.minecraft.util.math.Vec3i; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.vector.Vector3i; import net.minecraftforge.fluids.FluidAttributes; import net.minecraftforge.fluids.FluidStack; @@ -33,7 +33,7 @@ public class FluidRenderer { int color = fluidAttributes.getColor(fluidStack); IVertexBuilder builder = buffer.getBuffer(RenderType.getTranslucent()); MatrixStacker msr = MatrixStacker.of(ms); - Vec3d center = new Vec3d(xMin + (xMax - xMin) / 2, yMin + (yMax - yMin) / 2, zMin + (zMax - zMin) / 2); + Vector3d center = new Vector3d(xMin + (xMax - xMin) / 2, yMin + (yMax - yMin) / 2, zMin + (zMax - zMin) / 2); int blockLightIn = (light >> 4) & 0xf; int luminosity = Math.max(blockLightIn, fluidAttributes.getLuminosity(fluidStack)); @@ -138,7 +138,7 @@ public class FluidRenderer { private static void putVertex(IVertexBuilder builder, MatrixStack ms, float x, float y, float z, int color, float u, float v, Direction face, int light) { - Vec3i n = face.getDirectionVec(); + Vector3i n = face.getDirectionVec(); Entry peek = ms.peek(); int ff = 0xff; int a = color >> 24 & ff; diff --git a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java index 49d7882b6..111467d6f 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java +++ b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java @@ -112,7 +112,7 @@ public enum AllGuiTextures { @OnlyIn(Dist.CLIENT) public void draw(AbstractGui screen, int x, int y) { bind(); - screen.blit(x, y, startX, startY, width, height); + screen.drawTexture(x, y, startX, startY, width, height); } @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java b/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java index 28dc9bea8..d28546da0 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java +++ b/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java @@ -12,7 +12,7 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -119,7 +119,7 @@ public class AllIcons { @OnlyIn(Dist.CLIENT) public void draw(AbstractGui screen, int x, int y) { bind(); - screen.blit(x, y, iconX, iconY, 16, 16); + screen.drawTexture(x, y, iconX, iconY, 16, 16); } @OnlyIn(Dist.CLIENT) @@ -136,12 +136,12 @@ public class AllIcons { int j = i >> 16 & '\uffff'; int k = i & '\uffff'; Entry peek = ms.peek(); - Vec3d rgb = ColorHelper.getRGB(color); + Vector3d rgb = ColorHelper.getRGB(color); - Vec3d vec4 = new Vec3d(1, 1, 0); - Vec3d vec3 = new Vec3d(0, 1, 0); - Vec3d vec2 = new Vec3d(0, 0, 0); - Vec3d vec1 = new Vec3d(1, 0, 0); + Vector3d vec4 = new Vector3d(1, 1, 0); + Vector3d vec3 = new Vector3d(0, 1, 0); + Vector3d vec2 = new Vector3d(0, 0, 0); + Vector3d vec1 = new Vector3d(1, 0, 0); float u1 = (iconX + 16) / sheetSize; float u2 = iconX / sheetSize; @@ -155,7 +155,7 @@ public class AllIcons { } @OnlyIn(Dist.CLIENT) - private void vertex(Entry peek, IVertexBuilder builder, int j, int k, Vec3d rgb, Vec3d vec, float u, float v) { + private void vertex(Entry peek, IVertexBuilder builder, int j, int k, Vector3d rgb, Vector3d vec, float u, float v) { builder.vertex(peek.getModel(), (float) vec.x, (float) vec.y, (float) vec.z) .color((float) rgb.x, (float) rgb.y, (float) rgb.z, 1) .texture(u, v) diff --git a/src/main/java/com/simibubi/create/foundation/gui/GuiGameElement.java b/src/main/java/com/simibubi/create/foundation/gui/GuiGameElement.java index 53b183cb5..2df4f35f3 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/GuiGameElement.java +++ b/src/main/java/com/simibubi/create/foundation/gui/GuiGameElement.java @@ -35,7 +35,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.IItemProvider; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.LightType; import net.minecraft.world.World; import net.minecraftforge.client.model.data.EmptyModelData; @@ -70,7 +70,7 @@ public class GuiGameElement { double xRot, yRot, zRot; double scale = 1; int color = 0xFFFFFF; - Vec3d rotationOffset = Vec3d.ZERO; + Vector3d rotationOffset = Vector3d.ZERO; public GuiRenderBuilder atLocal(double x, double y, double z) { this.x = x; @@ -107,7 +107,7 @@ public class GuiGameElement { return this; } - public GuiRenderBuilder withRotationOffset(Vec3d offset) { + public GuiRenderBuilder withRotationOffset(Vector3d offset) { this.rotationOffset = offset; return this; } @@ -180,7 +180,7 @@ public class GuiGameElement { protected void renderModel(BlockRendererDispatcher blockRenderer, IRenderTypeBuffer.Impl buffer, RenderType renderType, IVertexBuilder vb, MatrixStack ms) { - Vec3d rgb = ColorHelper.getRGB(color); + Vector3d rgb = ColorHelper.getRGB(color); blockRenderer.getBlockModelRenderer() .renderModel(ms.peek(), vb, blockState, blockmodel, (float) rgb.x, (float) rgb.y, (float) rgb.z, 0xF000F0, OverlayTexture.DEFAULT_UV, EmptyModelData.INSTANCE); diff --git a/src/main/java/com/simibubi/create/foundation/gui/ToolSelectionScreen.java b/src/main/java/com/simibubi/create/foundation/gui/ToolSelectionScreen.java index 8ec08b02c..1457d8fc3 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/ToolSelectionScreen.java +++ b/src/main/java/com/simibubi/create/foundation/gui/ToolSelectionScreen.java @@ -68,7 +68,7 @@ public class ToolSelectionScreen extends Screen { RenderSystem.color4f(1, 1, 1, focused ? 7 / 8f : 1 / 2f); Minecraft.getInstance().getTextureManager().bindTexture(gray.location); - blit(x - 15, y, gray.startX, gray.startY, w, h, gray.width, gray.height); + drawTexture(x - 15, y, gray.startX, gray.startY, w, h, gray.width, gray.height); float toolTipAlpha = yOffset / 10; FontRenderer font = minecraft.fontRenderer; @@ -77,7 +77,7 @@ public class ToolSelectionScreen extends Screen { if (toolTipAlpha > 0.25f) { RenderSystem.color4f(.7f, .7f, .8f, toolTipAlpha); - blit(x - 15, y + 33, gray.startX, gray.startY, w, h + 22, gray.width, gray.height); + drawTexture(x - 15, y + 33, gray.startX, gray.startY, w, h + 22, gray.width, gray.height); RenderSystem.color4f(1, 1, 1, 1); if (toolTip.size() > 0) diff --git a/src/main/java/com/simibubi/create/foundation/gui/widgets/IconButton.java b/src/main/java/com/simibubi/create/foundation/gui/widgets/IconButton.java index 499a6a7c2..c06bafa5d 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/widgets/IconButton.java +++ b/src/main/java/com/simibubi/create/foundation/gui/widgets/IconButton.java @@ -25,7 +25,7 @@ public class IconButton extends AbstractSimiWidget { RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); AllGuiTextures.BUTTON.bind(); - blit(x, y, button.startX, button.startY, button.width, button.height); + drawTexture(x, y, button.startX, button.startY, button.width, button.height); icon.draw(this, x + 1, y + 1); } } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/CenteredSideValueBoxTransform.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/CenteredSideValueBoxTransform.java index fa2c343a3..4f3a8720c 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/CenteredSideValueBoxTransform.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/CenteredSideValueBoxTransform.java @@ -6,7 +6,7 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.util.Direction; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class CenteredSideValueBoxTransform extends ValueBoxTransform.Sided { @@ -21,7 +21,7 @@ public class CenteredSideValueBoxTransform extends ValueBoxTransform.Sided { } @Override - protected Vec3d getSouthLocation() { + protected Vector3d getSouthLocation() { return VecHelper.voxelSpace(8, 8, 16); } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/ValueBox.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/ValueBox.java index 3bda767f3..d1f8f6b75 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/ValueBox.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/ValueBox.java @@ -17,14 +17,14 @@ import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.item.ItemStack; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class ValueBox extends ChasingAABBOutline { protected String label = "Value Box"; protected String sublabel = ""; protected String scrollTooltip = ""; - protected Vec3d labelOffset = Vec3d.ZERO; + protected Vector3d labelOffset = Vector3d.ZERO; protected int passiveColor; protected int highlightColor; @@ -46,7 +46,7 @@ public class ValueBox extends ChasingAABBOutline { return this; } - public ValueBox offsetLabel(Vec3d offset) { + public ValueBox offsetLabel(Vector3d offset) { this.labelOffset = offset; return this; } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/ValueBoxTransform.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/ValueBoxTransform.java index ad6efc0b1..1c9f3169d 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/ValueBoxTransform.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/ValueBoxTransform.java @@ -14,25 +14,25 @@ import net.minecraft.block.material.Material; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public abstract class ValueBoxTransform { protected float scale = getScale(); - protected abstract Vec3d getLocalOffset(BlockState state); + protected abstract Vector3d getLocalOffset(BlockState state); protected abstract void rotate(BlockState state, MatrixStack ms); - public boolean testHit(BlockState state, Vec3d localHit) { - Vec3d offset = getLocalOffset(state); + public boolean testHit(BlockState state, Vector3d localHit) { + Vector3d offset = getLocalOffset(state); if (offset == null) return false; return localHit.distanceTo(offset) < scale / 2; } public void transform(BlockState state, MatrixStack ms) { - Vec3d position = getLocalOffset(state); + Vector3d position = getLocalOffset(state); if (position == null) return; ms.translate(position.x, position.y, position.z); @@ -44,7 +44,7 @@ public abstract class ValueBoxTransform { return state.getMaterial() != Material.AIR && getLocalOffset(state) != null; } - protected Vec3d rotateHorizontally(BlockState state, Vec3d vec) { + protected Vector3d rotateHorizontally(BlockState state, Vector3d vec) { float yRot = 0; if (state.has(BlockStateProperties.FACING)) yRot = AngleHelper.horizontalAngle(state.get(BlockStateProperties.FACING)); @@ -77,8 +77,8 @@ public abstract class ValueBoxTransform { return Pair.of(factory.apply(true), factory.apply(false)); } - public boolean testHit(BlockState state, Vec3d localHit) { - Vec3d offset = getLocalOffset(state); + public boolean testHit(BlockState state, Vector3d localHit) { + Vector3d offset = getLocalOffset(state); if (offset == null) return false; return localHit.distanceTo(offset) < scale / 3.5f; @@ -96,14 +96,14 @@ public abstract class ValueBoxTransform { } @Override - protected Vec3d getLocalOffset(BlockState state) { - Vec3d location = getSouthLocation(); + protected Vector3d getLocalOffset(BlockState state) { + Vector3d location = getSouthLocation(); location = VecHelper.rotateCentered(location, AngleHelper.horizontalAngle(getSide()), Axis.Y); location = VecHelper.rotateCentered(location, AngleHelper.verticalAngle(getSide()), Axis.Z); return location; } - protected abstract Vec3d getSouthLocation(); + protected abstract Vector3d getSouthLocation(); @Override protected void rotate(BlockState state, MatrixStack ms) { @@ -120,7 +120,7 @@ public abstract class ValueBoxTransform { } @Override - public boolean testHit(BlockState state, Vec3d localHit) { + public boolean testHit(BlockState state, Vector3d localHit) { return isSideActive(state, getSide()) && super.testHit(state, localHit); } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/belt/TransportedItemStackHandlerBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/belt/TransportedItemStackHandlerBehaviour.java index 4e667247a..02d995ded 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/belt/TransportedItemStackHandlerBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/belt/TransportedItemStackHandlerBehaviour.java @@ -9,7 +9,7 @@ import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType; import com.simibubi.create.foundation.utility.VecHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class TransportedItemStackHandlerBehaviour extends TileEntityBehaviour { @@ -37,7 +37,7 @@ public class TransportedItemStackHandlerBehaviour extends TileEntityBehaviour { this.processingCallback.applyToAllItems(maxDistanceFromCenter, processFunction); } - public Vec3d getWorldPositionOf(TransportedItemStack transported) { + public Vector3d getWorldPositionOf(TransportedItemStack transported) { return positionGetter.getWorldPositionVector(transported); } @@ -54,7 +54,7 @@ public class TransportedItemStackHandlerBehaviour extends TileEntityBehaviour { @FunctionalInterface public interface PositionGetter { - public Vec3d getWorldPositionVector(TransportedItemStack transported); + public Vector3d getWorldPositionVector(TransportedItemStack transported); } } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java index 972623a74..81c6db155 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java @@ -17,8 +17,8 @@ import net.minecraft.util.SoundEvents; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; -import net.minecraft.util.math.Vec3d; -import net.minecraft.util.math.Vec3i; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.vector.Vector3i; import net.minecraft.world.World; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -79,7 +79,7 @@ public class EdgeInteractionHandler { return sides; } - public static Direction getActivatedDirection(World world, BlockPos pos, Direction face, Vec3d hit, + public static Direction getActivatedDirection(World world, BlockPos pos, Direction face, Vector3d hit, EdgeInteractionBehaviour behaviour) { for (Direction facing : getConnectiveSides(world, pos, face, behaviour)) { AxisAlignedBB bb = getBB(pos, facing); @@ -91,7 +91,7 @@ public class EdgeInteractionHandler { static AxisAlignedBB getBB(BlockPos pos, Direction direction) { AxisAlignedBB bb = new AxisAlignedBB(pos); - Vec3i vec = direction.getDirectionVec(); + Vector3i vec = direction.getDirectionVec(); int x = vec.getX(); int y = vec.getY(); int z = vec.getZ(); diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionRenderer.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionRenderer.java index 3211ee68a..9d1cfa357 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionRenderer.java @@ -18,7 +18,7 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class EdgeInteractionRenderer { @@ -49,9 +49,9 @@ public class EdgeInteractionRenderer { Direction closestEdge = connectiveSides.get(0); double bestDistance = Double.MAX_VALUE; - Vec3d center = VecHelper.getCenterOf(pos); + Vector3d center = VecHelper.getCenterOf(pos); for (Direction direction : connectiveSides) { - double distance = new Vec3d(direction.getDirectionVec()).subtract(target.getHitVec() + double distance = Vector3d.of(direction.getDirectionVec()).subtract(target.getHitVec() .subtract(center)) .length(); if (distance > bestDistance) @@ -64,7 +64,7 @@ public class EdgeInteractionRenderer { boolean hit = bb.contains(target.getHitVec()); ValueBox box = new ValueBox("", bb.offset(-pos.getX(), -pos.getY(), -pos.getZ()), pos); - Vec3d textOffset = Vec3d.ZERO; + Vector3d textOffset = Vector3d.ZERO; boolean positive = closestEdge.getAxisDirection() == AxisDirection.POSITIVE; if (positive) { diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java index 9dbffb81a..f03989122 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringBehaviour.java @@ -16,7 +16,7 @@ import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.Direction; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; public class FilteringBehaviour extends TileEntityBehaviour { @@ -25,7 +25,7 @@ public class FilteringBehaviour extends TileEntityBehaviour { ValueBoxTransform slotPositioning; boolean showCount; - Vec3d textShift; + Vector3d textShift; private ItemStack filter; public int count; @@ -45,7 +45,7 @@ public class FilteringBehaviour extends TileEntityBehaviour { callback = stack -> { }; isActive = () -> true; - textShift = Vec3d.ZERO; + textShift = Vector3d.ZERO; count = 0; ticksUntilScrollPacket = -1; showCountPredicate = () -> showCount; @@ -115,7 +115,7 @@ public class FilteringBehaviour extends TileEntityBehaviour { return this; } - public FilteringBehaviour moveText(Vec3d shift) { + public FilteringBehaviour moveText(Vector3d shift) { textShift = shift; return this; } @@ -143,7 +143,7 @@ public class FilteringBehaviour extends TileEntityBehaviour { @Override public void destroy() { if (filter.getItem() instanceof FilterItem) { - Vec3d pos = VecHelper.getCenterOf(getPos()); + Vector3d pos = VecHelper.getCenterOf(getPos()); World world = getWorld(); world.addEntity(new ItemEntity(world, pos.x, pos.y, pos.z, filter.copy())); } @@ -172,9 +172,9 @@ public class FilteringBehaviour extends TileEntityBehaviour { return TYPE; } - public boolean testHit(Vec3d hit) { + public boolean testHit(Vector3d hit) { BlockState state = tileEntity.getBlockState(); - Vec3d localHit = hit.subtract(new Vec3d(tileEntity.getPos())); + Vector3d localHit = hit.subtract(Vector3d.of(tileEntity.getPos())); return slotPositioning.testHit(state, localHit); } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java index 790e06234..92f6219b6 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/FilteringRenderer.java @@ -24,7 +24,7 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class FilteringRenderer { @@ -61,9 +61,9 @@ public class FilteringRenderer { boolean showCount = behaviour.isCountVisible(); String label = isFilterSlotted ? "" : Lang.translate("logistics.filter"); boolean hit = behaviour.slotPositioning.testHit(state, target.getHitVec() - .subtract(new Vec3d(pos))); + .subtract(Vector3d.of(pos))); - AxisAlignedBB emptyBB = new AxisAlignedBB(Vec3d.ZERO, Vec3d.ZERO); + AxisAlignedBB emptyBB = new AxisAlignedBB(Vector3d.ZERO, Vector3d.ZERO); AxisAlignedBB bb = isFilterSlotted ? emptyBB.grow(.45f, .31f, .2f) : emptyBB.grow(.25f); ValueBox box = showCount ? new ItemValueBox(label, bb, pos, filter, behaviour.scrollableValue) diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/SidedFilteringBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/SidedFilteringBehaviour.java index 7dc6bf4e3..fe322f214 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/SidedFilteringBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/filtering/SidedFilteringBehaviour.java @@ -17,7 +17,7 @@ import net.minecraft.block.BlockState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.Direction; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraftforge.common.util.Constants.NBT; public class SidedFilteringBehaviour extends FilteringBehaviour { @@ -139,10 +139,10 @@ public class SidedFilteringBehaviour extends FilteringBehaviour { .destroy(); } - public boolean testHit(Direction direction, Vec3d hit) { + public boolean testHit(Direction direction, Vector3d hit) { ValueBoxTransform.Sided sidedPositioning = (Sided) slotPositioning; BlockState state = tileEntity.getBlockState(); - Vec3d localHit = hit.subtract(new Vec3d(tileEntity.getPos())); + Vector3d localHit = hit.subtract(Vector3d.of(tileEntity.getPos())); return sidedPositioning.fromSide(direction) .testHit(state, localHit); } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/inventory/SynchronizedExtraction.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/inventory/SynchronizedExtraction.java index 39fefa472..f4de43840 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/inventory/SynchronizedExtraction.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/inventory/SynchronizedExtraction.java @@ -11,11 +11,11 @@ import net.minecraft.block.ChestBlock; import net.minecraft.state.properties.ChestType; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ILightReader; +import net.minecraft.world.IBlockDisplayReader; public class SynchronizedExtraction { - static boolean extractSynchronized(ILightReader reader, BlockPos inventoryPos) { + static boolean extractSynchronized(IBlockDisplayReader reader, BlockPos inventoryPos) { List actors = getAllSyncedExtractors(reader, inventoryPos); int startIndex = actors.size() - 1; boolean success = false; @@ -34,7 +34,7 @@ public class SynchronizedExtraction { return success; } - private static List getAllSyncedExtractors(ILightReader reader, + private static List getAllSyncedExtractors(IBlockDisplayReader reader, BlockPos inventoryPos) { List list = new ArrayList<>(); List inventoryPositions = new ArrayList<>(); diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkBehaviour.java index 6d96d6a9b..49a7440c5 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkBehaviour.java @@ -17,7 +17,7 @@ import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; import net.minecraft.block.BlockState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class LinkBehaviour extends TileEntityBehaviour { @@ -31,7 +31,7 @@ public class LinkBehaviour extends TileEntityBehaviour { Frequency frequencyLast; ValueBoxTransform firstSlot; ValueBoxTransform secondSlot; - Vec3d textShift; + Vector3d textShift; public boolean newPosition; private Mode mode; @@ -44,7 +44,7 @@ public class LinkBehaviour extends TileEntityBehaviour { frequencyLast = new Frequency(ItemStack.EMPTY); firstSlot = slots.getLeft(); secondSlot = slots.getRight(); - textShift = Vec3d.ZERO; + textShift = Vector3d.ZERO; newPosition = true; } @@ -64,7 +64,7 @@ public class LinkBehaviour extends TileEntityBehaviour { return behaviour; } - public LinkBehaviour moveText(Vec3d shift) { + public LinkBehaviour moveText(Vector3d shift) { textShift = shift; return this; } @@ -170,12 +170,12 @@ public class LinkBehaviour extends TileEntityBehaviour { } public static class SlotPositioning { - Function> offsets; - Function rotation; + Function> offsets; + Function rotation; float scale; - public SlotPositioning(Function> offsetsForState, - Function rotationForState) { + public SlotPositioning(Function> offsetsForState, + Function rotationForState) { offsets = offsetsForState; rotation = rotationForState; scale = 1; @@ -188,9 +188,9 @@ public class LinkBehaviour extends TileEntityBehaviour { } - public boolean testHit(Boolean first, Vec3d hit) { + public boolean testHit(Boolean first, Vector3d hit) { BlockState state = tileEntity.getBlockState(); - Vec3d localHit = hit.subtract(new Vec3d(tileEntity.getPos())); + Vector3d localHit = hit.subtract(Vector3d.of(tileEntity.getPos())); return (first ? firstSlot : secondSlot).testHit(state, localHit); } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkRenderer.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkRenderer.java index 64e5d6862..80aad562e 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/linked/LinkRenderer.java @@ -20,7 +20,7 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class LinkRenderer { @@ -42,7 +42,7 @@ public class LinkRenderer { String freq2 = Lang.translate("logistics.secondFrequency"); for (boolean first : Iterate.trueAndFalse) { - AxisAlignedBB bb = new AxisAlignedBB(Vec3d.ZERO, Vec3d.ZERO).grow(.25f); + AxisAlignedBB bb = new AxisAlignedBB(Vector3d.ZERO, Vector3d.ZERO).grow(.25f); String label = first ? freq2 : freq1; boolean hit = behaviour.testHit(first, target.getHitVec()); ValueBoxTransform transform = first ? behaviour.firstSlot : behaviour.secondSlot; diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java index a9585d883..5f4dab502 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java @@ -12,14 +12,14 @@ import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class ScrollValueBehaviour extends TileEntityBehaviour { public static BehaviourType TYPE = new BehaviourType<>(); ValueBoxTransform slotPositioning; - Vec3d textShift; + Vector3d textShift; int min = 0; int max = 1; @@ -43,7 +43,7 @@ public class ScrollValueBehaviour extends TileEntityBehaviour { }; clientCallback = i -> { }; - textShift = Vec3d.ZERO; + textShift = Vector3d.ZERO; formatter = i -> Integer.toString(i); step = (c) -> 1; value = 0; @@ -108,7 +108,7 @@ public class ScrollValueBehaviour extends TileEntityBehaviour { return this; } - public ScrollValueBehaviour moveText(Vec3d shift) { + public ScrollValueBehaviour moveText(Vector3d shift) { textShift = shift; return this; } @@ -165,9 +165,9 @@ public class ScrollValueBehaviour extends TileEntityBehaviour { return TYPE; } - public boolean testHit(Vec3d hit) { + public boolean testHit(Vector3d hit) { BlockState state = tileEntity.getBlockState(); - Vec3d localHit = hit.subtract(new Vec3d(tileEntity.getPos())); + Vector3d localHit = hit.subtract(Vector3d.of(tileEntity.getPos())); return slotPositioning.testHit(state, localHit); } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueRenderer.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueRenderer.java index cac65c2ce..628a8d92b 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueRenderer.java @@ -17,7 +17,7 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class ScrollValueRenderer { @@ -53,7 +53,7 @@ public class ScrollValueRenderer { protected static void addBox(ClientWorld world, BlockPos pos, Direction face, ScrollValueBehaviour behaviour, boolean highlight) { - AxisAlignedBB bb = new AxisAlignedBB(Vec3d.ZERO, Vec3d.ZERO).grow(.5f) + AxisAlignedBB bb = new AxisAlignedBB(Vector3d.ZERO, Vector3d.ZERO).grow(.5f) .contract(0, 0, -.5f) .offset(0, 0, -.125f); String label = behaviour.label; diff --git a/src/main/java/com/simibubi/create/foundation/utility/AngleHelper.java b/src/main/java/com/simibubi/create/foundation/utility/AngleHelper.java index f42a9f6c0..22d4b9cd5 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/AngleHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/AngleHelper.java @@ -2,7 +2,7 @@ package com.simibubi.create.foundation.utility; import com.mojang.blaze3d.matrix.MatrixStack; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraftforge.api.distmarker.Dist; diff --git a/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java b/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java index 1197aa3cf..45d90788d 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java @@ -5,7 +5,7 @@ import java.util.function.Consumer; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.state.properties.BlockStateProperties; @@ -76,7 +76,7 @@ public class BlockHelper { public static void destroyBlock(World world, BlockPos pos, float effectChance, Consumer droppedItemCallback) { - IFluidState ifluidstate = world.getFluidState(pos); + FluidState ifluidstate = world.getFluidState(pos); BlockState state = world.getBlockState(pos); if (world.rand.nextFloat() < effectChance) world.playEvent(2001, pos, Block.getStateId(state)); diff --git a/src/main/java/com/simibubi/create/foundation/utility/ColorHelper.java b/src/main/java/com/simibubi/create/foundation/utility/ColorHelper.java index 658ecee30..d7f300c76 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/ColorHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/ColorHelper.java @@ -4,7 +4,7 @@ import java.util.UUID; import com.mojang.blaze3d.systems.RenderSystem; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class ColorHelper { @@ -56,11 +56,11 @@ public class ColorHelper { RenderSystem.color4f(1, 1, 1, 1); } - public static Vec3d getRGB(int color) { + public static Vector3d getRGB(int color) { int r = (color >> 16); int g = (color >> 8) & 0xFF; int b = color & 0xFF; - return new Vec3d(r, g, b).scale(1 / 256d); + return new Vector3d(r, g, b).scale(1 / 256d); } public static int colorFromUUID(UUID uuid) { diff --git a/src/main/java/com/simibubi/create/foundation/utility/MatrixStacker.java b/src/main/java/com/simibubi/create/foundation/utility/MatrixStacker.java index 545d41a50..74a949ac1 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/MatrixStacker.java +++ b/src/main/java/com/simibubi/create/foundation/utility/MatrixStacker.java @@ -2,14 +2,14 @@ package com.simibubi.create.foundation.utility; import com.mojang.blaze3d.matrix.MatrixStack; -import net.minecraft.client.renderer.Vector3f; +import net.minecraft.util.math.vector.Vector3f; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.util.math.Vec3i; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.vector.Vector3i; public class MatrixStacker { - static Vec3d center = VecHelper.getCenterOf(BlockPos.ZERO); + static Vector3d center = VecHelper.getCenterOf(BlockPos.ZERO); static MatrixStacker instance; MatrixStack ms; @@ -48,17 +48,17 @@ public class MatrixStacker { return translateBack(center); } - public MatrixStacker translate(Vec3i vec) { + public MatrixStacker translate(Vector3i vec) { ms.translate(vec.getX(), vec.getY(), vec.getZ()); return this; } - public MatrixStacker translate(Vec3d vec) { + public MatrixStacker translate(Vector3d vec) { ms.translate(vec.x, vec.y, vec.z); return this; } - public MatrixStacker translateBack(Vec3d vec) { + public MatrixStacker translateBack(Vector3d vec) { ms.translate(-vec.x, -vec.y, -vec.z); return this; } diff --git a/src/main/java/com/simibubi/create/foundation/utility/Pointing.java b/src/main/java/com/simibubi/create/foundation/utility/Pointing.java index 89c434111..c9eac4486 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/Pointing.java +++ b/src/main/java/com/simibubi/create/foundation/utility/Pointing.java @@ -15,7 +15,7 @@ public enum Pointing implements IStringSerializable { } @Override - public String getName() { + public String getString() { return Lang.asId(name()); } diff --git a/src/main/java/com/simibubi/create/foundation/utility/RaycastHelper.java b/src/main/java/com/simibubi/create/foundation/utility/RaycastHelper.java index 803674f9a..3d30182e7 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/RaycastHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/RaycastHelper.java @@ -10,26 +10,26 @@ 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.FluidMode; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.world.World; public class RaycastHelper { public static BlockRayTraceResult rayTraceRange(World worldIn, PlayerEntity playerIn, double range) { - Vec3d origin = getTraceOrigin(playerIn); - Vec3d target = getTraceTarget(playerIn, range, origin); + Vector3d origin = getTraceOrigin(playerIn); + Vector3d target = getTraceTarget(playerIn, range, origin); RayTraceContext context = new RayTraceContext(origin, target, BlockMode.COLLIDER, FluidMode.NONE, playerIn); return worldIn.rayTraceBlocks(context); } public static PredicateTraceResult rayTraceUntil(PlayerEntity playerIn, double range, Predicate predicate) { - Vec3d origin = getTraceOrigin(playerIn); - Vec3d target = getTraceTarget(playerIn, range, origin); + Vector3d origin = getTraceOrigin(playerIn); + Vector3d target = getTraceTarget(playerIn, range, origin); return rayTraceUntil(origin, target, predicate); } - public static Vec3d getTraceTarget(PlayerEntity playerIn, double range, Vec3d origin) { + public static Vector3d getTraceTarget(PlayerEntity playerIn, double range, Vector3d origin) { float f = playerIn.rotationPitch; float f1 = playerIn.rotationYaw; float f2 = MathHelper.cos(-f1 * 0.017453292F - (float) Math.PI); @@ -39,19 +39,19 @@ public class RaycastHelper { float f6 = f3 * f4; float f7 = f2 * f4; double d3 = range; - Vec3d vec3d1 = origin.add((double) f6 * d3, (double) f5 * d3, (double) f7 * d3); + Vector3d vec3d1 = origin.add((double) f6 * d3, (double) f5 * d3, (double) f7 * d3); return vec3d1; } - public static Vec3d getTraceOrigin(PlayerEntity playerIn) { + public static Vector3d getTraceOrigin(PlayerEntity playerIn) { double d0 = playerIn.getX(); double d1 = playerIn.getY() + (double) playerIn.getEyeHeight(); double d2 = playerIn.getZ(); - Vec3d vec3d = new Vec3d(d0, d1, d2); + Vector3d vec3d = new Vector3d(d0, d1, d2); return vec3d; } - public static PredicateTraceResult rayTraceUntil(Vec3d start, Vec3d end, Predicate predicate) { + public static PredicateTraceResult rayTraceUntil(Vector3d start, Vector3d end, Predicate predicate) { if (Double.isNaN(start.x) || Double.isNaN(start.y) || Double.isNaN(start.z)) return null; if (Double.isNaN(end.x) || Double.isNaN(end.y) || Double.isNaN(end.z)) @@ -146,13 +146,13 @@ public class RaycastHelper { if (d3 < d4 && d3 < d5) { enumfacing = dx > x ? Direction.WEST : Direction.EAST; - start = new Vec3d(d0, start.y + d7 * d3, start.z + d8 * d3); + start = new Vector3d(d0, start.y + d7 * d3, start.z + d8 * d3); } else if (d4 < d5) { enumfacing = dy > y ? Direction.DOWN : Direction.UP; - start = new Vec3d(start.x + d6 * d4, d1, start.z + d8 * d4); + start = new Vector3d(start.x + d6 * d4, d1, start.z + d8 * d4); } else { enumfacing = dz > z ? Direction.NORTH : Direction.SOUTH; - start = new Vec3d(start.x + d6 * d5, start.y + d7 * d5, d2); + start = new Vector3d(start.x + d6 * d5, start.y + d7 * d5, d2); } x = MathHelper.floor(start.x) - (enumfacing == Direction.EAST ? 1 : 0); diff --git a/src/main/java/com/simibubi/create/foundation/utility/ShadowRenderHelper.java b/src/main/java/com/simibubi/create/foundation/utility/ShadowRenderHelper.java index 0a8f5349a..b0e2b4c64 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/ShadowRenderHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/ShadowRenderHelper.java @@ -13,7 +13,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IWorldReader; @@ -24,7 +24,7 @@ public class ShadowRenderHelper { private static final RenderType SHADOW_LAYER = RenderType.getEntityNoOutline(new ResourceLocation("textures/misc/shadow.png")); - public static void renderShadow(MatrixStack p_229096_0_, IRenderTypeBuffer p_229096_1_, Vec3d pos, + public static void renderShadow(MatrixStack p_229096_0_, IRenderTypeBuffer p_229096_1_, Vector3d pos, float p_229096_3_, float p_229096_6_) { float f = p_229096_6_; diff --git a/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java b/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java index c888ea1d2..50178e682 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java +++ b/src/main/java/com/simibubi/create/foundation/utility/SuperByteBuffer.java @@ -12,8 +12,8 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.BufferBuilder.DrawState; import net.minecraft.client.renderer.GLAllocation; -import net.minecraft.client.renderer.Matrix4f; -import net.minecraft.client.renderer.Vector4f; +import net.minecraft.util.math.vector.Matrix4f; +import net.minecraft.util.math.vector.Vector4f; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.Direction; diff --git a/src/main/java/com/simibubi/create/foundation/utility/TileEntityRenderHelper.java b/src/main/java/com/simibubi/create/foundation/utility/TileEntityRenderHelper.java index 1f8a3150c..dbda9ebfd 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/TileEntityRenderHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/TileEntityRenderHelper.java @@ -8,8 +8,8 @@ import com.simibubi.create.foundation.config.AllConfigs; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; -import net.minecraft.client.renderer.Matrix4f; -import net.minecraft.client.renderer.Vector4f; +import net.minecraft.util.math.vector.Matrix4f; +import net.minecraft.util.math.vector.Vector4f; import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; diff --git a/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java b/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java index 17123dd50..eb89ce5ed 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/VecHelper.java @@ -8,29 +8,29 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; -import net.minecraft.util.math.Vec3i; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.vector.Vector3i; public class VecHelper { - public static Vec3d rotate(Vec3d vec, Vec3d rotationVec) { + public static Vector3d rotate(Vector3d vec, Vector3d rotationVec) { return rotate(vec, rotationVec.x, rotationVec.y, rotationVec.z); } - public static Vec3d rotate(Vec3d vec, double xRot, double yRot, double zRot) { + public static Vector3d rotate(Vector3d vec, double xRot, double yRot, double zRot) { return rotate(rotate(rotate(vec, xRot, Axis.X), yRot, Axis.Y), zRot, Axis.Z); } - public static Vec3d rotateCentered(Vec3d vec, double deg, Axis axis) { - Vec3d shift = getCenterOf(BlockPos.ZERO); + public static Vector3d rotateCentered(Vector3d vec, double deg, Axis axis) { + Vector3d shift = getCenterOf(BlockPos.ZERO); return VecHelper.rotate(vec.subtract(shift), deg, axis) .add(shift); } - public static Vec3d rotate(Vec3d vec, double deg, Axis axis) { + public static Vector3d rotate(Vector3d vec, double deg, Axis axis) { if (deg == 0) return vec; - if (vec == Vec3d.ZERO) + if (vec == Vector3d.ZERO) return vec; float angle = (float) (deg / 180f * Math.PI); @@ -41,33 +41,33 @@ public class VecHelper { double z = vec.z; if (axis == Axis.X) - return new Vec3d(x, y * cos - z * sin, z * cos + y * sin); + return new Vector3d(x, y * cos - z * sin, z * cos + y * sin); if (axis == Axis.Y) - return new Vec3d(x * cos + z * sin, y, z * cos - x * sin); + return new Vector3d(x * cos + z * sin, y, z * cos - x * sin); if (axis == Axis.Z) - return new Vec3d(x * cos - y * sin, y * cos + x * sin, z); + return new Vector3d(x * cos - y * sin, y * cos + x * sin, z); return vec; } - public static boolean isVecPointingTowards(Vec3d vec, Direction direction) { - return new Vec3d(direction.getDirectionVec()).distanceTo(vec.normalize()) < .75; + public static boolean isVecPointingTowards(Vector3d vec, Direction direction) { + return Vector3d.of(direction.getDirectionVec()).distanceTo(vec.normalize()) < .75; } - public static Vec3d getCenterOf(Vec3i pos) { - return new Vec3d(pos).add(.5f, .5f, .5f); + public static Vector3d getCenterOf(Vector3i pos) { + return Vector3d.of(pos).add(.5f, .5f, .5f); } - public static Vec3d offsetRandomly(Vec3d vec, Random r, float radius) { - return new Vec3d(vec.x + (r.nextFloat() - .5f) * 2 * radius, vec.y + (r.nextFloat() - .5f) * 2 * radius, + public static Vector3d offsetRandomly(Vector3d vec, Random r, float radius) { + return new Vector3d(vec.x + (r.nextFloat() - .5f) * 2 * radius, vec.y + (r.nextFloat() - .5f) * 2 * radius, vec.z + (r.nextFloat() - .5f) * 2 * radius); } - public static Vec3d planeByNormal(Vec3d vec) { + public static Vector3d planeByNormal(Vector3d vec) { vec = vec.normalize(); - return new Vec3d(1, 1, 1).subtract(Math.abs(vec.x), Math.abs(vec.y), Math.abs(vec.z)); + return new Vector3d(1, 1, 1).subtract(Math.abs(vec.x), Math.abs(vec.y), Math.abs(vec.z)); } - public static ListNBT writeNBT(Vec3d vec) { + public static ListNBT writeNBT(Vector3d vec) { ListNBT listnbt = new ListNBT(); listnbt.add(DoubleNBT.of(vec.x)); listnbt.add(DoubleNBT.of(vec.y)); @@ -75,19 +75,19 @@ public class VecHelper { return listnbt; } - public static Vec3d readNBT(ListNBT list) { - return new Vec3d(list.getDouble(0), list.getDouble(1), list.getDouble(2)); + public static Vector3d readNBT(ListNBT list) { + return new Vector3d(list.getDouble(0), list.getDouble(1), list.getDouble(2)); } - public static Vec3d voxelSpace(double x, double y, double z) { - return new Vec3d(x, y, z).scale(1 / 16f); + public static Vector3d voxelSpace(double x, double y, double z) { + return new Vector3d(x, y, z).scale(1 / 16f); } - public static int getCoordinate(Vec3i pos, Axis axis) { + public static int getCoordinate(Vector3i pos, Axis axis) { return axis.getCoordinate(pos.getX(), pos.getY(), pos.getZ()); } - public static float getCoordinate(Vec3d vec, Axis axis) { + public static float getCoordinate(Vector3d vec, Axis axis) { return (float) axis.getCoordinate(vec.x, vec.y, vec.z); } diff --git a/src/main/java/com/simibubi/create/foundation/utility/VoxelShaper.java b/src/main/java/com/simibubi/create/foundation/utility/VoxelShaper.java index ad40422ef..f673f5d1b 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/VoxelShaper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/VoxelShaper.java @@ -7,11 +7,13 @@ import java.util.function.Function; import org.apache.commons.lang3.mutable.MutableObject; +import com.simibubi.create.content.contraptions.relays.belt.Vector3i; + import net.minecraft.block.Block; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; @@ -45,7 +47,7 @@ public class VoxelShaper { public VoxelShaper withVerticalShapes(VoxelShape upShape) { shapes.put(Direction.UP, upShape); - shapes.put(Direction.DOWN, rotatedCopy(upShape, new Vec3d(180, 0, 0))); + shapes.put(Direction.DOWN, rotatedCopy(upShape, new Vector3d(180, 0, 0))); return this; } @@ -62,7 +64,7 @@ public class VoxelShaper { return (float)((Math.max(direction.getHorizontalIndex(), 0) & 3) * 90); } - protected static VoxelShaper forDirectionsWithRotation(VoxelShape shape, Direction facing, Iterable directions, Function rotationValues){ + protected static VoxelShaper forDirectionsWithRotation(VoxelShape shape, Direction facing, Iterable directions, Function rotationValues){ VoxelShaper voxelShaper = new VoxelShaper(); for (Direction dir : directions) { voxelShaper.shapes.put(dir, rotate(shape, facing, dir, rotationValues)); @@ -70,23 +72,23 @@ public class VoxelShaper { return voxelShaper; } - protected static VoxelShape rotate(VoxelShape shape, Direction from, Direction to, Function usingValues){ + protected static VoxelShape rotate(VoxelShape shape, Direction from, Direction to, Function usingValues){ if (from == to) return shape; return rotatedCopy(shape, usingValues.apply(from).inverse().add(usingValues.apply(to))); } - protected static VoxelShape rotatedCopy(VoxelShape shape, Vec3d rotation){ - if (rotation.equals(Vec3d.ZERO)) + protected static VoxelShape rotatedCopy(VoxelShape shape, Vector3d rotation){ + if (rotation.equals(Vector3d.ZERO)) return shape; MutableObject result = new MutableObject<>(VoxelShapes.empty()); - Vec3d center = new Vec3d(8, 8, 8); + Vector3d center = new Vector3d(8, 8, 8); shape.forEachBox((x1, y1, z1, x2, y2, z2) -> { - Vec3d v1 = new Vec3d(x1, y1, z1).scale(16).subtract(center); - Vec3d v2 = new Vec3d(x2, y2, z2).scale(16).subtract(center); + Vector3d v1 = new Vector3d(x1, y1, z1).scale(16).subtract(center); + Vector3d v2 = new Vector3d(x2, y2, z2).scale(16).subtract(center); v1 = VecHelper.rotate(v1, (float) rotation.x, Axis.X); v1 = VecHelper.rotate(v1, (float) rotation.y, Axis.Y); @@ -103,11 +105,11 @@ public class VoxelShaper { return result.getValue(); } - protected static class DefaultRotationValues implements Function { + protected static class DefaultRotationValues implements Function { //assume facing up as the default rotation @Override - public Vec3d apply(Direction direction) { - return new Vec3d( + public Vector3d apply(Direction direction) { + return new Vector3d( direction == Direction.UP ? 0 : (Direction.Plane.VERTICAL.test(direction) ? 180 : 90), -horizontalAngleFromDirection(direction), 0 @@ -115,10 +117,10 @@ public class VoxelShaper { } } - protected static class HorizontalRotationValues implements Function { + protected static class HorizontalRotationValues implements Function { @Override - public Vec3d apply(Direction direction) { - return new Vec3d( + public Vector3d apply(Direction direction) { + return new Vector3d( 0, -horizontalAngleFromDirection(direction), 0 diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java index 55c0462fb..daee1416b 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/AABBOutline.java @@ -11,7 +11,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class AABBOutline extends Outline { @@ -27,22 +27,22 @@ public class AABBOutline extends Outline { } public void renderBB(MatrixStack ms, SuperRenderTypeBuffer buffer, AxisAlignedBB bb) { - Vec3d projectedView = Minecraft.getInstance().gameRenderer.getActiveRenderInfo() + Vector3d projectedView = Minecraft.getInstance().gameRenderer.getActiveRenderInfo() .getProjectedView(); boolean noCull = bb.contains(projectedView); bb = bb.grow(noCull ? -1 / 128d : 1 / 128d); noCull |= params.disableCull; - Vec3d xyz = new Vec3d(bb.minX, bb.minY, bb.minZ); - Vec3d Xyz = new Vec3d(bb.maxX, bb.minY, bb.minZ); - Vec3d xYz = new Vec3d(bb.minX, bb.maxY, bb.minZ); - Vec3d XYz = new Vec3d(bb.maxX, bb.maxY, bb.minZ); - Vec3d xyZ = new Vec3d(bb.minX, bb.minY, bb.maxZ); - Vec3d XyZ = new Vec3d(bb.maxX, bb.minY, bb.maxZ); - Vec3d xYZ = new Vec3d(bb.minX, bb.maxY, bb.maxZ); - Vec3d XYZ = new Vec3d(bb.maxX, bb.maxY, bb.maxZ); + Vector3d xyz = new Vector3d(bb.minX, bb.minY, bb.minZ); + Vector3d Xyz = new Vector3d(bb.maxX, bb.minY, bb.minZ); + Vector3d xYz = new Vector3d(bb.minX, bb.maxY, bb.minZ); + Vector3d XYz = new Vector3d(bb.maxX, bb.maxY, bb.minZ); + Vector3d xyZ = new Vector3d(bb.minX, bb.minY, bb.maxZ); + Vector3d XyZ = new Vector3d(bb.maxX, bb.minY, bb.maxZ); + Vector3d xYZ = new Vector3d(bb.minX, bb.maxY, bb.maxZ); + Vector3d XYZ = new Vector3d(bb.maxX, bb.maxY, bb.maxZ); - Vec3d start = xyz; + Vector3d start = xyz; renderAACuboidLine(ms, buffer, start, Xyz); renderAACuboidLine(ms, buffer, start, xYz); renderAACuboidLine(ms, buffer, start, xyZ); @@ -71,8 +71,8 @@ public class AABBOutline extends Outline { } - protected void renderFace(MatrixStack ms, SuperRenderTypeBuffer buffer, Direction direction, Vec3d p1, Vec3d p2, - Vec3d p3, Vec3d p4, boolean noCull) { + protected void renderFace(MatrixStack ms, SuperRenderTypeBuffer buffer, Direction direction, Vector3d p1, Vector3d p2, + Vector3d p3, Vector3d p4, boolean noCull) { if (!params.faceTexture.isPresent()) return; @@ -86,8 +86,8 @@ public class AABBOutline extends Outline { IVertexBuilder builder = buffer.getLateBuffer(translucentType); Axis axis = direction.getAxis(); - Vec3d uDiff = p2.subtract(p1); - Vec3d vDiff = p4.subtract(p1); + Vector3d uDiff = p2.subtract(p1); + Vector3d vDiff = p4.subtract(p1); float maxU = (float) Math.abs(axis == Axis.X ? uDiff.z : uDiff.x); float maxV = (float) Math.abs(axis == Axis.Y ? vDiff.z : vDiff.y); putQuadUV(ms, builder, p1, p2, p3, p4, 0, 0, maxU, maxV, Direction.UP); diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/BlockClusterOutline.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/BlockClusterOutline.java index 014d8c8ac..6bdecac60 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/BlockClusterOutline.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/BlockClusterOutline.java @@ -18,7 +18,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class BlockClusterOutline extends Outline { @@ -32,9 +32,9 @@ public class BlockClusterOutline extends Outline { @Override public void render(MatrixStack ms, SuperRenderTypeBuffer buffer) { for (MergeEntry edge : cluster.visibleEdges) { - Vec3d start = new Vec3d(edge.pos); + Vector3d start = Vector3d.of(edge.pos); Direction direction = Direction.getFacingFromAxis(AxisDirection.POSITIVE, edge.axis); - renderAACuboidLine(ms, buffer, start, new Vec3d(edge.pos.offset(direction))); + renderAACuboidLine(ms, buffer, start, Vector3d.of(edge.pos.offset(direction))); } for (MergeEntry face : cluster.visibleFaces.keySet()) { @@ -56,9 +56,9 @@ public class BlockClusterOutline extends Outline { .getLocation(), true); IVertexBuilder builder = buffer.getLateBuffer(translucentType); - Vec3d center = VecHelper.getCenterOf(pos); - Vec3d offset = new Vec3d(face.getDirectionVec()); - Vec3d plane = VecHelper.planeByNormal(offset); + Vector3d center = VecHelper.getCenterOf(pos); + Vector3d offset = Vector3d.of(face.getDirectionVec()); + Vector3d plane = VecHelper.planeByNormal(offset); Axis axis = face.getAxis(); offset = offset.scale(1 / 2f + 1 / 64d); @@ -67,13 +67,13 @@ public class BlockClusterOutline extends Outline { int deg = face.getAxisDirection() .getOffset() * 90; - Vec3d a1 = plane.add(center); + Vector3d a1 = plane.add(center); plane = VecHelper.rotate(plane, deg, axis); - Vec3d a2 = plane.add(center); + Vector3d a2 = plane.add(center); plane = VecHelper.rotate(plane, deg, axis); - Vec3d a3 = plane.add(center); + Vector3d a3 = plane.add(center); plane = VecHelper.rotate(plane, deg, axis); - Vec3d a4 = plane.add(center); + Vector3d a4 = plane.add(center); putQuad(ms, builder, a1, a2, a3, a4, face); } diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/LineOutline.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/LineOutline.java index 0c97d254f..9e0acdd83 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/LineOutline.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/LineOutline.java @@ -5,14 +5,14 @@ import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer; import net.minecraft.client.Minecraft; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class LineOutline extends Outline { - protected Vec3d start = Vec3d.ZERO; - protected Vec3d end = Vec3d.ZERO; + protected Vector3d start = Vector3d.ZERO; + protected Vector3d end = Vector3d.ZERO; - public LineOutline set(Vec3d start, Vec3d end) { + public LineOutline set(Vector3d start, Vector3d end) { this.start = start; this.end = end; return this; @@ -39,7 +39,7 @@ public class LineOutline extends Outline { } @Override - public LineOutline set(Vec3d start, Vec3d end) { + public LineOutline set(Vector3d start, Vector3d end) { if (!end.equals(this.end)) super.set(start, end); return this; @@ -50,7 +50,7 @@ public class LineOutline extends Outline { float pt = Minecraft.getInstance() .getRenderPartialTicks(); float distanceToTarget = 1 - MathHelper.lerp(pt, prevProgress, progress); - Vec3d start = end.add(this.start.subtract(end) + Vector3d start = end.add(this.start.subtract(end) .scale(distanceToTarget)); renderAACuboidLine(ms, buffer, start, end); } diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java index 4329d97fd..4ec758203 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outline.java @@ -13,11 +13,11 @@ import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer; import com.simibubi.create.foundation.utility.ColorHelper; import com.simibubi.create.foundation.utility.VecHelper; -import net.minecraft.client.renderer.Matrix3f; +import net.minecraft.util.math.vector.Matrix3f; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public abstract class Outline { @@ -30,21 +30,21 @@ public abstract class Outline { public abstract void render(MatrixStack ms, SuperRenderTypeBuffer buffer); - public void renderAACuboidLine(MatrixStack ms, SuperRenderTypeBuffer buffer, Vec3d start, Vec3d end) { + public void renderAACuboidLine(MatrixStack ms, SuperRenderTypeBuffer buffer, Vector3d start, Vector3d end) { IVertexBuilder builder = buffer.getBuffer(RenderTypes.getOutlineSolid()); - Vec3d diff = end.subtract(start); + Vector3d diff = end.subtract(start); if (diff.x + diff.y + diff.z < 0) { - Vec3d temp = start; + Vector3d temp = start; start = end; end = temp; diff = diff.scale(-1); } float lineWidth = params.getLineWidth(); - Vec3d extension = diff.normalize() + Vector3d extension = diff.normalize() .scale(lineWidth / 2); - Vec3d plane = VecHelper.planeByNormal(diff); + Vector3d plane = VecHelper.planeByNormal(diff); Direction face = Direction.getFacingFromVector(diff.x, diff.y, diff.z); Axis axis = face.getAxis(); @@ -52,17 +52,17 @@ public abstract class Outline { end = end.add(extension); plane = plane.scale(lineWidth / 2); - Vec3d a1 = plane.add(start); - Vec3d b1 = plane.add(end); + Vector3d a1 = plane.add(start); + Vector3d b1 = plane.add(end); plane = VecHelper.rotate(plane, -90, axis); - Vec3d a2 = plane.add(start); - Vec3d b2 = plane.add(end); + Vector3d a2 = plane.add(start); + Vector3d b2 = plane.add(end); plane = VecHelper.rotate(plane, -90, axis); - Vec3d a3 = plane.add(start); - Vec3d b3 = plane.add(end); + Vector3d a3 = plane.add(start); + Vector3d b3 = plane.add(end); plane = VecHelper.rotate(plane, -90, axis); - Vec3d a4 = plane.add(start); - Vec3d b4 = plane.add(end); + Vector3d a4 = plane.add(start); + Vector3d b4 = plane.add(end); if (params.disableNormals) { face = Direction.UP; @@ -77,7 +77,7 @@ public abstract class Outline { putQuad(ms, builder, b4, b3, b2, b1, face); putQuad(ms, builder, a1, a2, a3, a4, face.getOpposite()); - Vec3d vec = a1.subtract(a4); + Vector3d vec = a1.subtract(a4); face = Direction.getFacingFromVector(vec.x, vec.y, vec.z); putQuad(ms, builder, a1, b1, b2, a2, face); vec = VecHelper.rotate(vec, -90, axis); @@ -91,12 +91,12 @@ public abstract class Outline { putQuad(ms, builder, a4, b4, b1, a1, face); } - public void putQuad(MatrixStack ms, IVertexBuilder builder, Vec3d v1, Vec3d v2, Vec3d v3, Vec3d v4, + public void putQuad(MatrixStack ms, IVertexBuilder builder, Vector3d v1, Vector3d v2, Vector3d v3, Vector3d v4, Direction normal) { putQuadUV(ms, builder, v1, v2, v3, v4, 0, 0, 1, 1, normal); } - public void putQuadUV(MatrixStack ms, IVertexBuilder builder, Vec3d v1, Vec3d v2, Vec3d v3, Vec3d v4, float minU, + public void putQuadUV(MatrixStack ms, IVertexBuilder builder, Vector3d v1, Vector3d v2, Vector3d v3, Vector3d v4, float minU, float minV, float maxU, float maxV, Direction normal) { putVertex(ms, builder, v1, minU, minV, normal); putVertex(ms, builder, v2, maxU, minV, normal); @@ -104,12 +104,12 @@ public abstract class Outline { putVertex(ms, builder, v4, minU, maxV, normal); } - protected void putVertex(MatrixStack ms, IVertexBuilder builder, Vec3d pos, float u, float v, Direction normal) { + protected void putVertex(MatrixStack ms, IVertexBuilder builder, Vector3d pos, float u, float v, Direction normal) { int i = 15 << 20 | 15 << 4; int j = i >> 16 & '\uffff'; int k = i & '\uffff'; Entry peek = ms.peek(); - Vec3d rgb = params.rgb; + Vector3d rgb = params.rgb; if (transformNormals == null) transformNormals = peek.getNormal(); @@ -149,7 +149,7 @@ public abstract class Outline { protected boolean disableNormals; protected float alpha; protected int lightMapU, lightMapV; - protected Vec3d rgb; + protected Vector3d rgb; private float lineWidth; public OutlineParams() { diff --git a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java index 67ee4f80b..f0adedc7f 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java +++ b/src/main/java/com/simibubi/create/foundation/utility/outliner/Outliner.java @@ -16,7 +16,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.vector.Vector3d; public class Outliner { @@ -29,7 +29,7 @@ public class Outliner { return box.getParams(); } - public OutlineParams showLine(Object slot, Vec3d start, Vec3d end) { + public OutlineParams showLine(Object slot, Vector3d start, Vector3d end) { if (!outlines.containsKey(slot)) { LineOutline outline = new LineOutline(); outlines.put(slot, new OutlineEntry(outline)); @@ -40,7 +40,7 @@ public class Outliner { return entry.outline.getParams(); } - public OutlineParams endChasingLine(Object slot, Vec3d start, Vec3d end, float chasingProgress) { + public OutlineParams endChasingLine(Object slot, Vector3d start, Vector3d end, float chasingProgress) { if (!outlines.containsKey(slot)) { EndChasingLineOutline outline = new EndChasingLineOutline(); outlines.put(slot, new OutlineEntry(outline)); diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/RayTraceWorld.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/RayTraceWorld.java index 45843916e..3a15cc1e7 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/RayTraceWorld.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/RayTraceWorld.java @@ -3,7 +3,7 @@ package com.simibubi.create.foundation.utility.worldWrappers; import java.util.function.BiFunction; import net.minecraft.block.BlockState; -import net.minecraft.fluid.IFluidState; +import net.minecraft.fluid.FluidState; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; @@ -30,7 +30,7 @@ public class RayTraceWorld implements IBlockReader { } @Override - public IFluidState getFluidState(BlockPos pos) { + public FluidState getFluidState(BlockPos pos) { return template.getFluidState(pos); } diff --git a/src/main/java/com/simibubi/create/foundation/worldgen/OxidizingBlock.java b/src/main/java/com/simibubi/create/foundation/worldgen/OxidizingBlock.java index 101edd2c2..e194a51ae 100644 --- a/src/main/java/com/simibubi/create/foundation/worldgen/OxidizingBlock.java +++ b/src/main/java/com/simibubi/create/foundation/worldgen/OxidizingBlock.java @@ -59,7 +59,7 @@ public class OxidizingBlock extends MetalBlock { if (!worldIn.isBlockPresent(neighbourPos)) continue; BlockState neighborState = worldIn.getBlockState(neighbourPos); - if (neighborState.has(OXIDIZATION) && neighborState.get(OXIDIZATION) != 0) { + if (neighborState.func_235903_d_(OXIDIZATION).map(ox -> ox != 0).orElse(false)) { neighbors.add(neighborState.get(OXIDIZATION)); } if (Block.hasSolidSide(neighborState, worldIn, neighbourPos, facing.getOpposite())) { @@ -76,8 +76,10 @@ public class OxidizingBlock extends MetalBlock { } @Override - public float getBlockHardness(BlockState blockState, IBlockReader worldIn, BlockPos pos) { - return this.blockHardness - 0.2f * blockState.get(OXIDIZATION); + public float getPlayerRelativeBlockHardness(BlockState blockState, PlayerEntity player, IBlockReader worldIn, + BlockPos pos) { + return super.getPlayerRelativeBlockHardness(blockState, player, worldIn, pos) + - 0.2f * blockState.get(OXIDIZATION); } @Override