This commit is contained in:
DrMangoTea
2025-06-02 19:59:00 +02:00
parent 6bdf086df0
commit 68b21429f1
77 changed files with 23730 additions and 21072 deletions

View File

@@ -359,12 +359,7 @@ public class TFMGUtils {
pMatrixStack.popPose();
}
public static void debugMessage(Level level,String message){
if(level.isClientSide){
TFMG.LOGGER.debug("Client "+message);
} else
TFMG.LOGGER.debug("Server "+message);
}
private static void addVertexPair(VertexConsumer vertexConsumer, Matrix4f matrix4f, float p_174310_, float p_174311_, float p_174312_, int light_1, int light_2, int p_174315_, int p_174316_, float thickness, float p_174318_, float p_174319_, float p_174320_, int value, boolean p_174322_, float curve, float r, float g, float b) {
float f = (float) (value / 24.0F);

View File

@@ -18,14 +18,6 @@ import net.minecraftforge.fml.common.Mod;
public class TFMGCommonEvents {
//@SubscribeEvent
//public static void playerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) {
// Player player = event.getEntity();
// TFMG.DEPOSITS.playerLogin(player);
// TFMG.LOGGER.debug("PLAYER LOG");
//}
@SubscribeEvent
public static void onUnloadWorld(LevelEvent.Unload event) {
@@ -40,7 +32,6 @@ public class TFMGCommonEvents {
LevelAccessor world = event.getLevel();
TFMG.NETWORK_MANAGER.onLoadWorld(world);
TFMG.DEPOSITS.levelLoaded(world);
TFMG.LOGGER.debug("WORLD LOAD");
}
@SubscribeEvent

View File

@@ -159,9 +159,7 @@ public class ElectricBlockEntity extends SmartBlockEntity implements IElectric,
@Override
public void setVoltage(int newVoltage) {
//if(this instanceof LightBulbBlockEntity be&&be.color == DyeColor.WHITE){
// TFMG.LOGGER.debug("Rezistancja Grup "+data.group.resistance);
//}
if (canBeInGroups()) {
data.voltage = (int) (((float) resistance() / data.group.resistance) * (float) data.voltageSupply);

View File

@@ -206,7 +206,6 @@ public interface IElectric {
for (Direction direction : Direction.values()) {
if (member.getLevelAccessor().getBlockEntity(BlockPos.of(member.getPos()).relative(direction)) instanceof IElectric be && be.getData().getId() != member.getData().getId()) {
TFMG.LOGGER.debug("SIGMA");
be.getLevelAccessor().setBlock(BlockPos.of(be.getPos()).above(3), Blocks.GOLD_BLOCK.defaultBlockState(), 3);
be.updateNextTick();
}

View File

@@ -7,11 +7,9 @@ import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
import com.simibubi.create.api.equipment.goggles.IHaveHoveringInformation;
import com.simibubi.create.content.kinetics.base.GeneratingKineticBlockEntity;
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
import com.simibubi.create.foundation.utility.CreateLang;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
@@ -37,7 +35,6 @@ public class KineticElectricBlockEntity extends GeneratingKineticBlockEntity imp
}
@Override
public void addBehaviours(List<BlockEntityBehaviour> behaviours) {
}
@@ -70,7 +67,7 @@ public class KineticElectricBlockEntity extends GeneratingKineticBlockEntity imp
this.blockFail();
data.failTimer = 0;
sendStuff();
} else if ((data.voltage > getMaxVoltage() && getMaxVoltage() > 0) || (getCurrent() > getMaxCurrent()&&getMaxCurrent()>0)) {
} else if ((data.voltage > getMaxVoltage() && getMaxVoltage() > 0) || (getCurrent() > getMaxCurrent() && getMaxCurrent() > 0)) {
data.failTimer++;
}
}
@@ -81,8 +78,6 @@ public class KineticElectricBlockEntity extends GeneratingKineticBlockEntity imp
}
@Override
public float resistance() {
return 0;
@@ -113,7 +108,6 @@ public class KineticElectricBlockEntity extends GeneratingKineticBlockEntity imp
}
@Override
public int powerGeneration() {
@@ -122,15 +116,15 @@ public class KineticElectricBlockEntity extends GeneratingKineticBlockEntity imp
for (Direction direction : Direction.values()) {
if (hasElectricitySlot(direction)) {
if (level.getBlockEntity(getBlockPos().relative(direction)) instanceof VoltageAlteringBlockEntity be&&be.canWork()) {
if (level.getBlockEntity(getBlockPos().relative(direction)) instanceof VoltageAlteringBlockEntity be && be.canWork()) {
if (be.getData().getId() != getData().getId())
if (be.getData().getVoltage() != 0)
if (be.hasElectricitySlot(direction)) {
powerGeneration = Math.max(powerGeneration, be.getPowerUsage()) + 1;
if(powerGeneration>be.getNetworkPowerGeneration()) {
if (powerGeneration > be.getNetworkPowerGeneration()) {
powerGeneration = 0;
be.data.updatePowerNextTick=true;
be.data.updatePowerNextTick = true;
}
}
}
@@ -166,9 +160,6 @@ public class KineticElectricBlockEntity extends GeneratingKineticBlockEntity imp
@Override
public void setVoltage(int newVoltage) {
//if(this instanceof LightBulbBlockEntity be&&be.color == DyeColor.WHITE){
// TFMG.LOGGER.debug("Rezistancja Grup "+data.group.resistance);
//}
if (canBeInGroups()) {
data.voltage = (int) (((float) resistance() / data.group.resistance) * (float) data.voltageSupply);
@@ -283,13 +274,13 @@ public class KineticElectricBlockEntity extends GeneratingKineticBlockEntity imp
public void onSpeedChanged(float previousSpeed) {
super.onSpeedChanged(previousSpeed);
if(this instanceof RegularEngineBlockEntity)
// TFMG.LOGGER.debug("SPEEED CHANGED "+getBlockPos().getX()+" "+getBlockPos().getY()+" "+getBlockPos().getZ());
notifyNetworkAboutSpeedChange();
if (this instanceof RegularEngineBlockEntity)
notifyNetworkAboutSpeedChange();
timer = 0;
}
public void notifyNetworkAboutSpeedChange(){
public void notifyNetworkAboutSpeedChange() {
updateNextTick();
}
}

View File

@@ -50,7 +50,6 @@ public class ElectriciansWrenchPacket extends SimplePacketBase {
public void applyGroup(ItemStack stack){
TFMG.LOGGER.debug("Packet Mogus "+group);
stack.getOrCreateTag().putInt("Number", group);
}

View File

@@ -150,17 +150,13 @@ public class CableConnectorBlockEntity extends ElectricBlockEntity implements IH
if(connection.blockPos1 == getBlockPos())
TFMGUtils.debugMessage(level, "PRIMARY IS SUS");
if(pos ==getBlockPos()){
TFMG.LOGGER.debug("WHAT THE SIGMA");
continue;
}
// TFMGUtils.debugMessage(level, "Eﴤ "+connections.size());
if(level.getBlockEntity(pos) instanceof CableConnectorBlockEntity bee&&bee.getBlockPos() == getBlockPos())
TFMGUtils.debugMessage(level, "SUSSY BEHAVIOUR");
if(level.getBlockEntity(pos) instanceof CableConnectorBlockEntity be&&!foundList.contains(be)){
// TFMGUtils.debugMessage(level, "Bﴤ "+connections.size());

View File

@@ -49,149 +49,8 @@ public class DebugCinderBlockItem extends Item {
BlockPos pos = context.getClickedPos();
Level level = context.getLevel();
if (level.getBlockEntity(pos) instanceof VatBlockEntity be) {
if (!level.isClientSide)
return InteractionResult.SUCCESS;
TFMG.LOGGER.debug("////////////////////////////////////////");
for (int i = 0; i < 8; i++) {
TFMG.LOGGER.debug("fluid " + i + ": " + be.fluidLevel[i].getValue());
}
TFMG.LOGGER.debug("////////////////////////////////////////");
return InteractionResult.SUCCESS;
}
if (level.getBlockEntity(pos) instanceof EngineControllerBlockEntity be) {
if (context.getPlayer().isCrouching()) {
context.getPlayer().getPersistentData().remove("IsUsingEngineController");
} else {
TFMG.LOGGER.debug(be.shift.name());
TFMGUtils.debugMessage(level, "ENGINE "+(be.engine!=null));
}
return InteractionResult.SUCCESS;
}
if (level.getBlockEntity(pos) instanceof LargeEngineBlockEntity be) {
be.airTank.fill(new FluidStack(TFMGFluids.AIR.getSource(),200), IFluidHandler.FluidAction.EXECUTE);
return InteractionResult.SUCCESS;
}
if (level.getBlockEntity(pos) instanceof ConcreteHoseBlockEntity be) {
be.filler.reset();
return InteractionResult.SUCCESS;
}
// if (level.getBlockEntity(pos) instanceof CableConnectorBlockEntity be) {
// if (context.getPlayer().isShiftKeyDown()) {
// TFMG.LOGGER.debug("///////////////////////////////");
// for (CableConnection connection : be.connections) {
// TFMG.LOGGER.debug("Primary Pos " + connection.blockPos1.getX() + " " + connection.blockPos1.getY() + " " + connection.blockPos1.getZ());
// }
// TFMG.LOGGER.debug("///////////////////////////////");
// return InteractionResult.SUCCESS;
// }
// TFMG.LOGGER.debug("///////////////////////////////");
// TFMG.LOGGER.debug("Connector Count " + be.getConnectedWires().size());
// TFMG.LOGGER.debug("Wire Count " + be.connections.size());
// TFMG.LOGGER.debug("Member Count " + be.getOrCreateElectricNetwork().members.size());
// TFMG.LOGGER.debug("Id " + "X " + BlockPos.of(be.getData().electricalNetworkId).getX() + " Y " + BlockPos.of(be.getData().electricalNetworkId).getY() + " Z " + BlockPos.of(be.getData().electricalNetworkId).getZ());
// TFMG.LOGGER.debug("///////////////////////////////");
// return InteractionResult.SUCCESS;
// }
if (level.getBlockEntity(pos) instanceof IElectric be) {
// be.onPlaced();
if (context.getPlayer().isShiftKeyDown()) {
TFMG.LOGGER.debug("///////////////////////////////");
TFMG.LOGGER.debug("Group Resistance " + be.getData().group.resistance);
TFMG.LOGGER.debug("Resistance " + be.resistance());
TFMG.LOGGER.debug("Voltage Supply " + be.getData().voltageSupply);
TFMG.LOGGER.debug("Higherst Current " + be.getData().highestCurrent);
TFMG.LOGGER.debug("Group " + be.getData().group.id);
TFMG.LOGGER.debug("///////////////////////////////");
for(IElectric member : be.getOrCreateElectricNetwork().members){
level.setBlock(BlockPos.of(member.getPos()).above(3), Blocks.GOLD_BLOCK.defaultBlockState(),3);
}
} else {
be.updateNextTick();
// be.getOrCreateElectricNetwork().checkForLoops(BlockPos.of(be.getPos()));
TFMGUtils.debugMessage(level, "Power " + be.getNetworkPowerUsage());
TFMGUtils.debugMessage(level, "Voltage " + be.getData().getVoltage());
}
;
}
if (level.getBlockEntity(pos) instanceof CokeOvenBlockEntity be) {
be.controller = be.getBlockPos();
}
if (level.getBlockEntity(pos) instanceof BlastStoveBlockEntity be) {
be.notifyMultiUpdated();
}
if (level.getBlockEntity(pos) instanceof VatBlockEntity be) {
be.evaluate();
}
if (level.getBlockEntity(pos) instanceof FluidTankBlockEntity be) {
TFMGUtils.blowUpTank(be, 5);
}
if (level.getBlockEntity(pos) instanceof MechanicalMixerBlockEntity be) {
TFMG.LOGGER.debug("Reservoir Count " + TFMG.DEPOSITS.list.size());
if (context.getPlayer().isCrouching()) {
TFMG.DEPOSITS.list = new ArrayList<>();
TFMG.DEPOSITS.markDirty();
} else {
// TFMG.DEPOSITS.list.add(new FluidReservoir(758441445444L));
// TFMG.DEPOSITS.markDirty();
if (!TFMG.DEPOSITS.list.isEmpty()) {
FluidReservoir reservoir = TFMG.DEPOSITS.list.get(0);
TFMG.LOGGER.debug("////////////////////");
for (long deposit : reservoir.deposits)
TFMG.LOGGER.debug("Deposit " + deposit);
TFMG.LOGGER.debug("Size " + reservoir.oilReserves);
TFMG.LOGGER.debug("ID " + reservoir.id);
TFMG.LOGGER.debug("////////////////////");
}
}
}
if (level.getBlockEntity(pos) instanceof AbstractSmallEngineBlockEntity be) {
//be.getControllerBE().highestSignal=0;
//be.getControllerBE().rpm = 0;
//be.getControllerBE().engineController = null;
//be.getControllerBE().updateGeneratedRotation();
be.setSpeed(0);
TFMGUtils.debugMessage(level, "SPEED "+be.getGeneratedSpeed());
TFMGUtils.debugMessage(level, "SPEED "+be.getControllerBE().getGeneratedSpeed());
//TFMGUtils.debugMessage(level, "RPM "+be.rpm);
//TFMGUtils.debugMessage(level, "RPM "+be.getControllerBE().rpm);
//TFMGUtils.debugMessage(level, "SIGNAL "+be.getControllerBE().signal);
//TFMGUtils.debugMessage(level, "HSIGNAL "+be.getControllerBE().highestSignal);
//TFMGUtils.debugMessage(level, "RATE "+be.getControllerBE().fuelInjectionRate);
//TFMGUtils.debugMessage(level, "RATE "+be.fuelInjectionRate);
}
if (level.getBlockEntity(pos) instanceof CastingBasinBlockEntity be) {
be.findRecipe();
}
if (level.getBlockEntity(pos) instanceof SurfaceScannerBlockEntity be) {
be.findDeposits();
}
if (level.getBlockEntity(pos) instanceof PumpjackBaseBlockEntity be) {
if (!context.getPlayer().isCrouching()) {
be.process();
} else {
if (context.getPlayer().getServer() != null)
TFMG.DEPOSITS.levelLoaded(context.getPlayer().level());
}
}
return InteractionResult.SUCCESS;
return InteractionResult.PASS;
}
}

View File

@@ -73,8 +73,6 @@ public class GeneratorBlockEntity extends KineticElectricBlockEntity {
public int generation() {
float modifier = TFMGConfigs.common().machines.generatorModifier.getF();
float maxSpeed = TFMGConfigs.common().machines.generatorMinSpeed.getF();
if(!level.isClientSide)
TFMG.LOGGER.debug("GENERATION: "+(int) Math.max(0,((Math.abs(getSpeed())-maxSpeed)* modifier)));
return (int) Math.max(0,((Math.abs(getSpeed())-maxSpeed)* modifier));
}

View File

@@ -70,6 +70,7 @@ public class RotorBlockEntity extends KineticElectricBlockEntity {
public void onPlaced() {
super.onPlaced();
findStators();
updateNextTick();
}
@Override

View File

@@ -64,7 +64,6 @@ public class NeonTubeBlock extends PipeBlock implements IBE<NeonTubeBlockEntity>
Direction facing = context.getClickedFace();
Vec3 position = context.getClickLocation();
TFMG.LOGGER.debug("X "+(position.x()-pos.getX())+" Y "+(position.y()-pos.getY())+" Z "+(position.z()-pos.getZ()));
SimplePos clickPosition = new SimplePos(position.x()-pos.getX(),position.y()-pos.getY(),position.z()-pos.getZ());
Direction dirToToggle = Direction.NORTH;
@@ -135,10 +134,8 @@ public class NeonTubeBlock extends PipeBlock implements IBE<NeonTubeBlockEntity>
if(!p_60569_.is(TFMGBlocks.NEON_TUBE.get()))
for(Direction facing : Direction.values()) {
BlockState neighbourState = level.getBlockState(pos.relative(facing));
TFMG.LOGGER.debug("A");
if (neighbourState.is(TFMGBlocks.NEON_TUBE.get())) {
level.setBlockAndUpdate(pos.relative(facing), neighbourState.setValue(PipeBlock.PROPERTY_BY_DIRECTION.get(facing.getOpposite()), true));
TFMG.LOGGER.debug("B");
}
}
withBlockEntityDo(level,pos, IElectric::onPlaced);

View File

@@ -52,18 +52,16 @@ public class MultimeterOverlayRenderer {
public static void renderOverlay(ForgeGui gui, GuiGraphics graphics, float partialTicks, int width,
int height) {
TFMG.LOGGER.debug("GGGGGGGGGGGGGGGGGGGGGGGGGGG");
Minecraft mc = Minecraft.getInstance();
if (mc.options.hideGui || mc.gameMode.getPlayerMode() == GameType.SPECTATOR)
return;
TFMG.LOGGER.debug("CCCCCCCCCCCCCCCCCCCCCC");
HitResult objectMouseOver = mc.hitResult;
if (!(objectMouseOver instanceof BlockHitResult result)) {
lastHovered = null;
hoverTicks = 0;
return;
}
TFMG.LOGGER.debug("DDDDDDDDDDDDDDDDDDDDDDDDDDD");
for (OutlineEntry entry : outlines.values()) {
if (!entry.isAlive())
continue;
@@ -71,7 +69,7 @@ public class MultimeterOverlayRenderer {
if (outline instanceof ValueBox && !((ValueBox) outline).isPassive)
return;
}
TFMG.LOGGER.debug("EEEEEEEEEEEEEEEEEEEE");
ClientLevel world = mc.level;
BlockPos pos = result.getBlockPos();
@@ -87,10 +85,8 @@ public class MultimeterOverlayRenderer {
boolean isShifting = mc.player.isShiftKeyDown();
boolean isElectricBlock = be instanceof IElectric;
TFMG.LOGGER.debug("AAAAAAAAAAAAAAAAAAAAAAAAA");
if(!isElectricBlock)
return;
TFMG.LOGGER.debug("BBBBBBBBBBBBBBBBBBBBBBBBBB");

View File

@@ -46,7 +46,7 @@ public class VoltMeterBlock extends TFMGHorizontalDirectionalBlock implements IB
for(VoltMeterBlockEntity.MeasureMode mode : VoltMeterBlockEntity.MeasureMode.values()){
if(mode == VoltMeterBlockEntity.MeasureMode.POWER){
if(mode == VoltMeterBlockEntity.MeasureMode.FALLBACK){
be.mode = VoltMeterBlockEntity.MeasureMode.VOLTAGE;
break;
}

View File

@@ -3,6 +3,7 @@ package com.drmangotea.tfmg.content.electricity.measurement;
import com.drmangotea.tfmg.TFMG;
import com.drmangotea.tfmg.base.TFMGUtils;
import com.drmangotea.tfmg.content.electricity.base.IElectric;
import com.drmangotea.tfmg.content.electricity.storage.AccumulatorBlockEntity;
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
@@ -51,9 +52,6 @@ public class VoltMeterBlockEntity extends SmartBlockEntity implements IHaveGoggl
BlockEntity beBehind = level.getBlockEntity(getBlockPos().relative(getBlockState().getValue(FACING).getOpposite()));
if (beBehind instanceof IElectric be) {
// TFMG.LOGGER.debug("A "+ ElectricalNetwork.getCableCurrent(be));
// TFMG.LOGGER.debug("id group "+be.getData().group.id);
// TFMG.LOGGER.debug("resistance group "+be.getData().group.resistance);
value = Math.min(getUnit(be), mode.defaultRange);
} else value = 0;
@@ -66,6 +64,11 @@ public class VoltMeterBlockEntity extends SmartBlockEntity implements IHaveGoggl
case CURRENT -> be.getCurrent();
case RESISTANCE -> be.resistance();
case POWER -> be.powerGeneration() > 0 ? be.powerGeneration() : be.getPowerUsage();
case NETWORK_POWER_USAGE -> be.getNetworkPowerUsage();
case NETWORK_POWER_GENERATION -> be.getNetworkPowerGeneration();
case CAPACITY -> be instanceof AccumulatorBlockEntity accumulator ? level.getBlockEntity(accumulator.controller) instanceof AccumulatorBlockEntity controllerBE ? controllerBE.energy.getEnergyStored() :0 :0;
case FALLBACK -> 0;
};
}
@@ -119,7 +122,11 @@ public class VoltMeterBlockEntity extends SmartBlockEntity implements IHaveGoggl
CURRENT("Current", "A", 16),
RESISTANCE("Resistance", "Ω", 500),
// HIGH_RESISTANCE("Resistance (High)", "Ω", 500),
POWER("Power", "A", 5000),
POWER("Power", "W", 5000),
NETWORK_POWER_USAGE("Network Power Usage", "W", 50000),
NETWORK_POWER_GENERATION("Network Power Generation", "W", 50000),
CAPACITY("Capacity", "Fe", 300000),
FALLBACK("fallback", "", 0),
;

View File

@@ -105,7 +105,7 @@ public class ElectricMotorBlockEntity extends KineticElectricBlockEntity {
if(speed==0){
return testSpeed;
}
// TFMG.LOGGER.debug("SPEED: "+speed+" "+generatedSpeed.getValue()+" "+data.getVoltage()/2);
testSpeed = 0;
return speed;

View File

@@ -147,9 +147,7 @@ public class FuseBlockEntity extends ElectricDiodeBlockEntity {
Direction facing = getBlockState().getValue(FACING).getCounterClockWise();
if (level.getBlockEntity(getBlockPos().relative(facing)) instanceof IElectric be) {
TFMG.LOGGER.debug("AMPS " + be.getData().highestCurrent);
}
}

View File

@@ -35,7 +35,6 @@ public class ResistorBlockEntity extends ElectricBlockEntity {
}
public void setResistance(ItemStack stack){
TFMG.LOGGER.debug("Resistohr "+stack.getOrCreateTag().getInt("Resistance"));
this.resistance = stack.getOrCreateTag().getInt("Resistance");
}

View File

@@ -103,7 +103,6 @@ public abstract class AbstractEngineBlockEntity extends KineticElectricBlockEnti
@Override
public void updateNetwork() {
//TFMG.LOGGER.debug("UPDATE ENGINE NETWORK");
super.updateNetwork();
}

View File

@@ -391,7 +391,6 @@ public class EngineControllerBlockEntity extends SmartBlockEntity implements IHa
if (level.isClientSide)
return InteractionResult.SUCCESS;
TFMG.LOGGER.debug("OPEN SCREEN");
NetworkHooks.openScreen((ServerPlayer) player, this, worldPosition);
return InteractionResult.SUCCESS;
}

View File

@@ -39,7 +39,6 @@ public class EngineControllerClientHandler {
selectedLocation = location;
} else {
MODE = Mode.IDLE;
TFMG.LOGGER.debug("TOGGLE BIND MODE");
onReset();
}
}
@@ -50,7 +49,6 @@ public class EngineControllerClientHandler {
controllerPos = null;
} else {
MODE = Mode.IDLE;
TFMG.LOGGER.debug("TOGGLE");
onReset();
}
}
@@ -65,7 +63,6 @@ public class EngineControllerClientHandler {
public static void deactivateInLectern() {
if (MODE == Mode.ACTIVE && isController()) {
MODE = Mode.IDLE;
TFMG.LOGGER.debug("DEACTIVATE");
onReset();
}
}
@@ -79,7 +76,6 @@ public class EngineControllerClientHandler {
.forEach(kb -> kb.setDown(ControlsUtil.isActuallyPressed(kb)));
packetCooldown = 0;
selectedLocation = BlockPos.ZERO;
TFMG.LOGGER.debug("OnReset");
if (isController())
TFMGPackets.getChannel().sendToServer(new EngineControllerStopControllerPacket(controllerPos));
controllerPos = null;
@@ -105,7 +101,6 @@ public class EngineControllerClientHandler {
if (player.isSpectator()) {
MODE = Mode.IDLE;
TFMG.LOGGER.debug("SPEKTATOR");
onReset();
return;
}
@@ -130,7 +125,6 @@ public class EngineControllerClientHandler {
if (mc.screen != null) {
MODE = Mode.IDLE;
TFMG.LOGGER.debug("NO SCREEN");
onReset();
return;
}
@@ -138,7 +132,6 @@ public class EngineControllerClientHandler {
if (InputConstants.isKeyDown(mc.getWindow()
.getWindow(), GLFW.GLFW_KEY_ESCAPE)) {
MODE = Mode.IDLE;
TFMG.LOGGER.debug("ESCAPE");
onReset();
return;
}
@@ -187,7 +180,6 @@ public class EngineControllerClientHandler {
}
}
if(newKeys.contains(8)){
TFMG.LOGGER.debug("BBBBBBBBBBBBBBBBBBBBBB");
TFMGPackets.getChannel().sendToServer(new EngineStartPacket(controllerPos));
if(player.level().getBlockEntity(controllerPos) instanceof EngineControllerBlockEntity be){
be.toggleEngine();

View File

@@ -121,7 +121,7 @@ public abstract class AbstractSmallEngineBlockEntity extends AbstractEngineBlock
public int voltageGeneration() {
if (upgrade.isPresent() && upgrade.get().getItem() == TFMGBlocks.GENERATOR.asItem())
return (int) (20 * (rpm / 3000));
return (int) (20 * (rpm / 500));
return 0;
}
@@ -597,7 +597,6 @@ public abstract class AbstractSmallEngineBlockEntity extends AbstractEngineBlock
be.connect();
return;
}
TFMG.LOGGER.debug("CONNECT");
engines = new ArrayList<>();
@@ -621,7 +620,6 @@ public abstract class AbstractSmallEngineBlockEntity extends AbstractEngineBlock
// level.setBlock(be.getBlockPos().above(), Blocks.GOLD_BLOCK.defaultBlockState(),3);
be.engineNumber = i;
TFMG.LOGGER.debug("ADD " + be.engineNumber);
be.engines = new ArrayList<>();
be.controller = getBlockPos();
be.refreshCapability();
@@ -641,7 +639,6 @@ public abstract class AbstractSmallEngineBlockEntity extends AbstractEngineBlock
} else {
TFMG.LOGGER.debug("END");
setBlockStates(this, getBlockPos().relative(updateDirection, i - 1));
return;
}

View File

@@ -151,7 +151,6 @@ public class RegularEngineBlockEntity extends AbstractSmallEngineBlockEntity {
if (itemStack.is(AllItems.EMPTY_SCHEMATIC.get())) {
boolean next = false;
TFMG.LOGGER.debug("INSERT");
if (type == EngineType.BOXER) {
if (level.getBlockEntity(controller) instanceof RegularEngineBlockEntity be)
be.updateEngineType(EngineType.I);

View File

@@ -159,8 +159,6 @@ public class ConcreteFillingBehavior extends TFMGFluidManipulationBehaviour {
boolean success = false;
TFMG.LOGGER.debug("queueweueue "+queue.size());
for (int i = 0; !success && !queue.isEmpty() && i < searchedPerTick; i++) {
BlockPosEntry entry = queue.first();
BlockPos currentPos = entry.pos();

View File

@@ -0,0 +1,45 @@
package com.drmangotea.tfmg.content.machinery.oil_processing;
import com.drmangotea.tfmg.TFMG;
import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.simibubi.create.foundation.utility.CreateLang;
import net.minecraft.ChatFormatting;
import net.minecraft.core.BlockPos;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
public class OilHammerItem extends Item {
public OilHammerItem(Properties p_41383_) {
super(p_41383_);
}
@Override
public InteractionResult useOn(UseOnContext context) {
Level level = context.getLevel();
BlockPos pos = context.getClickedPos();
Player player = context.getPlayer();
for(int i = 0;i<300;i++){
BlockPos posToCheck = pos.below(i);
if(level.getBlockState(posToCheck).is(TFMGBlocks.OIL_DEPOSIT.get())){
if(TFMG.DEPOSITS.getReservoirFor(posToCheck.asLong())==null)
return InteractionResult.SUCCESS;
int oilReserves = TFMG.DEPOSITS.getReservoirFor(posToCheck.asLong()).oilReserves;
if (level.isClientSide&&player!=null)
player.displayClientMessage(CreateLang.translateDirect("oil_hammer.reserves", oilReserves)
.withStyle(ChatFormatting.YELLOW), true);
return InteractionResult.SUCCESS;
}
}
return InteractionResult.SUCCESS;
}
}

View File

@@ -20,7 +20,6 @@ public class TestSavedData extends SavedData {
FluidReservoir reservoir = manager.list.get(i);
CompoundTag reservoirNBT = new CompoundTag();
reservoirNBT.putLong("Id", reservoir.id);
TFMG.LOGGER.debug("SAVED "+reservoir.oilReserves);
reservoirNBT.putInt("Reserves", reservoir.oilReserves);
//reservoirNBT.putLongArray("Deposits", reservoir.deposits);
reservoirNBT.putInt("DepositCount", reservoir.deposits.size());
@@ -54,7 +53,7 @@ public class TestSavedData extends SavedData {
for (int j = 0; j < compound.getInt("DepositCount"); j++) {
reservoir.deposits.add(reservoirNBT.getLong("Deposit"+j));
}
TFMG.LOGGER.debug("LOADETH " + reservoirNBT.getInt("Reserves"));
reservoir.oilReserves = reservoirNBT.getInt("Reserves");
sd.list.add(reservoir);
}

View File

@@ -52,7 +52,6 @@ public class TestSavedDataManager {
for (int i = 0; i < TFMG.DEPOSITS.list.size(); i++) {
FluidReservoir reservoir = TFMG.DEPOSITS.list.get(i);
if (reservoir.id == checkedPos.asLong()) {
TFMG.LOGGER.debug("INCREASED RESERVOIR SIZE");
TFMG.DEPOSITS.list.get(i).deposits.add(pos.asLong());
return true;
}
@@ -80,7 +79,6 @@ public class TestSavedDataManager {
}
}
}
TFMG.LOGGER.debug("ADDED NEW RESERVOIR");
RandomSource randomSource = level.random;
FluidReservoir reservoir = new FluidReservoir(pos);

View File

@@ -83,7 +83,6 @@ public class IndustrialMixerBlockEntity extends KineticBlockEntity implements IV
@Override
protected void read(CompoundTag compound, boolean clientPacket) {
TFMG.LOGGER.debug("Loading " + compound.getString("MixerMode"));
setMixerMode(compound.getString("MixerMode"), false);
if (clientPacket)

View File

@@ -685,8 +685,18 @@ public class TFMGStandardRecipeGen extends TFMGRecipeProvider {
.pattern(" A ")
.pattern(" ")),
OIL_HAMMER = create(TFMGItems.OIL_HAMMER)
.unlockedBy(TFMGItems.ALUMINUM_INGOT::get)
.viaShaped(b -> b
.define('O', steelIngot())
.define('R', rebar())
.define('A', aluminumSheet())
.pattern("OOA")
.pattern(" R ")
.pattern(" R ")),
CABLE_TUBE = create(TFMGBlocks.CABLE_TUBE)
CABLE_TUBE = create(TFMGBlocks.CABLE_TUBE).returns(8)
.unlockedBy(TFMGItems.RUBBER_SHEET::get)
.viaShaped(b -> b
.define('C', copperWire())
@@ -696,7 +706,7 @@ public class TFMGStandardRecipeGen extends TFMGRecipeProvider {
.pattern("CRC")
.pattern(" N ")),
DIAGONAL_CABLE = create(TFMGBlocks.DIAGONAL_CABLE_BLOCK)
DIAGONAL_CABLE = create(TFMGBlocks.DIAGONAL_CABLE_BLOCK).returns(8)
.unlockedBy(TFMGItems.RUBBER_SHEET::get)
.viaShaped(b -> b
.define('C', copperWire())
@@ -706,7 +716,7 @@ public class TFMGStandardRecipeGen extends TFMGRecipeProvider {
.pattern("CRN")
.pattern(" N ")),
ELECTRIC_POST = create(TFMGBlocks.ELECTRIC_POST)
ELECTRIC_POST = create(TFMGBlocks.ELECTRIC_POST).returns(4)
.unlockedBy(TFMGItems.COPPER_WIRE::get)
.viaShaped(b -> b
.define('C', copperWire())

View File

@@ -3,6 +3,7 @@ package com.drmangotea.tfmg.datagen.recipes.values.create;
import com.drmangotea.tfmg.datagen.recipes.TFMGProcessingRecipeGen;
import com.drmangotea.tfmg.registry.TFMGBlocks;
import com.drmangotea.tfmg.registry.TFMGFluids;
import com.drmangotea.tfmg.registry.TFMGItems;
import com.simibubi.create.AllRecipeTypes;
import net.minecraft.data.PackOutput;
import net.minecraft.tags.ItemTags;
@@ -20,6 +21,11 @@ public class TFMGFillingRecipeGen extends TFMGProcessingRecipeGen {
.require(TFMGFluids.CREOSOTE.getSource(), 250)
.output(TFMGBlocks.HARDENED_PLANKS)),
NAPALM_POTATO = create("napalm_potato", b -> b
.require(Items.POTATO)
.require(TFMGFluids.NAPALM.getSource(), 500)
.output(TFMGItems.NAPALM_POTATO)),
//GAS TANKS

View File

@@ -98,6 +98,17 @@ public class TFMGMechanicalCraftingRecipeGen extends TFMGRecipeProvider {
.patternLine("S O ")
.disallowMirrored()),
ADVANCED_POTATO_CANNON = create(TFMGItems.ADVANCED_POTATO_CANNON::get)
.recipe(b -> b
.key('O', rebar())
.key('C', circuitBoard())
.key('T', steelTank())
.key('P', steelPipe())
.key('M', steelMechanism())
.patternLine("PPPT")
.patternLine(" MCO")
.disallowMirrored()),
LARGE_ENGINE = create(TFMGBlocks.LARGE_ENGINE::get)
.recipe((b) -> b
.key('A', aluminumSheet())

View File

@@ -119,7 +119,7 @@ public class TFMGMixingRecipeGen extends TFMGProcessingRecipeGen {
.require(TFMGItems.SILICON_INGOT)
.require(steelIngot())
.require(steelIngot())
.output(magneticIngot())
.output(magneticIngot(),2)
.duration(300)
.requiresHeat(HeatCondition.HEATED)
);

View File

@@ -89,13 +89,11 @@ public class TFMGSequencedAssemblyRecipeGen extends CreateRecipeProvider {
MOTOR = create("motor", b -> b.require(shaft())
.transitionTo(TFMGItems.UNFINISHED_ELECTRIC_MOTOR.get())
.addOutput(TFMGBlocks.ELECTRIC_MOTOR.get(), 120)
.addOutput(TFMGBlocks.STEEL_CASING.get(), 8)
.addOutput(TFMGItems.NICKEL_SHEET.get(), 8)
.addOutput(TFMGBlocks.STEEL_CASING.get(), 4)
.addOutput(TFMGItems.NICKEL_SHEET.get(), 4)
.loops(3)
.addStep(DeployerApplicationRecipe::new, rb -> rb.require(nickelSheet()))
.addStep(WindingRecipe::new, rb -> rb.require(TFMGItems.COPPER_SPOOL.get()).duration(75))
.addStep(DeployerApplicationRecipe::new, rb -> rb.require(magnet()))
.addStep(DeployerApplicationRecipe::new, rb -> rb.require(steelSheet()))
.addStep(DeployerApplicationRecipe::new, rb -> rb.require(steelMechanism()))
.addStep(DeployerApplicationRecipe::new, rb -> rb.require(TFMGItems.SCREWDRIVER))
),

View File

@@ -19,7 +19,7 @@ public class IndustrialBlastingRecipeGen extends TFMGRecipeProvider{
SILICON = createIndustrialBlastingRecipe("silicon", b -> (IndustrialBlastingRecipeBuilder) b
.require(Items.QUARTZ)
.output(TFMGFluids.LIQUID_SILICON.get(),10)
.output(TFMGFluids.LIQUID_SILICON.get(),40)
.duration(5)
, 0),

View File

@@ -33,7 +33,8 @@ public class VatRecipeGen extends TFMGRecipeProvider {
ARC_FURNACE_STEEL = createVatRecipe("arc_furnace_steel", b -> (VatMachineRecipeBuilder) b
.require(crushedRawIron())
.require(TFMGTags.TFMGItemTags.FLUX.tag)
.require(TFMGTags.TFMGItemTags.BLAST_FURNACE_FUEL.tag)
.require(TFMGItems.COAL_COKE_DUST)
.output(0.9f,TFMGItems.COAL_COKE_DUST)
.output(TFMGFluids.MOLTEN_STEEL.get(), 144)
.output(TFMGFluids.MOLTEN_SLAG.get(), 288)
.duration(20)
@@ -93,26 +94,26 @@ public class VatRecipeGen extends TFMGRecipeProvider {
.output(TFMGFluids.CARBON_DIOXIDE.get(), 500)
.duration(100)
.requiresHeat(HeatCondition.HEATED)
, electrolysis()),
DEBUG_5 = createVatRecipe("debug_5", b -> (VatMachineRecipeBuilder) b
.require(Blocks.GOLD_BLOCK.asItem())
.require(Blocks.DIAMOND_BLOCK.asItem())
.require(Blocks.IRON_BLOCK.asItem())
.require(Blocks.COAL_BLOCK.asItem())
.require(TFMGFluids.LIQUID_CONCRETE.getSource(), 1)
.require(TFMGFluids.HEAVY_OIL.getSource(), 1)
.require(TFMGFluids.COOLING_FLUID.getSource(), 1)
.require(TFMGFluids.CRUDE_OIL.getSource(), 1)
.output(TFMGFluids.LIQUID_CONCRETE.get(), 1)
.output(TFMGFluids.HEAVY_OIL.get(), 1)
.output(TFMGFluids.COOLING_FLUID.get(), 1)
.output(TFMGFluids.CRUDE_OIL.get(), 1)
.output(Items.EGG)
.output(Items.ARROW)
.output(Items.DIAMOND)
.output(Items.STRING)
, mixing());
, electrolysis())
//DEBUG_5 = createVatRecipe("debug_5", b -> (VatMachineRecipeBuilder) b
// .require(Blocks.GOLD_BLOCK.asItem())
// .require(Blocks.DIAMOND_BLOCK.asItem())
// .require(Blocks.IRON_BLOCK.asItem())
// .require(Blocks.COAL_BLOCK.asItem())
// .require(TFMGFluids.LIQUID_CONCRETE.getSource(), 1)
// .require(TFMGFluids.HEAVY_OIL.getSource(), 1)
// .require(TFMGFluids.COOLING_FLUID.getSource(), 1)
// .require(TFMGFluids.CRUDE_OIL.getSource(), 1)
// .output(TFMGFluids.LIQUID_CONCRETE.get(), 1)
// .output(TFMGFluids.HEAVY_OIL.get(), 1)
// .output(TFMGFluids.COOLING_FLUID.get(), 1)
// .output(TFMGFluids.CRUDE_OIL.get(), 1)
// .output(Items.EGG)
// .output(Items.ARROW)
// .output(Items.DIAMOND)
// .output(Items.STRING)
// , mixing());
;
/// ////
public VatRecipeParams electrolysis() {

View File

@@ -101,8 +101,6 @@ public class FluidTankBlockEntityMixin extends SmartBlockEntity {
if (width == 3 && abs(abs(xOffset) - abs(zOffset)) == 1)
shape = FluidTankBlock.Shape.WINDOW;
}
TFMG.LOGGER.debug("spawned "+shape.getSerializedName());
TFMG.LOGGER.debug("should spawn window: "+window);
level.setBlock(pos, blockState.setValue(FluidTankBlock.SHAPE, shape), 22);
level.getChunkSource()
.getLightEngine()

View File

@@ -178,7 +178,7 @@ public class TFMGBlocks {
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.properties(BlockBehaviour.Properties::noOcclusion)
.addLayer(() -> RenderType::cutoutMipped)
.transform(TFMGStress.setCapacity(85))
.transform(TFMGStress.setCapacity(100))
.blockstate(new TurbineEngineGenerator()::generate)
.item()
.transform(customItemModel())
@@ -189,7 +189,7 @@ public class TFMGBlocks {
.properties(BlockBehaviour.Properties::noOcclusion)
.onRegister(connectedTextures(() -> new EngineCTBehavior(TFMGSpriteShifts.REGULAR_ENGINE_TOP, TFMGSpriteShifts.REGULAR_ENGINE_BOTTOM, TFMGSpriteShifts.REGULAR_ENGINE_SIDE)))
.blockstate(new EngineGenerator()::generate)
.transform(TFMGStress.setCapacity(85.0))
.transform(TFMGStress.setCapacity(100.0))
.item()
.transform(customItemModel())
.register();
@@ -197,7 +197,7 @@ public class TFMGBlocks {
.initialProperties(() -> Blocks.IRON_BLOCK)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.properties(BlockBehaviour.Properties::noOcclusion)
.transform(TFMGStress.setCapacity(85))
.transform(TFMGStress.setCapacity(100))
.onRegister(connectedTextures(() -> new EngineCTBehavior(TFMGSpriteShifts.REGULAR_ENGINE_TOP, TFMGSpriteShifts.REGULAR_ENGINE_BOTTOM, TFMGSpriteShifts.REGULAR_ENGINE_SIDE)))
.blockstate(new TurbineEngineGenerator()::generate)
.item()

View File

@@ -27,6 +27,7 @@ import com.drmangotea.tfmg.content.items.weapons.lithium_blade.LitLithiumBladeIt
import com.drmangotea.tfmg.content.items.weapons.lithium_blade.LithiumBladeItem;
import com.drmangotea.tfmg.content.items.weapons.quad_potato_cannon.QuadPotatoCannonItem;
import com.drmangotea.tfmg.content.machinery.misc.winding_machine.SpoolItem;
import com.drmangotea.tfmg.content.machinery.oil_processing.OilHammerItem;
import com.drmangotea.tfmg.content.machinery.oil_processing.pumpjack.pumpjack.base.DepositItem;
import com.simibubi.create.AllTags;
import com.simibubi.create.content.processing.sequenced.SequencedAssemblyItem;
@@ -208,6 +209,9 @@ public class TFMGItems {
.tag(forgeItemTag("dusts/coal_coke"), TFMGTags.TFMGItemTags.BLAST_FURNACE_FUEL.tag)
.register();
public static final ItemEntry<OilHammerItem> OIL_HAMMER = REGISTRATE.item("oil_hammer", OilHammerItem::new)
.register();
public static final ItemEntry<CoalCokeItem> COAL_COKE = REGISTRATE.item("coal_coke", CoalCokeItem::new)
.register();

View File

@@ -105,6 +105,10 @@
"create.winding_machine.turn_percentage": "Allowed Turn Percentage (From 1000)",
"create.creative_generator.voltage_generation": "Voltage Generation",
"create.distillation_output.when_tank_is_full": "When Internal Tank is Full",
"create.distillation_output.mode.keep_fluid": "Stop Distillation Process",
"create.distillation_output.mode.void_when_full": "Void Excess Fluid",
"death.attack.tfmg.concrete": "%1$s tried to eat Concrete",
"death.attack.tfmg.concrete.player": "%1$s tried to eat Concrete",
@@ -156,6 +160,8 @@
"create.wires.removed_data": "Data Removed",
"create.oil_hammer.reserves": "Oil Reserves: %1$s",
"tfmg.subtitle.engine_sounds": "Engine Sounds",

View File

@@ -4,7 +4,8 @@
"texture_size": [32, 32],
"textures": {
"1": "tfmg:block/converter",
"2": "tfmg:block/heavy_machinery_casing"
"2": "tfmg:block/heavy_machinery_casing",
"particle": "tfmg:block/heavy_machinery_casing"
},
"elements": [
{

View File

@@ -4,7 +4,8 @@
"texture_size": [32, 32],
"textures": {
"1": "tfmg:block/converter",
"2": "tfmg:block/heavy_machinery_casing"
"2": "tfmg:block/heavy_machinery_casing",
"particle": "tfmg:block/heavy_machinery_casing"
},
"elements": [
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B