Better Encased Belts

- Encased belts can now connect in larger groups
- Kinetic blocks break when their speed changes too frequently
- Removed some unused assets
- Fixed Clutches not working properly
- Organized imports and packages
This commit is contained in:
simibubi 2019-12-12 10:56:34 +01:00
parent c0b47c124f
commit 3989dbc656
140 changed files with 766 additions and 614 deletions

View file

@ -8,42 +8,42 @@ import com.simibubi.create.foundation.block.RenderUtilityBlock;
import com.simibubi.create.foundation.block.RenderUtilityDirectionalBlock;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.IModule;
import com.simibubi.create.modules.contraptions.generators.MotorBlock;
import com.simibubi.create.modules.contraptions.generators.WaterWheelBlock;
import com.simibubi.create.modules.contraptions.receivers.BasinBlock;
import com.simibubi.create.modules.contraptions.receivers.CrushingWheelBlock;
import com.simibubi.create.modules.contraptions.receivers.CrushingWheelControllerBlock;
import com.simibubi.create.modules.contraptions.receivers.DrillBlock;
import com.simibubi.create.modules.contraptions.receivers.DrillBlock.DrillHeadBlock;
import com.simibubi.create.modules.contraptions.receivers.HarvesterBlock;
import com.simibubi.create.modules.contraptions.receivers.HarvesterBlock.HarvesterBladeBlock;
import com.simibubi.create.modules.contraptions.receivers.MechanicalMixerBlock;
import com.simibubi.create.modules.contraptions.receivers.MechanicalMixerBlock.MechanicalMixerBlockItem;
import com.simibubi.create.modules.contraptions.receivers.MechanicalPressBlock;
import com.simibubi.create.modules.contraptions.receivers.SawBlock;
import com.simibubi.create.modules.contraptions.receivers.TurntableBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.LinearChassisBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.RadialChassisBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.bearing.MechanicalBearingBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.mounted.CartAssemblerBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.mounted.CartAssemblerBlock.MinecartAnchorBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.piston.MechanicalPistonBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.piston.MechanicalPistonHeadBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.piston.PistonPoleBlock;
import com.simibubi.create.modules.contraptions.receivers.crafter.MechanicalCrafterBlock;
import com.simibubi.create.modules.contraptions.receivers.fan.EncasedFanBlock;
import com.simibubi.create.modules.contraptions.components.actors.DrillBlock;
import com.simibubi.create.modules.contraptions.components.actors.HarvesterBlock;
import com.simibubi.create.modules.contraptions.components.actors.DrillBlock.DrillHeadBlock;
import com.simibubi.create.modules.contraptions.components.actors.HarvesterBlock.HarvesterBladeBlock;
import com.simibubi.create.modules.contraptions.components.constructs.LinearChassisBlock;
import com.simibubi.create.modules.contraptions.components.constructs.RadialChassisBlock;
import com.simibubi.create.modules.contraptions.components.constructs.bearing.MechanicalBearingBlock;
import com.simibubi.create.modules.contraptions.components.constructs.mounted.CartAssemblerBlock;
import com.simibubi.create.modules.contraptions.components.constructs.mounted.CartAssemblerBlock.MinecartAnchorBlock;
import com.simibubi.create.modules.contraptions.components.constructs.piston.MechanicalPistonBlock;
import com.simibubi.create.modules.contraptions.components.constructs.piston.MechanicalPistonHeadBlock;
import com.simibubi.create.modules.contraptions.components.constructs.piston.PistonPoleBlock;
import com.simibubi.create.modules.contraptions.components.crafter.MechanicalCrafterBlock;
import com.simibubi.create.modules.contraptions.components.crusher.CrushingWheelBlock;
import com.simibubi.create.modules.contraptions.components.crusher.CrushingWheelControllerBlock;
import com.simibubi.create.modules.contraptions.components.fan.EncasedFanBlock;
import com.simibubi.create.modules.contraptions.components.mixer.MechanicalMixerBlock;
import com.simibubi.create.modules.contraptions.components.mixer.MechanicalMixerBlock.MechanicalMixerBlockItem;
import com.simibubi.create.modules.contraptions.components.motor.MotorBlock;
import com.simibubi.create.modules.contraptions.components.press.MechanicalPressBlock;
import com.simibubi.create.modules.contraptions.components.saw.SawBlock;
import com.simibubi.create.modules.contraptions.components.turntable.TurntableBlock;
import com.simibubi.create.modules.contraptions.components.waterwheel.WaterWheelBlock;
import com.simibubi.create.modules.contraptions.processing.BasinBlock;
import com.simibubi.create.modules.contraptions.redstone.ContactBlock;
import com.simibubi.create.modules.contraptions.relays.ClutchBlock;
import com.simibubi.create.modules.contraptions.relays.CogWheelBlock;
import com.simibubi.create.modules.contraptions.relays.EncasedBeltBlock;
import com.simibubi.create.modules.contraptions.relays.EncasedShaftBlock;
import com.simibubi.create.modules.contraptions.relays.GearboxBlock;
import com.simibubi.create.modules.contraptions.relays.GearshiftBlock;
import com.simibubi.create.modules.contraptions.relays.ShaftBlock;
import com.simibubi.create.modules.contraptions.relays.ShaftHalfBlock;
import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTunnelBlock;
import com.simibubi.create.modules.contraptions.relays.elementary.CogWheelBlock;
import com.simibubi.create.modules.contraptions.relays.elementary.ShaftBlock;
import com.simibubi.create.modules.contraptions.relays.elementary.ShaftHalfBlock;
import com.simibubi.create.modules.contraptions.relays.encased.ClutchBlock;
import com.simibubi.create.modules.contraptions.relays.encased.EncasedBeltBlock;
import com.simibubi.create.modules.contraptions.relays.encased.EncasedShaftBlock;
import com.simibubi.create.modules.contraptions.relays.encased.GearshiftBlock;
import com.simibubi.create.modules.contraptions.relays.gauge.GaugeBlock;
import com.simibubi.create.modules.contraptions.relays.gearbox.GearboxBlock;
import com.simibubi.create.modules.curiosities.partialWindows.WindowInABlockBlock;
import com.simibubi.create.modules.curiosities.symmetry.block.CrossPlaneSymmetryBlock;
import com.simibubi.create.modules.curiosities.symmetry.block.PlaneSymmetryBlock;

View file

