mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-19 16:32:31 +01:00
This? Yes. That? No.
- Added config values to toggle the modules of create. - Added config options to disable unstable features in case of a crashloop. - Cleaned up the Encased Fan TileEntity - Changed in-world processing from static lists to item nbt.
This commit is contained in:
parent
6fb5da3d6a
commit
4a2335672d
156 changed files with 1517 additions and 598 deletions
|
@ -4,6 +4,7 @@ import com.simibubi.create.foundation.block.IWithoutBlockItem;
|
|||
import com.simibubi.create.foundation.block.ProperStairsBlock;
|
||||
import com.simibubi.create.foundation.block.RenderUtilityAxisBlock;
|
||||
import com.simibubi.create.foundation.block.RenderUtilityBlock;
|
||||
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.CrushingWheelBlock;
|
||||
|
@ -28,7 +29,6 @@ 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.economy.ShopShelfBlock;
|
||||
import com.simibubi.create.modules.gardens.CocoaLogBlock;
|
||||
import com.simibubi.create.modules.logistics.block.BeltFunnelBlock;
|
||||
import com.simibubi.create.modules.logistics.block.EntityDetectorBlock;
|
||||
|
@ -60,14 +60,14 @@ import net.minecraftforge.registries.IForgeRegistry;
|
|||
|
||||
public enum AllBlocks {
|
||||
|
||||
// Schematics
|
||||
__SCHEMATICS__(),
|
||||
SCHEMATICANNON(new SchematicannonBlock()),
|
||||
SCHEMATICANNON_CONNECTOR(new RenderUtilityBlock()),
|
||||
SCHEMATICANNON_PIPE(new RenderUtilityBlock()),
|
||||
CREATIVE_CRATE(new CreativeCrateBlock()),
|
||||
SCHEMATIC_TABLE(new SchematicTableBlock()),
|
||||
|
||||
// Kinetics
|
||||
__CONTRAPTIONS__(),
|
||||
SHAFT(new ShaftBlock(Properties.from(Blocks.ANDESITE))),
|
||||
COGWHEEL(new CogWheelBlock(false)),
|
||||
LARGE_COGWHEEL(new CogWheelBlock(true)),
|
||||
|
@ -79,17 +79,14 @@ public enum AllBlocks {
|
|||
BELT(new BeltBlock()),
|
||||
BELT_PULLEY(new RenderUtilityAxisBlock()),
|
||||
BELT_ANIMATION(new RenderUtilityBlock()),
|
||||
|
||||
MOTOR(new MotorBlock()),
|
||||
WATER_WHEEL(new WaterWheelBlock()),
|
||||
|
||||
ENCASED_FAN(new EncasedFanBlock()),
|
||||
ENCASED_FAN_INNER(new RenderUtilityAxisBlock()),
|
||||
TURNTABLE(new TurntableBlock()),
|
||||
SHAFT_HALF(new ShaftHalfBlock()),
|
||||
CRUSHING_WHEEL(new CrushingWheelBlock()),
|
||||
CRUSHING_WHEEL_CONTROLLER(new CrushingWheelControllerBlock()),
|
||||
|
||||
MECHANICAL_PISTON(new MechanicalPistonBlock(false)),
|
||||
STICKY_MECHANICAL_PISTON(new MechanicalPistonBlock(true)),
|
||||
MECHANICAL_PISTON_HEAD(new MechanicalPistonHeadBlock()),
|
||||
|
@ -98,12 +95,10 @@ public enum AllBlocks {
|
|||
MECHANICAL_BEARING_TOP(new ShaftHalfBlock()),
|
||||
TRANSLATION_CHASSIS(new TranslationChassisBlock()),
|
||||
ROTATION_CHASSIS(new RotationChassisBlock()),
|
||||
|
||||
// Get rid o' these
|
||||
DRILL(new DrillBlock()),
|
||||
HARVESTER(new HarvesterBlock()),
|
||||
|
||||
// Logistics
|
||||
__LOGISTICS__(),
|
||||
CONTACT(new ContactBlock()),
|
||||
REDSTONE_BRIDGE(new RedstoneBridgeBlock()),
|
||||
STOCKSWITCH(new StockswitchBlock()),
|
||||
|
@ -114,22 +109,18 @@ public enum AllBlocks {
|
|||
ENTITY_DETECTOR(new EntityDetectorBlock()),
|
||||
PULSE_REPEATER(new PulseRepeaterBlock()),
|
||||
|
||||
// Symmetry
|
||||
__CURIOSITIES__(),
|
||||
SYMMETRY_PLANE(new PlaneSymmetryBlock()),
|
||||
SYMMETRY_CROSSPLANE(new CrossPlaneSymmetryBlock()),
|
||||
SYMMETRY_TRIPLEPLANE(new TriplePlaneSymmetryBlock()),
|
||||
|
||||
// Gardens
|
||||
__GARDENS__(),
|
||||
COCOA_LOG(new CocoaLogBlock()),
|
||||
|
||||
// Economy
|
||||
SHOP_SHELF(new ShopShelfBlock()),
|
||||
|
||||
// Palettes
|
||||
__PALETTES__(),
|
||||
ANDESITE_BRICKS(new Block(Properties.from(Blocks.ANDESITE))),
|
||||
DIORITE_BRICKS(new Block(Properties.from(Blocks.DIORITE))),
|
||||
GRANITE_BRICKS(new Block(Properties.from(Blocks.GRANITE))),
|
||||
|
||||
GABBRO(new Block(Properties.from(Blocks.GRANITE)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
||||
POLISHED_GABBRO(new Block(Properties.from(GABBRO.block))),
|
||||
GABBRO_BRICKS(new Block(Properties.from(GABBRO.block)), ComesWith.STAIRS, ComesWith.WALL),
|
||||
|
@ -137,18 +128,15 @@ public enum AllBlocks {
|
|||
INDENTED_GABBRO(new Block(Properties.from(GABBRO.block)), ComesWith.SLAB),
|
||||
SLIGHTLY_MOSSY_GABBRO_BRICKS(new Block(Properties.from(GABBRO.block))),
|
||||
MOSSY_GABBRO_BRICKS(new Block(Properties.from(GABBRO.block))),
|
||||
|
||||
LIMESTONE(new Block(Properties.from(Blocks.SANDSTONE)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
||||
LIMESTONE_BRICKS(new Block(Properties.from(LIMESTONE.block)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
||||
POLISHED_LIMESTONE(new Block(Properties.from(LIMESTONE.block)), ComesWith.SLAB),
|
||||
LIMESTONE_PILLAR(new RotatedPillarBlock(Properties.from(LIMESTONE.block))),
|
||||
|
||||
WEATHERED_LIMESTONE(new Block(Properties.from(Blocks.ANDESITE)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
||||
WEATHERED_LIMESTONE_BRICKS(new Block(Properties.from(WEATHERED_LIMESTONE.block)), ComesWith.STAIRS, ComesWith.SLAB,
|
||||
ComesWith.WALL),
|
||||
POLISHED_WEATHERED_LIMESTONE(new Block(Properties.from(WEATHERED_LIMESTONE.block)), ComesWith.SLAB),
|
||||
WEATHERED_LIMESTONE_PILLAR(new RotatedPillarBlock(Properties.from(WEATHERED_LIMESTONE.block))),
|
||||
|
||||
DOLOMITE(new Block(Properties.from(Blocks.QUARTZ_BLOCK)), ComesWith.STAIRS, ComesWith.SLAB, ComesWith.WALL),
|
||||
DOLOMITE_BRICKS(new Block(Properties.from(DOLOMITE.block))),
|
||||
POLISHED_DOLOMITE(new Block(Properties.from(DOLOMITE.block))),
|
||||
|
@ -160,12 +148,27 @@ public enum AllBlocks {
|
|||
WALL, FENCE, FENCE_GATE, SLAB, STAIRS;
|
||||
}
|
||||
|
||||
private static class CategoryTracker {
|
||||
static IModule currentModule;
|
||||
}
|
||||
|
||||
public Block block;
|
||||
public Block[] alsoRegistered;
|
||||
public IModule module;
|
||||
|
||||
private AllBlocks() {
|
||||
CategoryTracker.currentModule = new IModule() {
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return name().toLowerCase().replaceAll("__", "");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private AllBlocks(Block block, ComesWith... comesWith) {
|
||||
this.block = block;
|
||||
this.block.setRegistryName(Create.ID, this.name().toLowerCase());
|
||||
this.module = CategoryTracker.currentModule;
|
||||
|
||||
alsoRegistered = new Block[comesWith.length];
|
||||
for (int i = 0; i < comesWith.length; i++)
|
||||
|
@ -174,6 +177,9 @@ public enum AllBlocks {
|
|||
|
||||
public static void registerBlocks(IForgeRegistry<Block> registry) {
|
||||
for (AllBlocks block : values()) {
|
||||
if (block.get() == null)
|
||||
continue;
|
||||
|
||||
registry.register(block.block);
|
||||
for (Block extra : block.alsoRegistered)
|
||||
registry.register(extra);
|
||||
|
@ -182,6 +188,8 @@ public enum AllBlocks {
|
|||
|
||||
public static void registerItemBlocks(IForgeRegistry<Item> registry) {
|
||||
for (AllBlocks block : values()) {
|
||||
if (block.get() == null)
|
||||
continue;
|
||||
if (block.get() instanceof IWithoutBlockItem)
|
||||
continue;
|
||||
|
||||
|
@ -193,7 +201,7 @@ public enum AllBlocks {
|
|||
|
||||
private static void registerAsItem(IForgeRegistry<Item> registry, Block blockIn) {
|
||||
registry.register(
|
||||
new BlockItem(blockIn, AllItems.standardProperties()).setRegistryName(blockIn.getRegistryName()));
|
||||
new BlockItem(blockIn, AllItems.standardItemProperties()).setRegistryName(blockIn.getRegistryName()));
|
||||
}
|
||||
|
||||
public Block get() {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.simibubi.create;
|
||||
|
||||
import com.simibubi.create.modules.economy.ShopShelfContainer;
|
||||
import com.simibubi.create.modules.economy.ShopShelfScreen;
|
||||
import com.simibubi.create.modules.logistics.block.FlexcrateContainer;
|
||||
import com.simibubi.create.modules.logistics.block.FlexcrateScreen;
|
||||
import com.simibubi.create.modules.schematics.block.SchematicTableContainer;
|
||||
|
@ -32,8 +30,6 @@ public enum AllContainers {
|
|||
SCHEMATICANNON(SchematicannonContainer::new),
|
||||
FLEXCRATE(FlexcrateContainer::new),
|
||||
|
||||
SHOP_SHELF(ShopShelfContainer::new),
|
||||
|
||||
;
|
||||
|
||||
public ContainerType<? extends Container> type;
|
||||
|
@ -58,7 +54,6 @@ public enum AllContainers {
|
|||
bind(SCHEMATIC_TABLE, SchematicTableScreen::new);
|
||||
bind(SCHEMATICANNON, SchematicannonScreen::new);
|
||||
bind(FLEXCRATE, FlexcrateScreen::new);
|
||||
bind(SHOP_SHELF, ShopShelfScreen::new);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.simibubi.create;
|
||||
|
||||
import com.simibubi.create.foundation.item.IItemWithColorHandler;
|
||||
import com.simibubi.create.modules.IModule;
|
||||
import com.simibubi.create.modules.contraptions.relays.belt.BeltItem;
|
||||
import com.simibubi.create.modules.curiosities.ChromaticCompoundCubeItem;
|
||||
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunItem;
|
||||
|
@ -33,20 +34,21 @@ import net.minecraftforge.registries.IForgeRegistry;
|
|||
@EventBusSubscriber(value = Dist.CLIENT, bus = Bus.MOD)
|
||||
public enum AllItems {
|
||||
|
||||
__CURIOSITIES__(),
|
||||
SYMMETRY_WAND(new SymmetryWandItem(
|
||||
standardProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.SYMMETRY_WAND)))),
|
||||
|
||||
standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.SYMMETRY_WAND)))),
|
||||
PLACEMENT_HANDGUN(
|
||||
new BuilderGunItem(new Properties().setTEISR(() -> () -> renderUsing(AllItemRenderers.BUILDER_GUN)))),
|
||||
|
||||
ANDESITE_ALLOY_CUBE(new Item(standardProperties())),
|
||||
BLAZE_BRASS_CUBE(new Item(standardProperties())),
|
||||
CHORUS_CHROME_CUBE(new Item(standardProperties().rarity(Rarity.UNCOMMON))),
|
||||
SHADOW_STEEL_CUBE(new Item(standardProperties().rarity(Rarity.UNCOMMON))),
|
||||
ROSE_QUARTZ(new Item(standardProperties())),
|
||||
REFINED_ROSE_QUARTZ(new Item(standardProperties())),
|
||||
CHROMATIC_COMPOUND_CUBE(new ChromaticCompoundCubeItem(standardProperties().rarity(Rarity.UNCOMMON))),
|
||||
REFINED_RADIANCE_CUBE(new Item(standardProperties().rarity(Rarity.RARE))),
|
||||
__MATERIALS__(),
|
||||
ANDESITE_ALLOY_CUBE(new Item(standardItemProperties())),
|
||||
BLAZE_BRASS_CUBE(new Item(standardItemProperties())),
|
||||
CHORUS_CHROME_CUBE(new Item(standardItemProperties().rarity(Rarity.UNCOMMON))),
|
||||
SHADOW_STEEL_CUBE(new Item(standardItemProperties().rarity(Rarity.UNCOMMON))),
|
||||
ROSE_QUARTZ(new Item(standardItemProperties())),
|
||||
REFINED_ROSE_QUARTZ(new Item(standardItemProperties())),
|
||||
CHROMATIC_COMPOUND_CUBE(new ChromaticCompoundCubeItem(standardItemProperties().rarity(Rarity.UNCOMMON))),
|
||||
REFINED_RADIANCE_CUBE(new Item(standardItemProperties().rarity(Rarity.RARE))),
|
||||
|
||||
// BLAZING_PICKAXE(new BlazingToolItem(1, -2.8F, standardProperties(), PICKAXE)),
|
||||
// BLAZING_SHOVEL(new BlazingToolItem(1.5F, -3.0F, standardProperties(), SHOVEL)),
|
||||
|
@ -62,30 +64,51 @@ public enum AllItems {
|
|||
// SHADOW_STEEL_MATTOCK(new ShadowSteelToolItem(2.5F, -1.5F, standardProperties(), SHOVEL, AXE, HOE)),
|
||||
// SHADOW_STEEL_SWORD(new ShadowSteelToolItem(3, -2.0F, standardProperties(), SWORD)),
|
||||
|
||||
TREE_FERTILIZER(new TreeFertilizerItem(standardProperties())),
|
||||
__GARDENS__(),
|
||||
TREE_FERTILIZER(new TreeFertilizerItem(standardItemProperties())),
|
||||
|
||||
EMPTY_BLUEPRINT(new Item(standardProperties().maxStackSize(1))),
|
||||
BLUEPRINT_AND_QUILL(new SchematicAndQuillItem(standardProperties().maxStackSize(1))),
|
||||
BLUEPRINT(new SchematicItem(standardProperties())),
|
||||
BELT_CONNECTOR(new BeltItem(standardProperties())),
|
||||
__SCHEMATICS__(),
|
||||
EMPTY_BLUEPRINT(new Item(standardItemProperties().maxStackSize(1))),
|
||||
BLUEPRINT_AND_QUILL(new SchematicAndQuillItem(standardItemProperties().maxStackSize(1))),
|
||||
BLUEPRINT(new SchematicItem(standardItemProperties())),
|
||||
|
||||
__CONTRAPTIONS__(),
|
||||
BELT_CONNECTOR(new BeltItem(standardItemProperties())),
|
||||
|
||||
;
|
||||
|
||||
private static class CategoryTracker {
|
||||
static IModule currentModule;
|
||||
}
|
||||
|
||||
// Common
|
||||
|
||||
public Item item;
|
||||
public IModule module;
|
||||
|
||||
private AllItems() {
|
||||
CategoryTracker.currentModule = new IModule() {
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return name().toLowerCase().replaceAll("__", "");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private AllItems(Item item) {
|
||||
this.item = item;
|
||||
this.item.setRegistryName(Create.ID, this.name().toLowerCase());
|
||||
this.module = CategoryTracker.currentModule;
|
||||
}
|
||||
|
||||
public static Properties standardProperties() {
|
||||
public static Properties standardItemProperties() {
|
||||
return new Properties().group(Create.creativeTab);
|
||||
}
|
||||
|
||||
public static void registerItems(IForgeRegistry<Item> iForgeRegistry) {
|
||||
for (AllItems item : values()) {
|
||||
if (item.get() == null)
|
||||
continue;
|
||||
iForgeRegistry.register(item.get());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ import com.simibubi.create.modules.contraptions.relays.ShaftTileEntity;
|
|||
import com.simibubi.create.modules.contraptions.relays.SplitShaftTileEntityRenderer;
|
||||
import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntity;
|
||||
import com.simibubi.create.modules.contraptions.relays.belt.BeltTileEntityRenderer;
|
||||
import com.simibubi.create.modules.economy.ShopShelfTileEntity;
|
||||
import com.simibubi.create.modules.logistics.block.BeltFunnelTileEntity;
|
||||
import com.simibubi.create.modules.logistics.block.EntityDetectorTileEntity;
|
||||
import com.simibubi.create.modules.logistics.block.EntityDetectorTileEntityRenderer;
|
||||
|
@ -90,9 +89,6 @@ public enum AllTileEntities {
|
|||
BELT_FUNNEL(BeltFunnelTileEntity::new, AllBlocks.BELT_FUNNEL),
|
||||
ENTITY_DETECTOR(EntityDetectorTileEntity::new, AllBlocks.ENTITY_DETECTOR),
|
||||
|
||||
// Economy
|
||||
SHOP_SHELF(ShopShelfTileEntity::new, AllBlocks.SHOP_SHELF),
|
||||
|
||||
;
|
||||
|
||||
private Supplier<? extends TileEntity> supplier;
|
||||
|
|
|
@ -3,15 +3,16 @@ package com.simibubi.create;
|
|||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import com.simibubi.create.modules.ModuleLoadedCondition;
|
||||
import com.simibubi.create.modules.contraptions.receivers.constructs.MovingConstructHandler;
|
||||
import com.simibubi.create.modules.logistics.FrequencyHandler;
|
||||
import com.simibubi.create.modules.logistics.InWorldItemProcessingHandler;
|
||||
import com.simibubi.create.modules.schematics.ServerSchematicLoader;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraftforge.common.crafting.CraftingHelper;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
|
@ -33,7 +34,6 @@ public class Create {
|
|||
public static ItemGroup creativeTab = new CreateItemGroup();
|
||||
public static ServerSchematicLoader schematicReceiver;
|
||||
public static FrequencyHandler frequencyHandler;
|
||||
public static InWorldItemProcessingHandler itemProcessingHandler;
|
||||
public static MovingConstructHandler constructHandler;
|
||||
|
||||
public static ModConfig config;
|
||||
|
@ -46,9 +46,9 @@ public class Create {
|
|||
@SubscribeEvent
|
||||
public static void init(final FMLCommonSetupEvent event) {
|
||||
schematicReceiver = new ServerSchematicLoader();
|
||||
itemProcessingHandler = new InWorldItemProcessingHandler();
|
||||
frequencyHandler = new FrequencyHandler();
|
||||
constructHandler = new MovingConstructHandler();
|
||||
CraftingHelper.register(new ModuleLoadedCondition.Serializer());
|
||||
AllPackets.registerPackets();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.simibubi.create;
|
||||
|
||||
import com.simibubi.create.modules.contraptions.receivers.EncasedFanParticleHandler;
|
||||
import com.simibubi.create.modules.schematics.ClientSchematicLoader;
|
||||
import com.simibubi.create.modules.schematics.client.SchematicAndQuillHandler;
|
||||
import com.simibubi.create.modules.schematics.client.SchematicHandler;
|
||||
|
@ -18,6 +19,7 @@ public class CreateClient {
|
|||
public static SchematicHandler schematicHandler;
|
||||
public static SchematicHologram schematicHologram;
|
||||
public static SchematicAndQuillHandler schematicAndQuillHandler;
|
||||
public static EncasedFanParticleHandler fanParticles;
|
||||
|
||||
public static ModConfig config;
|
||||
|
||||
|
@ -27,6 +29,7 @@ public class CreateClient {
|
|||
schematicHandler = new SchematicHandler();
|
||||
schematicHologram = new SchematicHologram();
|
||||
schematicAndQuillHandler = new SchematicAndQuillHandler();
|
||||
fanParticles = new EncasedFanParticleHandler();
|
||||
|
||||
AllKeys.register();
|
||||
AllContainers.registerScreenFactories();
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.nio.file.Paths;
|
|||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
import net.minecraftforge.common.ForgeConfigSpec.BooleanValue;
|
||||
import net.minecraftforge.common.ForgeConfigSpec.Builder;
|
||||
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
||||
import net.minecraftforge.common.ForgeConfigSpec.DoubleValue;
|
||||
|
@ -23,6 +24,22 @@ public class CreateConfig {
|
|||
parameters = specPair.getLeft();
|
||||
}
|
||||
|
||||
// Modules
|
||||
public BooleanValue enableSchematics;
|
||||
public BooleanValue enableCuriosities;
|
||||
public BooleanValue enableContraptions;
|
||||
public BooleanValue enablePalettes;
|
||||
public BooleanValue enableLogistics;
|
||||
public BooleanValue enableGardens;
|
||||
|
||||
// Damage Control
|
||||
public BooleanValue freezeRotationPropagator;
|
||||
public BooleanValue freezeCrushing;
|
||||
public BooleanValue freezeInWorldProcessing;
|
||||
public BooleanValue freezeRotationConstructs;
|
||||
public BooleanValue freezePistonConstructs;
|
||||
public BooleanValue freezeExtractors;
|
||||
|
||||
// Schematics
|
||||
public IntValue maxSchematics, maxTotalSchematicSize, maxSchematicPacketSize, schematicIdleTimeout;
|
||||
public IntValue schematicannonDelay, schematicannonSkips;
|
||||
|
@ -34,7 +51,7 @@ public class CreateConfig {
|
|||
|
||||
// Contraptions
|
||||
public IntValue maxBeltLength, crushingDamage, maxMotorSpeed, maxRotationSpeed;
|
||||
public IntValue fanMaxPushDistance, fanMaxPullDistance, fanBlockCheckRate, fanRotationArgmax;
|
||||
public IntValue fanMaxPushDistance, fanMaxPullDistance, fanBlockCheckRate, fanRotationArgmax, inWorldProcessingTime;
|
||||
public IntValue maxChassisForTranslation, maxChassisForRotation, maxChassisRange, maxPistonPoles;
|
||||
|
||||
// Logistics
|
||||
|
@ -44,23 +61,78 @@ public class CreateConfig {
|
|||
public DoubleValue cocoaLogGrowthSpeed;
|
||||
|
||||
CreateConfig(final ForgeConfigSpec.Builder builder) {
|
||||
|
||||
// Schematics
|
||||
initSchematics(builder);
|
||||
initGeneral(builder);
|
||||
initContraptions(builder);
|
||||
initCuriosities(builder);
|
||||
initLogistics(builder);
|
||||
initGardens(builder);
|
||||
}
|
||||
|
||||
private void initGeneral(Builder builder) {
|
||||
builder.comment(
|
||||
"Configure which Modules should be accessible. This only affects Creative Menus and Recipes - any blocks and items already present will not stop working or disappear.")
|
||||
.push("modules");
|
||||
String basePath = "create.config.modules.";
|
||||
String name = "";
|
||||
|
||||
name = "enableSchematics";
|
||||
enableSchematics = builder.translation(basePath + name).define(name, true);
|
||||
|
||||
name = "enableContraptions";
|
||||
enableContraptions = builder.translation(basePath + name).define(name, true);
|
||||
|
||||
name = "enableCuriosities";
|
||||
enableCuriosities = builder.translation(basePath + name).define(name, true);
|
||||
|
||||
name = "enableGardens";
|
||||
enableGardens = builder.translation(basePath + name).define(name, true);
|
||||
|
||||
name = "enableLogistics";
|
||||
enableLogistics = builder.translation(basePath + name).define(name, true);
|
||||
|
||||
name = "enablePalettes";
|
||||
enablePalettes = builder.translation(basePath + name).define(name, true);
|
||||
|
||||
builder.pop();
|
||||
builder.comment("In case of repeated crashing, you can inhibit related game mechanics for Troubleshooting.")
|
||||
.push("damageControl");
|
||||
basePath = "create.config.damageControl.";
|
||||
|
||||
name = "freezeCrushing";
|
||||
freezeCrushing = builder.comment("", "In case Crushing Wheels crushed your server.")
|
||||
.translation(basePath + name).define(name, false);
|
||||
|
||||
name = "freezeExtractors";
|
||||
freezeExtractors = builder.comment("", "In case Extractors pulled the plug.").translation(basePath + name)
|
||||
.define(name, false);
|
||||
|
||||
name = "freezeInWorldProcessing";
|
||||
freezeInWorldProcessing = builder.comment("", "In case Encased Fans tried smelting your hardware.")
|
||||
.translation(basePath + name).define(name, false);
|
||||
|
||||
name = "freezeRotationPropagator";
|
||||
freezeRotationPropagator = builder
|
||||
.comment("", "Pauses rotation logic altogether - Use if crash mentions RotationPropagators.")
|
||||
.translation(basePath + name).define(name, false);
|
||||
|
||||
name = "freezeRotationConstructs";
|
||||
freezeRotationConstructs = builder.comment("", "In case Mechanical Bearings turned against you.")
|
||||
.translation(basePath + name).define(name, false);
|
||||
|
||||
name = "freezePistonConstructs";
|
||||
freezePistonConstructs = builder.comment("", "In case Mechanical Pistons pushed it too far.")
|
||||
.translation(basePath + name).define(name, false);
|
||||
|
||||
builder.pop();
|
||||
}
|
||||
|
||||
private void initGardens(Builder builder) {
|
||||
builder.comment("The Gardens Module").push("gardens");
|
||||
String basePath = "create.config.gardens";
|
||||
String basePath = "create.config.gardens.";
|
||||
String name = "";
|
||||
|
||||
name = "cocoaLogGrowthSpeed";
|
||||
cocoaLogGrowthSpeed = builder
|
||||
.comment("", "% of random Ticks causing a Cocoa log to grow.")
|
||||
cocoaLogGrowthSpeed = builder.comment("", "% of random Ticks causing a Cocoa log to grow.")
|
||||
.translation(basePath + name).defineInRange(name, 0D, 20D, 100D);
|
||||
|
||||
builder.pop();
|
||||
|
@ -68,7 +140,7 @@ public class CreateConfig {
|
|||
|
||||
private void initLogistics(Builder builder) {
|
||||
builder.comment("The Logistics Module").push("logistics");
|
||||
String basePath = "create.config.logistics";
|
||||
String basePath = "create.config.logistics.";
|
||||
String name = "";
|
||||
|
||||
name = "extractorDelay";
|
||||
|
@ -82,8 +154,7 @@ public class CreateConfig {
|
|||
.translation(basePath + name).defineInRange(name, 16, 1, 64);
|
||||
|
||||
name = "linkRange";
|
||||
linkRange = builder
|
||||
.comment("", "Maximum possible range in blocks of redstone link connections.")
|
||||
linkRange = builder.comment("", "Maximum possible range in blocks of redstone link connections.")
|
||||
.translation(basePath + name).defineInRange(name, 128, 4, Integer.MAX_VALUE);
|
||||
|
||||
builder.pop();
|
||||
|
@ -91,18 +162,16 @@ public class CreateConfig {
|
|||
|
||||
private void initContraptions(Builder builder) {
|
||||
builder.comment("The Contraptions Module").push("contraptions");
|
||||
String basePath = "create.config.contraptions";
|
||||
String basePath = "create.config.contraptions.";
|
||||
String name = "";
|
||||
|
||||
name = "maxBeltLength";
|
||||
maxBeltLength = builder
|
||||
.comment("", "Maximum length in blocks of mechanical belts.")
|
||||
maxBeltLength = builder.comment("", "Maximum length in blocks of mechanical belts.")
|
||||
.translation(basePath + name).defineInRange(name, 20, 5, Integer.MAX_VALUE);
|
||||
|
||||
name = "crushingDamage";
|
||||
crushingDamage = builder
|
||||
.comment("", "Damage dealt by active Crushing Wheels.")
|
||||
.translation(basePath + name).defineInRange(name, 4, 0, Integer.MAX_VALUE);
|
||||
crushingDamage = builder.comment("", "Damage dealt by active Crushing Wheels.").translation(basePath + name)
|
||||
.defineInRange(name, 4, 0, Integer.MAX_VALUE);
|
||||
|
||||
{
|
||||
builder.comment("Encased Fan").push("encasedFan");
|
||||
|
@ -114,31 +183,31 @@ public class CreateConfig {
|
|||
.translation(basePath + name).defineInRange(name, 100, 20, Integer.MAX_VALUE);
|
||||
|
||||
name = "fanMaxPushDistance";
|
||||
fanMaxPushDistance = builder
|
||||
.comment("", "Maximum distance in blocks Fans can push entities.")
|
||||
fanMaxPushDistance = builder.comment("", "Maximum distance in blocks Fans can push entities.")
|
||||
.translation(basePath + name).defineInRange(name, 20, 1, Integer.MAX_VALUE);
|
||||
|
||||
name = "fanMaxPullDistance";
|
||||
fanMaxPullDistance = builder
|
||||
.comment("", "Maximum distance in blocks from where Fans can pull entities.")
|
||||
fanMaxPullDistance = builder.comment("", "Maximum distance in blocks from where Fans can pull entities.")
|
||||
.translation(basePath + name).defineInRange(name, 5, 1, Integer.MAX_VALUE);
|
||||
|
||||
name = "fanRotationArgmax";
|
||||
fanRotationArgmax = builder
|
||||
.comment("", "Rotation speed at which the maximum stats of fans are reached.")
|
||||
fanRotationArgmax = builder.comment("", "Rotation speed at which the maximum stats of fans are reached.")
|
||||
.translation(basePath + name).defineInRange(name, 8192, 64, Integer.MAX_VALUE);
|
||||
|
||||
name = "inWorldProcessingTime";
|
||||
inWorldProcessingTime = builder
|
||||
.comment("", "Game ticks required for a Fan-based processing recipe to take effect.")
|
||||
.translation(basePath + name).defineInRange(name, 150, 0, Integer.MAX_VALUE);
|
||||
|
||||
builder.pop();
|
||||
}
|
||||
|
||||
{
|
||||
builder.comment("Mechanical Pistons and Bearings").push("constructs");
|
||||
basePath = "create.config.contraptions.constructs";
|
||||
basePath = "create.config.contraptions.constructs.";
|
||||
|
||||
name = "maxChassisRange";
|
||||
maxChassisRange = builder
|
||||
.comment("", "Maximum value of a chassis attachment range.")
|
||||
maxChassisRange = builder.comment("", "Maximum value of a chassis attachment range.")
|
||||
.translation(basePath + name).defineInRange(name, 16, 1, Integer.MAX_VALUE);
|
||||
|
||||
name = "maxChassisForRotation";
|
||||
|
@ -152,21 +221,18 @@ public class CreateConfig {
|
|||
.translation(basePath + name).defineInRange(name, 16, 1, Integer.MAX_VALUE);
|
||||
|
||||
name = "maxPistonPoles";
|
||||
maxPistonPoles = builder
|
||||
.comment("", "Maximum amount of extension poles behind a Mechanical Piston.")
|
||||
maxPistonPoles = builder.comment("", "Maximum amount of extension poles behind a Mechanical Piston.")
|
||||
.translation(basePath + name).defineInRange(name, 64, 1, Integer.MAX_VALUE);
|
||||
|
||||
builder.pop();
|
||||
}
|
||||
|
||||
name = "maxMotorSpeed";
|
||||
maxMotorSpeed = builder
|
||||
.comment("", "Maximum allowed speed of a configurable motor.")
|
||||
maxMotorSpeed = builder.comment("", "Maximum allowed speed of a configurable motor.")
|
||||
.translation(basePath + name).defineInRange(name, 4096, 64, Integer.MAX_VALUE);
|
||||
|
||||
name = "maxRotationSpeed";
|
||||
maxRotationSpeed = builder
|
||||
.comment("", "Maximum allowed rotation speed for any Kinetic Tile.")
|
||||
maxRotationSpeed = builder.comment("", "Maximum allowed rotation speed for any Kinetic Tile.")
|
||||
.translation(basePath + name).defineInRange(name, 16384, 64, Integer.MAX_VALUE);
|
||||
|
||||
builder.pop();
|
||||
|
@ -174,7 +240,7 @@ public class CreateConfig {
|
|||
|
||||
private void initCuriosities(Builder builder) {
|
||||
builder.comment("The Curiosities Module").push("curiosities");
|
||||
String basePath = "create.config.curiosities";
|
||||
String basePath = "create.config.curiosities.";
|
||||
String name = "";
|
||||
|
||||
name = "maxSymmetryWandRange";
|
||||
|
@ -187,7 +253,7 @@ public class CreateConfig {
|
|||
|
||||
public void initSchematics(final ForgeConfigSpec.Builder builder) {
|
||||
builder.comment("The Schematics Module").push("schematics");
|
||||
String basePath = "create.config.schematics";
|
||||
String basePath = "create.config.schematics.";
|
||||
String name = "";
|
||||
|
||||
name = "maxSchematics";
|
||||
|
@ -219,23 +285,21 @@ public class CreateConfig {
|
|||
basePath = "create.config.schematics.schematicannon";
|
||||
|
||||
name = "schematicannonDelay";
|
||||
schematicannonDelay = builder.comment("",
|
||||
"Amount of game ticks between shots of the cannon. Higher => Slower")
|
||||
schematicannonDelay = builder
|
||||
.comment("", "Amount of game ticks between shots of the cannon. Higher => Slower")
|
||||
.translation(basePath + name).defineInRange(name, 10, 1, Integer.MAX_VALUE);
|
||||
|
||||
name = "schematicannonSkips";
|
||||
schematicannonSkips = builder.comment("",
|
||||
"Amount of block positions per tick scanned by a running cannon. Higher => Faster")
|
||||
schematicannonSkips = builder
|
||||
.comment("", "Amount of block positions per tick scanned by a running cannon. Higher => Faster")
|
||||
.translation(basePath + name).defineInRange(name, 10, 1, Integer.MAX_VALUE);
|
||||
|
||||
name = "schematicannonGunpowderWorth";
|
||||
schematicannonGunpowderWorth = builder.comment("",
|
||||
"% of Schematicannon's Fuel filled by 1 Gunpowder.")
|
||||
schematicannonGunpowderWorth = builder.comment("", "% of Schematicannon's Fuel filled by 1 Gunpowder.")
|
||||
.translation(basePath + name).defineInRange(name, 20D, 0D, 100D);
|
||||
|
||||
name = "schematicannonFuelUsage";
|
||||
schematicannonFuelUsage = builder.comment("",
|
||||
"% of Schematicannon's Fuel used for each fired block.")
|
||||
schematicannonFuelUsage = builder.comment("", "% of Schematicannon's Fuel used for each fired block.")
|
||||
.translation(basePath + name).defineInRange(name, 0.05D, 0D, 100D);
|
||||
builder.pop();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package com.simibubi.create;
|
||||
|
||||
import com.simibubi.create.foundation.block.IWithoutBlockItem;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
public final class CreateItemGroup extends ItemGroup {
|
||||
|
||||
|
@ -13,4 +17,29 @@ public final class CreateItemGroup extends ItemGroup {
|
|||
public ItemStack createIcon() {
|
||||
return new ItemStack(AllItems.SYMMETRY_WAND.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fill(NonNullList<ItemStack> items) {
|
||||
for (AllItems item : AllItems.values()) {
|
||||
if (item.get() == null)
|
||||
continue;
|
||||
if (!item.module.isEnabled())
|
||||
continue;
|
||||
|
||||
item.get().fillItemGroup(this, items);
|
||||
}
|
||||
|
||||
for (AllBlocks block : AllBlocks.values()) {
|
||||
if (block.get() == null)
|
||||
continue;
|
||||
if (!block.module.isEnabled())
|
||||
continue;
|
||||
if (block.get() instanceof IWithoutBlockItem)
|
||||
continue;
|
||||
|
||||
block.get().asItem().fillItemGroup(this, items);
|
||||
for (Block alsoRegistered : block.alsoRegistered)
|
||||
alsoRegistered.asItem().fillItemGroup(this, items);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ public class Events {
|
|||
@SubscribeEvent
|
||||
public static void onLoadWorld(WorldEvent.Load event) {
|
||||
IWorld world = event.getWorld();
|
||||
Create.itemProcessingHandler.onLoadWorld(world);
|
||||
Create.frequencyHandler.onLoadWorld(world);
|
||||
Create.constructHandler.onLoadWorld(world);
|
||||
}
|
||||
|
@ -35,7 +34,6 @@ public class Events {
|
|||
@SubscribeEvent
|
||||
public static void onUnloadWorld(WorldEvent.Unload event) {
|
||||
IWorld world = event.getWorld();
|
||||
Create.itemProcessingHandler.onUnloadWorld(world);
|
||||
Create.frequencyHandler.onUnloadWorld(world);
|
||||
Create.constructHandler.onUnloadWorld(world);
|
||||
}
|
||||
|
|
36
src/main/java/com/simibubi/create/modules/IModule.java
Normal file
36
src/main/java/com/simibubi/create/modules/IModule.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
package com.simibubi.create.modules;
|
||||
|
||||
import com.simibubi.create.CreateConfig;
|
||||
|
||||
public interface IModule {
|
||||
|
||||
public static boolean isActive(String module) {
|
||||
if (module.equals("materials"))
|
||||
return true;
|
||||
|
||||
CreateConfig conf = CreateConfig.parameters;
|
||||
switch (module) {
|
||||
case "contraptions":
|
||||
return conf.enableContraptions.get();
|
||||
case "palettes":
|
||||
return conf.enablePalettes.get();
|
||||
case "curiosities":
|
||||
return conf.enableCuriosities.get();
|
||||
case "logistics":
|
||||
return conf.enableLogistics.get();
|
||||
case "schematics":
|
||||
return conf.enableSchematics.get();
|
||||
case "gardens":
|
||||
return conf.enableGardens.get();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public default boolean isEnabled() {
|
||||
return isActive(getModuleName());
|
||||
}
|
||||
|
||||
public String getModuleName();
|
||||
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.simibubi.create.modules;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.simibubi.create.Create;
|
||||
|
||||
import net.minecraft.util.JSONUtils;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.crafting.conditions.ICondition;
|
||||
import net.minecraftforge.common.crafting.conditions.IConditionSerializer;
|
||||
|
||||
public class ModuleLoadedCondition implements ICondition {
|
||||
|
||||
private static final ResourceLocation NAME = new ResourceLocation(Create.ID, "module");
|
||||
protected String module;
|
||||
|
||||
public ModuleLoadedCondition(String module) {
|
||||
this.module = module;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getID() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test() {
|
||||
return IModule.isActive(module);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "module_loaded(\"" + module + "\")";
|
||||
}
|
||||
|
||||
public static class Serializer implements IConditionSerializer<ModuleLoadedCondition> {
|
||||
public static final Serializer INSTANCE = new Serializer();
|
||||
|
||||
@Override
|
||||
public void write(JsonObject json, ModuleLoadedCondition value) {
|
||||
json.addProperty("module", value.module);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModuleLoadedCondition read(JsonObject json) {
|
||||
return new ModuleLoadedCondition(JSONUtils.getString(json, "module"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getID() {
|
||||
return NAME;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -6,6 +6,7 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
|
||||
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;
|
||||
|
@ -133,9 +134,9 @@ public class RotationPropagator {
|
|||
* @param pos
|
||||
*/
|
||||
public static void handleAdded(World worldIn, BlockPos pos, KineticTileEntity addedTE) {
|
||||
if (worldIn.isRemote)
|
||||
if (worldIn.isRemote || isFrozen())
|
||||
return;
|
||||
if (!worldIn.isAreaLoaded(pos, 1))
|
||||
if (!worldIn.isBlockPresent(pos))
|
||||
return;
|
||||
|
||||
if (addedTE.getSpeed() != 0) {
|
||||
|
@ -205,7 +206,7 @@ public class RotationPropagator {
|
|||
* @param removedTE
|
||||
*/
|
||||
public static void handleRemoved(World worldIn, BlockPos pos, KineticTileEntity removedTE) {
|
||||
if (worldIn.isRemote)
|
||||
if (worldIn.isRemote || isFrozen())
|
||||
return;
|
||||
if (removedTE == null)
|
||||
return;
|
||||
|
@ -324,4 +325,8 @@ public class RotationPropagator {
|
|||
return neighbours;
|
||||
}
|
||||
|
||||
public static boolean isFrozen() {
|
||||
return CreateConfig.parameters.freezeRotationPropagator.get();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class CrushingWheelControllerBlock extends Block implements IWithoutBlock
|
|||
}
|
||||
|
||||
public void onEntityCollision(BlockState state, World worldIn, BlockPos pos, Entity entityIn) {
|
||||
if (!state.get(VALID))
|
||||
if (!state.get(VALID) || CrushingWheelControllerTileEntity.isFrozen())
|
||||
return;
|
||||
CrushingWheelControllerTileEntity te = (CrushingWheelControllerTileEntity) worldIn.getTileEntity(pos);
|
||||
if (te == null)
|
||||
|
@ -63,6 +63,8 @@ public class CrushingWheelControllerBlock extends Block implements IWithoutBlock
|
|||
@Override
|
||||
public void onLanded(IBlockReader worldIn, Entity entityIn) {
|
||||
super.onLanded(worldIn, entityIn);
|
||||
if (CrushingWheelControllerTileEntity.isFrozen())
|
||||
return;
|
||||
CrushingWheelControllerTileEntity te = (CrushingWheelControllerTileEntity) worldIn
|
||||
.getTileEntity(entityIn.getPosition().down());
|
||||
if (te == null)
|
||||
|
@ -93,7 +95,7 @@ public class CrushingWheelControllerBlock extends Block implements IWithoutBlock
|
|||
}
|
||||
|
||||
public void updateSpeed(BlockState state, World world, BlockPos pos) {
|
||||
if (!state.get(VALID))
|
||||
if (!state.get(VALID) || CrushingWheelControllerTileEntity.isFrozen())
|
||||
return;
|
||||
CrushingWheelControllerTileEntity te = (CrushingWheelControllerTileEntity) world.getTileEntity(pos);
|
||||
if (te == null)
|
||||
|
|
|
@ -92,7 +92,7 @@ public class CrushingWheelControllerTileEntity extends SyncedTileEntity implemen
|
|||
|
||||
@Override
|
||||
public void tick() {
|
||||
if (!isOccupied())
|
||||
if (!isOccupied() || isFrozen())
|
||||
return;
|
||||
|
||||
float speed = crushingspeed / 2.5f;
|
||||
|
@ -204,7 +204,7 @@ public class CrushingWheelControllerTileEntity extends SyncedTileEntity implemen
|
|||
|
||||
@Override
|
||||
public CompoundNBT write(CompoundNBT compound) {
|
||||
if (hasEntity())
|
||||
if (hasEntity() && !isFrozen())
|
||||
compound.put("Entity", NBTUtil.writeUniqueId(entityUUID));
|
||||
contents.write(compound);
|
||||
compound.putFloat("Speed", crushingspeed);
|
||||
|
@ -216,7 +216,7 @@ public class CrushingWheelControllerTileEntity extends SyncedTileEntity implemen
|
|||
public void read(CompoundNBT compound) {
|
||||
super.read(compound);
|
||||
|
||||
if (compound.contains("Entity")) {
|
||||
if (compound.contains("Entity") && !isFrozen()) {
|
||||
entityUUID = NBTUtil.readUniqueId(compound.getCompound("Entity"));
|
||||
|
||||
List<Entity> search = world.getEntitiesInAABBexcluding(null, new AxisAlignedBB(getPos()),
|
||||
|
@ -259,4 +259,8 @@ public class CrushingWheelControllerTileEntity extends SyncedTileEntity implemen
|
|||
return processingEntity != null;
|
||||
}
|
||||
|
||||
public static boolean isFrozen() {
|
||||
return CreateConfig.parameters.freezeCrushing.get();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
package com.simibubi.create.modules.contraptions.receivers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.particles.BlockParticleData;
|
||||
import net.minecraft.particles.IParticleData;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.particles.RedstoneParticleData;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
|
||||
public class EncasedFanParticleHandler {
|
||||
|
||||
public final Map<Block, List<FanEffect>> effects = new HashMap<>();
|
||||
|
||||
public EncasedFanParticleHandler() {
|
||||
initEffects();
|
||||
}
|
||||
|
||||
private void initEffects() {
|
||||
List<FanEffect> standardFX = new ArrayList<>(2);
|
||||
standardFX.add(new FanEffect(ParticleTypes.BUBBLE_POP, 1 / 4f, 1 / 4f, 1 / 3f, 1));
|
||||
standardFX.add(new FanEffect(new RedstoneParticleData(1, 1, 1, 1), 1 / 2f, 1 / 32f, 1/16f, 512f));
|
||||
effects.put(Blocks.AIR, standardFX);
|
||||
|
||||
List<FanEffect> waterFX = new ArrayList<>(2);
|
||||
waterFX.add(new FanEffect(new BlockParticleData(ParticleTypes.BLOCK, Blocks.WATER.getDefaultState()), 1 / 4f,
|
||||
1 / 2f, 1 / 4f, 1));
|
||||
waterFX.add(new FanEffect(ParticleTypes.SPLASH, 1 / 4f, 1 / 2f, 0.5f, 1));
|
||||
effects.put(Blocks.WATER, waterFX);
|
||||
|
||||
List<FanEffect> fireFX = new ArrayList<>(2);
|
||||
fireFX.add(new FanEffect(ParticleTypes.LARGE_SMOKE, 1 / 4f, 1 / 8f, 0.125f, .5f));
|
||||
fireFX.add(new FanEffect(ParticleTypes.FLAME, 1 / 4f, 1 / 8f, 1 / 32f, 1 / 256f));
|
||||
effects.put(Blocks.FIRE, fireFX);
|
||||
|
||||
List<FanEffect> lavaFX = new ArrayList<>(3);
|
||||
lavaFX.add(new FanEffect(new BlockParticleData(ParticleTypes.BLOCK, Blocks.LAVA.getDefaultState()), 1 / 4f,
|
||||
1 / 2f, 1 / 4f, 1));
|
||||
lavaFX.add(new FanEffect(ParticleTypes.LAVA, 1 / 2f, 1 / 32f, 0, .25f));
|
||||
lavaFX.add(new FanEffect(ParticleTypes.FLAME, 1 / 4f, 1 / 32f, 1 / 32f, 1 / 256f));
|
||||
effects.put(Blocks.LAVA, lavaFX);
|
||||
}
|
||||
|
||||
public void makeParticles(EncasedFanTileEntity te) {
|
||||
Direction direction = te.getAirFlow();
|
||||
Vec3i directionVec = direction.getDirectionVec();
|
||||
|
||||
boolean hasFx = false;
|
||||
BlockState frontBlock = te.frontBlock;
|
||||
if (frontBlock != null) {
|
||||
if (effects.containsKey(frontBlock.getBlock())) {
|
||||
hasFx = true;
|
||||
for (FanEffect fx : effects.get(frontBlock.getBlock()))
|
||||
fx.render(directionVec, true, te);
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasFx)
|
||||
for (FanEffect fx : effects.get(Blocks.AIR))
|
||||
fx.render(directionVec, true, te);
|
||||
|
||||
for (FanEffect fx : effects.get(Blocks.AIR))
|
||||
fx.render(directionVec, false, te);
|
||||
}
|
||||
|
||||
protected static class FanEffect {
|
||||
private IParticleData particle;
|
||||
private float density;
|
||||
private float chance;
|
||||
private float spread;
|
||||
private float speed;
|
||||
private Random r;
|
||||
|
||||
public FanEffect(IParticleData particle, float density, float chance, float spread, float speed) {
|
||||
r = new Random();
|
||||
this.particle = particle;
|
||||
this.density = density;
|
||||
this.chance = chance;
|
||||
this.spread = spread;
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public void render(Vec3i directionVec, boolean front, EncasedFanTileEntity te) {
|
||||
render(directionVec, front ? .5f : -te.pullDistance, front ? te.pushDistance : -.5f, te);
|
||||
}
|
||||
|
||||
private void render(Vec3i directionVec, float start, float end, EncasedFanTileEntity te) {
|
||||
float x = directionVec.getX();
|
||||
float y = directionVec.getY();
|
||||
float z = directionVec.getZ();
|
||||
float speed = this.speed * Math.abs(te.getSpeed()) / 512f;
|
||||
|
||||
for (float offset = start; offset < end; offset += density) {
|
||||
if (r.nextFloat() > chance)
|
||||
continue;
|
||||
float xs = rollOffset() * spread;
|
||||
float ys = rollOffset() * spread;
|
||||
float zs = rollOffset() * spread;
|
||||
float xs2 = rollOffset() * spread;
|
||||
float ys2 = rollOffset() * spread;
|
||||
float zs2 = rollOffset() * spread;
|
||||
te.getWorld().addParticle(particle, te.getPos().getX() + .5f + x * offset + xs2,
|
||||
te.getPos().getY() + .5f + y * offset + ys2, te.getPos().getZ() + .5f + z * offset + zs2,
|
||||
x * speed + xs, y * speed + ys, z * speed + zs);
|
||||
}
|
||||
}
|
||||
|
||||
private float rollOffset() {
|
||||
return (r.nextFloat() - .5f) * 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -5,17 +5,11 @@ import static net.minecraft.state.properties.BlockStateProperties.AXIS;
|
|||
import static net.minecraft.util.Direction.AxisDirection.NEGATIVE;
|
||||
import static net.minecraft.util.Direction.AxisDirection.POSITIVE;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.CreateClient;
|
||||
import com.simibubi.create.foundation.utility.VecHelper;
|
||||
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.modules.logistics.InWorldProcessing;
|
||||
|
@ -27,16 +21,12 @@ import net.minecraft.block.Blocks;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.INBT;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.nbt.NBTUtil;
|
||||
import net.minecraft.particles.BlockParticleData;
|
||||
import net.minecraft.particles.IParticleData;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.particles.RedstoneParticleData;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
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.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
@ -45,11 +35,11 @@ import net.minecraft.util.math.Vec3i;
|
|||
|
||||
public class EncasedFanTileEntity extends KineticTileEntity implements ITickableTileEntity {
|
||||
|
||||
public static final Map<Block, List<FanEffect>> effects = new HashMap<>();
|
||||
private static DamageSource damageSourceFire = new DamageSource("create.fan_fire").setDifficultyScaled()
|
||||
.setFireDamage();
|
||||
private static DamageSource damageSourceLava = new DamageSource("create.fan_lava").setDifficultyScaled()
|
||||
.setFireDamage();
|
||||
private static EncasedFanParticleHandler particleHandler;
|
||||
|
||||
protected float pushDistance;
|
||||
protected float pullDistance;
|
||||
|
@ -57,89 +47,8 @@ public class EncasedFanTileEntity extends KineticTileEntity implements ITickable
|
|||
protected AxisAlignedBB backBB;
|
||||
|
||||
protected int blockCheckCooldown;
|
||||
protected BlockState frontBlock;
|
||||
|
||||
protected boolean findLoadedItems;
|
||||
protected boolean findFrontBlock;
|
||||
public List<ProcessedItem> items;
|
||||
|
||||
public class ProcessedItem {
|
||||
private UUID loadedUUID;
|
||||
private int loadedTime;
|
||||
private ItemEntity entity;
|
||||
|
||||
public ProcessedItem(UUID uuid, int timeLeft) {
|
||||
loadedUUID = uuid;
|
||||
loadedTime = timeLeft;
|
||||
}
|
||||
|
||||
public ProcessedItem(ItemEntity item) {
|
||||
entity = item;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
if (world.rand.nextInt(4) == 0) {
|
||||
Type processingType = getProcessingType();
|
||||
if (processingType == Type.BLASTING)
|
||||
world.addParticle(ParticleTypes.LARGE_SMOKE, entity.posX, entity.posY + .25f, entity.posZ, 0, 1/16f, 0);
|
||||
if (processingType == Type.SMOKING)
|
||||
world.addParticle(ParticleTypes.CLOUD, entity.posX, entity.posY + .25f, entity.posZ, 0, 1/16f, 0);
|
||||
}
|
||||
|
||||
if (world.isRemote)
|
||||
return;
|
||||
|
||||
Create.itemProcessingHandler.getProcessing(entity).process(entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected static class FanEffect {
|
||||
private IParticleData particle;
|
||||
private float density;
|
||||
private float chance;
|
||||
private float spread;
|
||||
private float speed;
|
||||
private Random r;
|
||||
|
||||
public FanEffect(IParticleData particle, float density, float chance, float spread, float speed) {
|
||||
r = new Random();
|
||||
this.particle = particle;
|
||||
this.density = density;
|
||||
this.chance = chance;
|
||||
this.spread = spread;
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public void render(Vec3i directionVec, boolean front, EncasedFanTileEntity te) {
|
||||
render(directionVec, front ? .5f : -te.pullDistance, front ? te.pushDistance : -.5f, te);
|
||||
}
|
||||
|
||||
private void render(Vec3i directionVec, float start, float end, EncasedFanTileEntity te) {
|
||||
float x = directionVec.getX();
|
||||
float y = directionVec.getY();
|
||||
float z = directionVec.getZ();
|
||||
float speed = this.speed * Math.abs(te.speed) / 512f;
|
||||
|
||||
for (float offset = start; offset < end; offset += density) {
|
||||
if (r.nextFloat() > chance)
|
||||
continue;
|
||||
float xs = rollOffset() * spread;
|
||||
float ys = rollOffset() * spread;
|
||||
float zs = rollOffset() * spread;
|
||||
float xs2 = rollOffset() * spread;
|
||||
float ys2 = rollOffset() * spread;
|
||||
float zs2 = rollOffset() * spread;
|
||||
te.world.addParticle(particle, te.pos.getX() + .5f + x * offset + xs2,
|
||||
te.pos.getY() + .5f + y * offset + ys2, te.pos.getZ() + .5f + z * offset + zs2, x * speed + xs,
|
||||
y * speed + ys, z * speed + zs);
|
||||
}
|
||||
}
|
||||
|
||||
private float rollOffset() {
|
||||
return (r.nextFloat() - .5f) * 2;
|
||||
}
|
||||
}
|
||||
protected BlockState frontBlock;
|
||||
|
||||
public EncasedFanTileEntity() {
|
||||
super(AllTileEntities.ENCASED_FAN.type);
|
||||
|
@ -147,36 +56,7 @@ public class EncasedFanTileEntity extends KineticTileEntity implements ITickable
|
|||
findFrontBlock = true;
|
||||
frontBB = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
|
||||
backBB = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
|
||||
items = new ArrayList<>();
|
||||
// if (effects.isEmpty())
|
||||
initEffects();
|
||||
}
|
||||
|
||||
private static void initEffects() {
|
||||
effects.clear();
|
||||
|
||||
List<FanEffect> standardFX = new ArrayList<>(2);
|
||||
standardFX.add(new FanEffect(ParticleTypes.BUBBLE_POP, 1 / 4f, 1 / 4f, 1 / 3f, 1));
|
||||
standardFX.add(new FanEffect(new RedstoneParticleData(1, 1, 1, 1), 1 / 2f, 1 / 32f, 1/16f, 512f));
|
||||
effects.put(Blocks.AIR, standardFX);
|
||||
|
||||
List<FanEffect> waterFX = new ArrayList<>(2);
|
||||
waterFX.add(new FanEffect(new BlockParticleData(ParticleTypes.BLOCK, Blocks.WATER.getDefaultState()), 1 / 4f,
|
||||
1 / 2f, 1 / 4f, 1));
|
||||
waterFX.add(new FanEffect(ParticleTypes.SPLASH, 1 / 4f, 1 / 2f, 0.5f, 1));
|
||||
effects.put(Blocks.WATER, waterFX);
|
||||
|
||||
List<FanEffect> fireFX = new ArrayList<>(2);
|
||||
fireFX.add(new FanEffect(ParticleTypes.LARGE_SMOKE, 1 / 4f, 1 / 8f, 0.125f, .5f));
|
||||
fireFX.add(new FanEffect(ParticleTypes.FLAME, 1 / 4f, 1 / 8f, 1 / 32f, 1 / 256f));
|
||||
effects.put(Blocks.FIRE, fireFX);
|
||||
|
||||
List<FanEffect> lavaFX = new ArrayList<>(3);
|
||||
lavaFX.add(new FanEffect(new BlockParticleData(ParticleTypes.BLOCK, Blocks.LAVA.getDefaultState()), 1 / 4f,
|
||||
1 / 2f, 1 / 4f, 1));
|
||||
lavaFX.add(new FanEffect(ParticleTypes.LAVA, 1 / 2f, 1 / 32f, 0, .25f));
|
||||
lavaFX.add(new FanEffect(ParticleTypes.FLAME, 1 / 4f, 1 / 32f, 1 / 32f, 1 / 256f));
|
||||
effects.put(Blocks.LAVA, lavaFX);
|
||||
particleHandler = CreateClient.fanParticles;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -195,32 +75,14 @@ public class EncasedFanTileEntity extends KineticTileEntity implements ITickable
|
|||
@Override
|
||||
public void read(CompoundNBT compound) {
|
||||
super.read(compound);
|
||||
|
||||
pushDistance = compound.getFloat("PushDistance");
|
||||
pullDistance = compound.getFloat("PullDistance");
|
||||
|
||||
ListNBT itemsNBT = compound.getList("Items", 10);
|
||||
items.clear();
|
||||
for (INBT iNBT : itemsNBT) {
|
||||
CompoundNBT itemNBT = (CompoundNBT) iNBT;
|
||||
items.add(new ProcessedItem(NBTUtil.readUniqueId(itemNBT.getCompound("UUID")), itemNBT.getInt("TimeLeft")));
|
||||
}
|
||||
findLoadedItems = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT write(CompoundNBT compound) {
|
||||
compound.putFloat("PushDistance", pushDistance);
|
||||
compound.putFloat("PullDistance", pullDistance);
|
||||
|
||||
ListNBT itemsNBT = new ListNBT();
|
||||
for (ProcessedItem item : items) {
|
||||
CompoundNBT itemNBT = new CompoundNBT();
|
||||
itemNBT.put("UUID", NBTUtil.writeUniqueId(item.entity.getUniqueID()));
|
||||
itemNBT.putInt("TimeLeft", Create.itemProcessingHandler.getProcessing(item.entity).timeRemaining);
|
||||
itemsNBT.add(itemNBT);
|
||||
}
|
||||
compound.put("Items", itemsNBT);
|
||||
return super.write(compound);
|
||||
}
|
||||
|
||||
|
@ -307,16 +169,7 @@ public class EncasedFanTileEntity extends KineticTileEntity implements ITickable
|
|||
List<Entity> frontEntities = world.getEntitiesWithinAABBExcludingEntity(null, frontBB);
|
||||
for (Entity entity : frontEntities) {
|
||||
moveEntity(entity, true);
|
||||
if (!(entity instanceof ItemEntity)) {
|
||||
if (frontBlock != null && frontBlock.getBlock() == Blocks.FIRE) {
|
||||
entity.setFire(2);
|
||||
entity.attackEntityFrom(damageSourceFire, 4);
|
||||
}
|
||||
if (frontBlock != null && frontBlock.getBlock() == Blocks.LAVA) {
|
||||
entity.setFire(10);
|
||||
entity.attackEntityFrom(damageSourceLava, 8);
|
||||
}
|
||||
}
|
||||
processEntity(entity);
|
||||
}
|
||||
|
||||
for (Entity entity : world.getEntitiesWithinAABBExcludingEntity(null, backBB)) {
|
||||
|
@ -333,79 +186,46 @@ public class EncasedFanTileEntity extends KineticTileEntity implements ITickable
|
|||
updateReachAndForce();
|
||||
}
|
||||
|
||||
updateProcessedItems(frontEntities);
|
||||
|
||||
if (world.isRemote) {
|
||||
makeParticles();
|
||||
particleHandler.makeParticles(this);
|
||||
return;
|
||||
}
|
||||
|
||||
discoverEntitiesAfterLoad(frontEntities);
|
||||
}
|
||||
|
||||
public void updateProcessedItems(List<Entity> frontEntities) {
|
||||
ArrayList<ProcessedItem> prevItems = new ArrayList<>(items);
|
||||
Iterator<ProcessedItem> itemIter = prevItems.iterator();
|
||||
public void processEntity(Entity entity) {
|
||||
if (InWorldProcessing.isFrozen())
|
||||
return;
|
||||
|
||||
if (canProcess()) {
|
||||
while (itemIter.hasNext()) {
|
||||
Iterator<Entity> entityIter = frontEntities.iterator();
|
||||
ProcessedItem item = itemIter.next();
|
||||
|
||||
while (entityIter.hasNext()) {
|
||||
Entity e = entityIter.next();
|
||||
if (!(e instanceof ItemEntity)) {
|
||||
entityIter.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item.entity == e && e.isAlive()) {
|
||||
item.tick();
|
||||
entityIter.remove();
|
||||
itemIter.remove();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (entity instanceof ItemEntity) {
|
||||
if (world.rand.nextInt(4) == 0) {
|
||||
Type processingType = getProcessingType();
|
||||
if (processingType == Type.BLASTING)
|
||||
world.addParticle(ParticleTypes.LARGE_SMOKE, entity.posX, entity.posY + .25f, entity.posZ, 0,
|
||||
1 / 16f, 0);
|
||||
if (processingType == Type.SMOKING)
|
||||
world.addParticle(ParticleTypes.CLOUD, entity.posX, entity.posY + .25f, entity.posZ, 0, 1 / 16f, 0);
|
||||
}
|
||||
// Add remaining
|
||||
for (Entity entity : frontEntities) {
|
||||
if (entity instanceof ItemEntity && canProcess((ItemEntity) entity)) {
|
||||
items.add(new ProcessedItem((ItemEntity) entity));
|
||||
if (!world.isRemote)
|
||||
Create.itemProcessingHandler.startProcessing((ItemEntity) entity,
|
||||
new InWorldProcessing(getProcessingType(), 100));
|
||||
}
|
||||
|
||||
if (world.isRemote)
|
||||
return;
|
||||
|
||||
if (canProcess((ItemEntity) entity))
|
||||
InWorldProcessing.process((ItemEntity) entity, getProcessingType());
|
||||
|
||||
} else {
|
||||
if (getProcessingType() == Type.SMOKING) {
|
||||
entity.setFire(2);
|
||||
entity.attackEntityFrom(damageSourceFire, 4);
|
||||
}
|
||||
}
|
||||
|
||||
for (ProcessedItem lostItem : prevItems) {
|
||||
items.remove(lostItem);
|
||||
if (!world.isRemote && lostItem.entity != null)
|
||||
Create.itemProcessingHandler.stopProcessing(lostItem.entity);
|
||||
}
|
||||
}
|
||||
|
||||
public void discoverEntitiesAfterLoad(List<Entity> frontEntities) {
|
||||
if (findLoadedItems) {
|
||||
findLoadedItems = false;
|
||||
Iterator<ProcessedItem> iterator = items.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ProcessedItem item = iterator.next();
|
||||
if (!canProcess())
|
||||
iterator.remove();
|
||||
|
||||
for (Entity entity : frontEntities) {
|
||||
if (!(entity instanceof ItemEntity))
|
||||
continue;
|
||||
if (entity.getUniqueID().equals(item.loadedUUID)) {
|
||||
item.entity = (ItemEntity) entity;
|
||||
if (!world.isRemote && canProcess((ItemEntity) entity))
|
||||
Create.itemProcessingHandler.startProcessing((ItemEntity) entity,
|
||||
new InWorldProcessing(getProcessingType(), item.loadedTime));
|
||||
}
|
||||
}
|
||||
if (item.entity == null)
|
||||
iterator.remove();
|
||||
if (getProcessingType() == Type.BLASTING) {
|
||||
entity.setFire(10);
|
||||
entity.attackEntityFrom(damageSourceLava, 8);
|
||||
}
|
||||
if (getProcessingType() == Type.SPLASHING) {
|
||||
entity.setFire(0);
|
||||
world.playSound(null, entity.getPosition(), SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE,
|
||||
SoundCategory.NEUTRAL, 0.7F, 1.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.4F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -415,10 +235,13 @@ public class EncasedFanTileEntity extends KineticTileEntity implements ITickable
|
|||
}
|
||||
|
||||
protected boolean canProcess(ItemEntity entity) {
|
||||
return canProcess() && new InWorldProcessing(getProcessingType(), 0).canProcess(entity);
|
||||
return canProcess() && InWorldProcessing.canProcess(entity, getProcessingType());
|
||||
}
|
||||
|
||||
protected InWorldProcessing.Type getProcessingType() {
|
||||
if (frontBlock == null)
|
||||
return null;
|
||||
|
||||
Block block = frontBlock.getBlock();
|
||||
|
||||
if (block == Blocks.FIRE)
|
||||
|
@ -439,37 +262,20 @@ public class EncasedFanTileEntity extends KineticTileEntity implements ITickable
|
|||
|
||||
Vec3d center = VecHelper.getCenterOf(pos);
|
||||
Vec3i flow = getAirFlow().getDirectionVec();
|
||||
float modifier = entity.isSneaking() ? 4096f : 512f;
|
||||
float s = (float) (speed * 1 / modifier
|
||||
|
||||
float sneakModifier = entity.isSneaking() ? 4096f : 512f;
|
||||
float acceleration = (float) (speed * 1 / sneakModifier
|
||||
/ (entity.getPositionVec().distanceTo(center) / (push ? pushDistance : pullDistance)));
|
||||
Vec3d motion = entity.getMotion();
|
||||
float maxSpeedModifier = 5;
|
||||
double xIn = MathHelper.clamp(flow.getX() * s - motion.x, -maxSpeedModifier, maxSpeedModifier);
|
||||
double yIn = MathHelper.clamp(flow.getY() * s - motion.y, -maxSpeedModifier, maxSpeedModifier);
|
||||
double zIn = MathHelper.clamp(flow.getZ() * s - motion.z, -maxSpeedModifier, maxSpeedModifier);
|
||||
entity.setMotion(motion.add(new Vec3d(xIn, yIn, zIn).mul(flow.getX(), flow.getY(), flow.getZ()).scale(1 / 8f)));
|
||||
Vec3d previousMotion = entity.getMotion();
|
||||
float maxAcceleration = 5;
|
||||
|
||||
double xIn = MathHelper.clamp(flow.getX() * acceleration - previousMotion.x, -maxAcceleration, maxAcceleration);
|
||||
double yIn = MathHelper.clamp(flow.getY() * acceleration - previousMotion.y, -maxAcceleration, maxAcceleration);
|
||||
double zIn = MathHelper.clamp(flow.getZ() * acceleration - previousMotion.z, -maxAcceleration, maxAcceleration);
|
||||
|
||||
entity.setMotion(
|
||||
previousMotion.add(new Vec3d(xIn, yIn, zIn).mul(flow.getX(), flow.getY(), flow.getZ()).scale(1 / 8f)));
|
||||
entity.fallDistance = 0;
|
||||
}
|
||||
|
||||
protected void makeParticles() {
|
||||
Direction direction = getAirFlow();
|
||||
Vec3i directionVec = direction.getDirectionVec();
|
||||
|
||||
boolean hasFx = false;
|
||||
if (frontBlock != null) {
|
||||
if (effects.containsKey(frontBlock.getBlock())) {
|
||||
hasFx = true;
|
||||
for (FanEffect fx : effects.get(frontBlock.getBlock()))
|
||||
fx.render(directionVec, true, this);
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasFx)
|
||||
for (FanEffect fx : effects.get(Blocks.AIR))
|
||||
fx.render(directionVec, true, this);
|
||||
|
||||
for (FanEffect fx : effects.get(Blocks.AIR))
|
||||
fx.render(directionVec, false, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.simibubi.create.modules.contraptions.receivers.constructs;
|
||||
|
||||
import static com.simibubi.create.CreateConfig.parameters;
|
||||
|
||||
import com.simibubi.create.AllPackets;
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.CreateConfig;
|
||||
import com.simibubi.create.foundation.block.SyncedTileEntity;
|
||||
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
|
@ -10,15 +13,13 @@ import net.minecraft.util.math.MathHelper;
|
|||
|
||||
public class ChassisTileEntity extends SyncedTileEntity implements ITickableTileEntity {
|
||||
|
||||
public static final int MAX_RANGE = 16;
|
||||
private int range;
|
||||
|
||||
public int newRange;
|
||||
public int lastModified;
|
||||
|
||||
public ChassisTileEntity() {
|
||||
super(AllTileEntities.CHASSIS.type);
|
||||
newRange = range = MAX_RANGE / 2;
|
||||
newRange = range = CreateConfig.parameters.maxChassisRange.get() / 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +46,7 @@ public class ChassisTileEntity extends SyncedTileEntity implements ITickableTile
|
|||
}
|
||||
|
||||
public void setRangeLazily(int range) {
|
||||
this.newRange = MathHelper.clamp(range, 1, MAX_RANGE);
|
||||
this.newRange = MathHelper.clamp(range, 1, parameters.maxChassisRange.get());
|
||||
if (newRange == this.range)
|
||||
return;
|
||||
this.lastModified = 0;
|
||||
|
|
|
@ -35,7 +35,7 @@ public class MechanicalBearingTileEntity extends KineticTileEntity implements IT
|
|||
public CompoundNBT write(CompoundNBT tag) {
|
||||
tag.putBoolean("Running", running);
|
||||
tag.putFloat("Angle", angle);
|
||||
if (running)
|
||||
if (running && !RotationConstruct.isFrozen())
|
||||
tag.put("Construct", movingConstruct.writeNBT());
|
||||
|
||||
return super.write(tag);
|
||||
|
@ -45,13 +45,15 @@ public class MechanicalBearingTileEntity extends KineticTileEntity implements IT
|
|||
public void read(CompoundNBT tag) {
|
||||
running = tag.getBoolean("Running");
|
||||
angle = tag.getFloat("Angle");
|
||||
if (running)
|
||||
if (running && !RotationConstruct.isFrozen())
|
||||
movingConstruct = RotationConstruct.fromNBT(tag.getCompound("Construct"));
|
||||
|
||||
super.read(tag);
|
||||
}
|
||||
|
||||
public float getInterpolatedAngle(float partialTicks) {
|
||||
if (RotationConstruct.isFrozen())
|
||||
return 0;
|
||||
return MathHelper.lerp(partialTicks, angle, angle + getAngularSpeed());
|
||||
}
|
||||
|
||||
|
@ -111,6 +113,9 @@ public class MechanicalBearingTileEntity extends KineticTileEntity implements IT
|
|||
|
||||
@Override
|
||||
public void tick() {
|
||||
if (running && RotationConstruct.isFrozen())
|
||||
disassembleConstruct();
|
||||
|
||||
if (!world.isRemote && assembleNextTick) {
|
||||
assembleNextTick = false;
|
||||
if (running) {
|
||||
|
|
|
@ -52,7 +52,7 @@ public class MechanicalPistonTileEntity extends KineticTileEntity implements ITi
|
|||
public CompoundNBT write(CompoundNBT tag) {
|
||||
tag.putBoolean("Running", running);
|
||||
tag.putFloat("Offset", offset);
|
||||
if (running)
|
||||
if (running && !TranslationConstruct.isFrozen())
|
||||
tag.put("Construct", movingConstruct.writeNBT());
|
||||
|
||||
return super.write(tag);
|
||||
|
@ -62,13 +62,16 @@ public class MechanicalPistonTileEntity extends KineticTileEntity implements ITi
|
|||
public void read(CompoundNBT tag) {
|
||||
running = tag.getBoolean("Running");
|
||||
offset = tag.getFloat("Offset");
|
||||
if (running)
|
||||
if (running && !TranslationConstruct.isFrozen())
|
||||
movingConstruct = TranslationConstruct.fromNBT(tag.getCompound("Construct"));
|
||||
|
||||
super.read(tag);
|
||||
}
|
||||
|
||||
protected void onBlockVisited(float newOffset) {
|
||||
if (TranslationConstruct.isFrozen())
|
||||
return;
|
||||
|
||||
Direction direction = getBlockState().get(BlockStateProperties.FACING);
|
||||
|
||||
for (BlockInfo block : movingConstruct.actors) {
|
||||
|
@ -205,6 +208,9 @@ public class MechanicalPistonTileEntity extends KineticTileEntity implements ITi
|
|||
}
|
||||
|
||||
private boolean hasBlockCollisions(float newOffset) {
|
||||
if (TranslationConstruct.isFrozen())
|
||||
return true;
|
||||
|
||||
Direction movementDirection = getBlockState().get(BlockStateProperties.FACING);
|
||||
BlockPos relativePos = BlockPos.ZERO.offset(movementDirection, getModulatedOffset(newOffset));
|
||||
|
||||
|
|
|
@ -46,6 +46,9 @@ public class MovingConstructHandler {
|
|||
|
||||
public static void moveEntities(MechanicalPistonTileEntity te, float movementSpeed, Direction movementDirection,
|
||||
float newOffset) {
|
||||
if (TranslationConstruct.isFrozen())
|
||||
return;
|
||||
|
||||
World world = te.getWorld();
|
||||
Vec3d movementVec = new Vec3d(te.getBlockState().get(BlockStateProperties.FACING).getDirectionVec());
|
||||
TranslationConstruct construct = te.movingConstruct;
|
||||
|
@ -132,8 +135,6 @@ public class MovingConstructHandler {
|
|||
}
|
||||
}
|
||||
|
||||
if (entity instanceof PlayerEntity && !world.isRemote)
|
||||
return;
|
||||
|
||||
if (!allowedMovement.equals(movement)) {
|
||||
if (allowedMovement.y != movement.y) {
|
||||
|
@ -141,6 +142,8 @@ public class MovingConstructHandler {
|
|||
entity.fallDistance = 0;
|
||||
entity.onGround = true;
|
||||
}
|
||||
if (entity instanceof PlayerEntity && !world.isRemote)
|
||||
return;
|
||||
entity.setMotion(allowedMovement.subtract(movement.subtract(motion)));
|
||||
entity.velocityChanged = true;
|
||||
}
|
||||
|
|
|
@ -41,6 +41,8 @@ public class RotationConstruct {
|
|||
}
|
||||
|
||||
protected boolean collectAttached(World world, BlockPos pos, Direction direction) {
|
||||
if (isFrozen())
|
||||
return false;
|
||||
|
||||
// Find chassis
|
||||
List<BlockInfo> chassis = collectChassis(world, pos, direction);
|
||||
|
@ -188,4 +190,8 @@ public class RotationConstruct {
|
|||
|| AllBlocks.ROTATION_CHASSIS.typeOf(world.getBlockState(pos));
|
||||
}
|
||||
|
||||
public static boolean isFrozen() {
|
||||
return CreateConfig.parameters.freezeRotationConstructs.get();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import java.util.Set;
|
|||
import java.util.function.Function;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.CreateConfig;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.FallingBlock;
|
||||
|
@ -77,6 +78,9 @@ public class TranslationConstruct {
|
|||
}
|
||||
|
||||
public static TranslationConstruct getAttachedForPushing(World world, BlockPos pos, Direction direction) {
|
||||
if (isFrozen())
|
||||
return null;
|
||||
|
||||
TranslationConstruct construct = new TranslationConstruct();
|
||||
|
||||
if (!construct.collectExtensions(world, pos, direction))
|
||||
|
@ -89,6 +93,9 @@ public class TranslationConstruct {
|
|||
}
|
||||
|
||||
public static TranslationConstruct getAttachedForPulling(World world, BlockPos pos, Direction direction) {
|
||||
if (isFrozen())
|
||||
return null;
|
||||
|
||||
TranslationConstruct construct = new TranslationConstruct();
|
||||
|
||||
if (!construct.collectExtensions(world, pos, direction))
|
||||
|
@ -444,4 +451,8 @@ public class TranslationConstruct {
|
|||
|
||||
return construct;
|
||||
}
|
||||
|
||||
public static boolean isFrozen() {
|
||||
return CreateConfig.parameters.freezePistonConstructs.get();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.simibubi.create.modules.economy;
|
||||
|
||||
import com.simibubi.create.AllContainers;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
|
@ -10,11 +8,13 @@ import net.minecraft.network.PacketBuffer;
|
|||
public class ShopShelfContainer extends Container {
|
||||
|
||||
public ShopShelfContainer(int id, PlayerInventory inv, ShopShelfTileEntity te) {
|
||||
super(AllContainers.SHOP_SHELF.type, id);
|
||||
// super(AllContainers.SHOP_SHELF.type, id);
|
||||
super(null, id);
|
||||
}
|
||||
|
||||
public ShopShelfContainer(int id, PlayerInventory inv, PacketBuffer extraData) {
|
||||
super(AllContainers.SHOP_SHELF.type, id);
|
||||
// super(AllContainers.SHOP_SHELF.type, id);
|
||||
super(null, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.simibubi.create.modules.economy;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.foundation.block.SyncedTileEntity;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -20,7 +19,8 @@ public class ShopShelfTileEntity extends SyncedTileEntity implements INamedConta
|
|||
private UUID owner;
|
||||
|
||||
public ShopShelfTileEntity() {
|
||||
super(AllTileEntities.SHOP_SHELF.type);
|
||||
super(null);
|
||||
// super(AllTileEntities.SHOP_SHELF.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
package com.simibubi.create.modules.logistics;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.simibubi.create.Create;
|
||||
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.world.IWorld;
|
||||
|
||||
public class InWorldItemProcessingHandler {
|
||||
|
||||
private Map<IWorld, Map<ItemEntity, InWorldProcessing>> items = new HashMap<>();
|
||||
|
||||
public void onLoadWorld(IWorld world) {
|
||||
items.put(world, new HashMap<>());
|
||||
Create.logger.info("Prepared Item Processing space for " + world.getDimension().getType().getRegistryName());
|
||||
}
|
||||
|
||||
public void onUnloadWorld(IWorld world) {
|
||||
items.remove(world);
|
||||
Create.logger.info("Removed Item Processing space for " + world.getDimension().getType().getRegistryName());
|
||||
}
|
||||
|
||||
public void startProcessing(ItemEntity entity, InWorldProcessing processing) {
|
||||
Map<ItemEntity, InWorldProcessing> itemsInWorld = items.get(entity.world);
|
||||
if (itemsInWorld.containsKey(entity) && processing.type == itemsInWorld.get(entity).type) {
|
||||
itemsInWorld.get(entity).processorCount++;
|
||||
} else {
|
||||
itemsInWorld.put(entity, processing);
|
||||
}
|
||||
}
|
||||
|
||||
public void stopProcessing(ItemEntity entity) {
|
||||
Map<ItemEntity, InWorldProcessing> itemsInWorld = items.get(entity.world);
|
||||
if (!itemsInWorld.containsKey(entity))
|
||||
return;
|
||||
InWorldProcessing processing = itemsInWorld.get(entity);
|
||||
processing.processorCount--;
|
||||
|
||||
if (processing.processorCount == 0)
|
||||
itemsInWorld.remove(entity);
|
||||
}
|
||||
|
||||
public InWorldProcessing getProcessing(ItemEntity entity) {
|
||||
Map<ItemEntity, InWorldProcessing> itemsInWorld = items.get(entity.world);
|
||||
if (!itemsInWorld.containsKey(entity))
|
||||
return null;
|
||||
return itemsInWorld.get(entity);
|
||||
}
|
||||
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.simibubi.create.modules.logistics;
|
|||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.simibubi.create.CreateConfig;
|
||||
import com.simibubi.create.foundation.utility.ItemHelper;
|
||||
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
|
@ -13,6 +14,7 @@ import net.minecraft.item.crafting.FurnaceRecipe;
|
|||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeType;
|
||||
import net.minecraft.item.crafting.SmokingRecipe;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.BlastFurnaceTileEntity;
|
||||
import net.minecraft.tileentity.FurnaceTileEntity;
|
||||
import net.minecraft.tileentity.SmokerTileEntity;
|
||||
|
@ -24,19 +26,13 @@ public class InWorldProcessing {
|
|||
SMOKING, BLASTING, SPLASHING
|
||||
}
|
||||
|
||||
public Type type;
|
||||
public int processorCount;
|
||||
public int timeRemaining;
|
||||
|
||||
public InWorldProcessing(Type type, int time) {
|
||||
this.timeRemaining = time;
|
||||
this.type = type;
|
||||
processorCount = 1;
|
||||
}
|
||||
|
||||
public boolean canProcess(ItemEntity entity) {
|
||||
public static boolean canProcess(ItemEntity entity, Type type) {
|
||||
World world = entity.world;
|
||||
|
||||
if (entity.getPersistantData().contains("CreateData")
|
||||
&& entity.getPersistantData().getCompound("CreateData").contains("Processing"))
|
||||
return true;
|
||||
|
||||
if (type == Type.BLASTING) {
|
||||
return true;
|
||||
}
|
||||
|
@ -56,13 +52,10 @@ public class InWorldProcessing {
|
|||
return false;
|
||||
}
|
||||
|
||||
public void process(ItemEntity entity) {
|
||||
timeRemaining--;
|
||||
if (timeRemaining != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
public static void process(ItemEntity entity, Type type) {
|
||||
World world = entity.world;
|
||||
if (decrementProcessingTime(entity, type) != 0)
|
||||
return;
|
||||
|
||||
if (type == Type.SPLASHING) {
|
||||
return;
|
||||
|
@ -109,7 +102,28 @@ public class InWorldProcessing {
|
|||
|
||||
}
|
||||
|
||||
public void applyRecipeOn(ItemEntity entity, IRecipe<?> recipe) {
|
||||
private static int decrementProcessingTime(ItemEntity entity, Type type) {
|
||||
CompoundNBT nbt = entity.getPersistantData();
|
||||
|
||||
if (!nbt.contains("CreateData"))
|
||||
nbt.put("CreateData", new CompoundNBT());
|
||||
CompoundNBT createData = nbt.getCompound("CreateData");
|
||||
|
||||
if (!createData.contains("Processing"))
|
||||
createData.put("Processing", new CompoundNBT());
|
||||
CompoundNBT processing = createData.getCompound("Processing");
|
||||
|
||||
if (!processing.contains("Type") || Type.valueOf(processing.getString("Type")) != type) {
|
||||
processing.putString("Type", type.name());
|
||||
processing.putInt("Time", CreateConfig.parameters.inWorldProcessingTime.get() + 1);
|
||||
}
|
||||
|
||||
int value = processing.getInt("Time") - 1;
|
||||
processing.putInt("Time", value);
|
||||
return value;
|
||||
}
|
||||
|
||||
public static void applyRecipeOn(ItemEntity entity, IRecipe<?> recipe) {
|
||||
ItemStack out = recipe.getRecipeOutput().copy();
|
||||
List<ItemStack> stacks = ItemHelper.multipliedOutput(entity.getItem(), out);
|
||||
if (stacks.isEmpty())
|
||||
|
@ -119,4 +133,8 @@ public class InWorldProcessing {
|
|||
entity.world.addEntity(new ItemEntity(entity.world, entity.posX, entity.posY, entity.posZ, additional));
|
||||
}
|
||||
|
||||
public static boolean isFrozen() {
|
||||
return CreateConfig.parameters.freezeInWorldProcessing.get();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,9 @@ public interface IExtractor extends ITickableTileEntity, IInventoryManipulator {
|
|||
|
||||
@Override
|
||||
default void tick() {
|
||||
if (isFrozen())
|
||||
return;
|
||||
|
||||
State state = getState();
|
||||
|
||||
if (state == State.LOCKED)
|
||||
|
@ -79,6 +82,9 @@ public interface IExtractor extends ITickableTileEntity, IInventoryManipulator {
|
|||
}
|
||||
|
||||
public default void neighborChanged() {
|
||||
if (isFrozen())
|
||||
return;
|
||||
|
||||
boolean hasSpace = hasSpaceForExtracting();
|
||||
boolean hasInventory = getInventory().isPresent();
|
||||
ItemStack toExtract = ItemStack.EMPTY;
|
||||
|
@ -142,4 +148,8 @@ public interface IExtractor extends ITickableTileEntity, IInventoryManipulator {
|
|||
return extracting;
|
||||
}
|
||||
|
||||
public static boolean isFrozen() {
|
||||
return CreateConfig.parameters.freezeExtractors.get();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,7 +50,6 @@ public class ServerSchematicLoader {
|
|||
|
||||
public ServerSchematicLoader() {
|
||||
activeUploads = new HashMap<>();
|
||||
FilesHelper.createFolderIfMissing(getSchematicPath());
|
||||
}
|
||||
|
||||
public String getSchematicPath() {
|
||||
|
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:belt_connector",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:belt_funnel",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "logistics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:blueprint_and_quill",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "schematics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -22,5 +22,11 @@
|
|||
"result": {
|
||||
"item": "create:clutch",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:cocoa_log",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "gardens"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -16,5 +16,11 @@
|
|||
"result": {
|
||||
"item": "create:cogwheel",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -22,5 +22,11 @@
|
|||
"result": {
|
||||
"item": "create:contact",
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "logistics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:crushing_wheel",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -22,5 +22,11 @@
|
|||
"result": {
|
||||
"item": "create:drill",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:empty_blueprint",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "schematics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:encased_belt",
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -22,5 +22,11 @@
|
|||
"result": {
|
||||
"item": "create:encased_fan",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:encased_shaft",
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:entity_detector",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "logistics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -25,5 +25,11 @@
|
|||
"result": {
|
||||
"item": "create:extractor",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "logistics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:flexcrate",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "logistics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:gearbox",
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -22,5 +22,11 @@
|
|||
"result": {
|
||||
"item": "create:gearshift",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:harvester",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:large_cogwheel",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:linked_extractor",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "logistics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -22,5 +22,11 @@
|
|||
"result": {
|
||||
"item": "create:mechanical_bearing",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -22,5 +22,11 @@
|
|||
"result": {
|
||||
"item": "create:mechanical_piston",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -25,5 +25,11 @@
|
|||
"result": {
|
||||
"item": "create:motor",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -5,5 +5,11 @@
|
|||
},
|
||||
"result": "create:dolomite",
|
||||
"experience": 0.1,
|
||||
"cookingtime": 200
|
||||
"cookingtime": 200,
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:dolomite_bricks",
|
||||
"count": 4
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:dolomite_slab",
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -13,5 +13,11 @@
|
|||
"result": {
|
||||
"item": "create:dolomite_stairs",
|
||||
"count": 8
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:dolomite_wall",
|
||||
"count": 12
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -5,5 +5,11 @@
|
|||
},
|
||||
"result": "create:gabbro",
|
||||
"experience": 0.1,
|
||||
"cookingtime": 200
|
||||
"cookingtime": 200,
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:gabbro_bricks",
|
||||
"count": 4
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -13,5 +13,11 @@
|
|||
"result": {
|
||||
"item": "create:gabbro_bricks_stairs",
|
||||
"count": 8
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:gabbro_bricks_wall",
|
||||
"count": 12
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:gabbro_slab",
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -13,5 +13,11 @@
|
|||
"result": {
|
||||
"item": "create:gabbro_stairs",
|
||||
"count": 8
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:gabbro_wall",
|
||||
"count": 12
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:indented_gabbro_slab",
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -5,5 +5,11 @@
|
|||
},
|
||||
"result": "create:limestone",
|
||||
"experience": 0.1,
|
||||
"cookingtime": 200
|
||||
"cookingtime": 200,
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:limestone_bricks",
|
||||
"count": 4
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:limestone_bricks_slab",
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -13,5 +13,11 @@
|
|||
"result": {
|
||||
"item": "create:limestone_bricks_stairs",
|
||||
"count": 8
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:limestone_bricks_wall",
|
||||
"count": 12
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:limestone_slab",
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -13,5 +13,11 @@
|
|||
"result": {
|
||||
"item": "create:limestone_stairs",
|
||||
"count": 8
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:limestone_wall",
|
||||
"count": 12
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:paved_gabbro_bricks_slab",
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:polished_dolomite",
|
||||
"count": 4
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:polished_gabbro",
|
||||
"count": 4
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:polished_limestone",
|
||||
"count": 4
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:polished_limestone_slab",
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:polished_weathered_limestone",
|
||||
"count": 4
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:polished_weathered_limestone_slab",
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -16,5 +16,11 @@
|
|||
"result": {
|
||||
"item": "create:weathered_limestone",
|
||||
"count": 8
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:weathered_limestone_bricks",
|
||||
"count": 4
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:weathered_limestone_bricks_slab",
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -13,5 +13,11 @@
|
|||
"result": {
|
||||
"item": "create:weathered_limestone_bricks_stairs",
|
||||
"count": 8
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:weathered_limestone_bricks_wall",
|
||||
"count": 12
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -11,5 +11,11 @@
|
|||
"result": {
|
||||
"item": "create:weathered_limestone_slab",
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -13,5 +13,11 @@
|
|||
"result": {
|
||||
"item": "create:weathered_limestone_stairs",
|
||||
"count": 8
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -12,5 +12,11 @@
|
|||
"result": {
|
||||
"item": "create:weathered_limestone_wall",
|
||||
"count": 12
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "palettes"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -16,5 +16,11 @@
|
|||
"result": {
|
||||
"item": "create:piston_pole",
|
||||
"count": 8
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:placement_handgun",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "curiosities"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -18,5 +18,11 @@
|
|||
"result": {
|
||||
"item": "create:pulse_repeater",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "logistics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -18,5 +18,11 @@
|
|||
"result": {
|
||||
"item": "create:redstone_bridge",
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "logistics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:rotation_chassis",
|
||||
"count": 4
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -16,5 +16,11 @@
|
|||
"result": {
|
||||
"item": "create:schematic_table",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "schematics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -25,5 +25,11 @@
|
|||
"result": {
|
||||
"item": "create:schematicannon",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "schematics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -13,5 +13,11 @@
|
|||
"result": {
|
||||
"item": "create:shaft",
|
||||
"count": 16
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -15,5 +15,11 @@
|
|||
"result": {
|
||||
"item": "create:sticky_mechanical_piston",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -22,5 +22,11 @@
|
|||
"result": {
|
||||
"item": "create:stockswitch",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "logistics"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -25,5 +25,11 @@
|
|||
"result": {
|
||||
"item": "create:symmetry_wand",
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "curiosities"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -19,5 +19,11 @@
|
|||
"result": {
|
||||
"item": "create:translation_chassis",
|
||||
"count": 4
|
||||
}
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"type": "create:module",
|
||||
"module": "contraptions"
|
||||
}
|
||||
]
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue