diff --git a/.gitignore b/.gitignore
index 0b333bf..322e5e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,7 +19,4 @@ build
# other
eclipse
-run
-
-# Files from Forge MDK
-changelog.txt
+run
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..267ab35
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 George VI
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..1fda76b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,21 @@
+
Create Diesel Generators
+
+
+
+ 
+Adding Diesel Generators ( and more stuff ) to the Create mod.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/build.gradle b/build.gradle
index ba123e7..c6ff02d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,7 +6,7 @@ plugins {
}
-version = '1.19.2-1.1'
+version = '1.19.2-1.1b'
group = 'com.jesz.createdieselgenerators' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'createdieselgenerators'
diff --git a/src/main/java/com/jesz/createdieselgenerators/CreateDieselGenerators.java b/src/main/java/com/jesz/createdieselgenerators/CreateDieselGenerators.java
index 23297e3..a6e7aba 100644
--- a/src/main/java/com/jesz/createdieselgenerators/CreateDieselGenerators.java
+++ b/src/main/java/com/jesz/createdieselgenerators/CreateDieselGenerators.java
@@ -2,24 +2,24 @@
import com.jesz.createdieselgenerators.blocks.BlockRegistry;
import com.jesz.createdieselgenerators.blocks.entity.BlockEntityRegistry;
+import com.jesz.createdieselgenerators.config.ConfigRegistry;
import com.jesz.createdieselgenerators.fluids.FluidRegistry;
import com.jesz.createdieselgenerators.items.ItemRegistry;
import com.jesz.createdieselgenerators.ponder.PonderIndex;
import com.jesz.createdieselgenerators.recipes.RecipeRegistry;
-import com.simibubi.create.Create;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.utility.Components;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.MutableComponent;
-import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.DistExecutor;
+import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
+import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
-import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import static com.simibubi.create.foundation.utility.Lang.resolveBuilders;
@@ -33,13 +33,15 @@ public CreateDieselGenerators()
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
IEventBus forgeEventBus = MinecraftForge.EVENT_BUS;
- ItemRegistry.register(modEventBus);
+
+ ItemRegistry.register();
BlockRegistry.register();
FluidRegistry.register();
BlockEntityRegistry.register();
RecipeRegistry.register(modEventBus);
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> onClient(modEventBus, forgeEventBus));
+ ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, ConfigRegistry.SERVER_SPEC, "createdieselgenerators-server.toml");
MinecraftForge.EVENT_BUS.register(this);
REGISTRATE.registerEventListeners(modEventBus);
}
diff --git a/src/main/java/com/jesz/createdieselgenerators/blocks/BasinLidBlock.java b/src/main/java/com/jesz/createdieselgenerators/blocks/BasinLidBlock.java
index a2ef3a3..35bbb54 100644
--- a/src/main/java/com/jesz/createdieselgenerators/blocks/BasinLidBlock.java
+++ b/src/main/java/com/jesz/createdieselgenerators/blocks/BasinLidBlock.java
@@ -24,6 +24,7 @@
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.DirectionProperty;
import net.minecraft.world.level.material.FluidState;
+import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
@@ -58,6 +59,25 @@ public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos,
return Shapes.or(Block.box(14, 0, 0, 16, 16, 16),
Block.box(16, 5, 5, 18, 11, 11));
+ }
+ @Override
+ public void neighborChanged(BlockState state, Level level, BlockPos pos, Block block, BlockPos p_57551_, boolean p_57552_) {
+ if (!level.isClientSide) {
+ boolean flag = level.hasNeighborSignal(pos);
+ if (flag != state.getValue(OPEN)) {
+ if (state.getValue(OPEN) != flag) {
+ state = state.setValue(OPEN, flag);
+ level.levelEvent(null, flag ? 1037:1036, pos, 0);
+ }
+
+ level.setBlock(pos, state.setValue(OPEN, flag), 2);
+ if (state.getValue(WATERLOGGED)) {
+ level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level));
+ }
+ }
+
+ }
+
}
@Override
diff --git a/src/main/java/com/jesz/createdieselgenerators/blocks/BlockRegistry.java b/src/main/java/com/jesz/createdieselgenerators/blocks/BlockRegistry.java
index 2cf6300..635a9dc 100644
--- a/src/main/java/com/jesz/createdieselgenerators/blocks/BlockRegistry.java
+++ b/src/main/java/com/jesz/createdieselgenerators/blocks/BlockRegistry.java
@@ -1,6 +1,8 @@
package com.jesz.createdieselgenerators.blocks;
import com.jesz.createdieselgenerators.CreativeTab;
+import com.jesz.createdieselgenerators.other.EngineStateDisplaySource;
+import com.simibubi.create.content.redstone.displayLink.source.BoilerDisplaySource;
import com.simibubi.create.foundation.data.BlockStateGen;
import com.tterrag.registrate.util.entry.BlockEntry;
import net.minecraft.client.renderer.RenderType;
@@ -8,15 +10,17 @@
import net.minecraft.world.level.material.MaterialColor;
import static com.jesz.createdieselgenerators.CreateDieselGenerators.REGISTRATE;
+import static com.simibubi.create.content.redstone.displayLink.AllDisplayBehaviours.assignDataBehaviour;
import static com.simibubi.create.foundation.data.ModelGen.customItemModel;
public class BlockRegistry {
-static {
+ static {
REGISTRATE.creativeModeTab(() -> CreativeTab.CREATIVE_TAB);
}
public static final BlockEntry DIESEL_ENGINE = REGISTRATE.block("diesel_engine", DieselGeneratorBlock::new)
.properties(p -> p.color(MaterialColor.COLOR_YELLOW))
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
+ .onRegister(assignDataBehaviour(new EngineStateDisplaySource()))
.properties(p -> p.noOcclusion())
.properties(p -> p.strength(3f))
.blockstate(BlockStateGen.horizontalBlockProvider(true))
@@ -26,6 +30,7 @@ public class BlockRegistry {
public static final BlockEntry MODULAR_DIESEL_ENGINE = REGISTRATE.block("large_diesel_engine", LargeDieselGeneratorBlock::new)
.properties(p -> p.color(MaterialColor.COLOR_YELLOW))
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
+ .onRegister(assignDataBehaviour(new EngineStateDisplaySource()))
.properties(p -> p.noOcclusion())
.properties(p -> p.strength(3f))
.blockstate(BlockStateGen.horizontalBlockProvider(true))
@@ -33,7 +38,7 @@ public class BlockRegistry {
.transform(customItemModel("_", "block"))
.register();
public static final BlockEntry BASIN_LID = REGISTRATE.block("basin_lid", BasinLidBlock::new)
- .properties(p -> p.color(MaterialColor.COLOR_BLACK))
+ .properties(p -> p.color(MaterialColor.COLOR_GRAY))
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.properties(p -> p.noOcclusion())
.properties(p -> p.strength(3f))
diff --git a/src/main/java/com/jesz/createdieselgenerators/blocks/DieselGeneratorBlock.java b/src/main/java/com/jesz/createdieselgenerators/blocks/DieselGeneratorBlock.java
index 49d4ed9..372242d 100644
--- a/src/main/java/com/jesz/createdieselgenerators/blocks/DieselGeneratorBlock.java
+++ b/src/main/java/com/jesz/createdieselgenerators/blocks/DieselGeneratorBlock.java
@@ -1,7 +1,7 @@
package com.jesz.createdieselgenerators.blocks;
-import com.jesz.createdieselgenerators.blocks.entity.DieselGeneratorBlockEntity;
import com.jesz.createdieselgenerators.blocks.entity.BlockEntityRegistry;
+import com.jesz.createdieselgenerators.blocks.entity.DieselGeneratorBlockEntity;
import com.simibubi.create.content.kinetics.base.DirectionalKineticBlock;
import com.simibubi.create.foundation.block.IBE;
import com.simibubi.create.foundation.block.ProperWaterloggedBlock;
diff --git a/src/main/java/com/jesz/createdieselgenerators/blocks/LargeDieselGeneratorBlock.java b/src/main/java/com/jesz/createdieselgenerators/blocks/LargeDieselGeneratorBlock.java
index f52d69c..688fcc5 100644
--- a/src/main/java/com/jesz/createdieselgenerators/blocks/LargeDieselGeneratorBlock.java
+++ b/src/main/java/com/jesz/createdieselgenerators/blocks/LargeDieselGeneratorBlock.java
@@ -2,14 +2,20 @@
import com.jesz.createdieselgenerators.blocks.entity.LargeDieselGeneratorBlockEntity;
import com.jesz.createdieselgenerators.blocks.entity.BlockEntityRegistry;
+import com.simibubi.create.content.kinetics.base.GeneratingKineticBlockEntity;
import com.simibubi.create.content.kinetics.base.HorizontalKineticBlock;
+import com.simibubi.create.content.kinetics.base.KineticBlockEntity;
import com.simibubi.create.foundation.block.IBE;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
+import net.minecraft.world.InteractionResult;
import net.minecraft.world.item.context.BlockPlaceContext;
+import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.BlockGetter;
+import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition.Builder;
@@ -36,6 +42,34 @@ public LargeDieselGeneratorBlock(Properties properties) {
registerDefaultState(super.defaultBlockState().setValue(PIPE, true));
}
@Override
+ public InteractionResult onWrenched(BlockState state, UseOnContext context) {
+ if(context.getClickedFace() == Direction.UP){
+ if(state.getValue(PIPE)) {
+ context.getLevel().setBlock(context.getClickedPos(), state.setValue(PIPE, false), 3);
+ }else{
+ context.getLevel().setBlock(context.getClickedPos(), state.setValue(PIPE, true), 3);
+ }
+ return InteractionResult.SUCCESS;
+ }
+ Level world = context.getLevel();
+ BlockState rotated = getRotatedBlockState(state, context.getClickedFace());
+ if (!rotated.canSurvive(world, context.getClickedPos()))
+ return InteractionResult.PASS;
+
+ KineticBlockEntity.switchToBlockState(world, context.getClickedPos(), updateAfterWrenched(rotated, context));
+
+ BlockEntity be = context.getLevel()
+ .getBlockEntity(context.getClickedPos());
+ if (be instanceof GeneratingKineticBlockEntity) {
+ ((GeneratingKineticBlockEntity) be).reActivateSource = true;
+ }
+
+ if (world.getBlockState(context.getClickedPos()) != state)
+ playRotateSound(world, context.getClickedPos());
+
+ return InteractionResult.SUCCESS;
+ }
+ @Override
public BlockState getRotatedBlockState(BlockState originalState, Direction targetedFace) {
return originalState;
}
diff --git a/src/main/java/com/jesz/createdieselgenerators/blocks/entity/BasinLidBlockEntity.java b/src/main/java/com/jesz/createdieselgenerators/blocks/entity/BasinLidBlockEntity.java
index c929717..ebb4ad6 100644
--- a/src/main/java/com/jesz/createdieselgenerators/blocks/entity/BasinLidBlockEntity.java
+++ b/src/main/java/com/jesz/createdieselgenerators/blocks/entity/BasinLidBlockEntity.java
@@ -20,7 +20,7 @@
public class BasinLidBlockEntity extends BasinOperatingBlockEntity {
- public int procesingTime;
+ public int processingTime;
public boolean running;
public BasinLidBlockEntity(BlockEntityType> type, BlockPos pos, BlockState state) {
super(type, pos, state);
@@ -29,21 +29,21 @@ public BasinLidBlockEntity(BlockEntityType> type, BlockPos pos, BlockState sta
@Override
protected void write(CompoundTag compound, boolean clientPacket) {
super.write(compound, clientPacket);
- compound.putInt("MeltingTime", this.procesingTime);
+ compound.putInt("MeltingTime", this.processingTime);
compound.putBoolean("Running", this.running);
}
@Override
protected void read(CompoundTag compound, boolean clientPacket) {
super.read(compound, clientPacket);
- this.procesingTime = compound.getInt("MeltingTime");
+ this.processingTime = compound.getInt("MeltingTime");
this.running = compound.getBoolean("Running");
}
@Override
protected void onBasinRemoved() {
if (!this.running) return;
- this.procesingTime = 0;
+ this.processingTime = 0;
this.currentRecipe = null;
this.running = false;
}
@@ -58,20 +58,20 @@ public void tick() {
level.setBlock(getBlockPos(), getBlockState().setValue(ON_A_BASIN, basinPresent), 3);
}
- if (!this.level.isClientSide && (this.currentRecipe == null || this.procesingTime == -1)) {
+ if (!this.level.isClientSide && (this.currentRecipe == null || this.processingTime == -1)) {
this.running = false;
- this.procesingTime = -1;
+ this.processingTime = -1;
this.basinChecker.scheduleUpdate();
}
if (this.running && this.level != null) {
- if (!this.level.isClientSide && this.procesingTime <= 0) {
- this.procesingTime = -1;
+ if (!this.level.isClientSide && this.processingTime <= 0) {
+ this.processingTime = -1;
this.applyBasinRecipe();
this.sendData();
}
- if (this.procesingTime > 0) --this.procesingTime;
+ if (this.processingTime > 0) --this.processingTime;
}
}
@@ -91,10 +91,10 @@ protected boolean updateBasin() {
@Override
public void startProcessingBasin() {
- if (this.running && this.procesingTime > 0) return;
+ if (this.running && this.processingTime > 0) return;
super.startProcessingBasin();
this.running = true;
- this.procesingTime = this.currentRecipe instanceof ProcessingRecipe> processed ? processed.getProcessingDuration() : 20;
+ this.processingTime = this.currentRecipe instanceof ProcessingRecipe> processed ? processed.getProcessingDuration() : 20;
}
@Override
diff --git a/src/main/java/com/jesz/createdieselgenerators/blocks/entity/DieselGeneratorBlockEntity.java b/src/main/java/com/jesz/createdieselgenerators/blocks/entity/DieselGeneratorBlockEntity.java
index e187e96..8afcd82 100644
--- a/src/main/java/com/jesz/createdieselgenerators/blocks/entity/DieselGeneratorBlockEntity.java
+++ b/src/main/java/com/jesz/createdieselgenerators/blocks/entity/DieselGeneratorBlockEntity.java
@@ -1,13 +1,14 @@
package com.jesz.createdieselgenerators.blocks.entity;
-import com.jesz.createdieselgenerators.blocks.BlockRegistry;
-//import com.jesz.createdieselgenerators.blocks.LargeDieselGeneratorBlock;
import com.jesz.createdieselgenerators.blocks.DieselGeneratorBlock;
+import com.jesz.createdieselgenerators.config.ConfigRegistry;
import com.simibubi.create.AllSoundEvents;
+import com.simibubi.create.content.contraptions.bearing.WindmillBearingBlockEntity;
import com.simibubi.create.content.kinetics.base.GeneratingKineticBlockEntity;
import com.simibubi.create.content.kinetics.base.IRotate;
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
import com.simibubi.create.foundation.blockEntity.behaviour.fluid.SmartFluidTankBehaviour;
+import com.simibubi.create.foundation.blockEntity.behaviour.scrollValue.ScrollOptionBehaviour;
import com.simibubi.create.foundation.fluid.FluidHelper;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.ChatFormatting;
@@ -30,14 +31,14 @@
import java.util.List;
-import static com.jesz.createdieselgenerators.blocks.DieselGeneratorBlock.*;
+import static com.jesz.createdieselgenerators.blocks.DieselGeneratorBlock.FACING;
import static com.simibubi.create.AllTags.optionalTag;
public class DieselGeneratorBlockEntity extends GeneratingKineticBlockEntity {
BlockState state;
boolean weak;
boolean slow;
- boolean validFuel;
+ public boolean validFuel;
private final TagKey tagSS;
private final TagKey tagFS;
@@ -46,6 +47,8 @@ public class DieselGeneratorBlockEntity extends GeneratingKineticBlockEntity {
private final TagKey tagPlantOil;
private final TagKey tagFuel;
private final TagKey tagEthanol;
+ private final TagKey tagBiodiesel;
+
public DieselGeneratorBlockEntity(BlockEntityType> typeIn, BlockPos pos, BlockState state) {
super(typeIn, pos, state);
tagSS = optionalTag(ForgeRegistries.FLUIDS, new ResourceLocation("createdieselgenerators:diesel_engine_fuel_slow_strong"));
@@ -55,6 +58,7 @@ public DieselGeneratorBlockEntity(BlockEntityType> typeIn, BlockPos pos, Block
tagPlantOil = optionalTag(ForgeRegistries.FLUIDS, new ResourceLocation("forge:plantoil"));
tagFuel = optionalTag(ForgeRegistries.FLUIDS, new ResourceLocation("forge:fuel"));
tagEthanol = optionalTag(ForgeRegistries.FLUIDS, new ResourceLocation("forge:ethanol"));
+ tagBiodiesel = optionalTag(ForgeRegistries.FLUIDS, new ResourceLocation("forge:biodiesel"));
this.state = state;
}
private SmartFluidTankBehaviour tank;
@@ -94,14 +98,20 @@ protected void read(CompoundTag compound, boolean clientPacket) {
super.read(compound, clientPacket);
tank.read(compound, false);
}
-
+ protected ScrollOptionBehaviour movementDirection;
@Override
public void addBehaviours(List behaviours) {
+
+ movementDirection = new ScrollOptionBehaviour<>(WindmillBearingBlockEntity.RotationDirection.class,
+ Lang.translateDirect("contraptions.windmill.rotation_direction"), this, new DieselGeneratorValueBox());
+ movementDirection.withCallback($ -> onDirectionChanged());
+
+ behaviours.add(movementDirection);
tank = SmartFluidTankBehaviour.single(this, 1000);
behaviours.add(tank);
super.addBehaviours(behaviours);
}
-
+ public void onDirectionChanged(){}
@Override
public void initialize() {
super.initialize();
@@ -112,19 +122,19 @@ public void initialize() {
public float calculateAddedStressCapacity() {
if(getGeneratedSpeed() == 0)
return 0;
- if(weak)
- return 512/Math.abs(getGeneratedSpeed());
+ if (weak)
+ return ConfigRegistry.WEAK_STRESS.get().floatValue() / Math.abs(getGeneratedSpeed());
else
- return 1024/Math.abs(getGeneratedSpeed());
+ return ConfigRegistry.STRONG_STRESS.get().floatValue() / Math.abs(getGeneratedSpeed());
}
@Override
public float getGeneratedSpeed() {
if(validFuel) {
if(slow)
- return convertToDirection(48, getBlockState().getValue(FACING));
+ return convertToDirection((movementDirection.getValue() == 1 ? -1 : 1)*ConfigRegistry.SLOW_SPEED.get().floatValue(), getBlockState().getValue(DieselGeneratorBlock.FACING));
else
- return convertToDirection(96, getBlockState().getValue(FACING));
+ return convertToDirection((movementDirection.getValue() == 1 ? -1 : 1)*ConfigRegistry.FAST_SPEED.get().floatValue(), getBlockState().getValue(DieselGeneratorBlock.FACING));
}
return 0;
}
@@ -149,15 +159,15 @@ public boolean addToGoggleTooltip(List tooltip, boolean isPlayerSneak
public void tick() {
super.tick();
updateGeneratedRotation();
- if (tank.getPrimaryHandler().getFluid().getFluid().is(tagFS) || tank.getPrimaryHandler().getFluid().getFluid().is(tagFuel)) {
+ if (tank.getPrimaryHandler().getFluid().getFluid().is(tagFS) || (ConfigRegistry.FUEL_TAG.get() && tank.getPrimaryHandler().getFluid().getFluid().is(tagFuel)) || (ConfigRegistry.BIODIESEL_TAG.get() && tank.getPrimaryHandler().getFluid().getFluid().is(tagBiodiesel))) {
validFuel = true;
slow = false;
weak = false;
- } else if (tank.getPrimaryHandler().getFluid().getFluid().is(tagFW) || tank.getPrimaryHandler().getFluid().getFluid().is(tagEthanol)) {
+ } else if (tank.getPrimaryHandler().getFluid().getFluid().is(tagFW) || (ConfigRegistry.ETHANOL_TAG.get() && tank.getPrimaryHandler().getFluid().getFluid().is(tagEthanol))) {
validFuel = true;
slow = false;
weak = true;
- } else if (tank.getPrimaryHandler().getFluid().getFluid().is(tagSS) || tank.getPrimaryHandler().getFluid().getFluid().is(tagPlantOil)) {
+ } else if (tank.getPrimaryHandler().getFluid().getFluid().is(tagSS) || (ConfigRegistry.PLANTOIL_TAG.get() && tank.getPrimaryHandler().getFluid().getFluid().is(tagPlantOil))) {
validFuel = true;
slow = true;
weak = false;
diff --git a/src/main/java/com/jesz/createdieselgenerators/blocks/entity/DieselGeneratorValueBox.java b/src/main/java/com/jesz/createdieselgenerators/blocks/entity/DieselGeneratorValueBox.java
new file mode 100644
index 0000000..70312e2
--- /dev/null
+++ b/src/main/java/com/jesz/createdieselgenerators/blocks/entity/DieselGeneratorValueBox.java
@@ -0,0 +1,42 @@
+package com.jesz.createdieselgenerators.blocks.entity;
+
+import com.mojang.blaze3d.vertex.PoseStack;
+import com.simibubi.create.foundation.blockEntity.behaviour.ValueBoxTransform;
+import com.simibubi.create.foundation.utility.VecHelper;
+import net.minecraft.core.Direction;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.phys.Vec3;
+
+import static com.jesz.createdieselgenerators.blocks.DieselGeneratorBlock.FACING;
+
+public class DieselGeneratorValueBox extends ValueBoxTransform.Sided {
+
+ @Override
+ protected boolean isSideActive(BlockState state, Direction side) {
+ if(state.getValue(FACING) == Direction.UP)
+ return side == Direction.WEST;
+ if(state.getValue(FACING) == Direction.DOWN)
+ return side == Direction.NORTH;
+ return side == Direction.UP;
+ }
+
+ @Override
+ public Vec3 getLocalOffset(BlockState state) {
+ if(state.getValue(FACING) == Direction.UP)
+ return VecHelper.voxelSpace(3, 8, 8);
+ if(state.getValue(FACING) == Direction.DOWN)
+ return VecHelper.voxelSpace(8, 8, 3);
+ return VecHelper.voxelSpace(8, 13, 8);
+ }
+
+ @Override
+ public void rotate(BlockState state, PoseStack ms) {
+ super.rotate(state,ms);
+
+ }
+
+ @Override
+ protected Vec3 getSouthLocation() {
+ return Vec3.ZERO;
+ }
+}
diff --git a/src/main/java/com/jesz/createdieselgenerators/blocks/entity/LargeDieselGeneratorBlockEntity.java b/src/main/java/com/jesz/createdieselgenerators/blocks/entity/LargeDieselGeneratorBlockEntity.java
index 5f23bad..025806d 100644
--- a/src/main/java/com/jesz/createdieselgenerators/blocks/entity/LargeDieselGeneratorBlockEntity.java
+++ b/src/main/java/com/jesz/createdieselgenerators/blocks/entity/LargeDieselGeneratorBlockEntity.java
@@ -1,11 +1,13 @@
package com.jesz.createdieselgenerators.blocks.entity;
-import com.mojang.logging.LogUtils;
+import com.jesz.createdieselgenerators.config.ConfigRegistry;
import com.simibubi.create.AllSoundEvents;
+import com.simibubi.create.content.contraptions.bearing.WindmillBearingBlockEntity;
import com.simibubi.create.content.kinetics.base.GeneratingKineticBlockEntity;
import com.simibubi.create.content.kinetics.base.IRotate;
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
import com.simibubi.create.foundation.blockEntity.behaviour.fluid.SmartFluidTankBehaviour;
+import com.simibubi.create.foundation.blockEntity.behaviour.scrollValue.ScrollOptionBehaviour;
import com.simibubi.create.foundation.fluid.FluidHelper;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.ChatFormatting;
@@ -25,8 +27,8 @@
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;
+import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.registries.ForgeRegistries;
-import org.slf4j.Logger;
import java.lang.ref.WeakReference;
import java.util.List;
@@ -38,7 +40,7 @@ public class LargeDieselGeneratorBlockEntity extends GeneratingKineticBlockEntit
BlockState state;
boolean weak;
boolean slow;
- boolean validFuel;
+ public boolean validFuel;
public int stacked;
public boolean powered = false;
boolean end = true;
@@ -49,6 +51,7 @@ public class LargeDieselGeneratorBlockEntity extends GeneratingKineticBlockEntit
private final TagKey tagPlantOil;
private final TagKey tagFuel;
private final TagKey tagEthanol;
+ private final TagKey tagBiodiesel;
public WeakReference forw;
public WeakReference back;
@@ -63,6 +66,7 @@ public LargeDieselGeneratorBlockEntity(BlockEntityType> typeIn, BlockPos pos,
tagPlantOil = optionalTag(ForgeRegistries.FLUIDS, new ResourceLocation("forge:plantoil"));
tagFuel = optionalTag(ForgeRegistries.FLUIDS, new ResourceLocation("forge:fuel"));
tagEthanol = optionalTag(ForgeRegistries.FLUIDS, new ResourceLocation("forge:ethanol"));
+ tagBiodiesel = optionalTag(ForgeRegistries.FLUIDS, new ResourceLocation("forge:biodiesel"));
this.state = state;
}
@@ -90,13 +94,28 @@ protected void read(CompoundTag compound, boolean clientPacket) {
super.read(compound, clientPacket);
tank.read(compound, false);
}
-
+ protected ScrollOptionBehaviour movementDirection;
@Override
public void addBehaviours(List behaviours) {
+ movementDirection = new ScrollOptionBehaviour<>(WindmillBearingBlockEntity.RotationDirection.class,
+ Lang.translateDirect("contraptions.windmill.rotation_direction"), this, new LargeDieselGeneratorValueBox());
+ movementDirection.withCallback($ -> onDirectionChanged(true));
+
+ behaviours.add(movementDirection);
tank = SmartFluidTankBehaviour.single(this, 1000);
behaviours.add(tank);
super.addBehaviours(behaviours);
}
+ public void onDirectionChanged(boolean first) {
+ if(first && getEngineFor() != null){
+ FrontEngine.movementDirection.setValue(movementDirection.getValue());
+ FrontEngine.onDirectionChanged(false);
+ return;
+ }
+ movementDirection.setValue(FrontEngine.movementDirection.getValue());
+ if(getEngineBack() != null)
+ getEngineBack().onDirectionChanged(false);
+ }
@Override
public void initialize() {
@@ -110,33 +129,80 @@ public float calculateAddedStressCapacity() {
if (getGeneratedSpeed() == 0 || !end)
return 0;
if (weak)
- return (512 / Math.abs(getGeneratedSpeed())) * stacked;
+ return (ConfigRegistry.WEAK_STRESS.get().floatValue() / Math.abs(getGeneratedSpeed())) * stacked;
else
- return (1024 / Math.abs(getGeneratedSpeed())) * stacked;
+ return (ConfigRegistry.STRONG_STRESS.get().floatValue() / Math.abs(getGeneratedSpeed())) * stacked;
}
@Override
public float getGeneratedSpeed() {
if (validFuel) {
- if (slow)
- return convertToDirection(48, getBlockState().getValue(FACING));
+ if(slow)
+ return convertToDirection((movementDirection.getValue() == 1 ? -1 : 1)*ConfigRegistry.SLOW_SPEED.get().floatValue(), getBlockState().getValue(FACING));
else
- return convertToDirection(96, getBlockState().getValue(FACING));
+ return convertToDirection((movementDirection.getValue() == 1 ? -1 : 1)*ConfigRegistry.FAST_SPEED.get().floatValue(), getBlockState().getValue(FACING));
}
return 0;
}
+ public LargeDieselGeneratorBlockEntity FrontEngine;
+ public void UpdateStacked(){
+ LargeDieselGeneratorBlockEntity engineForward = getEngineFor();
+ LargeDieselGeneratorBlockEntity engineBack = getEngineBack();
+
+
+ if(engineBack == null) {
+ stacked = 1;
+
+ }else{
+ stacked = engineBack.stacked + 1;
+ }
+ if(engineForward == null)
+ SetEveryEnginesFront();
+ else
+ engineForward.UpdateStacked();
+ }
+ public void SetEveryEnginesFront(){
+ LargeDieselGeneratorBlockEntity engineForward = getEngineFor();
+ LargeDieselGeneratorBlockEntity engineBack = getEngineBack();
+
+ if(engineForward == null){
+ FrontEngine = this;
+ }else{
+ FrontEngine = engineForward.FrontEngine;
+ }
+ if(engineBack != null)
+ engineBack.SetEveryEnginesFront();
+ }
@Override
public boolean addToGoggleTooltip(List tooltip, boolean isPlayerSneaking) {
boolean added = super.addToGoggleTooltip(tooltip, isPlayerSneaking);
- if (!IRotate.StressImpact.isEnabled())
+ if (!IRotate.StressImpact.isEnabled() || FrontEngine == null)
return added;
-
- float stressBase = calculateAddedStressCapacity();
+ float stressBase = FrontEngine.calculateAddedStressCapacity();
if (Mth.equal(stressBase, 0))
return added;
+ if(FrontEngine != this){
+ Lang.translate("gui.goggles.generator_stats")
+ .forGoggles(tooltip);
+ Lang.translate("tooltip.capacityProvided")
+ .style(ChatFormatting.GRAY)
+ .forGoggles(tooltip);
+
+ float stressTotal = FrontEngine.getGeneratedSpeed()* stressBase;
+
+ Lang.number(stressTotal)
+ .translate("generic.unit.stress")
+ .style(ChatFormatting.AQUA)
+ .space()
+ .add(Lang.translate("gui.goggles.at_current_speed")
+ .style(ChatFormatting.DARK_GRAY))
+ .forGoggles(tooltip, 1);
+
+ }
+
Lang.translate("gui.goggles.fluid_container").forGoggles(tooltip);
- Lang.fluidName(tank.getPrimaryHandler().getFluid()).style(ChatFormatting.GRAY).space().add(Lang.number(tank.getPrimaryHandler().getFluid().getAmount()).style(ChatFormatting.DARK_GRAY)).add(Lang.translate("generic.unit.millibuckets").style(ChatFormatting.DARK_GRAY)).forGoggles(tooltip);
+ Lang.fluidName(FrontEngine.tank.getPrimaryHandler().getFluid()).style(ChatFormatting.GRAY).space().add(Lang.number(FrontEngine.tank.getPrimaryHandler().getFluid().getAmount()).style(ChatFormatting.DARK_GRAY)).add(Lang.translate("generic.unit.millibuckets").style(ChatFormatting.DARK_GRAY)).forGoggles(tooltip);
return true;
}
@@ -150,21 +216,8 @@ public void tick() {
LargeDieselGeneratorBlockEntity engineForward = getEngineFor();
LargeDieselGeneratorBlockEntity engineBack = getEngineBack();
-
-
- lastf = getBlockState().getValue(PIPE);
state = getBlockState();
- if(engineForward == null){
- if(!lastf){
- lastf = true;
- changeBlockState(getBlockState().setValue(PIPE, true));
- }
- }else{
- if(lastf){
- lastf = false;
- changeBlockState(getBlockState().setValue(PIPE, false));
- }
- }
+
end = engineForward == null;
@@ -176,32 +229,34 @@ public void tick() {
}
// stacked
- if (engineBack != null) {
- this.stacked = engineBack.stacked + 1;
- } else {
- this.stacked = 1;
+ if(engineBack == null)
+ UpdateStacked();
+
+ if(engineForward != null){
+ FrontEngine.tank.getPrimaryHandler().fill(tank.getPrimaryHandler().getFluid(), IFluidHandler.FluidAction.EXECUTE);
+ tank.getPrimaryHandler().drain(tank.getPrimaryHandler().getFluid(), IFluidHandler.FluidAction.EXECUTE);
}
if(tank.getPrimaryHandler().getFluid().getAmount() >= stacked){
- if (tank.getPrimaryHandler().getFluid().getFluid().is(tagFS) || tank.getPrimaryHandler().getFluid().getFluid().is(tagFuel)) {
- validFuel = true;
- slow = false;
- weak = false;
- } else if (tank.getPrimaryHandler().getFluid().getFluid().is(tagFW) || tank.getPrimaryHandler().getFluid().getFluid().is(tagEthanol)) {
- validFuel = true;
- slow = false;
- weak = true;
- } else if (tank.getPrimaryHandler().getFluid().getFluid().is(tagSS) || tank.getPrimaryHandler().getFluid().getFluid().is(tagPlantOil)) {
- validFuel = true;
- slow = true;
- weak = false;
- } else if (tank.getPrimaryHandler().getFluid().getFluid().is(tagSW)) {
- validFuel = true;
- slow = true;
- weak = true;
- }else{
- validFuel = false;
- }
+ if (tank.getPrimaryHandler().getFluid().getFluid().is(tagFS) || (ConfigRegistry.FUEL_TAG.get() && tank.getPrimaryHandler().getFluid().getFluid().is(tagFuel)) || (ConfigRegistry.BIODIESEL_TAG.get() && tank.getPrimaryHandler().getFluid().getFluid().is(tagBiodiesel))) {
+ validFuel = true;
+ slow = false;
+ weak = false;
+ } else if (tank.getPrimaryHandler().getFluid().getFluid().is(tagFW) || (ConfigRegistry.ETHANOL_TAG.get() && tank.getPrimaryHandler().getFluid().getFluid().is(tagEthanol))) {
+ validFuel = true;
+ slow = false;
+ weak = true;
+ } else if (tank.getPrimaryHandler().getFluid().getFluid().is(tagSS) || (ConfigRegistry.PLANTOIL_TAG.get() && tank.getPrimaryHandler().getFluid().getFluid().is(tagPlantOil))) {
+ validFuel = true;
+ slow = true;
+ weak = false;
+ } else if (tank.getPrimaryHandler().getFluid().getFluid().is(tagSW)) {
+ validFuel = true;
+ slow = true;
+ weak = true;
+ }else{
+ validFuel = false;
+ }
}else{
validFuel = false;
}
diff --git a/src/main/java/com/jesz/createdieselgenerators/blocks/entity/LargeDieselGeneratorValueBox.java b/src/main/java/com/jesz/createdieselgenerators/blocks/entity/LargeDieselGeneratorValueBox.java
new file mode 100644
index 0000000..0969f73
--- /dev/null
+++ b/src/main/java/com/jesz/createdieselgenerators/blocks/entity/LargeDieselGeneratorValueBox.java
@@ -0,0 +1,38 @@
+package com.jesz.createdieselgenerators.blocks.entity;
+
+import com.jozufozu.flywheel.util.transform.TransformStack;
+import com.mojang.blaze3d.vertex.PoseStack;
+import com.simibubi.create.content.kinetics.steamEngine.SteamEngineBlock;
+import com.simibubi.create.foundation.blockEntity.behaviour.ValueBoxTransform;
+import com.simibubi.create.foundation.utility.AngleHelper;
+import com.simibubi.create.foundation.utility.Pointing;
+import com.simibubi.create.foundation.utility.VecHelper;
+import net.minecraft.core.Direction;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.phys.Vec3;
+
+public class LargeDieselGeneratorValueBox extends ValueBoxTransform.Sided {
+
+ @Override
+ protected boolean isSideActive(BlockState state, Direction side) {
+ return side == Direction.UP;
+ }
+
+ @Override
+ public Vec3 getLocalOffset(BlockState state) {
+ Vec3 local = VecHelper.voxelSpace(8, 16, 8);
+
+ return local;
+ }
+
+ @Override
+ public void rotate(BlockState state, PoseStack ms) {
+ super.rotate(state,ms);
+
+ }
+
+ @Override
+ protected Vec3 getSouthLocation() {
+ return Vec3.ZERO;
+ }
+}
diff --git a/src/main/java/com/jesz/createdieselgenerators/compat/jei/BasinFermentingCategory.java b/src/main/java/com/jesz/createdieselgenerators/compat/jei/BasinFermentingCategory.java
index f25aac2..265d795 100644
--- a/src/main/java/com/jesz/createdieselgenerators/compat/jei/BasinFermentingCategory.java
+++ b/src/main/java/com/jesz/createdieselgenerators/compat/jei/BasinFermentingCategory.java
@@ -4,6 +4,7 @@
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.compat.jei.category.CreateRecipeCategory;
+import com.simibubi.create.compat.jei.category.animations.AnimatedBlazeBurner;
import com.simibubi.create.compat.jei.category.animations.AnimatedMillstone;
import com.simibubi.create.content.processing.basin.BasinRecipe;
import com.simibubi.create.content.processing.burner.BlazeBurnerBlock;
@@ -12,12 +13,14 @@
import com.simibubi.create.foundation.fluid.FluidIngredient;
import com.simibubi.create.foundation.gui.AllGuiTextures;
import com.simibubi.create.foundation.item.ItemHelper;
+import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.Pair;
import mezz.jei.api.forge.ForgeTypes;
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
import mezz.jei.api.recipe.IFocusGroup;
import mezz.jei.api.recipe.RecipeIngredientRole;
+import net.minecraft.client.Minecraft;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraftforge.fluids.FluidStack;
@@ -31,80 +34,102 @@
public class BasinFermentingCategory extends CreateRecipeCategory {
private final BasinFermentingStationElement BasinFermentingStation = new BasinFermentingStationElement();
-
+ private final AnimatedBlazeBurner heater = new AnimatedBlazeBurner();
public BasinFermentingCategory(Info info) {
super(info);
}
-@Override
-public void setRecipe(IRecipeLayoutBuilder builder, BasinRecipe recipe, IFocusGroup focuses) {
- List> condensedIngredients = ItemHelper.condenseIngredients(recipe.getIngredients());
+ @Override
+ public void setRecipe(IRecipeLayoutBuilder builder, BasinRecipe recipe, IFocusGroup focuses) {
+ List> condensedIngredients = ItemHelper.condenseIngredients(recipe.getIngredients());
+
+ int size = condensedIngredients.size() + recipe.getFluidIngredients().size();
+ int xOffset = size < 3 ? (3 - size) * 19 / 2 : 0;
+ int i = 0;
+
+ for (Pair pair : condensedIngredients) {
+ List stacks = new ArrayList<>();
+ for (ItemStack itemStack : pair.getFirst().getItems()) {
+ ItemStack copy = itemStack.copy();
+ copy.setCount(pair.getSecond().getValue());
+ stacks.add(copy);
+ }
+
+ builder
+ .addSlot(RecipeIngredientRole.INPUT, 17 + xOffset + (i % 3) * 19, 41 - (i / 3) * 19)
+ .setBackground(getRenderedSlot(), -1, -1)
+ .addItemStacks(stacks);
+ i++;
+ }
+ for (FluidIngredient fluidIngredient : recipe.getFluidIngredients()) {
+ builder
+ .addSlot(RecipeIngredientRole.INPUT, 17 + xOffset + (i % 3) * 19, 41 - (i / 3) * 19)
+ .setBackground(getRenderedSlot(), -1, -1)
+ .addIngredients(ForgeTypes.FLUID_STACK, withImprovedVisibility(fluidIngredient.getMatchingFluidStacks()))
+ .addTooltipCallback(addFluidTooltip(fluidIngredient.getRequiredAmount()));
+ i++;
+ }
+
+ size = recipe.getRollableResults().size() + recipe.getFluidResults().size();
+ i = 0;
- int size = condensedIngredients.size() + recipe.getFluidIngredients().size();
- int xOffset = size < 2 ? (2 - size) * 19 / 2 : 0;
- int i = 0;
+ for (ProcessingOutput result : recipe.getRollableResults()) {
+ int xPosition = 142 - (size % 2 != 0 && i == size - 1 ? 0 : i % 2 == 0 ? 10 : -9);
+ int yPosition = -19 * (i / 2) + 51;
- for (Pair pair : condensedIngredients) {
- List stacks = new ArrayList<>();
- for (ItemStack itemStack : pair.getFirst().getItems()) {
- ItemStack copy = itemStack.copy();
- copy.setCount(pair.getSecond().getValue());
- stacks.add(copy);
+ builder
+ .addSlot(RecipeIngredientRole.OUTPUT, xPosition, yPosition)
+ .setBackground(getRenderedSlot(result), -1, -1)
+ .addItemStack(result.getStack())
+ .addTooltipCallback(addStochasticTooltip(result));
+ i++;
}
- int xPosition = 20 - (size % 2 != 0 && i == size - 1 ? 0 : i % 2 == 0 ? 10 : -9);
- int yPosition = -19 * (i / 2) + 20;
+ for (FluidStack fluidResult : recipe.getFluidResults()) {
+ int xPosition = 142 - (size % 2 != 0 && i == size - 1 ? 0 : i % 2 == 0 ? 10 : -9);
+ int yPosition = -19 * (i / 2) + 51;
- builder
- .addSlot(RecipeIngredientRole.INPUT, xPosition, yPosition)
- .setBackground(getRenderedSlot(), -1, -1)
- .addItemStacks(stacks);
- i++;
- }
- for (FluidIngredient fluidIngredient : recipe.getFluidIngredients()) {
- int xPosition = 20 - (size % 2 != 0 && i == size - 1 ? 0 : i % 2 == 0 ? 10 : -9);
- int yPosition = -19 * (i / 2) + 20;
- builder
- .addSlot(RecipeIngredientRole.INPUT, xPosition, yPosition)
- .setBackground(getRenderedSlot(), -1, -1)
- .addIngredients(ForgeTypes.FLUID_STACK, withImprovedVisibility(fluidIngredient.getMatchingFluidStacks()))
- .addTooltipCallback(addFluidTooltip(fluidIngredient.getRequiredAmount()));
- i++;
+ builder
+ .addSlot(RecipeIngredientRole.OUTPUT, xPosition, yPosition)
+ .setBackground(getRenderedSlot(), -1, -1)
+ .addIngredient(ForgeTypes.FLUID_STACK, withImprovedVisibility(fluidResult))
+ .addTooltipCallback(addFluidTooltip(fluidResult.getAmount()));
+ i++;
+ }
+
+ HeatCondition requiredHeat = recipe.getRequiredHeat();
+ if (!requiredHeat.testBlazeBurner(BlazeBurnerBlock.HeatLevel.NONE)) {
+ builder
+ .addSlot(RecipeIngredientRole.RENDER_ONLY, 134, 81)
+ .addItemStack(AllBlocks.BLAZE_BURNER.asStack());
+ }
+ if (!requiredHeat.testBlazeBurner(BlazeBurnerBlock.HeatLevel.KINDLED)) {
+ builder
+ .addSlot(RecipeIngredientRole.CATALYST, 153, 81)
+ .addItemStack(AllItems.BLAZE_CAKE.asStack());
+ }
}
- size = recipe.getRollableResults().size() + recipe.getFluidResults().size();
- i = 0;
+ @Override
+ public void draw(BasinRecipe recipe, IRecipeSlotsView iRecipeSlotsView, PoseStack matrixStack, double mouseX, double mouseY) {
+ AllGuiTextures.JEI_DOWN_ARROW.render(matrixStack, 136, 20);
- for (ProcessingOutput result : recipe.getRollableResults()) {
- int xPosition = 142 - (size % 2 != 0 && i == size - 1 ? 0 : i % 2 == 0 ? 10 : -9);
- int yPosition = -20 * (i / 2) + 30;
- builder
- .addSlot(RecipeIngredientRole.OUTPUT, xPosition, yPosition)
- .setBackground(getRenderedSlot(result), -1, -1)
- .addItemStack(result.getStack())
- .addTooltipCallback(addStochasticTooltip(result));
- i++;
- }
+ HeatCondition requiredHeat = recipe.getRequiredHeat();
- for (FluidStack fluidResult : recipe.getFluidResults()) {
- int xPosition = 142 - (size % 2 != 0 && i == size - 1 ? 0 : i % 2 == 0 ? 10 : -9);
- int yPosition = -20 * (i / 2) + 30;
+ boolean noHeat = requiredHeat == HeatCondition.NONE;
- builder
- .addSlot(RecipeIngredientRole.OUTPUT, xPosition, yPosition)
- .setBackground(getRenderedSlot(), -1, -1)
- .addIngredient(ForgeTypes.FLUID_STACK, withImprovedVisibility(fluidResult))
- .addTooltipCallback(addFluidTooltip(fluidResult.getAmount()));
- i++;
- }
-}
- @Override
- public void draw(BasinRecipe recipe, IRecipeSlotsView iRecipeSlotsView, PoseStack matrixStack, double mouseX, double mouseY) {
- AllGuiTextures.JEI_ARROW.render(matrixStack, 85, 32);
- AllGuiTextures.JEI_DOWN_ARROW.render(matrixStack, 50, 4);
- BasinFermentingStation.draw(matrixStack, 50, 27);
+ AllGuiTextures shadow = noHeat ? AllGuiTextures.JEI_SHADOW : AllGuiTextures.JEI_LIGHT;
+ shadow.render(matrixStack, 81, 58 + (noHeat ? 10 : 30));
+ BasinFermentingStation.draw(matrixStack, 91, 47);
+ if(!noHeat)
+ heater.withHeat(requiredHeat.visualizeAsBlazeBurner()).draw(matrixStack, 91, 55);
+
+ AllGuiTextures heatBar = noHeat ? AllGuiTextures.JEI_NO_HEAT_BAR : AllGuiTextures.JEI_HEAT_BAR;
+ heatBar.render(matrixStack, 4, 80);
+ Minecraft.getInstance().font.draw(matrixStack, Lang.translateDirect(requiredHeat.getTranslationKey()), 9,
+ 86, requiredHeat.getColor());
}
}
\ No newline at end of file
diff --git a/src/main/java/com/jesz/createdieselgenerators/compat/jei/cdgJei.java b/src/main/java/com/jesz/createdieselgenerators/compat/jei/cdgJei.java
index e673fda..b75457c 100644
--- a/src/main/java/com/jesz/createdieselgenerators/compat/jei/cdgJei.java
+++ b/src/main/java/com/jesz/createdieselgenerators/compat/jei/cdgJei.java
@@ -45,7 +45,7 @@
@JeiPlugin
@ParametersAreNonnullByDefault
-public class cdgJei implements IModPlugin {
+public class CDGJEI implements IModPlugin {
private static final ResourceLocation ID = new ResourceLocation("createdieselgenerators", "jei_plugin");
@Override
@@ -66,7 +66,7 @@ private void loadCategories() {
.catalyst(BlockRegistry.BASIN_LID::get)
.catalyst(AllBlocks.BASIN::get)
.doubleItemIcon(AllBlocks.BASIN.get(), BlockRegistry.BASIN_LID.get())
- .emptyBackground(177, 53)
+ .emptyBackground(177, 100)
.build("basin_fermenting", BasinFermentingCategory::new);
}
diff --git a/src/main/java/com/jesz/createdieselgenerators/config/ConfigRegistry.java b/src/main/java/com/jesz/createdieselgenerators/config/ConfigRegistry.java
new file mode 100644
index 0000000..8d4b3e5
--- /dev/null
+++ b/src/main/java/com/jesz/createdieselgenerators/config/ConfigRegistry.java
@@ -0,0 +1,49 @@
+package com.jesz.createdieselgenerators.config;
+
+import net.minecraftforge.common.ForgeConfigSpec;
+
+public class ConfigRegistry {
+ public static final ForgeConfigSpec.Builder SERVER_BUILDER = new ForgeConfigSpec.Builder();
+ public static final ForgeConfigSpec SERVER_SPEC;
+
+ public static final ForgeConfigSpec.ConfigValue SLOW_SPEED;
+ public static final ForgeConfigSpec.ConfigValue FAST_SPEED;
+ public static final ForgeConfigSpec.ConfigValue WEAK_STRESS;
+ public static final ForgeConfigSpec.ConfigValue STRONG_STRESS;
+
+ public static final ForgeConfigSpec.ConfigValue FUEL_TAG;
+ public static final ForgeConfigSpec.ConfigValue ETHANOL_TAG;
+ public static final ForgeConfigSpec.ConfigValue PLANTOIL_TAG;
+ public static final ForgeConfigSpec.ConfigValue BIODIESEL_TAG;
+
+
+ static {
+ SERVER_BUILDER.push("Server Configs");
+
+ FUEL_TAG = SERVER_BUILDER.comment("forge:fuel tag compatibility")
+ .define("forge:fuel tag compatibility", true);
+ ETHANOL_TAG = SERVER_BUILDER.comment("forge:ethanol tag compatibility")
+ .define("forge:ethanol tag compatibility", true);
+ PLANTOIL_TAG = SERVER_BUILDER.comment("forge:plantoil tag compatibility")
+ .define("forge:plantoil tag compatibility", true);
+ BIODIESEL_TAG = SERVER_BUILDER.comment("forge:biodiesel tag compatibility")
+ .define("forge:biodiesel tag compatibility", true);
+
+
+ SLOW_SPEED = SERVER_BUILDER.comment("Speed of Slow Fuel Type in RPM")
+ .define("Speed of Slow Fuel Type",48d);
+
+ FAST_SPEED = SERVER_BUILDER.comment("Speed of Fast Fuel Type in RPM")
+ .define("Speed of Fast Fuel Type",96d);
+
+ WEAK_STRESS = SERVER_BUILDER.comment("Strength of Weak Fuel Type in su")
+ .define("Strength of Weak Fuel Type",512d);
+
+ STRONG_STRESS = SERVER_BUILDER.comment("Strength of Strong Fuel Type in su")
+ .define("Strength of Strong Fuel Type",1024d);
+
+
+ SERVER_BUILDER.pop();
+ SERVER_SPEC = SERVER_BUILDER.build();
+ }
+}
diff --git a/src/main/java/com/jesz/createdieselgenerators/fluids/FluidRegistry.java b/src/main/java/com/jesz/createdieselgenerators/fluids/FluidRegistry.java
index b3d6e62..e1551db 100644
--- a/src/main/java/com/jesz/createdieselgenerators/fluids/FluidRegistry.java
+++ b/src/main/java/com/jesz/createdieselgenerators/fluids/FluidRegistry.java
@@ -1,14 +1,7 @@
package com.jesz.createdieselgenerators.fluids;
-import com.simibubi.create.AllFluids;
-import com.simibubi.create.content.fluids.potion.PotionFluid;
import com.tterrag.registrate.util.entry.FluidEntry;
-import net.minecraft.client.renderer.RenderType;
-import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
-import net.minecraft.world.level.BlockAndTintGetter;
-import net.minecraft.world.level.material.FluidState;
-import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.ForgeFlowingFluid;
import static com.jesz.createdieselgenerators.CreateDieselGenerators.REGISTRATE;
diff --git a/src/main/java/com/jesz/createdieselgenerators/items/ItemRegistry.java b/src/main/java/com/jesz/createdieselgenerators/items/ItemRegistry.java
index 2e02c92..d16ea76 100644
--- a/src/main/java/com/jesz/createdieselgenerators/items/ItemRegistry.java
+++ b/src/main/java/com/jesz/createdieselgenerators/items/ItemRegistry.java
@@ -1,20 +1,20 @@
package com.jesz.createdieselgenerators.items;
import com.jesz.createdieselgenerators.CreativeTab;
+import com.tterrag.registrate.util.entry.ItemEntry;
import net.minecraft.world.item.Item;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
+import static com.jesz.createdieselgenerators.CreateDieselGenerators.REGISTRATE;
+
public class ItemRegistry {
- public static final DeferredRegister- ITEMS =
- DeferredRegister.create(ForgeRegistries.ITEMS, "createdieselgenerators");
+ static { REGISTRATE.creativeModeTab(() -> CreativeTab.CREATIVE_TAB); }
+
+ public static final ItemEntry
- ENGINEPISTON = REGISTRATE.item("engine_piston", Item::new).register();
- public static final RegistryObject
- ENGINEPISTON = ITEMS.register("engine_piston",
- () -> new Item(new Item.Properties().tab(CreativeTab.CREATIVE_TAB)));
- public static void register(IEventBus eventBus) {
- ITEMS.register(eventBus);
- }
+ public static void register() {}
}
diff --git a/src/main/java/com/jesz/createdieselgenerators/other/EngineStateDisplaySource.java b/src/main/java/com/jesz/createdieselgenerators/other/EngineStateDisplaySource.java
new file mode 100644
index 0000000..1de0ed1
--- /dev/null
+++ b/src/main/java/com/jesz/createdieselgenerators/other/EngineStateDisplaySource.java
@@ -0,0 +1,49 @@
+package com.jesz.createdieselgenerators.other;
+
+import com.jesz.createdieselgenerators.blocks.entity.DieselGeneratorBlockEntity;
+import com.jesz.createdieselgenerators.blocks.entity.LargeDieselGeneratorBlockEntity;
+import com.simibubi.create.content.redstone.displayLink.DisplayLinkContext;
+import com.simibubi.create.content.redstone.displayLink.source.DisplaySource;
+import com.simibubi.create.content.redstone.displayLink.target.DisplayTargetStats;
+import net.minecraft.network.chat.MutableComponent;
+
+import java.util.List;
+
+import static com.jesz.createdieselgenerators.CreateDieselGenerators.translate;
+
+public class EngineStateDisplaySource extends DisplaySource {
+ @Override
+ public List provideText(DisplayLinkContext context, DisplayTargetStats stats) {
+ if(context.getSourceBlockEntity() instanceof DieselGeneratorBlockEntity sourceBE) {
+ if(sourceBE.validFuel)
+ return List.of(
+ translate("createdieselgenerators.display_source.engine_status").append(" : "),
+ translate("createdieselgenerators.display_source.speed").append(Math.abs(sourceBE.getGeneratedSpeed()) + "rpm"),
+ translate("createdieselgenerators.display_source.stress").append(Math.abs(sourceBE.calculateAddedStressCapacity() * sourceBE.getGeneratedSpeed()) + "su")
+ );
+
+ return List.of(
+ translate("createdieselgenerators.display_source.engine_status").append(" : "),
+ translate("createdieselgenerators.display_source.idle")
+ );
+
+
+
+ } else if(context.getSourceBlockEntity() instanceof LargeDieselGeneratorBlockEntity sourceBE) {
+ if(sourceBE.FrontEngine != null)
+ if(sourceBE.FrontEngine.validFuel)
+ return List.of(
+ translate("createdieselgenerators.display_source.engine_status").append(" : "),
+ translate("createdieselgenerators.display_source.speed").append(Math.abs(sourceBE.FrontEngine.getGeneratedSpeed()) + "rpm"),
+ translate("createdieselgenerators.display_source.stress").append(Math.abs(sourceBE.FrontEngine.calculateAddedStressCapacity() * sourceBE.FrontEngine.getGeneratedSpeed()) + "su")
+ );
+
+ return List.of(
+ translate("createdieselgenerators.display_source.engine_status").append(" : "),
+ translate("createdieselgenerators.display_source.idle")
+ );
+
+ }
+ return List.of();
+ }
+}
diff --git a/src/main/java/com/jesz/createdieselgenerators/ponder/PonderIndex.java b/src/main/java/com/jesz/createdieselgenerators/ponder/PonderIndex.java
index 50008d3..a4a98c2 100644
--- a/src/main/java/com/jesz/createdieselgenerators/ponder/PonderIndex.java
+++ b/src/main/java/com/jesz/createdieselgenerators/ponder/PonderIndex.java
@@ -21,5 +21,8 @@ public static void register() {
.add(BlockRegistry.MODULAR_DIESEL_ENGINE);
PonderRegistry.TAGS.forTag(AllPonderTags.KINETIC_APPLIANCES)
.add(BlockRegistry.BASIN_LID);
+ PonderRegistry.TAGS.forTag(AllPonderTags.DISPLAY_SOURCES)
+ .add(BlockRegistry.DIESEL_ENGINE)
+ .add(BlockRegistry.MODULAR_DIESEL_ENGINE);
}
}
diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml
index 7a2963c..c7e0484 100644
--- a/src/main/resources/META-INF/mods.toml
+++ b/src/main/resources/META-INF/mods.toml
@@ -19,9 +19,9 @@ modId="createdieselgenerators" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
# see the associated build.gradle script for how to populate this completely automatically during a build
-version="1.19.2-1.1" #mandatory
+version="1.19.2-1.1b" #mandatory
# A display name for the mod
-displayName="Create Diesel Generators" #mandatory
+displayName="Create Diesel Generators" #m
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
@@ -55,7 +55,7 @@ You can add custom fuel types by adding "createdieselgenerators:diesel_engine_fu
modId="minecraft"
mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version
- versionRange="[1.19.2,)"
+ versionRange="[1.18,)"
ordering="NONE"
side="BOTH"
[[dependencies.createdieselgenerators]]
diff --git a/src/main/resources/assets/createdieselgenerators/lang/en_us.json b/src/main/resources/assets/createdieselgenerators/lang/en_us.json
index 8d7b51d..4f423f1 100644
--- a/src/main/resources/assets/createdieselgenerators/lang/en_us.json
+++ b/src/main/resources/assets/createdieselgenerators/lang/en_us.json
@@ -23,5 +23,12 @@
"createdieselgenerators.ponder.large_diesel_engine.text_1": "Modular Diesel Generators function like normal Diesel generators.",
"createdieselgenerators.ponder.large_diesel_engine.text_2": "Once you give them some fuel, they will produce Kinetic Energy ...",
"createdieselgenerators.ponder.large_diesel_engine.text_3": "... They can be stacked.",
- "createdieselgenerators.ponder.large_diesel_engine.text_4": "They will generate stress proportionally to how much engines you stack."
+ "createdieselgenerators.ponder.large_diesel_engine.text_4": "They will generate stress proportionally to how much engines you stack.",
+
+ "createdieselgenerators.display_source.diesel_engine_source": "Engine Status",
+ "createdieselgenerators.display_source.large_diesel_engine_source": "Engine Status",
+ "createdieselgenerators.display_source.engine_status": "Engine Status",
+ "createdieselgenerators.display_source.speed": "SPEED : ",
+ "createdieselgenerators.display_source.stress": "STRESS : ",
+ "createdieselgenerators.display_source.idle": "IDLE"
}
\ No newline at end of file
diff --git a/src/main/resources/assets/createdieselgenerators/models/block/basin_lid_on_a_basin.json b/src/main/resources/assets/createdieselgenerators/models/block/basin_lid_on_a_basin.json
index 5f10723..356c6a1 100644
--- a/src/main/resources/assets/createdieselgenerators/models/block/basin_lid_on_a_basin.json
+++ b/src/main/resources/assets/createdieselgenerators/models/block/basin_lid_on_a_basin.json
@@ -5,6 +5,7 @@
"4": "create:block/basin",
"5": "createdieselgenerators:block/gauge",
"6": "createdieselgenerators:block/basin_lid",
+ "7": "createdieselgenerators:block/basin_fermenting_station",
"particle": "create:block/basin"
},
"elements": [
@@ -38,6 +39,17 @@
"faces": {
"north": {"uv": [0, 0, 8, 8], "texture": "#5"}
}
+ },
+ {
+ "from": [3, -14, 3],
+ "to": [13, -12, 13],
+ "faces": {
+ "north": {"uv": [0, 0, 10, 2], "texture": "#7"},
+ "east": {"uv": [0, 0, 10, 2], "texture": "#7"},
+ "south": {"uv": [0, 0, 10, 2], "texture": "#7"},
+ "west": {"uv": [0, 0, 10, 2], "texture": "#7"},
+ "up": {"uv": [0, 2, 10, 12], "texture": "#7"}
+ }
}
]
}
\ No newline at end of file
diff --git a/src/main/resources/assets/createdieselgenerators/models/block/basin_lid_on_a_basin_open.json b/src/main/resources/assets/createdieselgenerators/models/block/basin_lid_on_a_basin_open.json
index 78b95c8..8056bf6 100644
--- a/src/main/resources/assets/createdieselgenerators/models/block/basin_lid_on_a_basin_open.json
+++ b/src/main/resources/assets/createdieselgenerators/models/block/basin_lid_on_a_basin_open.json
@@ -5,6 +5,7 @@
"4": "create:block/basin",
"5": "createdieselgenerators:block/gauge",
"6": "createdieselgenerators:block/basin_lid",
+ "7": "createdieselgenerators:block/basin_fermenting_station",
"particle": "create:block/basin"
},
"elements": [
@@ -40,6 +41,17 @@
"faces": {
"north": {"uv": [0, 0, 8, 8], "texture": "#5"}
}
+ },
+ {
+ "from": [3, -14, 3],
+ "to": [13, -12, 13],
+ "faces": {
+ "north": {"uv": [0, 0, 10, 2], "texture": "#7"},
+ "east": {"uv": [0, 0, 10, 2], "texture": "#7"},
+ "south": {"uv": [0, 0, 10, 2], "texture": "#7"},
+ "west": {"uv": [0, 0, 10, 2], "texture": "#7"},
+ "up": {"uv": [0, 2, 10, 12], "texture": "#7"}
+ }
}
]
}
\ No newline at end of file
diff --git a/src/main/resources/assets/createdieselgenerators/models/block/diesel_engine_vertical.json b/src/main/resources/assets/createdieselgenerators/models/block/diesel_engine_vertical.json
index 91cdea7..8aaf894 100644
--- a/src/main/resources/assets/createdieselgenerators/models/block/diesel_engine_vertical.json
+++ b/src/main/resources/assets/createdieselgenerators/models/block/diesel_engine_vertical.json
@@ -8,9 +8,9 @@
},
"elements": [
{
- "from": [7, 3, -0.5],
- "to": [11, 7, 6.5],
- "rotation": {"angle": -45, "axis": "y", "origin": [9, 5, 3]},
+ "from": [8.5, 3, -0.75],
+ "to": [12.5, 7, 6.25],
+ "rotation": {"angle": -45, "axis": "y", "origin": [10.5, 5, 2.75]},
"faces": {
"north": {"uv": [2, 9.5, 4, 11.5], "rotation": 180, "texture": "#2"},
"east": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
@@ -20,9 +20,9 @@
}
},
{
- "from": [7, 9, -0.5],
- "to": [11, 13, 6.5],
- "rotation": {"angle": -45, "axis": "y", "origin": [9, 11, 3]},
+ "from": [8.5, 9, -0.75],
+ "to": [12.5, 13, 6.25],
+ "rotation": {"angle": -45, "axis": "y", "origin": [10.5, 11, 2.75]},
"faces": {
"north": {"uv": [10, 12, 12, 14], "rotation": 180, "texture": "#2"},
"east": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
@@ -32,27 +32,27 @@
}
},
{
- "from": [5.5, 3, 11],
- "to": [12.5, 7, 15],
- "rotation": {"angle": -45, "axis": "y", "origin": [9, 5, 13]},
+ "from": [3.6, 3, -0.75],
+ "to": [7.6, 7, 6.25],
+ "rotation": {"angle": 45, "axis": "y", "origin": [5.6, 5, 2.75]},
"faces": {
- "north": {"uv": [2, 9.5, 0, 13], "rotation": 270, "texture": "#2"},
- "east": {"uv": [10, 12, 12, 14], "rotation": 180, "texture": "#2"},
- "south": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
- "up": {"uv": [0, 9.5, 2, 13], "rotation": 90, "texture": "#2"},
- "down": {"uv": [0, 9.5, 2, 13], "rotation": 90, "texture": "#2"}
+ "north": {"uv": [2, 9.5, 4, 11.5], "rotation": 180, "texture": "#2"},
+ "east": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
+ "west": {"uv": [2, 9.5, 0, 13], "rotation": 270, "texture": "#2"},
+ "up": {"uv": [0, 9.5, 2, 13], "texture": "#2"},
+ "down": {"uv": [0, 9.5, 2, 13], "rotation": 180, "texture": "#2"}
}
},
{
- "from": [5.5, 9, 11],
- "to": [12.5, 13, 15],
- "rotation": {"angle": -45, "axis": "y", "origin": [9, 11, 13]},
+ "from": [3.6, 9, -0.75],
+ "to": [7.6, 13, 6.25],
+ "rotation": {"angle": 45, "axis": "y", "origin": [5.6, 11, 2.75]},
"faces": {
- "north": {"uv": [2, 9.5, 0, 13], "rotation": 270, "texture": "#2"},
- "east": {"uv": [2, 9.5, 4, 11.5], "rotation": 180, "texture": "#2"},
- "south": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
- "up": {"uv": [0, 9.5, 2, 13], "rotation": 90, "texture": "#2"},
- "down": {"uv": [0, 9.5, 2, 13], "rotation": 90, "texture": "#2"}
+ "north": {"uv": [10, 12, 12, 14], "rotation": 180, "texture": "#2"},
+ "east": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
+ "west": {"uv": [2, 9.5, 0, 13], "rotation": 270, "texture": "#2"},
+ "up": {"uv": [0, 9.5, 2, 13], "texture": "#2"},
+ "down": {"uv": [0, 9.5, 2, 13], "rotation": 180, "texture": "#2"}
}
},
{
diff --git a/src/main/resources/assets/createdieselgenerators/models/block/diesel_engine_vertical_on.json b/src/main/resources/assets/createdieselgenerators/models/block/diesel_engine_vertical_on.json
index 2dfd79c..ad9d52e 100644
--- a/src/main/resources/assets/createdieselgenerators/models/block/diesel_engine_vertical_on.json
+++ b/src/main/resources/assets/createdieselgenerators/models/block/diesel_engine_vertical_on.json
@@ -8,9 +8,20 @@
},
"elements": [
{
- "from": [7, 3, -0.5],
- "to": [11, 7, 6.5],
- "rotation": {"angle": -45, "axis": "y", "origin": [9, 5, 3]},
+ "from": [2, 4, 4],
+ "to": [14, 12, 12],
+ "rotation": {"angle": 0, "axis": "y", "origin": [13, 4, 4]},
+ "faces": {
+ "north": {"uv": [10, 7, 14, 10], "rotation": 90, "texture": "#2"},
+ "south": {"uv": [10, 7, 14, 10], "rotation": 90, "texture": "#2"},
+ "up": {"uv": [10, 7, 14, 10], "rotation": 90, "texture": "#2"},
+ "down": {"uv": [10, 7, 14, 10], "rotation": 90, "texture": "#2"}
+ }
+ },
+ {
+ "from": [8.5, 3, -0.75],
+ "to": [12.5, 7, 6.25],
+ "rotation": {"angle": -45, "axis": "y", "origin": [10.5, 5, 2.75]},
"faces": {
"north": {"uv": [2, 9.5, 4, 11.5], "rotation": 180, "texture": "#2"},
"east": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
@@ -20,9 +31,9 @@
}
},
{
- "from": [7, 9, -0.5],
- "to": [11, 13, 6.5],
- "rotation": {"angle": -45, "axis": "y", "origin": [9, 11, 3]},
+ "from": [8.5, 9, -0.75],
+ "to": [12.5, 13, 6.25],
+ "rotation": {"angle": -45, "axis": "y", "origin": [10.5, 11, 2.75]},
"faces": {
"north": {"uv": [10, 12, 12, 14], "rotation": 180, "texture": "#2"},
"east": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
@@ -32,27 +43,27 @@
}
},
{
- "from": [5.5, 3, 11],
- "to": [12.5, 7, 15],
- "rotation": {"angle": -45, "axis": "y", "origin": [9, 5, 13]},
+ "from": [3.6, 3, -0.75],
+ "to": [7.6, 7, 6.25],
+ "rotation": {"angle": 45, "axis": "y", "origin": [5.6, 5, 2.75]},
"faces": {
- "north": {"uv": [2, 9.5, 0, 13], "rotation": 270, "texture": "#2"},
- "east": {"uv": [10, 12, 12, 14], "rotation": 180, "texture": "#2"},
- "south": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
- "up": {"uv": [0, 9.5, 2, 13], "rotation": 90, "texture": "#2"},
- "down": {"uv": [0, 9.5, 2, 13], "rotation": 90, "texture": "#2"}
+ "north": {"uv": [2, 9.5, 4, 11.5], "rotation": 180, "texture": "#2"},
+ "east": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
+ "west": {"uv": [2, 9.5, 0, 13], "rotation": 270, "texture": "#2"},
+ "up": {"uv": [0, 9.5, 2, 13], "texture": "#2"},
+ "down": {"uv": [0, 9.5, 2, 13], "rotation": 180, "texture": "#2"}
}
},
{
- "from": [5.5, 9, 11],
- "to": [12.5, 13, 15],
- "rotation": {"angle": -45, "axis": "y", "origin": [9, 11, 13]},
+ "from": [3.6, 9, -0.75],
+ "to": [7.6, 13, 6.25],
+ "rotation": {"angle": 45, "axis": "y", "origin": [5.6, 11, 2.75]},
"faces": {
- "north": {"uv": [2, 9.5, 0, 13], "rotation": 270, "texture": "#2"},
- "east": {"uv": [2, 9.5, 4, 11.5], "rotation": 180, "texture": "#2"},
- "south": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
- "up": {"uv": [0, 9.5, 2, 13], "rotation": 90, "texture": "#2"},
- "down": {"uv": [0, 9.5, 2, 13], "rotation": 90, "texture": "#2"}
+ "north": {"uv": [10, 12, 12, 14], "rotation": 180, "texture": "#2"},
+ "east": {"uv": [2, 9.5, 0, 13], "rotation": 90, "texture": "#2"},
+ "west": {"uv": [2, 9.5, 0, 13], "rotation": 270, "texture": "#2"},
+ "up": {"uv": [0, 9.5, 2, 13], "texture": "#2"},
+ "down": {"uv": [0, 9.5, 2, 13], "rotation": 180, "texture": "#2"}
}
},
{
@@ -140,17 +151,6 @@
"up": {"uv": [12, 2.5, 13, 7.5], "texture": "#1"},
"down": {"uv": [12, 2.5, 13, 7.5], "texture": "#1"}
}
- },
- {
- "from": [2, 4, 4],
- "to": [14, 12, 12],
- "rotation": {"angle": 0, "axis": "y", "origin": [13, 4, 4]},
- "faces": {
- "north": {"uv": [10, 7, 14, 10], "rotation": 90, "texture": "#2"},
- "south": {"uv": [10, 7, 14, 10], "rotation": 90, "texture": "#2"},
- "up": {"uv": [10, 7, 14, 10], "rotation": 90, "texture": "#2"},
- "down": {"uv": [10, 7, 14, 10], "rotation": 90, "texture": "#2"}
- }
}
],
"display": {
diff --git a/src/main/resources/assets/createdieselgenerators/models/block/large_diesel_engine.json b/src/main/resources/assets/createdieselgenerators/models/block/large_diesel_engine.json
index 6f8cab4..1c6da58 100644
--- a/src/main/resources/assets/createdieselgenerators/models/block/large_diesel_engine.json
+++ b/src/main/resources/assets/createdieselgenerators/models/block/large_diesel_engine.json
@@ -39,7 +39,7 @@
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 6, 8, 8], "texture": "#3"},
- "east": {"uv": [0, 0, 8, 2], "texture": "#3"},
+ "east": {"uv": [8, 0, 0, 2], "texture": "#3"},
"south": {"uv": [0, 6, 8, 8], "texture": "#3"},
"west": {"uv": [0, 0, 8, 2], "texture": "#3"},
"up": {"uv": [8, 0, 16, 8], "rotation": 180, "texture": "#3"},
@@ -52,7 +52,7 @@
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [6, 8, 4, 12], "texture": "#3"},
- "east": {"uv": [0, 2, 8, 6], "texture": "#3"},
+ "east": {"uv": [8, 2, 0, 6], "texture": "#3"},
"south": {"uv": [4, 8, 6, 12], "texture": "#3"},
"west": {"uv": [7, 10, 15, 14], "texture": "#3"},
"up": {"uv": [0, 0, 2, 8], "rotation": 180, "texture": "#3"},
diff --git a/src/main/resources/assets/createdieselgenerators/models/block/large_diesel_engine_pipe.json b/src/main/resources/assets/createdieselgenerators/models/block/large_diesel_engine_pipe.json
index 27e1a98..65703cc 100644
--- a/src/main/resources/assets/createdieselgenerators/models/block/large_diesel_engine_pipe.json
+++ b/src/main/resources/assets/createdieselgenerators/models/block/large_diesel_engine_pipe.json
@@ -39,7 +39,7 @@
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 6, 8, 8], "texture": "#3"},
- "east": {"uv": [0, 0, 8, 2], "texture": "#3"},
+ "east": {"uv": [8, 0, 0, 2], "texture": "#3"},
"south": {"uv": [0, 6, 8, 8], "texture": "#3"},
"west": {"uv": [0, 0, 8, 2], "texture": "#3"},
"up": {"uv": [8, 0, 16, 8], "rotation": 180, "texture": "#3"},
@@ -52,7 +52,7 @@
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [6, 8, 4, 12], "texture": "#3"},
- "east": {"uv": [0, 2, 8, 6], "texture": "#3"},
+ "east": {"uv": [8, 2, 0, 6], "texture": "#3"},
"south": {"uv": [4, 8, 6, 12], "texture": "#3"},
"west": {"uv": [7, 10, 15, 14], "texture": "#3"},
"up": {"uv": [0, 0, 2, 8], "rotation": 180, "texture": "#3"},
diff --git a/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine.png b/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine.png
index abf48ec..aa275d2 100644
Binary files a/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine.png and b/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine.png differ
diff --git a/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_big.png b/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_big.png
index 3a38d45..30683b0 100644
Binary files a/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_big.png and b/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_big.png differ
diff --git a/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_big_pipe.png b/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_big_pipe.png
index 600c8ea..e609adf 100644
Binary files a/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_big_pipe.png and b/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_big_pipe.png differ
diff --git a/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_on.png b/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_on.png
index fcc4bae..bc3953d 100644
Binary files a/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_on.png and b/src/main/resources/assets/createdieselgenerators/textures/block/diesel_engine_on.png differ
diff --git a/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/apple.json b/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/apple.json
index 1d491d8..c5185d4 100644
--- a/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/apple.json
+++ b/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/apple.json
@@ -3,9 +3,12 @@
"ingredients": [
{
"item": "minecraft:apple"
+ },
+ {
+ "item": "minecraft:bone_meal"
}
],
- "processingTime": 180,
+ "processingTime": 400,
"results": [
{
"fluid": "createdieselgenerators:ethanol",
diff --git a/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/potato.json b/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/potato.json
index 8cbeddf..61bc9f4 100644
--- a/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/potato.json
+++ b/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/potato.json
@@ -3,9 +3,12 @@
"ingredients": [
{
"item": "minecraft:potato"
+ },
+ {
+ "item": "minecraft:bone_meal"
}
],
- "processingTime": 180,
+ "processingTime": 400,
"results": [
{
"fluid": "createdieselgenerators:ethanol",
diff --git a/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/sugar.json b/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/sugar.json
index f491435..cf0c4df 100644
--- a/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/sugar.json
+++ b/src/main/resources/data/createdieselgenerators/recipes/basin_fermenting/sugar.json
@@ -3,9 +3,12 @@
"ingredients": [
{
"item": "minecraft:sugar"
+ },
+ {
+ "item": "minecraft:bone_meal"
}
],
- "processingTime": 180,
+ "processingTime": 400,
"results": [
{
"fluid": "createdieselgenerators:ethanol",
diff --git a/src/main/resources/data/createdieselgenerators/recipes/crafting/diesel_engine.json b/src/main/resources/data/createdieselgenerators/recipes/mechanical_crafting/diesel_engine.json
similarity index 73%
rename from src/main/resources/data/createdieselgenerators/recipes/crafting/diesel_engine.json
rename to src/main/resources/data/createdieselgenerators/recipes/mechanical_crafting/diesel_engine.json
index 68a4960..b87d44e 100644
--- a/src/main/resources/data/createdieselgenerators/recipes/crafting/diesel_engine.json
+++ b/src/main/resources/data/createdieselgenerators/recipes/mechanical_crafting/diesel_engine.json
@@ -1,8 +1,9 @@
{
- "type": "minecraft:crafting_shaped",
+ "type": "create:mechanical_crafting",
"pattern": [
"#Q#",
"#G#",
+ "BFB",
"OSO"
],
"key": {
@@ -15,11 +16,17 @@
"G": {
"item": "create:brass_block"
},
+ "B": {
+ "tag": "forge:plates/brass"
+ },
"O": {
"item": "create:sturdy_sheet"
},
"S": {
"item": "create:fluid_pipe"
+ },
+ "F": {
+ "item": "create:fluid_tank"
}
},
"result": {
diff --git a/src/main/resources/data/createdieselgenerators/recipes/crafting/large_diesel_engine.json b/src/main/resources/data/createdieselgenerators/recipes/mechanical_crafting/large_diesel_engine.json
similarity index 92%
rename from src/main/resources/data/createdieselgenerators/recipes/crafting/large_diesel_engine.json
rename to src/main/resources/data/createdieselgenerators/recipes/mechanical_crafting/large_diesel_engine.json
index c252fdb..b8fe1fc 100644
--- a/src/main/resources/data/createdieselgenerators/recipes/crafting/large_diesel_engine.json
+++ b/src/main/resources/data/createdieselgenerators/recipes/mechanical_crafting/large_diesel_engine.json
@@ -1,5 +1,5 @@
{
- "type": "minecraft:crafting_shaped",
+ "type": "create:mechanical_crafting",
"pattern": [
"#Q#",
"SGS",
diff --git a/src/main/resources/data/createdieselgenerators/recipes/mixing/biodiesel.json b/src/main/resources/data/createdieselgenerators/recipes/mixing/biodiesel.json
index a9c33c4..65ed3d9 100644
--- a/src/main/resources/data/createdieselgenerators/recipes/mixing/biodiesel.json
+++ b/src/main/resources/data/createdieselgenerators/recipes/mixing/biodiesel.json
@@ -6,7 +6,7 @@
"amount": 100
},
{
- "fluid": "createdieselgenerators:ethanol",
+ "fluidTag": "forge:ethanol",
"amount": 100
}
],
diff --git a/src/main/resources/data/forge/tags/fluids/biodiesel.json b/src/main/resources/data/forge/tags/fluids/biodiesel.json
new file mode 100644
index 0000000..e6895e9
--- /dev/null
+++ b/src/main/resources/data/forge/tags/fluids/biodiesel.json
@@ -0,0 +1,6 @@
+{
+ "replace": false,
+ "values": [
+ "createdieselgenerators:biodiesel"
+ ]
+}
\ No newline at end of file