@ -2,8 +2,8 @@ package com.simibubi.create;
import java.util.function.Function;
import com.simibubi.create.modules.contraptions.receivers.constructs.mounted.ContraptionEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.mounted.ContraptionEntityRenderer;
import com.simibubi.create.modules.contraptions.components.constructs.mounted.ContraptionEntity;
import com.simibubi.create.modules.contraptions.components.constructs.mounted.ContraptionEntityRenderer;
import com.simibubi.create.modules.logistics.transport.CardboardBoxEntity;
import com.simibubi.create.modules.logistics.transport.CardboardBoxEntityRenderer;

View file

@ -6,8 +6,8 @@ import com.simibubi.create.modules.IModule;
import com.simibubi.create.modules.contraptions.GogglesItem;
import com.simibubi.create.modules.contraptions.WrenchItem;
import com.simibubi.create.modules.contraptions.WrenchItemRenderer;
import com.simibubi.create.modules.contraptions.relays.VerticalGearboxItem;
import com.simibubi.create.modules.contraptions.relays.belt.BeltConnectorItem;
import com.simibubi.create.modules.contraptions.relays.gearbox.VerticalGearboxItem;
import com.simibubi.create.modules.curiosities.ChromaticCompoundCubeItem;
import com.simibubi.create.modules.curiosities.deforester.DeforesterItem;
import com.simibubi.create.modules.curiosities.deforester.DeforesterItemRenderer;
@ -94,8 +94,6 @@ public enum AllItems {
CRUSHED_IRON(ingredient()),
CRUSHED_GOLD(ingredient()),
TIME_SCARF(ingredient()),
MOTION_SCARF(ingredient()),
__LOGISTICS__(),
CARDBOARD_BOX_1616(new CardboardBoxItem(standardItemProperties())),

View file

@ -6,9 +6,9 @@ import java.util.function.Supplier;
import com.simibubi.create.foundation.packet.NbtPacket;
import com.simibubi.create.foundation.packet.SimplePacketBase;
import com.simibubi.create.modules.contraptions.generators.ConfigureMotorPacket;
import com.simibubi.create.modules.contraptions.receivers.ConfigureMixerPacket;
import com.simibubi.create.modules.contraptions.receivers.constructs.ConfigureChassisPacket;
import com.simibubi.create.modules.contraptions.components.constructs.ConfigureChassisPacket;
import com.simibubi.create.modules.contraptions.components.mixer.ConfigureMixerPacket;
import com.simibubi.create.modules.contraptions.components.motor.ConfigureMotorPacket;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunBeamPacket;
import com.simibubi.create.modules.curiosities.symmetry.SymmetryEffectPacket;
import com.simibubi.create.modules.logistics.block.diodes.ConfigureFlexpeaterPacket;

View file

@ -3,12 +3,12 @@ package com.simibubi.create;
import java.util.function.Supplier;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.base.ProcessingRecipeSerializer;
import com.simibubi.create.modules.contraptions.receivers.CrushingRecipe;
import com.simibubi.create.modules.contraptions.receivers.CuttingRecipe;
import com.simibubi.create.modules.contraptions.receivers.MixingRecipe;
import com.simibubi.create.modules.contraptions.receivers.PressingRecipe;
import com.simibubi.create.modules.contraptions.receivers.fan.SplashingRecipe;
import com.simibubi.create.modules.contraptions.components.crusher.CrushingRecipe;
import com.simibubi.create.modules.contraptions.components.fan.SplashingRecipe;
import com.simibubi.create.modules.contraptions.components.mixer.MixingRecipe;
import com.simibubi.create.modules.contraptions.components.press.PressingRecipe;
import com.simibubi.create.modules.contraptions.components.saw.CuttingRecipe;
import com.simibubi.create.modules.contraptions.processing.ProcessingRecipeSerializer;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunUpgradeRecipe;
import net.minecraft.inventory.IInventory;

View file

@ -4,49 +4,49 @@ import java.util.function.Supplier;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.modules.contraptions.generators.MotorTileEntity;
import com.simibubi.create.modules.contraptions.generators.MotorTileEntityRenderer;
import com.simibubi.create.modules.contraptions.generators.WaterWheelTileEntity;
import com.simibubi.create.modules.contraptions.receivers.BasinTileEntity;
import com.simibubi.create.modules.contraptions.receivers.BasinTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.CrushingWheelControllerTileEntity;
import com.simibubi.create.modules.contraptions.receivers.CrushingWheelTileEntity;
import com.simibubi.create.modules.contraptions.receivers.DrillTileEntity;
import com.simibubi.create.modules.contraptions.receivers.DrillTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.HarvesterTileEntity;
import com.simibubi.create.modules.contraptions.receivers.HarvesterTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.MechanicalMixerTileEntity;
import com.simibubi.create.modules.contraptions.receivers.MechanicalMixerTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.MechanicalPressTileEntity;
import com.simibubi.create.modules.contraptions.receivers.MechanicalPressTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.SawTileEntity;
import com.simibubi.create.modules.contraptions.receivers.SawTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.TurntableTileEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.ChassisTileEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.bearing.MechanicalBearingTileEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.bearing.MechanicalBearingTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.constructs.piston.MechanicalPistonTileEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.piston.MechanicalPistonTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.crafter.MechanicalCrafterTileEntity;
import com.simibubi.create.modules.contraptions.receivers.crafter.MechanicalCrafterTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.fan.EncasedFanTileEntity;
import com.simibubi.create.modules.contraptions.receivers.fan.EncasedFanTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.ClutchTileEntity;
import com.simibubi.create.modules.contraptions.relays.EncasedShaftTileEntity;
import com.simibubi.create.modules.contraptions.relays.EncasedShaftTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.GearboxTileEntity;
import com.simibubi.create.modules.contraptions.relays.GearboxTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.GearshiftTileEntity;
import com.simibubi.create.modules.contraptions.relays.ShaftTileEntity;
import com.simibubi.create.modules.contraptions.relays.SplitShaftTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.actors.DrillTileEntity;
import com.simibubi.create.modules.contraptions.components.actors.DrillTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.actors.HarvesterTileEntity;
import com.simibubi.create.modules.contraptions.components.actors.HarvesterTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.constructs.ChassisTileEntity;
import com.simibubi.create.modules.contraptions.components.constructs.bearing.MechanicalBearingTileEntity;
import com.simibubi.create.modules.contraptions.components.constructs.bearing.MechanicalBearingTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.constructs.piston.MechanicalPistonTileEntity;
import com.simibubi.create.modules.contraptions.components.constructs.piston.MechanicalPistonTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.crafter.MechanicalCrafterTileEntity;
import com.simibubi.create.modules.contraptions.components.crafter.MechanicalCrafterTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.crusher.CrushingWheelControllerTileEntity;
import com.simibubi.create.modules.contraptions.components.crusher.CrushingWheelTileEntity;
import com.simibubi.create.modules.contraptions.components.fan.EncasedFanTileEntity;
import com.simibubi.create.modules.contraptions.components.fan.EncasedFanTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.mixer.MechanicalMixerTileEntity;
import com.simibubi.create.modules.contraptions.components.mixer.MechanicalMixerTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.motor.MotorTileEntity;
import com.simibubi.create.modules.contraptions.components.motor.MotorTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.press.MechanicalPressTileEntity;
import com.simibubi.create.modules.contraptions.components.press.MechanicalPressTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.saw.SawTileEntity;
import com.simibubi.create.modules.contraptions.components.saw.SawTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.turntable.TurntableTileEntity;
import com.simibubi.create.modules.contraptions.components.waterwheel.WaterWheelTileEntity;
import com.simibubi.create.modules.contraptions.processing.BasinTileEntity;
import com.simibubi.create.modules.contraptions.processing.BasinTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntity;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTunnelTileEntity;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTunnelTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.elementary.ShaftTileEntity;
import com.simibubi.create.modules.contraptions.relays.encased.ClutchTileEntity;
import com.simibubi.create.modules.contraptions.relays.encased.EncasedShaftTileEntity;
import com.simibubi.create.modules.contraptions.relays.encased.EncasedShaftTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.encased.SplitShaftTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.gauge.GaugeBlock;
import com.simibubi.create.modules.contraptions.relays.gauge.GaugeTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.gauge.SpeedGaugeTileEntity;
import com.simibubi.create.modules.contraptions.relays.gauge.StressGaugeTileEntity;
import com.simibubi.create.modules.contraptions.relays.gearbox.GearboxTileEntity;
import com.simibubi.create.modules.contraptions.relays.gearbox.GearboxTileEntityRenderer;
import com.simibubi.create.modules.contraptions.relays.gearbox.GearshiftTileEntity;
import com.simibubi.create.modules.curiosities.partialWindows.WindowInABlockTileEntity;
import com.simibubi.create.modules.logistics.block.LinkedTileEntityRenderer;
import com.simibubi.create.modules.logistics.block.RedstoneBridgeTileEntity;

View file

@ -9,7 +9,7 @@ import com.simibubi.create.foundation.item.TooltipHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.modules.contraptions.KineticDebugger;
import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.TurntableHandler;
import com.simibubi.create.modules.contraptions.components.turntable.TurntableHandler;
import com.simibubi.create.modules.contraptions.relays.belt.BeltConnectorItemHandler;
import net.minecraft.client.Minecraft;

View file

@ -6,7 +6,7 @@ import org.apache.logging.log4j.Logger;
import com.simibubi.create.foundation.world.OreGeneration;
import com.simibubi.create.modules.ModuleLoadedCondition;
import com.simibubi.create.modules.contraptions.TorquePropagator;
import com.simibubi.create.modules.contraptions.receivers.constructs.piston.MovingConstructHandler;
import com.simibubi.create.modules.contraptions.components.constructs.piston.MovingConstructHandler;
import com.simibubi.create.modules.logistics.FrequencyHandler;
import com.simibubi.create.modules.logistics.management.LogisticalNetworkHandler;
import com.simibubi.create.modules.logistics.transport.villager.LogisticianHandler;

View file

@ -13,7 +13,7 @@ import com.simibubi.create.foundation.block.SpriteShifter.SpriteShiftEntry;
import com.simibubi.create.foundation.utility.SuperByteBufferCache;
import com.simibubi.create.modules.contraptions.WrenchModel;
import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.constructs.ContraptionRenderer;
import com.simibubi.create.modules.contraptions.components.constructs.ContraptionRenderer;
import com.simibubi.create.modules.curiosities.deforester.DeforesterModel;
import com.simibubi.create.modules.curiosities.partialWindows.WindowInABlockModel;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunModel;

View file

@ -1,7 +1,7 @@
package com.simibubi.create;
import com.simibubi.create.foundation.block.SpriteShifter;
import com.simibubi.create.modules.contraptions.receivers.constructs.bearing.MechanicalBearingTileEntityRenderer;
import com.simibubi.create.modules.contraptions.components.constructs.bearing.MechanicalBearingTileEntityRenderer;
import net.minecraft.client.resources.ReloadListener;
import net.minecraft.profiler.IProfiler;

View file

@ -8,8 +8,8 @@ import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.base.StochasticOutput;
import com.simibubi.create.modules.contraptions.receivers.CrushingRecipe;
import com.simibubi.create.modules.contraptions.components.crusher.CrushingRecipe;
import com.simibubi.create.modules.contraptions.processing.StochasticOutput;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.IRecipeLayout;

View file

@ -8,8 +8,8 @@ import com.simibubi.create.AllItems;
import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.base.StochasticOutput;
import com.simibubi.create.modules.contraptions.receivers.PressingRecipe;
import com.simibubi.create.modules.contraptions.components.press.PressingRecipe;
import com.simibubi.create.modules.contraptions.processing.StochasticOutput;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.IRecipeLayout;

View file

@ -9,8 +9,8 @@ import com.simibubi.create.Create;
import com.simibubi.create.ScreenResources;
import com.simibubi.create.foundation.gui.ScreenElementRenderer;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.modules.contraptions.base.StochasticOutput;
import com.simibubi.create.modules.contraptions.receivers.fan.SplashingRecipe;
import com.simibubi.create.modules.contraptions.components.fan.SplashingRecipe;
import com.simibubi.create.modules.contraptions.processing.StochasticOutput;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.IRecipeLayout;

View file

@ -28,6 +28,7 @@ public class AllShapes {
;
@SuppressWarnings("deprecation")
private static final VoxelShape
LOGISTICAL_CASING_MIDDLE_SHAPE = VoxelShapes.or(
makeCuboidShape(1,0,1,15,16,15),

View file

@ -13,10 +13,10 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.CreateConfig;
import com.simibubi.create.modules.contraptions.base.IRotate;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.relays.EncasedBeltBlock;
import com.simibubi.create.modules.contraptions.relays.GearboxTileEntity;
import com.simibubi.create.modules.contraptions.relays.SplitShaftTileEntity;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntity;
import com.simibubi.create.modules.contraptions.relays.encased.EncasedBeltBlock;
import com.simibubi.create.modules.contraptions.relays.encased.SplitShaftTileEntity;
import com.simibubi.create.modules.contraptions.relays.gearbox.GearboxTileEntity;
import net.minecraft.block.BlockState;
import net.minecraft.util.Direction;
@ -69,9 +69,7 @@ public class RotationPropagator {
// Attached Encased Belts
if (AllBlocks.ENCASED_BELT.typeOf(stateFrom) && AllBlocks.ENCASED_BELT.typeOf(stateTo)) {
boolean connected = stateFrom.get(EncasedBeltBlock.CONNECTED) && stateTo.get(EncasedBeltBlock.CONNECTED)
&& stateFrom.get(EncasedBeltBlock.CONNECTED_FACE) == direction
&& stateTo.get(EncasedBeltBlock.CONNECTED_FACE) == direction.getOpposite();
boolean connected = EncasedBeltBlock.areBlocksConnected(stateFrom, stateTo, direction);
return connected ? 1 : 0;
}

View file

@ -41,6 +41,7 @@ public abstract class KineticTileEntity extends SyncedTileEntity implements ITic
public float speed;
protected Optional<BlockPos> source;
public boolean reActivateSource;
public int speedChangeCounter;
// Torque related
public float maxStress;
@ -95,6 +96,7 @@ public abstract class KineticTileEntity extends SyncedTileEntity implements ITic
}
public void onSpeedChanged() {
speedChangeCounter += 5;
}
@Override
@ -262,6 +264,11 @@ public abstract class KineticTileEntity extends SyncedTileEntity implements ITic
if (world.isRemote)
return;
if (speedChangeCounter > 25)
world.destroyBlock(pos, true);
if (speedChangeCounter > 0)
speedChangeCounter--;
if (particleSpawnCountdown > 0)
if (--particleSpawnCountdown == 0)
spawnRotationIndicators();

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.actors;
import java.util.List;
@ -7,7 +7,7 @@ import com.simibubi.create.foundation.block.IWithTileEntity;
import com.simibubi.create.foundation.utility.SuperByteBuffer;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.base.DirectionalKineticBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.actors;
import java.util.concurrent.atomic.AtomicInteger;
@ -39,6 +39,7 @@ public class DrillTileEntity extends KineticTileEntity {
@Override
public void onSpeedChanged() {
super.onSpeedChanged();
if (destroyProgress == -1)
destroyNextTick();
}

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.actors;
import static net.minecraft.state.properties.BlockStateProperties.FACING;
@ -9,7 +9,7 @@ import com.simibubi.create.foundation.utility.SuperByteBuffer;
import com.simibubi.create.modules.contraptions.base.IRotate;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior.MovementContext;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior.MovementContext;
import net.minecraft.block.BlockState;
import net.minecraft.util.Direction.Axis;

View file

@ -1,12 +1,12 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.actors;
import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.block.IRenderUtilityBlock;
import com.simibubi.create.foundation.utility.SuperByteBuffer;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.actors;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.foundation.block.SyncedTileEntity;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.actors;
import static com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer.KINETIC_TILE;
import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FACING;
@ -7,7 +7,7 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.CreateClient;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import com.simibubi.create.foundation.utility.SuperByteBuffer;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior.MovementContext;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior.MovementContext;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.BufferBuilder;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs;
package com.simibubi.create.modules.contraptions.components.constructs;
import java.util.List;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs;
package com.simibubi.create.modules.contraptions.components.constructs;
import static com.simibubi.create.CreateConfig.parameters;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs;
package com.simibubi.create.modules.contraptions.components.constructs;
import com.simibubi.create.foundation.packet.TileEntityConfigurationPacket;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs;
package com.simibubi.create.modules.contraptions.components.constructs;
import static com.simibubi.create.CreateConfig.parameters;
import static net.minecraft.state.properties.BlockStateProperties.AXIS;
@ -18,8 +18,8 @@ import org.apache.commons.lang3.tuple.MutablePair;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.CreateConfig;
import com.simibubi.create.modules.contraptions.receivers.SawBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior.MovementContext;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior.MovementContext;
import com.simibubi.create.modules.contraptions.components.saw.SawBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.FallingBlock;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs;
package com.simibubi.create.modules.contraptions.components.constructs;
import java.util.Random;
import java.util.function.Consumer;
@ -10,7 +10,7 @@ import com.simibubi.create.CreateClient;
import com.simibubi.create.foundation.utility.PlacementSimulationWorld;
import com.simibubi.create.foundation.utility.SuperByteBuffer;
import com.simibubi.create.foundation.utility.SuperByteBufferCache.Compartment;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior.MovementContext;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior.MovementContext;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BlockModelRenderer;

View file

@ -1,8 +1,8 @@
package com.simibubi.create.modules.contraptions.receivers.constructs;
package com.simibubi.create.modules.contraptions.components.constructs;
import com.simibubi.create.foundation.utility.SuperByteBuffer;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.modules.contraptions.receivers.constructs.piston.MechanicalPistonTileEntity;
import com.simibubi.create.modules.contraptions.components.constructs.piston.MechanicalPistonTileEntity;
import net.minecraft.block.BlockState;
import net.minecraft.nbt.CompoundNBT;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs;
package com.simibubi.create.modules.contraptions.components.constructs;
import com.google.common.collect.ImmutableList;
import com.simibubi.create.AllBlocks;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs;
package com.simibubi.create.modules.contraptions.components.constructs;
import com.simibubi.create.foundation.utility.Lang;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.bearing;
package com.simibubi.create.modules.contraptions.components.constructs.bearing;
import com.simibubi.create.foundation.block.IWithTileEntity;
import com.simibubi.create.modules.contraptions.base.DirectionalKineticBlock;

View file

@ -1,8 +1,8 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.bearing;
package com.simibubi.create.modules.contraptions.components.constructs.bearing;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.modules.contraptions.base.GeneratingKineticTileEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.ChassisTileEntity;
import com.simibubi.create.modules.contraptions.components.constructs.ChassisTileEntity;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.bearing;
package com.simibubi.create.modules.contraptions.components.constructs.bearing;
import java.util.Random;
import java.util.concurrent.TimeUnit;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.bearing;
package com.simibubi.create.modules.contraptions.components.constructs.bearing;
import java.util.ArrayList;
import java.util.HashMap;
@ -11,8 +11,8 @@ import java.util.Set;
import com.simibubi.create.AllBlockTags;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.CreateConfig;
import com.simibubi.create.modules.contraptions.receivers.constructs.ChassisTileEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.RadialChassisBlock;
import com.simibubi.create.modules.contraptions.components.constructs.ChassisTileEntity;
import com.simibubi.create.modules.contraptions.components.constructs.RadialChassisBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.PistonBlock;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.bearing;
package com.simibubi.create.modules.contraptions.components.constructs.bearing;
import java.nio.ByteBuffer;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.mounted;
package com.simibubi.create.modules.contraptions.components.constructs.mounted;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.block.RenderUtilityBlock;

View file

@ -1,9 +1,9 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.mounted;
package com.simibubi.create.modules.contraptions.components.constructs.mounted;
import com.simibubi.create.AllEntities;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior.MovementContext;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior.MovementContext;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;

View file

@ -1,9 +1,9 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.mounted;
package com.simibubi.create.modules.contraptions.components.constructs.mounted;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.foundation.utility.TessellatorHelper;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.modules.contraptions.receivers.constructs.ContraptionRenderer;
import com.simibubi.create.modules.contraptions.components.constructs.ContraptionRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.EntityRenderer;

View file

@ -1,15 +1,15 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.mounted;
package com.simibubi.create.modules.contraptions.components.constructs.mounted;
import static com.simibubi.create.modules.contraptions.receivers.constructs.mounted.CartAssemblerBlock.RAIL_SHAPE;
import static com.simibubi.create.modules.contraptions.components.constructs.mounted.CartAssemblerBlock.RAIL_SHAPE;
import java.util.List;
import org.apache.commons.lang3.tuple.MutablePair;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.modules.contraptions.receivers.constructs.Contraption;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior.MovementContext;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior.MoverType;
import com.simibubi.create.modules.contraptions.components.constructs.Contraption;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior.MovementContext;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior.MoverType;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.piston;
package com.simibubi.create.modules.contraptions.components.constructs.piston;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.CreateConfig;

View file

@ -1,11 +1,11 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.piston;
package com.simibubi.create.modules.contraptions.components.constructs.piston;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.CreateConfig;
import com.simibubi.create.foundation.block.IWithoutBlockItem;
import com.simibubi.create.foundation.block.ProperDirectionalBlock;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.receivers.constructs.piston.MechanicalPistonBlock.PistonState;
import com.simibubi.create.modules.contraptions.components.constructs.piston.MechanicalPistonBlock.PistonState;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
@ -21,7 +21,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
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.IBlockReader;
import net.minecraft.world.World;

View file

@ -1,7 +1,7 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.piston;
package com.simibubi.create.modules.contraptions.components.constructs.piston;
import static com.simibubi.create.CreateConfig.parameters;
import static com.simibubi.create.modules.contraptions.receivers.constructs.piston.MechanicalPistonBlock.STATE;
import static com.simibubi.create.modules.contraptions.components.constructs.piston.MechanicalPistonBlock.STATE;
import java.util.Arrays;
import java.util.Iterator;
@ -12,10 +12,10 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.Create;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior.MovementContext;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior.MoverType;
import com.simibubi.create.modules.contraptions.receivers.constructs.piston.MechanicalPistonBlock.PistonState;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior.MovementContext;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior.MoverType;
import com.simibubi.create.modules.contraptions.components.constructs.piston.MechanicalPistonBlock.PistonState;
import net.minecraft.block.Blocks;
import net.minecraft.nbt.CompoundNBT;
@ -190,6 +190,8 @@ public class MechanicalPistonTileEntity extends KineticTileEntity {
@Override
public void tick() {
super.tick();
if (isRemoved())
return;
if (!world.isRemote && assembleNextTick) {
assembleNextTick = false;

View file

@ -1,10 +1,10 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.piston;
package com.simibubi.create.modules.contraptions.components.constructs.piston;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.modules.contraptions.base.IRotate;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.modules.contraptions.receivers.constructs.ContraptionRenderer;
import com.simibubi.create.modules.contraptions.components.constructs.ContraptionRenderer;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.BufferBuilder;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.piston;
package com.simibubi.create.modules.contraptions.components.constructs.piston;
import java.util.ArrayList;
import java.util.HashMap;
@ -8,7 +8,7 @@ import java.util.Map;
import java.util.stream.Stream;
import com.simibubi.create.Create;
import com.simibubi.create.modules.contraptions.receivers.constructs.Contraption;
import com.simibubi.create.modules.contraptions.components.constructs.Contraption;
import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.Entity;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.piston;
package com.simibubi.create.modules.contraptions.components.constructs.piston;
import static com.simibubi.create.AllBlocks.MECHANICAL_PISTON_HEAD;
import static com.simibubi.create.AllBlocks.PISTON_POLE;
@ -10,8 +10,8 @@ import java.util.ArrayList;
import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.modules.contraptions.receivers.constructs.Contraption;
import com.simibubi.create.modules.contraptions.receivers.constructs.piston.MechanicalPistonBlock.PistonState;
import com.simibubi.create.modules.contraptions.components.constructs.Contraption;
import com.simibubi.create.modules.contraptions.components.constructs.piston.MechanicalPistonBlock.PistonState;
import net.minecraft.block.BlockState;
import net.minecraft.nbt.CompoundNBT;

View file

@ -1,10 +1,10 @@
package com.simibubi.create.modules.contraptions.receivers.constructs.piston;
package com.simibubi.create.modules.contraptions.components.constructs.piston;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.CreateConfig;
import com.simibubi.create.foundation.block.ProperDirectionalBlock;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.receivers.constructs.piston.MechanicalPistonBlock.PistonState;
import com.simibubi.create.modules.contraptions.components.constructs.piston.MechanicalPistonBlock.PistonState;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.crafter;
package com.simibubi.create.modules.contraptions.components.crafter;
import com.simibubi.create.foundation.block.IWithTileEntity;
import com.simibubi.create.modules.contraptions.base.DirectionalKineticBlock;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.crafter;
package com.simibubi.create.modules.contraptions.components.crafter;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.crafter;
package com.simibubi.create.modules.contraptions.components.crafter;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.utility.TessellatorHelper;

View file

@ -1,10 +1,11 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.crusher;
import java.util.List;
import com.simibubi.create.AllRecipes;
import com.simibubi.create.modules.contraptions.base.ProcessingRecipe;
import com.simibubi.create.modules.contraptions.base.StochasticOutput;
import com.simibubi.create.modules.contraptions.processing.ProcessingInventory;
import com.simibubi.create.modules.contraptions.processing.ProcessingRecipe;
import com.simibubi.create.modules.contraptions.processing.StochasticOutput;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.ResourceLocation;

View file

@ -1,6 +1,6 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.crusher;
import static com.simibubi.create.modules.contraptions.receivers.CrushingWheelControllerBlock.VALID;
import static com.simibubi.create.modules.contraptions.components.crusher.CrushingWheelControllerBlock.VALID;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.utility.AllShapes;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.crusher;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.crusher;
import java.util.List;
import java.util.Optional;
@ -9,6 +9,7 @@ import com.simibubi.create.AllRecipes;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.CreateConfig;
import com.simibubi.create.foundation.block.SyncedTileEntity;
import com.simibubi.create.modules.contraptions.processing.ProcessingInventory;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemEntity;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.crusher;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.fan;
package com.simibubi.create.modules.contraptions.components.fan;
import java.util.ArrayList;
import java.util.Iterator;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.fan;
package com.simibubi.create.modules.contraptions.components.fan;
import com.simibubi.create.foundation.block.IWithTileEntity;
import com.simibubi.create.modules.contraptions.base.DirectionalKineticBlock;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.fan;
package com.simibubi.create.modules.contraptions.components.fan;
import static com.simibubi.create.CreateConfig.parameters;
@ -85,6 +85,7 @@ public class EncasedFanTileEntity extends GeneratingKineticTileEntity {
@Override
public void onSpeedChanged() {
super.onSpeedChanged();
updateAirFlow = true;
}

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers.fan;
package com.simibubi.create.modules.contraptions.components.fan;
import static net.minecraft.state.properties.BlockStateProperties.FACING;
@ -23,9 +23,9 @@ public class EncasedFanTileEntityRenderer extends KineticTileEntityRenderer {
float time = AnimationTickHolder.getRenderTick();
float speed = te.getSpeed() * 20;
if (speed > 0)
speed = MathHelper.clamp(speed, 80, 128 * 20);
speed = MathHelper.clamp(speed, 80, 64 * 20);
if (speed < 0)
speed = MathHelper.clamp(speed, -128 * 20, -80);
speed = MathHelper.clamp(speed, -64 * 20, -80);
float angle = (time * speed) % 360;
angle = angle / 180f * (float) Math.PI;

View file

@ -1,10 +1,10 @@
package com.simibubi.create.modules.contraptions.receivers.fan;
package com.simibubi.create.modules.contraptions.components.fan;
import java.util.List;
import com.simibubi.create.AllRecipes;
import com.simibubi.create.modules.contraptions.base.ProcessingRecipe;
import com.simibubi.create.modules.contraptions.base.StochasticOutput;
import com.simibubi.create.modules.contraptions.processing.ProcessingRecipe;
import com.simibubi.create.modules.contraptions.processing.StochasticOutput;
import com.simibubi.create.modules.logistics.InWorldProcessing;
import com.simibubi.create.modules.logistics.InWorldProcessing.SplashingInv;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.mixer;
import com.simibubi.create.foundation.packet.TileEntityConfigurationPacket;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.mixer;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.block.IBlockWithScrollableValue;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.mixer;
import java.util.ArrayList;
import java.util.LinkedList;
@ -9,7 +9,8 @@ import com.simibubi.create.AllPackets;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.receivers.BasinTileEntity.BasinInventory;
import com.simibubi.create.modules.contraptions.processing.BasinTileEntity;
import com.simibubi.create.modules.contraptions.processing.BasinTileEntity.BasinInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.BucketItem;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.mixer;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.CreateClient;

View file

@ -1,13 +1,13 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.mixer;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import com.simibubi.create.AllRecipes;
import com.simibubi.create.modules.contraptions.base.ProcessingRecipe;
import com.simibubi.create.modules.contraptions.base.StochasticOutput;
import com.simibubi.create.modules.contraptions.receivers.BasinTileEntity.BasinInputInventory;
import com.simibubi.create.modules.contraptions.processing.BasinTileEntity.BasinInputInventory;
import com.simibubi.create.modules.contraptions.processing.ProcessingRecipe;
import com.simibubi.create.modules.contraptions.processing.StochasticOutput;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.generators;
package com.simibubi.create.modules.contraptions.components.motor;
import com.simibubi.create.foundation.packet.TileEntityConfigurationPacket;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.generators;
package com.simibubi.create.modules.contraptions.components.motor;
import com.simibubi.create.foundation.block.IBlockWithScrollableValue;
import com.simibubi.create.foundation.block.IWithTileEntity;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.generators;
package com.simibubi.create.modules.contraptions.components.motor;
import java.util.UUID;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.generators;
package com.simibubi.create.modules.contraptions.components.motor;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.press;
import java.util.Arrays;
import java.util.List;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.press;
import java.util.Optional;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.press;
import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FACING;

View file

@ -1,11 +1,11 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.press;
import java.util.List;
import com.simibubi.create.AllRecipes;
import com.simibubi.create.modules.contraptions.base.ProcessingRecipe;
import com.simibubi.create.modules.contraptions.base.StochasticOutput;
import com.simibubi.create.modules.contraptions.receivers.MechanicalPressTileEntity.PressingInv;
import com.simibubi.create.modules.contraptions.components.press.MechanicalPressTileEntity.PressingInv;
import com.simibubi.create.modules.contraptions.processing.ProcessingRecipe;
import com.simibubi.create.modules.contraptions.processing.StochasticOutput;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.ResourceLocation;

View file

@ -1,10 +1,11 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.saw;
import java.util.List;
import com.simibubi.create.AllRecipes;
import com.simibubi.create.modules.contraptions.base.ProcessingRecipe;
import com.simibubi.create.modules.contraptions.base.StochasticOutput;
import com.simibubi.create.modules.contraptions.processing.ProcessingInventory;
import com.simibubi.create.modules.contraptions.processing.ProcessingRecipe;
import com.simibubi.create.modules.contraptions.processing.StochasticOutput;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.ResourceLocation;

View file

@ -1,9 +1,9 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.saw;
import com.simibubi.create.foundation.block.IWithTileEntity;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.base.DirectionalAxisKineticBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior;
import com.simibubi.create.modules.logistics.block.IBlockWithFilter;
import net.minecraft.block.Block;

View file

@ -1,6 +1,6 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.saw;
import static com.simibubi.create.modules.contraptions.receivers.SawBlock.RUNNING;
import static com.simibubi.create.modules.contraptions.components.saw.SawBlock.RUNNING;
import java.util.LinkedList;
import java.util.List;
@ -13,6 +13,7 @@ import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.foundation.utility.recipe.RecipeConditions;
import com.simibubi.create.foundation.utility.recipe.RecipeFinder;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.processing.ProcessingInventory;
import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntity;
import com.simibubi.create.modules.logistics.block.IHaveFilter;
@ -62,6 +63,7 @@ public class SawTileEntity extends KineticTileEntity implements IHaveFilter {
@Override
public void onSpeedChanged() {
super.onSpeedChanged();
boolean shouldRun = Math.abs(getSpeed()) > 1 / 64f;
boolean running = getBlockState().get(RUNNING);
if (shouldRun != running)

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.saw;
import static net.minecraft.state.properties.BlockStateProperties.AXIS;
import static net.minecraft.state.properties.BlockStateProperties.FACING;

View file

@ -1,11 +1,10 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.turntable;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.modules.contraptions.base.KineticBlock;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity;
@ -18,7 +17,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
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.IBlockReader;
import net.minecraft.world.World;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.turntable;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.components.turntable;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.generators;
package com.simibubi.create.modules.contraptions.components.waterwheel;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.modules.contraptions.base.HorizontalKineticBlock;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.generators;
package com.simibubi.create.modules.contraptions.components.waterwheel;
import java.util.HashMap;
import java.util.Map;

View file

@ -2,7 +2,7 @@ package com.simibubi.create.modules.contraptions.particle;
import com.simibubi.create.foundation.utility.ColorHelper;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.modules.contraptions.receivers.fan.EncasedFanTileEntity;
import com.simibubi.create.modules.contraptions.components.fan.EncasedFanTileEntity;
import com.simibubi.create.modules.logistics.InWorldProcessing;
import net.minecraft.block.Blocks;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.processing;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.block.IWithTileEntity;

View file

@ -1,7 +1,8 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.processing;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.foundation.block.SyncedTileEntity;
import com.simibubi.create.modules.contraptions.components.mixer.MechanicalMixerTileEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.processing;
import java.util.Random;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.receivers;
package com.simibubi.create.modules.contraptions.processing;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.ItemStack;
@ -9,9 +9,9 @@ import net.minecraftforge.items.ItemStackHandler;
import net.minecraftforge.items.wrapper.RecipeWrapper;
public class ProcessingInventory extends RecipeWrapper implements IItemHandler {
protected int remainingTime;
protected int recipeDuration;
protected boolean appliedRecipe;
public int remainingTime;
public int recipeDuration;
public boolean appliedRecipe;
public ProcessingInventory() {
super(new ItemStackHandler(10));

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.base;
package com.simibubi.create.modules.contraptions.processing;
import java.util.ArrayList;
import java.util.List;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.base;
package com.simibubi.create.modules.contraptions.processing;
import java.util.ArrayList;
import java.util.List;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.base;
package com.simibubi.create.modules.contraptions.processing;
import java.util.Random;

View file

@ -4,7 +4,7 @@ import java.util.Random;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.block.ProperDirectionalBlock;
import com.simibubi.create.modules.contraptions.receivers.constructs.IHaveMovementBehavior;
import com.simibubi.create.modules.contraptions.components.constructs.IHaveMovementBehavior;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;

View file

@ -1,14 +0,0 @@
package com.simibubi.create.modules.contraptions.relays;
import net.minecraft.block.BlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;
public class ClutchBlock extends GearshiftBlock {
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new ClutchTileEntity();
}
}

View file

@ -1,106 +0,0 @@
package com.simibubi.create.modules.contraptions.relays;
import com.google.common.base.Predicates;
import com.simibubi.create.modules.contraptions.base.RotatedPillarKineticBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer.Builder;
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.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
public class EncasedBeltBlock extends RotatedPillarKineticBlock {
public static final BooleanProperty CONNECTED = BooleanProperty.create("attached");
public static final DirectionProperty CONNECTED_FACE = DirectionProperty.create("attach_face",
Predicates.alwaysTrue());
public EncasedBeltBlock() {
super(Properties.from(Blocks.ANDESITE));
setDefaultState(getDefaultState().with(CONNECTED, false));
}
@Override
protected void fillStateContainer(Builder<Block, BlockState> builder) {
super.fillStateContainer(builder);
builder.add(CONNECTED, CONNECTED_FACE);
}
@Override
public boolean isSolid(BlockState state) {
return false;
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
BlockState state = getDefaultState().with(AXIS, context.getNearestLookingDirection().getAxis());
for (Direction face : Direction.values()) {
BlockState neighbour = context.getWorld().getBlockState(context.getPos().offset(face));
if (neighbour.getBlock() != this || neighbour.get(CONNECTED))
continue;
if (neighbour.get(AXIS) == face.getAxis())
continue;
if (state.get(AXIS) == face.getAxis())
continue;
return state.with(CONNECTED, true).with(CONNECTED_FACE, face);
}
return state;
}
@Override
public BlockState updatePostPlacement(BlockState stateIn, Direction face, BlockState neighbour, IWorld worldIn,
BlockPos currentPos, BlockPos facingPos) {
if (neighbour.getBlock() != this || !neighbour.get(CONNECTED))
return stateIn;
if (neighbour.get(CONNECTED_FACE) != face.getOpposite())
return stateIn;
if (neighbour.get(AXIS) == face.getAxis())
return stateIn;
return stateIn.with(CONNECTED, true).with(CONNECTED_FACE, face);
}
@SuppressWarnings("deprecation")
@Override
public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) {
super.onReplaced(state, worldIn, pos, newState, isMoving);
if (!state.get(CONNECTED))
return;
BlockPos attached = pos.offset(state.get(CONNECTED_FACE));
BlockState attachedState = worldIn.getBlockState(attached);
if (attachedState.getBlock() == this)
worldIn.setBlockState(attached, attachedState.with(CONNECTED, false), 3);
}
@Override
public boolean hasShaftTowards(World world, BlockPos pos, BlockState state, Direction face) {
return face.getAxis() == state.get(AXIS);
}
@Override
public Axis getRotationAxis(BlockState state) {
return state.get(AXIS);
}
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new EncasedShaftTileEntity();
}
@Override
protected boolean hasStaticPart() {
return true;
}
}

View file

@ -6,9 +6,9 @@ import java.util.List;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.CreateConfig;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import com.simibubi.create.modules.contraptions.relays.ShaftBlock;
import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock.Part;
import com.simibubi.create.modules.contraptions.relays.belt.BeltBlock.Slope;
import com.simibubi.create.modules.contraptions.relays.elementary.ShaftBlock;
import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItem;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.relays;
package com.simibubi.create.modules.contraptions.relays.elementary;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.utility.AllShapes;
@ -9,11 +9,9 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.math.BlockPos;
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.IBlockReader;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.relays;
package com.simibubi.create.modules.contraptions.relays.elementary;
import com.simibubi.create.foundation.utility.AllShapes;
import com.simibubi.create.modules.contraptions.base.RotatedPillarKineticBlock;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.relays;
package com.simibubi.create.modules.contraptions.relays.elementary;
import com.simibubi.create.foundation.block.IWithoutBlockItem;
import com.simibubi.create.foundation.block.ProperDirectionalBlock;

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.relays;
package com.simibubi.create.modules.contraptions.relays.elementary;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;

View file

@ -0,0 +1,39 @@
package com.simibubi.create.modules.contraptions.relays.encased;
import com.simibubi.create.modules.contraptions.RotationPropagator;
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
public class ClutchBlock extends GearshiftBlock {
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new ClutchTileEntity();
}
@Override
public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos,
boolean isMoving) {
if (worldIn.isRemote)
return;
boolean previouslyPowered = state.get(POWERED);
if (previouslyPowered != worldIn.isBlockPowered(pos)) {
worldIn.setBlockState(pos, state.cycle(POWERED), 2 | 16);
TileEntity te = worldIn.getTileEntity(pos);
if (te == null || !(te instanceof KineticTileEntity))
return;
if (previouslyPowered)
RotationPropagator.handleAdded(worldIn, pos, (KineticTileEntity) te);
else
RotationPropagator.handleRemoved(worldIn, pos, (KineticTileEntity) te);
}
}
}

View file

@ -1,4 +1,4 @@
package com.simibubi.create.modules.contraptions.relays;
package com.simibubi.create.modules.contraptions.relays.encased;
import com.simibubi.create.AllTileEntities;

View file

@ -0,0 +1,161 @@
package com.simibubi.create.modules.contraptions.relays.encased;
import com.simibubi.create.modules.contraptions.base.DirectionalAxisKineticBlock;
import com.simibubi.create.modules.contraptions.base.RotatedPillarKineticBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.EnumProperty;
import net.minecraft.state.IProperty;
import net.minecraft.state.StateContainer.Builder;
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.IStringSerializable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
public class EncasedBeltBlock extends RotatedPillarKineticBlock {
public static final IProperty<Part> PART = EnumProperty.create("part", Part.class);
public static final BooleanProperty CONNECTED_ALONG_FIRST_COORDINATE = DirectionalAxisKineticBlock.AXIS_ALONG_FIRST_COORDINATE;
public EncasedBeltBlock() {
super(Properties.from(Blocks.ANDESITE));
setDefaultState(getDefaultState().with(PART, Part.NONE));
}
@Override
protected void fillStateContainer(Builder<Block, BlockState> builder) {
super.fillStateContainer(builder.add(PART, CONNECTED_ALONG_FIRST_COORDINATE));
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
Axis placedAxis = context.getNearestLookingDirection().getAxis();
Axis axis = context.isPlacerSneaking() ? placedAxis : getPreferredAxis(context);
if (axis == null)
axis = placedAxis;
BlockState state = getDefaultState().with(AXIS, axis);
for (Direction facing : Direction.values()) {
if (facing.getAxis() == axis)
continue;
BlockPos pos = context.getPos();
BlockPos offset = pos.offset(facing);
state = updatePostPlacement(state, facing, context.getWorld().getBlockState(offset), context.getWorld(),
pos, offset);
}
return state;
}
@Override
public BlockState updatePostPlacement(BlockState stateIn, Direction face, BlockState neighbour, IWorld worldIn,
BlockPos currentPos, BlockPos facingPos) {
Part part = stateIn.get(PART);
Axis axis = stateIn.get(AXIS);
boolean connectionAlongFirst = stateIn.get(CONNECTED_ALONG_FIRST_COORDINATE);
Axis connectionAxis = connectionAlongFirst ? (axis == Axis.X ? Axis.Y : Axis.X)
: (axis == Axis.Z ? Axis.Y : Axis.Z);
Axis faceAxis = face.getAxis();
boolean facingAlongFirst = axis == Axis.X ? faceAxis.isVertical() : faceAxis == Axis.X;
boolean positive = face.getAxisDirection() == AxisDirection.POSITIVE;
if (axis == faceAxis)
return stateIn;
if (neighbour.getBlock() != this) {
if (facingAlongFirst != connectionAlongFirst || part == Part.NONE)
return stateIn;
if (part == Part.MIDDLE)
return stateIn.with(PART, positive ? Part.END : Part.START);
if ((part == Part.START) == positive)
return stateIn.with(PART, Part.NONE);
return stateIn;
}
Part otherPart = neighbour.get(PART);
Axis otherAxis = neighbour.get(AXIS);
boolean otherConnection = neighbour.get(CONNECTED_ALONG_FIRST_COORDINATE);
Axis otherConnectionAxis = otherConnection ? (otherAxis == Axis.X ? Axis.Y : Axis.X)
: (otherAxis == Axis.Z ? Axis.Y : Axis.Z);
if (neighbour.get(AXIS) == faceAxis)
return stateIn;
if (otherPart != Part.NONE && otherConnectionAxis != faceAxis)
return stateIn;
if (part == Part.NONE) {
part = positive ? Part.START : Part.END;
connectionAlongFirst = axis == Axis.X ? faceAxis.isVertical() : faceAxis == Axis.X;
} else if (connectionAxis != faceAxis) {
return stateIn;
}
if ((part == Part.START) != positive)
part = Part.MIDDLE;
return stateIn.with(PART, part).with(CONNECTED_ALONG_FIRST_COORDINATE, connectionAlongFirst);
}
@Override
public boolean hasShaftTowards(World world, BlockPos pos, BlockState state, Direction face) {
return face.getAxis() == state.get(AXIS);
}
@Override
public Axis getRotationAxis(BlockState state) {
return state.get(AXIS);
}
public static boolean areBlocksConnected(BlockState state, BlockState other, Direction facing) {
Part part = state.get(PART);
Axis axis = state.get(AXIS);
boolean connectionAlongFirst = state.get(CONNECTED_ALONG_FIRST_COORDINATE);
Axis connectionAxis = connectionAlongFirst ? (axis == Axis.X ? Axis.Y : Axis.X)
: (axis == Axis.Z ? Axis.Y : Axis.Z);
Axis otherAxis = other.get(AXIS);
boolean otherConnection = other.get(CONNECTED_ALONG_FIRST_COORDINATE);
Axis otherConnectionAxis = otherConnection ? (otherAxis == Axis.X ? Axis.Y : Axis.X)
: (otherAxis == Axis.Z ? Axis.Y : Axis.Z);
if (otherConnectionAxis != connectionAxis)
return false;
if (facing.getAxis() != connectionAxis)
return false;
if (facing.getAxisDirection() == AxisDirection.POSITIVE && (part == Part.MIDDLE || part == Part.START))
return true;
if (facing.getAxisDirection() == AxisDirection.NEGATIVE && (part == Part.MIDDLE || part == Part.END))
return true;
return false;
}
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new EncasedShaftTileEntity();
}
@Override
protected boolean hasStaticPart() {
return true;
}
public enum Part implements IStringSerializable {
START, MIDDLE, END, NONE;
@Override
public String getName() {
return name().toLowerCase();
}
}
}

Some files were not shown because too many files have changed in this diff Show more