diff --git a/gradle.properties b/gradle.properties index d86cbb98..637c67ae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -31,7 +31,7 @@ registrate_version = MC1.21-1.3.0+62 mod_id=tfmg mod_name=Create: The Factory Must Grow mod_license=MIT -mod_version=1.1.0 +mod_version=1.1.0b mod_group_id=com.drmangotea mod_authors= DrMangoTea, Pepa, Luna mod_description= Create: The Factory Must Grow brings the age of steel, oil and electricity to the Create mod diff --git a/src/main/java/com/drmangotea/tfmg/TFMG.java b/src/main/java/com/drmangotea/tfmg/TFMG.java index bedb6011..5350a92a 100644 --- a/src/main/java/com/drmangotea/tfmg/TFMG.java +++ b/src/main/java/com/drmangotea/tfmg/TFMG.java @@ -76,7 +76,7 @@ public class TFMG { TFMGDataComponents.register(modEventBus); TFMGMobEffects.register(modEventBus); TFMGRecipeTypes.register(modEventBus); - TFMGArmorMaterials.register(modEventBus); + // TFMGArmorMaterials.register(modEventBus); TFMGColoredFires.register(modEventBus); TFMGFeatures.register(modEventBus); TFMGMountedStorageTypes.register(); diff --git a/src/main/java/com/drmangotea/tfmg/base/debug/DebugCinderBlockItem.java b/src/main/java/com/drmangotea/tfmg/base/debug/DebugCinderBlockItem.java index d1a6c093..5b4dffb6 100644 --- a/src/main/java/com/drmangotea/tfmg/base/debug/DebugCinderBlockItem.java +++ b/src/main/java/com/drmangotea/tfmg/base/debug/DebugCinderBlockItem.java @@ -3,6 +3,7 @@ package com.drmangotea.tfmg.base.debug; import com.drmangotea.tfmg.TFMG; import com.drmangotea.tfmg.content.decoration.tanks.steel.SteelTankBlock; import com.drmangotea.tfmg.content.decoration.tanks.steel.SteelTankBlockEntity; +import com.drmangotea.tfmg.content.electricity.generators.large_generator.StatorBlockEntity; import net.minecraft.core.BlockPos; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.Item; @@ -27,16 +28,19 @@ public class DebugCinderBlockItem extends Item { BlockPos pos = context.getClickedPos(); Level level = context.getLevel(); + if (level.getBlockEntity(pos) instanceof StatorBlockEntity be) { + be.updateRotor(); + } if (level.getBlockEntity(pos) instanceof SteelTankBlockEntity be) { - if(!context.getPlayer().isCrouching()) { + if (!context.getPlayer().isCrouching()) { //SteelTankBlock.updateTowerState(be.getLevel(), be.getBlockPos(), true, false); - // be.updateTemperature(); + // be.updateTemperature(); TFMG.LOGGER.debug(String.valueOf(be.isDistillationTower)); //be.sendData(); //be.getControllerBE().sendData(); - }else { + } else { SteelTankBlock.updateTowerState(be.getLevel(), be.getBlockPos(), false, false); TFMG.LOGGER.debug(String.valueOf(be.isDistillationTower)); } diff --git a/src/main/java/com/drmangotea/tfmg/config/MachineConfig.java b/src/main/java/com/drmangotea/tfmg/config/MachineConfig.java index e1cc9f6b..e43a97ad 100644 --- a/src/main/java/com/drmangotea/tfmg/config/MachineConfig.java +++ b/src/main/java/com/drmangotea/tfmg/config/MachineConfig.java @@ -7,12 +7,12 @@ public class MachineConfig extends ConfigBase { public final ConfigInt fireExtinguisherClearRadius = i(1, 0, "fireExtinguisherClearRadius", Comments.fireExtinguisherClearRadius); - public final ConfigFloat electricMotorInternalResistance = f(100, 0, "electricMotorInternalResistance", Comments.electricMotorInternalResistance); + public final ConfigFloat electricMotorInternalResistance = f(30, 0, "electricMotorInternalResistance", Comments.electricMotorInternalResistance); public final ConfigInt cokeOvenMaxSize = i(5, 1, "cokeOvenMaxSize", Comments.cokeOvenMaxSize); public final ConfigFloat FEtoWattTickConversionRate = f(1, 0, "FEtoWattTickConversionRate", Comments.FEtoWattTickConversionRate); - public final ConfigInt electrolysisMinimumCurrent = i(5, 1, "electrolysisMinimumCurrent", Comments.electrolysisMinimumCurrent); + public final ConfigInt electrolysisMinimumCurrent = i(10, 1, "electrolysisMinimumCurrent", Comments.electrolysisMinimumCurrent); public final ConfigInt engineMaxLength = i(5, 1, "engineMaxLength", Comments.engineMaxLength); public final ConfigInt surfaceScannerScanDepth = i(-64, -512, "surfaceScannerScanDepth", Comments.surfaceScannerScanDepth); public final ConfigInt polarizerItemChargingRate = i(1000, 1, "polarizerItemChargingRate", Comments.polarizerItemChargingRate); diff --git a/src/main/java/com/drmangotea/tfmg/content/decoration/pipes/TFMGPipeEntry.java b/src/main/java/com/drmangotea/tfmg/content/decoration/pipes/TFMGPipeEntry.java index 7b31f1e1..24b2b14b 100644 --- a/src/main/java/com/drmangotea/tfmg/content/decoration/pipes/TFMGPipeEntry.java +++ b/src/main/java/com/drmangotea/tfmg/content/decoration/pipes/TFMGPipeEntry.java @@ -27,7 +27,7 @@ import net.neoforged.neoforge.client.model.generators.ConfiguredModel; import static com.simibubi.create.foundation.data.ModelGen.customItemModel; import static com.simibubi.create.foundation.data.TagGen.axeOrPickaxe; import static com.simibubi.create.foundation.data.TagGen.pickaxeOnly; - +@SuppressWarnings("removal") public class TFMGPipeEntry { private final TFMGPipes.PipeMaterial material; private final TFMGRegistrate registrate; @@ -95,7 +95,14 @@ public class TFMGPipeEntry { .initialProperties(SharedProperties::copperMetal) .transform(pickaxeOnly()) .blockstate(BlockStateGen.pipe()) - .onRegister(CreateRegistrate.blockModel(()-> this.attachmentModel)) + .onRegister(CreateRegistrate.blockModel(()-> + switch (this.material){ + case BRASS -> TFMGPipeAttachmentModel::withAOBrass; + case STEEL -> TFMGPipeAttachmentModel::withAOSteel; + case ALUMINUM -> TFMGPipeAttachmentModel::withAOAluminum; + case CAST_IRON -> TFMGPipeAttachmentModel::withAOCastIron; + case PLASTIC -> TFMGPipeAttachmentModel::withAOPlastic; + })) .item() .transform(customItemModel()) .register(); @@ -134,7 +141,14 @@ public class TFMGPipeEntry { .build(); }, BlockStateProperties.WATERLOGGED); }) - .onRegister(CreateRegistrate.blockModel(()-> this.attachmentModel)) + .onRegister(CreateRegistrate.blockModel(()-> + switch (this.material){ + case BRASS -> TFMGPipeAttachmentModel::withAOBrass; + case STEEL -> TFMGPipeAttachmentModel::withAOSteel; + case ALUMINUM -> TFMGPipeAttachmentModel::withAOAluminum; + case CAST_IRON -> TFMGPipeAttachmentModel::withAOCastIron; + case PLASTIC -> TFMGPipeAttachmentModel::withAOPlastic; + })) .loot((p, b) -> p.dropOther(b, this.pipe.get())) .register(); } @@ -144,7 +158,14 @@ public class TFMGPipeEntry { .initialProperties(SharedProperties::copperMetal) .transform(pickaxeOnly()) .blockstate(BlockStateGen.directionalBlockProviderIgnoresWaterlogged(true)) - .onRegister(CreateRegistrate.blockModel(()-> this.attachmentModel)) + .onRegister(CreateRegistrate.blockModel(()-> + switch (this.material){ + case BRASS -> TFMGPipeAttachmentModel::withAOBrass; + case STEEL -> TFMGPipeAttachmentModel::withAOSteel; + case ALUMINUM -> TFMGPipeAttachmentModel::withAOAluminum; + case CAST_IRON -> TFMGPipeAttachmentModel::withAOCastIron; + case PLASTIC -> TFMGPipeAttachmentModel::withAOPlastic; + })) .transform(TFMGStress.setImpact(4.0)) .item() .transform(customItemModel()) @@ -156,7 +177,14 @@ public class TFMGPipeEntry { .initialProperties(SharedProperties::copperMetal) .transform(pickaxeOnly()) .blockstate(new SmartFluidPipeGenerator()::generate) - .onRegister(CreateRegistrate.blockModel(()-> this.attachmentModel)) + .onRegister(CreateRegistrate.blockModel(()-> + switch (this.material){ + case BRASS -> TFMGPipeAttachmentModel::withAOBrass; + case STEEL -> TFMGPipeAttachmentModel::withAOSteel; + case ALUMINUM -> TFMGPipeAttachmentModel::withAOAluminum; + case CAST_IRON -> TFMGPipeAttachmentModel::withAOCastIron; + case PLASTIC -> TFMGPipeAttachmentModel::withAOPlastic; + })) .item() .transform(customItemModel()) .register(); @@ -170,7 +198,14 @@ public class TFMGPipeEntry { .blockstate((c, p) -> BlockStateGen.directionalAxisBlock(c, p, (state, vertical) -> AssetLookup.partialBaseModel(c, p, vertical ? "vertical" : "horizontal", state.getValue(FluidValveBlock.ENABLED) ? "open" : "closed"))) - .onRegister(CreateRegistrate.blockModel(() -> this.attachmentModel)) + .onRegister(CreateRegistrate.blockModel(()-> + switch (this.material){ + case BRASS -> TFMGPipeAttachmentModel::withAOBrass; + case STEEL -> TFMGPipeAttachmentModel::withAOSteel; + case ALUMINUM -> TFMGPipeAttachmentModel::withAOAluminum; + case CAST_IRON -> TFMGPipeAttachmentModel::withAOCastIron; + case PLASTIC -> TFMGPipeAttachmentModel::withAOPlastic; + })) .item() .transform(customItemModel()) .register(); diff --git a/src/main/java/com/drmangotea/tfmg/content/decoration/pipes/TFMGPipes.java b/src/main/java/com/drmangotea/tfmg/content/decoration/pipes/TFMGPipes.java index f7805dd2..4e385bf7 100644 --- a/src/main/java/com/drmangotea/tfmg/content/decoration/pipes/TFMGPipes.java +++ b/src/main/java/com/drmangotea/tfmg/content/decoration/pipes/TFMGPipes.java @@ -43,15 +43,15 @@ public class TFMGPipes { public static final Map PIPES = new HashMap<>(); static { - PIPES.put(PipeMaterial.BRASS, createEntry(PipeMaterial.BRASS, TFMGPipeAttachmentModel::withAOBrass, TFMGSpriteShifts.BRASS_FLUID_CASING)); - PIPES.put(PipeMaterial.STEEL, createEntry(PipeMaterial.STEEL, TFMGPipeAttachmentModel::withAOSteel, TFMGSpriteShifts.STEEL_FLUID_CASING)); - PIPES.put(PipeMaterial.ALUMINUM, createEntry(PipeMaterial.ALUMINUM, TFMGPipeAttachmentModel::withAOAluminum, TFMGSpriteShifts.ALUMINUM_FLUID_CASING)); - PIPES.put(PipeMaterial.CAST_IRON, createEntry(PipeMaterial.CAST_IRON, TFMGPipeAttachmentModel::withAOCastIron, TFMGSpriteShifts.CAST_IRON_FLUID_CASING)); - PIPES.put(PipeMaterial.PLASTIC, createEntry(PipeMaterial.PLASTIC, TFMGPipeAttachmentModel::withAOPlastic, TFMGSpriteShifts.PLASTIC_FLUID_CASING)); + PIPES.put(PipeMaterial.BRASS, createEntry(PipeMaterial.BRASS, TFMGSpriteShifts.BRASS_FLUID_CASING)); + PIPES.put(PipeMaterial.STEEL, createEntry(PipeMaterial.STEEL, TFMGSpriteShifts.STEEL_FLUID_CASING)); + PIPES.put(PipeMaterial.ALUMINUM, createEntry(PipeMaterial.ALUMINUM, TFMGSpriteShifts.ALUMINUM_FLUID_CASING)); + PIPES.put(PipeMaterial.CAST_IRON, createEntry(PipeMaterial.CAST_IRON, TFMGSpriteShifts.CAST_IRON_FLUID_CASING)); + PIPES.put(PipeMaterial.PLASTIC, createEntry(PipeMaterial.PLASTIC, TFMGSpriteShifts.PLASTIC_FLUID_CASING)); } - private static TFMGPipeEntry createEntry(PipeMaterial material, NonNullFunction attachmentModel, CTSpriteShiftEntry spriteShiftEntry) { - return new TFMGPipeEntry(material, registrate).attachmentModel(attachmentModel).encasedSpriteShift(spriteShiftEntry); + private static TFMGPipeEntry createEntry(PipeMaterial material, CTSpriteShiftEntry spriteShiftEntry) { + return new TFMGPipeEntry(material, registrate).encasedSpriteShift(spriteShiftEntry); } public static void init() { diff --git a/src/main/java/com/drmangotea/tfmg/content/electricity/generators/large_generator/RotorBlockEntity.java b/src/main/java/com/drmangotea/tfmg/content/electricity/generators/large_generator/RotorBlockEntity.java index c5bf9266..34feb9af 100644 --- a/src/main/java/com/drmangotea/tfmg/content/electricity/generators/large_generator/RotorBlockEntity.java +++ b/src/main/java/com/drmangotea/tfmg/content/electricity/generators/large_generator/RotorBlockEntity.java @@ -90,6 +90,12 @@ public class RotorBlockEntity extends KineticElectricBlockEntity { return (int) Math.max(0, ((Math.abs(getSpeed()) - maxSpeed) * modifier)); } + @Override + public void onSpeedChanged(float previousSpeed) { + super.onSpeedChanged(previousSpeed); + updateNextTick(); + } + @Override public int powerGeneration() { return (int) (generation() * 40*1.84563); diff --git a/src/main/java/com/drmangotea/tfmg/content/electricity/generators/large_generator/StatorBlockEntity.java b/src/main/java/com/drmangotea/tfmg/content/electricity/generators/large_generator/StatorBlockEntity.java index 8b4e8cf0..90472ee6 100644 --- a/src/main/java/com/drmangotea/tfmg/content/electricity/generators/large_generator/StatorBlockEntity.java +++ b/src/main/java/com/drmangotea/tfmg/content/electricity/generators/large_generator/StatorBlockEntity.java @@ -5,6 +5,10 @@ import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation; import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.AABB; + +import java.util.Iterator; +import java.util.List; public class StatorBlockEntity extends ElectricBlockEntity implements IHaveGoggleInformation { @@ -31,6 +35,8 @@ public class StatorBlockEntity extends ElectricBlockEntity implements IHaveGoggl } + + @Override public void tick() { super.tick(); @@ -43,9 +49,23 @@ public class StatorBlockEntity extends ElectricBlockEntity implements IHaveGoggl } } + public void updateRotor(){ + + + Iterable blocksAround = BlockPos.betweenClosed(getBlockPos().below().north().west(),getBlockPos().above().east().east()); + + for (BlockPos blockPos : blocksAround) { + if(level.getBlockEntity(blockPos) instanceof RotorBlockEntity be) { + be.updateNextTick(); + timer = 11; + } + } + } + @Override public void onPlaced() { super.onPlaced(); + updateRotor(); if (rotor != null) if (level.getBlockEntity(rotor) instanceof RotorBlockEntity be) { timer =11; @@ -56,6 +76,7 @@ public class StatorBlockEntity extends ElectricBlockEntity implements IHaveGoggl @Override public void destroy() { super.destroy(); + updateRotor(); if (rotor != null) if (level.getBlockEntity(rotor) instanceof RotorBlockEntity be) { be.updateNextTick(); diff --git a/src/main/java/com/drmangotea/tfmg/content/electricity/utilities/electric_motor/ElectricMotorBlockEntity.java b/src/main/java/com/drmangotea/tfmg/content/electricity/utilities/electric_motor/ElectricMotorBlockEntity.java index ec0f37bb..f897825a 100644 --- a/src/main/java/com/drmangotea/tfmg/content/electricity/utilities/electric_motor/ElectricMotorBlockEntity.java +++ b/src/main/java/com/drmangotea/tfmg/content/electricity/utilities/electric_motor/ElectricMotorBlockEntity.java @@ -97,6 +97,7 @@ public class ElectricMotorBlockEntity extends KineticElectricBlockEntity { public void onNetworkChanged(int oldVoltage, int oldPower) { //if (oldPower != getPowerUsage() || oldVoltage != data.voltage) { delayedUpdate = true; + updateNextTick(); notifyUpdate(); // } } diff --git a/src/main/java/com/drmangotea/tfmg/registry/TFMGBlocks.java b/src/main/java/com/drmangotea/tfmg/registry/TFMGBlocks.java index 79fc7e24..338edb72 100644 --- a/src/main/java/com/drmangotea/tfmg/registry/TFMGBlocks.java +++ b/src/main/java/com/drmangotea/tfmg/registry/TFMGBlocks.java @@ -1048,7 +1048,7 @@ public class TFMGBlocks { .transform(pickaxeOnly()) .properties(BlockBehaviour.Properties::noOcclusion) .blockstate(new CreativeMotorGenerator()::generate) - .transform(TFMGStress.setCapacity(45.0)) + .transform(TFMGStress.setCapacity(12)) .onRegister(BlockStressValues.setGeneratorSpeed(64, true)) .item() .transform(customItemModel()) diff --git a/src/main/java/com/drmangotea/tfmg/registry/TFMGElectrodes.java b/src/main/java/com/drmangotea/tfmg/registry/TFMGElectrodes.java index 6ae823c3..ad64e668 100644 --- a/src/main/java/com/drmangotea/tfmg/registry/TFMGElectrodes.java +++ b/src/main/java/com/drmangotea/tfmg/registry/TFMGElectrodes.java @@ -14,7 +14,7 @@ public class TFMGElectrodes { public static final ElectrodeEntry copper = REGISTRATE.electrode("copper", Electrode::new) .properties((p) -> p - .resistance(100) + .resistance(10) .item(TFMGItems.COPPER_ELECTRODE) .operationId("tfmg:electrode") ) @@ -22,7 +22,7 @@ public class TFMGElectrodes { public static final ElectrodeEntry zinc = REGISTRATE.electrode("zinc", Electrode::new) .properties((p) -> p - .resistance(100) + .resistance(10) .item(TFMGItems.ZINC_ELECTRODE) .operationId("tfmg:electrode") ) diff --git a/src/main/resources/assets/tfmg/textures/block/electrodes.png b/src/main/resources/assets/tfmg/textures/block/electrodes.png index bf19f2be..fb17ef2a 100644 Binary files a/src/main/resources/assets/tfmg/textures/block/electrodes.png and b/src/main/resources/assets/tfmg/textures/block/electrodes.png differ diff --git a/src/main/resources/assets/tfmg/textures/block/modular_pumpjack.png b/src/main/resources/assets/tfmg/textures/block/modular_pumpjack.png index 180bcb07..faf7bae8 100644 Binary files a/src/main/resources/assets/tfmg/textures/block/modular_pumpjack.png and b/src/main/resources/assets/tfmg/textures/block/modular_pumpjack.png differ diff --git a/src/main/resources/assets/tfmg/textures/block/redstone_inlet.png b/src/main/resources/assets/tfmg/textures/block/redstone_inlet.png index 4fe2ce88..3c5acc67 100644 Binary files a/src/main/resources/assets/tfmg/textures/block/redstone_inlet.png and b/src/main/resources/assets/tfmg/textures/block/redstone_inlet.png differ diff --git a/src/main/resources/assets/tfmg/textures/block/switch_inlet.png b/src/main/resources/assets/tfmg/textures/block/switch_inlet.png index 6da9481f..b900002c 100644 Binary files a/src/main/resources/assets/tfmg/textures/block/switch_inlet.png and b/src/main/resources/assets/tfmg/textures/block/switch_inlet.png differ diff --git a/src/main/resources/assets/tfmg/textures/item/aluminum_spool.png b/src/main/resources/assets/tfmg/textures/item/aluminum_spool.png index 114bd633..53f57223 100644 Binary files a/src/main/resources/assets/tfmg/textures/item/aluminum_spool.png and b/src/main/resources/assets/tfmg/textures/item/aluminum_spool.png differ diff --git a/src/main/resources/assets/tfmg/textures/item/constantan_spool.png b/src/main/resources/assets/tfmg/textures/item/constantan_spool.png index cfdfe976..2eccbaf7 100644 Binary files a/src/main/resources/assets/tfmg/textures/item/constantan_spool.png and b/src/main/resources/assets/tfmg/textures/item/constantan_spool.png differ diff --git a/src/main/resources/assets/tfmg/textures/item/copper_spool.png b/src/main/resources/assets/tfmg/textures/item/copper_spool.png index 8109161c..54b8c4e1 100644 Binary files a/src/main/resources/assets/tfmg/textures/item/copper_spool.png and b/src/main/resources/assets/tfmg/textures/item/copper_spool.png differ diff --git a/src/main/resources/assets/tfmg/textures/item/copper_wire.png b/src/main/resources/assets/tfmg/textures/item/copper_wire.png index 1d7c898d..21f087ec 100644 Binary files a/src/main/resources/assets/tfmg/textures/item/copper_wire.png and b/src/main/resources/assets/tfmg/textures/item/copper_wire.png differ diff --git a/src/main/resources/assets/tfmg/textures/item/lithium_blade.png b/src/main/resources/assets/tfmg/textures/item/lithium_blade.png index 1fae2b54..284add98 100644 Binary files a/src/main/resources/assets/tfmg/textures/item/lithium_blade.png and b/src/main/resources/assets/tfmg/textures/item/lithium_blade.png differ diff --git a/src/main/resources/assets/tfmg/textures/item/screw.png b/src/main/resources/assets/tfmg/textures/item/screw.png index 50d6d2eb..88232dcd 100644 Binary files a/src/main/resources/assets/tfmg/textures/item/screw.png and b/src/main/resources/assets/tfmg/textures/item/screw.png differ