bugfixes
This commit is contained in:
@@ -31,7 +31,7 @@ registrate_version = MC1.21-1.3.0+62
|
||||
mod_id=tfmg
|
||||
mod_name=Create: The Factory Must Grow
|
||||
mod_license=MIT
|
||||
mod_version=1.1.0b
|
||||
mod_version=1.1.0c
|
||||
mod_group_id=com.drmangotea
|
||||
mod_authors= DrMangoTea, Pepa, Luna
|
||||
mod_description= Create: The Factory Must Grow brings the age of steel, oil and electricity to the Create mod
|
||||
|
||||
@@ -509,6 +509,7 @@
|
||||
"block.tfmg.yellow_rebar_concrete_wall": "ןןɐM ǝʇǝɹɔuoƆ ɹɐqǝᴚ ʍoןןǝʎ",
|
||||
"block.tfmg.zinc_frame": "ǝɯɐɹℲ ɔuıZ",
|
||||
"block.tfmg.zinc_truss": "ssnɹ⟘ ɔuıZ",
|
||||
"create.goggles.fluid_storage": ":ǝbɐɹoʇS pınןℲ",
|
||||
"creative_tab.tfmg_decoration": "sʞɔoןᗺ buıpןınᗺ ⅁WℲ⟘ :ǝʇɐǝɹƆ",
|
||||
"creative_tab.tfmg_main": "ʍoɹ⅁ ʇsnW ʎɹoʇɔɐℲ ǝɥ⟘ :ǝʇɐǝɹƆ",
|
||||
"death.attack.tfmg.acid": "ɥʇɐq pıɔɐ uɐ ʞooʇ %1$s",
|
||||
@@ -934,7 +935,6 @@
|
||||
"tfmg.goggles.engine.turbines_missing": "buıssıW sǝuıqɹn⟘",
|
||||
"tfmg.goggles.engine.type": "%s :ǝdʎ⟘",
|
||||
"tfmg.goggles.engine.unfinished": "pǝɥsıuıɟu∩ ǝuıbuƎ",
|
||||
"tfmg.goggles.fluid_storage": ":ǝbɐɹoʇS pınןℲ",
|
||||
"tfmg.goggles.gauge.value": ":ǝbɐʇןoΛ pǝɹnsɐǝW ",
|
||||
"tfmg.goggles.generator.production": "ʇ/ǝɟ %1$s :uoıʇɔnpoɹԀ ʎbɹǝuƎ",
|
||||
"tfmg.goggles.heat_status": " :snʇɐʇS ʇɐǝH",
|
||||
|
||||
@@ -509,6 +509,7 @@
|
||||
"block.tfmg.yellow_rebar_concrete_wall": "Yellow Rebar Concrete Wall",
|
||||
"block.tfmg.zinc_frame": "Zinc Frame",
|
||||
"block.tfmg.zinc_truss": "Zinc Truss",
|
||||
"create.goggles.fluid_storage": "Fluid Storage:",
|
||||
"creative_tab.tfmg_decoration": "Create: TFMG Building Blocks",
|
||||
"creative_tab.tfmg_main": "Create: The Factory Must Grow",
|
||||
"death.attack.tfmg.acid": "%1$s took an acid bath",
|
||||
@@ -934,7 +935,6 @@
|
||||
"tfmg.goggles.engine.turbines_missing": "Turbines Missing",
|
||||
"tfmg.goggles.engine.type": "Type: %s",
|
||||
"tfmg.goggles.engine.unfinished": "Engine Unfinished",
|
||||
"tfmg.goggles.fluid_storage": "Fluid Storage:",
|
||||
"tfmg.goggles.gauge.value": " Measured Voltage:",
|
||||
"tfmg.goggles.generator.production": "Energy Production: %1$s fe/t",
|
||||
"tfmg.goggles.heat_status": "Heat Status: ",
|
||||
|
||||
@@ -202,7 +202,7 @@ public class TFMGUtils {
|
||||
}
|
||||
if (!isEmpty) return true;
|
||||
|
||||
CreateLang.translate("gui.goggles.fluid_container.capacity").add(CreateLang.number(tank.getTankCapacity(0)).add(mb).style(ChatFormatting.DARK_GREEN)).style(ChatFormatting.DARK_GRAY).forGoggles(tooltip, 1);
|
||||
CreateLang.translate("goggles.fluid_storage").add(CreateLang.number(tank.getTankCapacity(0)).add(mb).style(ChatFormatting.DARK_GREEN)).style(ChatFormatting.DARK_GRAY).forGoggles(tooltip, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.drmangotea.tfmg.content.machinery.misc.concrete_hose.ConcreteHoseBloc
|
||||
import com.drmangotea.tfmg.content.machinery.misc.exhaust.ExhaustBlockEntity;
|
||||
import com.drmangotea.tfmg.content.machinery.misc.firebox.FireboxBlockEntity;
|
||||
import com.drmangotea.tfmg.content.machinery.misc.flarestack.FlarestackBlockEntity;
|
||||
import com.drmangotea.tfmg.content.machinery.misc.gas_lamp.GasLampBlockEntity;
|
||||
import com.drmangotea.tfmg.content.machinery.misc.smokestack.SmokestackBlockEntity;
|
||||
import com.drmangotea.tfmg.content.machinery.oil_processing.distillation_tower.controller.DistillationControllerBlockEntity;
|
||||
import com.drmangotea.tfmg.content.machinery.oil_processing.distillation_tower.output.DistillationOutputBlockEntity;
|
||||
@@ -103,6 +104,7 @@ public class TFMGCommonEvents {
|
||||
ExhaustBlockEntity.registerCapabilities(event);
|
||||
BlastFurnaceHatchBlockEntity.registerCapabilities(event);
|
||||
FlarestackBlockEntity.registerCapabilities(event);
|
||||
GasLampBlockEntity.registerCapabilities(event);
|
||||
BlastFurnaceOutputBlockEntity.registerCapabilities(event);
|
||||
CokeOvenBlockEntity.registerCapabilities(event);
|
||||
AirIntakeBlockEntity.registerCapabilities(event);
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.drmangotea.tfmg.content.electricity.base;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ElectricBlockValues {
|
||||
|
||||
|
||||
@@ -33,6 +38,8 @@ public class ElectricBlockValues {
|
||||
|
||||
public int failTimer = 0;
|
||||
|
||||
public List<BlockPos> blocksToPower = new ArrayList<>();
|
||||
|
||||
public ElectricalGroup group = new ElectricalGroup(0);
|
||||
|
||||
public ElectricBlockValues(long pos) {
|
||||
|
||||
@@ -12,8 +12,11 @@ import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.energy.IEnergyStorage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -64,6 +67,20 @@ public interface IElectric {
|
||||
|
||||
}
|
||||
|
||||
default void onNeighborChanged() {
|
||||
Level level = (Level) getLevelAccessor();
|
||||
for(Direction direction : Direction.values()){
|
||||
IEnergyStorage capability = level.getCapability(Capabilities.EnergyStorage.BLOCK,getBlockPos().relative(direction), direction);
|
||||
|
||||
if(capability==null)
|
||||
continue;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
default void onRemoved() {
|
||||
this.getData().destroyed = true;
|
||||
for (Direction d : Direction.values()) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.simibubi.create.content.equipment.wrench.IWrenchable;
|
||||
import com.simibubi.create.foundation.block.IBE;
|
||||
import net.minecraft.core.BlockPos;
|
||||
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.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
@@ -21,6 +22,8 @@ public class CableHubBlock extends Block implements IBE<ElectricBlockEntity>, IW
|
||||
withBlockEntityDo(level,pos, IElectric::onPlaced);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) {
|
||||
IBE.onRemove(state, level, pos, newState);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.drmangotea.tfmg.content.electricity.network.transformer;
|
||||
|
||||
import com.drmangotea.tfmg.TFMG;
|
||||
import com.drmangotea.tfmg.base.TFMGUtils;
|
||||
import com.drmangotea.tfmg.base.lang.TFMGTexts;
|
||||
import com.drmangotea.tfmg.content.electricity.base.IElectric;
|
||||
@@ -104,18 +105,22 @@ public class TransformerBlockEntity extends VoltageAlteringBlockEntity {
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void updateCoils(){
|
||||
if(primaryCoil.get(TFMGDataComponents.COIL_TURNS)==null||secondaryCoil.get(TFMGDataComponents.COIL_TURNS)==null)
|
||||
if(primaryCoil.get(TFMGDataComponents.COIL_TURNS)==null||secondaryCoil.get(TFMGDataComponents.COIL_TURNS)==null) {
|
||||
coilRatio = 0;
|
||||
updateNextTick();
|
||||
updateInFront();
|
||||
return;
|
||||
}
|
||||
int primaryTurns = primaryCoil.get(TFMGDataComponents.COIL_TURNS);
|
||||
int secondaryTurns = secondaryCoil.get(TFMGDataComponents.COIL_TURNS);
|
||||
|
||||
if(primaryCoil.isEmpty()||secondaryCoil.isEmpty()||primaryTurns<50||secondaryTurns<50){
|
||||
|
||||
coilRatio = 0;
|
||||
updateNextTick();
|
||||
updateInFront();
|
||||
|
||||
@@ -9,12 +9,9 @@ import com.drmangotea.tfmg.content.engines.fuels.FuelType;
|
||||
import com.drmangotea.tfmg.registry.TFMGBlockEntities;
|
||||
import com.drmangotea.tfmg.registry.TFMGFluids;
|
||||
import com.drmangotea.tfmg.registry.TFMGTags;
|
||||
import com.simibubi.create.AllBlockEntityTypes;
|
||||
import com.simibubi.create.foundation.fluid.CombinedTankWrapper;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
import net.createmod.catnip.math.VecHelper;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -32,14 +29,9 @@ import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
||||
import net.neoforged.neoforge.fluids.FluidStack;
|
||||
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import static com.drmangotea.tfmg.content.engines.base.EngineBlock.ENGINE_STATE;
|
||||
import static com.drmangotea.tfmg.content.engines.base.EngineBlock.EngineState.SHAFT;
|
||||
|
||||
public abstract class AbstractEngineBlockEntity extends KineticElectricBlockEntity {
|
||||
|
||||
//
|
||||
@@ -73,8 +65,8 @@ public abstract class AbstractEngineBlockEntity extends KineticElectricBlockEnti
|
||||
public AbstractEngineBlockEntity(BlockEntityType<?> typeIn, BlockPos pos, BlockState state) {
|
||||
super(typeIn, pos, state);
|
||||
setLazyTickRate(10);
|
||||
fuelTank = new EngineFluidTank(4000, false, true, f->tankUpdated(f,true), TFMGTags.TFMGFluidTags.AIR.tag);
|
||||
exhaustTank = new EngineFluidTank(8000, true, false, f->tankUpdated(f,false));
|
||||
fuelTank = new EngineFluidTank(4000, false, true, f -> tankUpdated(f, true), TFMGTags.TFMGFluidTags.AIR.tag);
|
||||
exhaustTank = new EngineFluidTank(8000, true, false, f -> tankUpdated(f, false));
|
||||
fluidCapability = new CombinedTankWrapper(fuelTank, exhaustTank);
|
||||
|
||||
refreshCapability();
|
||||
@@ -109,10 +101,15 @@ public abstract class AbstractEngineBlockEntity extends KineticElectricBlockEnti
|
||||
super.tick();
|
||||
}
|
||||
|
||||
public void tankUpdated(FluidStack stack, boolean fuelTank ) {
|
||||
if(fuelTank && stack.isEmpty()) {
|
||||
public void tankUpdated(FluidStack stack, boolean fuelTank) {
|
||||
|
||||
if (fuelTank && stack.isEmpty()) {
|
||||
TFMG.LOGGER.debug("FUEL OFF");
|
||||
|
||||
fuelInjectionRate = 0;
|
||||
rpm =0 ;
|
||||
updateRotation();
|
||||
analogSignalChanged();
|
||||
}
|
||||
sendData();
|
||||
setChanged();
|
||||
@@ -129,8 +126,10 @@ public abstract class AbstractEngineBlockEntity extends KineticElectricBlockEnti
|
||||
}
|
||||
|
||||
protected void analogSignalChanged() {
|
||||
|
||||
|
||||
if (!canWork()) {
|
||||
fuelInjectionRate = 0;
|
||||
return;
|
||||
}
|
||||
if (hasEngineController()) {
|
||||
fuelInjectionRate = highestSignal / 15f;
|
||||
return;
|
||||
@@ -165,7 +164,6 @@ public abstract class AbstractEngineBlockEntity extends KineticElectricBlockEnti
|
||||
neighbourChanged();
|
||||
|
||||
|
||||
|
||||
manageFuelAndExhaust();
|
||||
}
|
||||
|
||||
@@ -256,7 +254,6 @@ public abstract class AbstractEngineBlockEntity extends KineticElectricBlockEnti
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getMaxLength() {
|
||||
return TFMGConfigs.common().machines.engineMaxLength.get();
|
||||
}
|
||||
@@ -288,10 +285,10 @@ public abstract class AbstractEngineBlockEntity extends KineticElectricBlockEnti
|
||||
|
||||
@Override
|
||||
protected void read(CompoundTag compound, HolderLookup.Provider registries, boolean clientPacket) {
|
||||
super.read(compound,registries , clientPacket);
|
||||
super.read(compound, registries, clientPacket);
|
||||
|
||||
reverse = compound.getBoolean("Reverse");
|
||||
signal = compound.getInt("Signal")+1;
|
||||
signal = compound.getInt("Signal") + 1;
|
||||
if (hasEngineController())
|
||||
engineController = BlockPos.of(compound.getLong("EngineController"));
|
||||
fuelInjectionRate = compound.getFloat("RPM");
|
||||
@@ -300,8 +297,8 @@ public abstract class AbstractEngineBlockEntity extends KineticElectricBlockEnti
|
||||
// if (!BlockPos.of(compound.getLong("ControllerPos")).equals(new BlockPos(0, 0, 0)))
|
||||
// controller = BlockPos.of(compound.getLong("ControllerPos"));
|
||||
|
||||
fuelTank.readFromNBT(registries,compound.getCompound("FuelTank"));
|
||||
exhaustTank.readFromNBT(registries,compound.getCompound("ExhaustTank"));
|
||||
fuelTank.readFromNBT(registries, compound.getCompound("FuelTank"));
|
||||
exhaustTank.readFromNBT(registries, compound.getCompound("ExhaustTank"));
|
||||
|
||||
highestSignal = compound.getInt("HighestSignal");
|
||||
|
||||
@@ -315,7 +312,7 @@ public abstract class AbstractEngineBlockEntity extends KineticElectricBlockEnti
|
||||
|
||||
@Override
|
||||
protected void write(CompoundTag compound, HolderLookup.Provider registries, boolean clientPacket) {
|
||||
super.write(compound,registries , clientPacket);
|
||||
super.write(compound, registries, clientPacket);
|
||||
|
||||
compound.putBoolean("Reverse", reverse);
|
||||
compound.putInt("Signal", signal);
|
||||
@@ -324,8 +321,8 @@ public abstract class AbstractEngineBlockEntity extends KineticElectricBlockEnti
|
||||
compound.putFloat("RPM", fuelInjectionRate);
|
||||
|
||||
|
||||
compound.put("FuelTank", fuelTank.writeToNBT(registries,new CompoundTag()));
|
||||
compound.put("ExhaustTank", exhaustTank.writeToNBT(registries,new CompoundTag()));
|
||||
compound.put("FuelTank", fuelTank.writeToNBT(registries, new CompoundTag()));
|
||||
compound.put("ExhaustTank", exhaustTank.writeToNBT(registries, new CompoundTag()));
|
||||
|
||||
compound.putInt("HighestSignal", highestSignal);
|
||||
|
||||
|
||||
@@ -141,6 +141,9 @@ public abstract class AbstractSmallEngineBlockEntity extends AbstractEngineBlock
|
||||
public void lazyTick() {
|
||||
super.lazyTick();
|
||||
|
||||
if(!canWork())
|
||||
return;
|
||||
|
||||
if (level.random.nextInt(45) == 0) {
|
||||
if (oil > 0)
|
||||
oil--;
|
||||
@@ -252,6 +255,11 @@ public abstract class AbstractSmallEngineBlockEntity extends AbstractEngineBlock
|
||||
if (controller == null)
|
||||
return;
|
||||
|
||||
if (!canWork()) {
|
||||
fuelInjectionRate = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasEngineController()) {
|
||||
fuelInjectionRate = highestSignal / 15f;
|
||||
return;
|
||||
@@ -299,6 +307,12 @@ public abstract class AbstractSmallEngineBlockEntity extends AbstractEngineBlock
|
||||
return;
|
||||
}
|
||||
|
||||
if(fuelTank.isEmpty()){
|
||||
rpm = 0;
|
||||
torque = 0;
|
||||
fuelInjectionRate = 0;
|
||||
}
|
||||
|
||||
List<Long> allEngines = new ArrayList<>(engines);
|
||||
allEngines.add(controller.asLong());
|
||||
for (TagKey<Fluid> fluidTag : getSupportedFuels()) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.drmangotea.tfmg.content.machinery.misc.gas_lamp;
|
||||
|
||||
import com.drmangotea.tfmg.base.TFMGUtils;
|
||||
import com.drmangotea.tfmg.registry.TFMGBlockEntities;
|
||||
import com.drmangotea.tfmg.registry.TFMGTags;
|
||||
import com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation;
|
||||
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
|
||||
@@ -13,6 +14,8 @@ import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.neoforged.neoforge.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
|
||||
import net.neoforged.neoforge.fluids.FluidStack;
|
||||
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
|
||||
import net.neoforged.neoforge.fluids.capability.templates.FluidTank;
|
||||
@@ -46,11 +49,13 @@ public class GasLampBlockEntity extends SmartBlockEntity implements IHaveGoggleI
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static void registerCapabilities(RegisterCapabilitiesEvent event) {
|
||||
event.registerBlockEntity(
|
||||
Capabilities.FluidHandler.BLOCK,
|
||||
TFMGBlockEntities.GAS_LAMP.get(),
|
||||
(be, context) -> be.tankInventory
|
||||
);
|
||||
}
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.drmangotea.tfmg.content.electricity.connection.cable_type.CableType;
|
||||
import com.drmangotea.tfmg.content.electricity.connection.cables.CableConnection;
|
||||
import com.drmangotea.tfmg.content.electricity.connection.cables.CableConnectorBlockEntity;
|
||||
import com.drmangotea.tfmg.content.electricity.connection.cables.CablePos;
|
||||
import com.drmangotea.tfmg.registry.TFMGBlocks;
|
||||
import com.drmangotea.tfmg.registry.TFMGDataComponents;
|
||||
import com.drmangotea.tfmg.registry.TFMGItems;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
@@ -62,8 +63,8 @@ public class SpoolItem extends Item {
|
||||
@Override
|
||||
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) {
|
||||
ItemStack stack = player.getItemInHand(hand);
|
||||
if (player.isCrouching() && stack.get(TFMGDataComponents.POSITION) != 0) {
|
||||
if (level.getBlockEntity(BlockPos.of(stack.get(TFMGDataComponents.POSITION))) instanceof CableConnectorBlockEntity be)
|
||||
if (player.isCrouching() && stack.getOrDefault(TFMGDataComponents.POSITION,0f).longValue() != 0f) {
|
||||
if (level.getBlockEntity(BlockPos.of(stack.getOrDefault(TFMGDataComponents.POSITION,0f).longValue())) instanceof CableConnectorBlockEntity be)
|
||||
be.player = null;
|
||||
stack.set(TFMGDataComponents.POSITION, 0l);
|
||||
stack.remove(TFMGDataComponents.POSITION);
|
||||
@@ -107,6 +108,19 @@ public class SpoolItem extends Item {
|
||||
Player player = context.getPlayer();
|
||||
ItemStack stack = context.getItemInHand();
|
||||
|
||||
if(level.getBlockEntity(pos) instanceof WindingMachineBlockEntity be){
|
||||
ItemStack oldSpool = ItemStack.EMPTY;
|
||||
if(!be.spool.isEmpty()){
|
||||
oldSpool = be.spool;
|
||||
}
|
||||
be.spool = context.getItemInHand();
|
||||
context.getPlayer().setItemInHand(context.getHand(), oldSpool);
|
||||
be.sendData();
|
||||
be.setChanged();
|
||||
//
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
if(stack.get(TFMGDataComponents.SPOOL_AMOUNT)==null)
|
||||
return InteractionResult.PASS;
|
||||
if(level.isClientSide)
|
||||
@@ -207,18 +221,7 @@ public class SpoolItem extends Item {
|
||||
}
|
||||
//
|
||||
//
|
||||
if(level.getBlockEntity(pos) instanceof WindingMachineBlockEntity be){
|
||||
ItemStack oldSpool = ItemStack.EMPTY;
|
||||
if(!be.spool.isEmpty()){
|
||||
oldSpool = be.spool;
|
||||
}
|
||||
be.spool = context.getItemInHand();
|
||||
context.getPlayer().setItemInHand(context.getHand(), oldSpool);
|
||||
be.sendData();
|
||||
be.setChanged();
|
||||
//
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
public void removeOtherConnections(Player player, ItemStack stack){
|
||||
|
||||
47
src/main/java/com/drmangotea/tfmg/mixin/UtilMixin.java
Normal file
47
src/main/java/com/drmangotea/tfmg/mixin/UtilMixin.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package com.drmangotea.tfmg.mixin;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.Util;
|
||||
import org.slf4j.Logger;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Mixin(Util.class)
|
||||
public class UtilMixin {
|
||||
@Shadow
|
||||
private static Consumer<String> thePauser;
|
||||
|
||||
|
||||
@Shadow
|
||||
static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
@Overwrite
|
||||
public static void logAndPauseIfInIde(String error) {
|
||||
|
||||
if(error.contains("Detected setBlock in a far chunk"))
|
||||
return;
|
||||
|
||||
LOGGER.error(error);
|
||||
if (SharedConstants.IS_RUNNING_WITH_JDWP) {
|
||||
doPause(error);
|
||||
}
|
||||
|
||||
}
|
||||
@Shadow
|
||||
private static void doPause(String message) {
|
||||
Instant instant = Instant.now();
|
||||
LOGGER.warn("Did you remember to set a breakpoint here?");
|
||||
boolean flag = Duration.between(instant, Instant.now()).toMillis() > 500L;
|
||||
if (!flag) {
|
||||
thePauser.accept(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
@@ -41,25 +42,33 @@ public class OilDepositFeature extends Feature<NoneFeatureConfiguration> {
|
||||
|
||||
public void placeDeposit(BlockPos startingPos, WorldGenLevel level, RandomSource randomsource) {
|
||||
BlockPos pos = startingPos;
|
||||
level.setBlock(startingPos, TFMGBlocks.OIL_DEPOSIT.getDefaultState(), 2);
|
||||
setBlock(level, startingPos, TFMGBlocks.OIL_DEPOSIT.getDefaultState());
|
||||
|
||||
|
||||
for (int i = 0; i < randomsource.nextInt(25); i++) {
|
||||
pos = pos.above();
|
||||
|
||||
level.setBlock(pos, TFMGFluids.CRUDE_OIL.get().getSource().defaultFluidState().createLegacyBlock(), 2);
|
||||
setBlock(level, pos, TFMGFluids.CRUDE_OIL.get().getSource().defaultFluidState().createLegacyBlock());
|
||||
|
||||
|
||||
Direction direction1 = Direction.getRandom(randomsource);
|
||||
if (direction1.getAxis().isHorizontal())
|
||||
level.setBlock(pos.relative(direction1), TFMGFluids.CRUDE_OIL.get().getSource().defaultFluidState().createLegacyBlock(), 2);
|
||||
setBlock(level, pos.relative(direction1), TFMGFluids.CRUDE_OIL.get().getSource().defaultFluidState().createLegacyBlock());
|
||||
|
||||
if (i < 4) {
|
||||
Direction direction2 = Direction.getRandom(randomsource);
|
||||
if (direction2.getAxis().isHorizontal())
|
||||
level.setBlock(pos.relative(direction2), TFMGBlocks.FOSSILSTONE.getDefaultState(), 2);
|
||||
setBlock(level, pos.relative(direction2), TFMGBlocks.FOSSILSTONE.getDefaultState());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void setBlock(WorldGenLevel level,BlockPos pos, BlockState state){
|
||||
|
||||
|
||||
|
||||
level.setBlock (pos,state,2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"creative_tab.tfmg_main": "Create: The Factory Must Grow",
|
||||
"creative_tab.tfmg_decoration": "Create: TFMG Building Blocks",
|
||||
|
||||
"tfmg.goggles.fluid_storage": "Fluid Storage:",
|
||||
"create.goggles.fluid_storage": "Fluid Storage:",
|
||||
"tfmg.goggles.item_storage": "Item Storage:",
|
||||
"tfmg.goggles.item_storage_empty": "*Empty*",
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"format_version": "1.9.0",
|
||||
"credit": "Made with Blockbench",
|
||||
"textures": {
|
||||
"0": "i_architecture:block/metal/metal_railing",
|
||||
"particle": "i_architecture:block/metal/metal_railing"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [0, 0, 1],
|
||||
"to": [16, 14, 1],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 2, 16, 16], "texture": "#0"},
|
||||
"east": {"uv": [0, 0, 0, 14], "texture": "#0"},
|
||||
"south": {"uv": [0, 2, 16, 16], "texture": "#0"},
|
||||
"west": {"uv": [0, 0, 0, 14], "texture": "#0"},
|
||||
"up": {"uv": [0, 0, 16, 0], "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 16, 0], "texture": "#0"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [0, 14, 0],
|
||||
"to": [16, 15.99, 2],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 16, 1.99], "texture": "#0"},
|
||||
"east": {"uv": [0, 0, 2, 1.99], "texture": "#0"},
|
||||
"south": {"uv": [0, 0, 16, 1.99], "texture": "#0"},
|
||||
"west": {"uv": [0, 0, 2, 1.99], "texture": "#0"},
|
||||
"up": {"uv": [0, 0, 16, 2], "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 16, 2], "texture": "#0"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"format_version": "1.21.6",
|
||||
"credit": "Made with Blockbench",
|
||||
"parent": "block/block",
|
||||
"textures": {
|
||||
"0": "i_architecture:block/metal/metal_railing",
|
||||
"particle": "i_architecture:block/metal/metal_railing"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [15, 0, 0],
|
||||
"to": [15, 14, 16],
|
||||
"rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 0, 14], "texture": "#0"},
|
||||
"east": {"uv": [0, 2, 16, 16], "texture": "#0"},
|
||||
"south": {"uv": [0, 0, 0, 14], "texture": "#0"},
|
||||
"west": {"uv": [0, 2, 16, 16], "texture": "#0"},
|
||||
"up": {"uv": [0, 0, 16, 0], "rotation": 90, "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 16, 0], "rotation": 270, "texture": "#0"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [14, 14, 0],
|
||||
"to": [16, 16, 16],
|
||||
"rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 2, 2], "texture": "#0"},
|
||||
"east": {"uv": [0, 0, 16, 2], "texture": "#0"},
|
||||
"south": {"uv": [0, 0, 2, 2], "texture": "#0"},
|
||||
"west": {"uv": [0, 0, 16, 2], "texture": "#0"},
|
||||
"up": {"uv": [0, 0, 16, 2], "rotation": 90, "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 16, 2], "rotation": 270, "texture": "#0"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
"GoggleOverlayRendererMixin",
|
||||
"PipeAttachmentModelMixin",
|
||||
"RecipeProviderMixin",
|
||||
"UtilMixin",
|
||||
"accessor.FluidTankBlockEntityAccessor",
|
||||
"accessor.FlywheelBlockEntityMixin",
|
||||
"accessor.ProcessingRecipeAccessor",
|
||||
|
||||
Reference in New Issue
Block a user