tooltips
This commit is contained in:
@@ -5,7 +5,11 @@ import com.drmangotea.tfmg.base.fluid.GasFluidType;
|
||||
import com.simibubi.create.content.fluids.VirtualFluid;
|
||||
import com.simibubi.create.foundation.data.CreateRegistrate;
|
||||
import com.simibubi.create.foundation.data.VirtualFluidBuilder;
|
||||
import com.simibubi.create.foundation.item.ItemDescription;
|
||||
import com.simibubi.create.foundation.item.KineticStats;
|
||||
import com.simibubi.create.foundation.item.TooltipModifier;
|
||||
import com.tterrag.registrate.builders.FluidBuilder;
|
||||
import net.createmod.catnip.lang.FontHelper;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.*;
|
||||
@@ -40,7 +44,10 @@ public class TFMGRegistrate extends CreateRegistrate {
|
||||
}
|
||||
|
||||
public static TFMGRegistrate create() {
|
||||
return new TFMGRegistrate();
|
||||
return (TFMGRegistrate) new TFMGRegistrate().setTooltipModifierFactory(item ->
|
||||
new ItemDescription.Modifier(item, FontHelper.Palette.STANDARD_CREATE)
|
||||
.andThen(TooltipModifier.mapNull(KineticStats.create(item)))
|
||||
);
|
||||
}
|
||||
|
||||
public static Block getBlock(String name) {
|
||||
|
||||
@@ -10,6 +10,8 @@ import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public class ElectriciansWrenchScreen extends AbstractSimiScreen {
|
||||
|
||||
@@ -106,7 +108,7 @@ public class ElectriciansWrenchScreen extends AbstractSimiScreen {
|
||||
//packet.applyGroup(wrench);
|
||||
//TFMGPackets.getChannel().sendToServer(packet);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public TFMGGuiTextures background(){
|
||||
return TFMGGuiTextures.ELECTRICIANS_WRENCH;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public class ElectricMotorBlockEntity extends KineticElectricBlockEntity {
|
||||
if (Math.min(generatedSpeed.getValue(), data.getVoltage() / 2) == 0)
|
||||
return super.getPowerUsage();
|
||||
|
||||
float speedModifier = (Math.min(Math.abs(generatedSpeed.getValue()), data.getVoltage()) / 256f) * 5;
|
||||
float speedModifier = (Math.min(Math.abs(generatedSpeed.getValue()), data.getVoltage()) / 256f) * 8;
|
||||
|
||||
|
||||
return (int) ((float) super.getPowerUsage() * speedModifier);
|
||||
|
||||
@@ -153,6 +153,8 @@ public abstract class AbstractSmallEngineBlockEntity extends AbstractEngineBlock
|
||||
@Override
|
||||
public float calculateAddedStressCapacity() {
|
||||
float stress = super.calculateAddedStressCapacity() + (torque);
|
||||
|
||||
|
||||
return hasTwoShafts() ? stress / 2 : stress;
|
||||
}
|
||||
|
||||
@@ -655,6 +657,11 @@ public abstract class AbstractSmallEngineBlockEntity extends AbstractEngineBlock
|
||||
public void remove() {
|
||||
super.remove();
|
||||
updateOthers();
|
||||
for(int i =0;i<componentsInventory.getSlots();i++){
|
||||
ItemStack stack = componentsInventory.getItem(i);
|
||||
dropItem(stack);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void updateOthers() {
|
||||
|
||||
@@ -145,6 +145,15 @@ public class RegularEngineBlockEntity extends AbstractSmallEngineBlockEntity {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateAddedStressCapacity() {
|
||||
float stress = super.calculateAddedStressCapacity() + (torque);
|
||||
|
||||
stress *= pistonInventory.getSlots()/2f;
|
||||
|
||||
return hasTwoShafts() ? stress / 2 : stress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertItem(ItemStack itemStack, boolean shifting, Player player, InteractionHand hand) {
|
||||
|
||||
@@ -225,6 +234,16 @@ public class RegularEngineBlockEntity extends AbstractSmallEngineBlockEntity {
|
||||
return super.insertItem(itemStack, shifting, player, hand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
super.remove();
|
||||
for(int i =0;i<pistonInventory.getSlots();i++){
|
||||
ItemStack stack = pistonInventory.getItem(i);
|
||||
dropItem(stack);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCorrectCylinder(ItemStack itemStack) {
|
||||
return itemStack.is(TFMGItems.ENGINE_CYLINDER.get())||itemStack.is(TFMGItems.SIMPLE_ENGINE_CYLINDER.get())||itemStack.is(TFMGItems.DIESEL_ENGINE_CYLINDER.get());
|
||||
}
|
||||
@@ -380,6 +399,10 @@ public class RegularEngineBlockEntity extends AbstractSmallEngineBlockEntity {
|
||||
.add(Component.empty().append(nextComponent().getItems()[0].getHoverName()))
|
||||
.color(0xfff240)
|
||||
.forGoggles(tooltip);
|
||||
CreateLang.translate("goggles.engine.type")
|
||||
.add(CreateLang.text(type.name()))
|
||||
.color(0xfcad03)
|
||||
.forGoggles(tooltip);
|
||||
return true;
|
||||
}
|
||||
if(!hasAllPistons()){
|
||||
@@ -430,6 +453,11 @@ public class RegularEngineBlockEntity extends AbstractSmallEngineBlockEntity {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFuelConsumption() {
|
||||
return super.getFuelConsumption()*(pistonInventory.getSlots()/2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String engineId() {
|
||||
return type.name;
|
||||
|
||||
@@ -1075,6 +1075,17 @@ public class TFMGStandardRecipeGen extends TFMGRecipeProvider {
|
||||
.pattern("OCA")
|
||||
.pattern(" R ")),
|
||||
|
||||
STEEL_VERTICAL_GEARBOX = create(TFMGItems.STEEL_VERTICAL_GEARBOX::get)
|
||||
.unlockedBy(() -> TFMGBlocks.STEEL_GEARBOX)
|
||||
.viaShapeless(b -> b
|
||||
.requires(TFMGBlocks.STEEL_GEARBOX)),
|
||||
|
||||
STEEL_GEARBOX_FROM_VERTICAL = create(TFMGBlocks.STEEL_GEARBOX::get).withSuffix("_from_vertical")
|
||||
.unlockedBy(() -> TFMGItems.STEEL_VERTICAL_GEARBOX)
|
||||
.viaShapeless(b -> b
|
||||
.requires(TFMGItems.STEEL_VERTICAL_GEARBOX)),
|
||||
|
||||
|
||||
OIL_CAN = create(TFMGItems.OIL_CAN)
|
||||
.unlockedBy(TFMGItems.STEEL_NUGGET::get)
|
||||
.viaShaped(b -> b
|
||||
|
||||
@@ -178,7 +178,8 @@ public class TFMGBlocks {
|
||||
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.addLayer(() -> RenderType::cutoutMipped)
|
||||
.transform(TFMGStress.setCapacity(100))
|
||||
.transform(TFMGStress.setCapacity(10))
|
||||
.transform(pickaxeOnly())
|
||||
.blockstate(new TurbineEngineGenerator()::generate)
|
||||
.item()
|
||||
.transform(customItemModel())
|
||||
@@ -189,7 +190,8 @@ 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(100.0))
|
||||
.transform(TFMGStress.setCapacity(15))
|
||||
.transform(pickaxeOnly())
|
||||
.item()
|
||||
.transform(customItemModel())
|
||||
.register();
|
||||
@@ -197,7 +199,8 @@ public class TFMGBlocks {
|
||||
.initialProperties(() -> Blocks.IRON_BLOCK)
|
||||
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.transform(TFMGStress.setCapacity(100))
|
||||
.transform(TFMGStress.setCapacity(15))
|
||||
.transform(pickaxeOnly())
|
||||
.onRegister(connectedTextures(() -> new EngineCTBehavior(TFMGSpriteShifts.REGULAR_ENGINE_TOP, TFMGSpriteShifts.REGULAR_ENGINE_BOTTOM, TFMGSpriteShifts.REGULAR_ENGINE_SIDE)))
|
||||
.blockstate(new TurbineEngineGenerator()::generate)
|
||||
.item()
|
||||
@@ -208,6 +211,7 @@ public class TFMGBlocks {
|
||||
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.transform(TFMGStress.setCapacity(55))
|
||||
.transform(pickaxeOnly())
|
||||
.blockstate((c, p) -> p.horizontalFaceBlock(c.get(), AssetLookup.partialBaseModel(c, p)))
|
||||
.item()
|
||||
.transform(customItemModel())
|
||||
@@ -217,6 +221,7 @@ public class TFMGBlocks {
|
||||
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.transform(TFMGStress.setCapacity(40))
|
||||
.transform(pickaxeOnly())
|
||||
.blockstate((c, p) -> p.horizontalFaceBlock(c.get(), AssetLookup.partialBaseModel(c, p)))
|
||||
.item()
|
||||
.transform(customItemModel())
|
||||
@@ -226,6 +231,7 @@ public class TFMGBlocks {
|
||||
.initialProperties(() -> Blocks.IRON_BLOCK)
|
||||
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.transform(pickaxeOnly())
|
||||
.blockstate(BlockStateGen.horizontalBlockProvider(true))
|
||||
.item()
|
||||
.transform(customItemModel())
|
||||
@@ -235,6 +241,7 @@ public class TFMGBlocks {
|
||||
.initialProperties(() -> Blocks.IRON_BLOCK)
|
||||
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.transform(pickaxeOnly())
|
||||
.blockstate(BlockStateGen.horizontalBlockProvider(true))
|
||||
.item()
|
||||
.transform(customItemModel())
|
||||
|
||||
@@ -9,135 +9,6 @@
|
||||
"item.tfmg.quad_potato_cannon.tooltip.condition1": "When R-Clicked",
|
||||
"item.tfmg.quad_potato_cannon.tooltip.behaviour1": "_Shoots_ a suitable item from your _Inventory_.",
|
||||
"item.tfmg.quad_potato_cannon.tooltip.condition2": "While wearing Backtank",
|
||||
"item.tfmg.quad_potato_cannon.tooltip.behaviour2": "_No_ _Durability_ will be used. Instead, _Air_ _pressure_ is drained from the Tank",
|
||||
|
||||
"item.tfmg.advanced_potato_cannon.tooltip.summary": "Launches _Napalm Potatoes_ at Enemies. Can be powered with _Air_ _Pressure_ from a _Backtank_",
|
||||
"item.tfmg.advanced_potato_cannon.tooltip.condition1": "When R-Clicked",
|
||||
"item.tfmg.advanced_potato_cannon.tooltip.behaviour1": "_Shoots_ a _Napalm Potato_ from your _Inventory_.",
|
||||
"item.tfmg.advanced_potato_cannon.tooltip.condition2": "While wearing Backtank",
|
||||
"item.tfmg.advanced_potato_cannon.tooltip.behaviour2": "_No_ _Durability_ will be used. Instead, _Air_ _pressure_ is drained from the Tank",
|
||||
|
||||
"item.tfmg.flamethrower.tooltip.summary": "Burns burnable _Gases_ and _Fluids_ to shoot out a burst of flame to burn your Enemies",
|
||||
"item.tfmg.flamethrower.tooltip.condition1": "When R-Clicked",
|
||||
"item.tfmg.flamethrower.tooltip.behaviour1": "_Shoots out Flames_ ",
|
||||
"item.tfmg.flamethrower.tooltip.condition2": "When R-Clicking a Fluid Tank with a Burnable Fluid/Gas inside",
|
||||
"item.tfmg.flamethrower.tooltip.behaviour2": "The _Fuel_ will be consumed from the tank. _Range_ and _Spread_ change according to your _Fuel_ of choice",
|
||||
|
||||
"item.tfmg.lithium_blade.tooltip.summary": "Using _Steel Ingot_Lithium Charges_, this Blade is set aflame burning enemies and shooting out Bolts of _Hellfire_",
|
||||
"item.tfmg.lithium_blade.tooltip.condition1": "When R-Clicked when Off",
|
||||
"item.tfmg.lithium_blade.tooltip.behaviour1": "Is set on hellfire, consuming a _Lithium Charge_. Its flame sets enemies on fire for a set amount of time, this fire is renewed even after Enemy extinguishes themself in water ",
|
||||
"item.tfmg.lithium_blade.tooltip.condition2": "When R-Clicking when On",
|
||||
"item.tfmg.lithium_blade.tooltip.behaviour2": "Shoots out several bolts of _Hellfire_ consuming the blades charge",
|
||||
|
||||
"item.tfmg.pipebomb.tooltip.summary": "So cool",
|
||||
|
||||
"item.tfmg.screwdriver.tooltip.summary": "Can lock pipes in place",
|
||||
"item.tfmg.screwdriver.tooltip.condition1": "When R-Clicking pipe",
|
||||
"item.tfmg.screwdriver.tooltip.behaviour1": "Locks _Pipe_ in its current rotation allowing for _Pipes_ to be placed next to eachother _Without Connecting_",
|
||||
|
||||
"block.tfmg.formwork_block.tooltip.summary": "Holds Liquid Concrete until it turns into concrete blocks",
|
||||
"block.tfmg.formwork_block.tooltip.condition1": "When Pumped concrete into",
|
||||
"block.tfmg.formwork_block.tooltip.behaviour1": "Fills out with _Liquid Concrete_, this Concrete eventually turns into solid blocks",
|
||||
|
||||
"block.tfmg.rebar_formwork_block.tooltip.summary": "Holds Liquid Concrete until it turns into rebar concrete blocks",
|
||||
"block.tfmg.rebar_formwork_block.tooltip.condition1": "When Pumped concrete into",
|
||||
"block.tfmg.rebar_formwork_block.tooltip.behaviour1": "Fills out with _Liquid Concrete_, this concrete eventually turns into solid rebar concrete blocks",
|
||||
|
||||
"block.tfmg.firebox.tooltip.summary": "Uses burnables to function as a blaze burner",
|
||||
"block.tfmg.firebox.condition1": "When inputted burnables into",
|
||||
"block.tfmg.firebox.tooltip.behaviour1": "The _Firebox_ will act as a _Blaze Burner_ until it runs out of fuel, there is no way to superheat it",
|
||||
|
||||
"block.tfmg.polarizer.tooltip.summary": "Makes Magnetic Ingots out of Steel",
|
||||
"block.tfmg.polarizer.condition1": "When powered",
|
||||
"block.tfmg.polarizer.tooltip.behaviour1": "Will turn a _Steel Ingot_ into a _Magnetic Ingot_ when right clicked with a _Steel Ingot_",
|
||||
|
||||
"block.tfmg.energy_meter.tooltip.summary": "Measures energy",
|
||||
"block.tfmg.energy_meter.condition1": "When put on Power Source",
|
||||
"block.tfmg.energy_meter.tooltip.behaviour1": "Measures the _Energy_ of the _Power Source_",
|
||||
"block.tfmg.energy_meter.condition2": "When looked on with Engineer's Goggles",
|
||||
"block.tfmg.energy_meter.tooltip.behaviour2": "Shows detailed info on the sources energy",
|
||||
|
||||
"block.tfmg.voltmeter.tooltip.summary": "Measures voltage",
|
||||
"block.tfmg.voltmeter.condition1": "When put on Power Source",
|
||||
"block.tfmg.voltmeter.tooltip.behaviour1": "Measures the _Voltage_ of the _Power Source_ the max energy on the _Voltmeter_ is determined by its _Measuring Range_",
|
||||
"block.tfmg.voltmeter.condition2": "When looked on with Engineer's Goggles",
|
||||
"block.tfmg.voltmeter.tooltip.behaviour2": "Shows detailed info on the sources _Voltage_ as well as the Voltmeters _Measuring Range_",
|
||||
"block.tfmg.voltmeter.condition3": "When R-Clicked with Wrench",
|
||||
"block.tfmg.voltmeter.tooltip.behaviour3": "Changes the _Measuring Range_",
|
||||
|
||||
"block.tfmg.converter.tooltip.summary": "Makes other mods compatible with TFMG by adding voltage",
|
||||
"block.tfmg.converter.condition1": "When Put FE from Bottom",
|
||||
"block.tfmg.converter.behaviour1": "The _Top_ outputs FE With _Voltage_ making it usable with _TFMG_",
|
||||
|
||||
"block.tfmg.light_bulb.tooltip.summary": "Glows when Powered",
|
||||
"block.tfmg.light_bulb.condition1": "When put on Power Source",
|
||||
"block.tfmg.light_bulb.behaviour1": "The lightbulb will _Glow_ if _Voltage_ and _Energy_ are balanced, the higher the _Voltage_, the stronger the glow",
|
||||
|
||||
"block.tfmg.rgb_light_bulb.tooltip.summary": "Glows in a certain color when Powered",
|
||||
"block.tfmg.rgb_light_bulb.condition1": "When put on Power Source",
|
||||
"block.tfmg.rgb_light_bulb.behaviour1": "The lightbulb will _Glow_ if _Voltage_ and _Energy_ are balanced, the higher the _Voltage_, the stronger the glow",
|
||||
"block.tfmg.rgb_light_bulb.condition2": "When R-Clicked with Wrench",
|
||||
"block.tfmg.rgb_light_bulb.behaviour2": "Cycles through colors",
|
||||
|
||||
"block.tfmg.creative_generator.tooltip.summary": "Outputs energy based on the value on its input panel",
|
||||
|
||||
"block.tfmg.cable connector.tooltip.summary": "Right click 2 cable connectors with a _Copper Cable_ amking them transport _Energy_",
|
||||
|
||||
"block.tfmg.lithium_torch.tooltip.summary": "Works underwater and can be placed upside down",
|
||||
|
||||
"block.tfmg.cable_tube.tooltip.summary": "Transports Energy like a Cable",
|
||||
|
||||
"block.tfmg.diagonal_cable_block.tooltip.summary": "Transports Energy like a Cable (But diagonally)",
|
||||
|
||||
"block.tfmg.capacitor.tooltip.summary": "Holds a Small Amount of energy (inserted from bottom) that can be outputted Quickly from the Top",
|
||||
|
||||
"block.tfmg.accumulator.tooltip.summary": "Holds a Large Amount of energy (inserted from bottom) that can be outputted Slowly from the Top",
|
||||
|
||||
"block.tfmg.electric_motor.tooltip.summary": "Changes energy to rotation (rpm configurable on side)",
|
||||
|
||||
"block.tfmg.generator.tooltip.summary": "Changes rotation to energy",
|
||||
|
||||
"block.tfmg.copper_coil.tooltip.summary": "Increases Voltage",
|
||||
"block.tfmg.copper_coil.tooltip.behaviour1": "To increase voltage you have to have to towers of coils either next to or one block from eachother, one atleast 1 block larger than the other, both max 5 blocks in height and with their top blocks touching. R-Click the top block in the larger tower with a wrench to make it the output. Energy is both inputted and outputted on the top of their respective towers",
|
||||
|
||||
"block.tfmg.flarestack.tooltip.summary": "Burns unneeded oil products",
|
||||
"block.tfmg.flarestack.tooltip.condition1": "When Pumped burnable Fluids/Gases into from the bottom",
|
||||
"block.tfmg.flarestack.tooltip.behaviour1": "Deletes what is pumped inside",
|
||||
|
||||
"block.tfmg.resistor.tooltip.summary": "Reduces voltage",
|
||||
"block.tfmg.resistor.tooltip.condition1": "When Put Energy into from the back (where strip of lead is smaller on top of the texture)",
|
||||
"block.tfmg.resistor.tooltip.behaviour1": "Outputs energy with voltage based on its allowed voltage (configurable on top) on front",
|
||||
|
||||
"block.tfmg.galvanic_cell.tooltip.summary": "Has a small amount of unchargable energy inside, ideal for starting your venture into electricity",
|
||||
|
||||
"block.tfmg.neon_tube.tooltip.summary": "Glows in a certain color when Powered",
|
||||
"block.tfmg.neon_tube.condition1": "When put on Power Source",
|
||||
"block.tfmg.neon_tube.behaviour1": "The tube will _Glow_ ",
|
||||
"block.tfmg.neon_tube.condition2": "When R-Clicked with Dye",
|
||||
"block.tfmg.neon_tube.behaviour2": "Changes Color",
|
||||
|
||||
"block.tfmg.low_grade_fuel_engine.tooltip.summary": "Makes Rotation from Creosote",
|
||||
"block.tfmg.low_grade_fuel_engine.condition1": "When Pumped Creosote into",
|
||||
"block.tfmg.low_grade_fuel_engine.behaviour1": "Will output a small amount of _RPM_ based on the strength of the _Redstone Signal_ inputted into it",
|
||||
|
||||
"block.tfmg.compact_engine.tooltip.summary": "Makes Rotation from Gasoline",
|
||||
"block.tfmg.compact_engine.condition1": "When Gasoline Creosote into",
|
||||
"block.tfmg.compact_engine.behaviour1": "Will output _RPM_ based on the strength of the _Redstone Signal_ inputted into it",
|
||||
|
||||
"block.tfmg.fireclay.tooltip.summary": "It is found in underground veins in the overworld",
|
||||
|
||||
"block.tfmg.copper_cable_hub.tooltip.summary": "Can be turned off with redstone",
|
||||
|
||||
"block.tfmg.aluminium_cable_hub.tooltip.summary": "Can be turned off with redstone",
|
||||
|
||||
"block.tfmg.brass_cable_hub.tooltip.summary": "Can be turned off with redstone",
|
||||
|
||||
"block.tfmg.steel_cable_hub.tooltip.summary": "Can be turned off with redstone",
|
||||
|
||||
"block.tfmg.heavy_cable_hub.tooltip.summary": "Can be turned off with redstone",
|
||||
|
||||
"block.tfmg.steel_casing_cable_hub.tooltip.summary": "Can be turned off with redstone",
|
||||
|
||||
"block.tfmg.copycat_cable_block.tooltip.summary": "Can be turned off with redstone"
|
||||
"item.tfmg.quad_potato_cannon.tooltip.behaviour2": "_No_ _Durability_ will be used. Instead, _Air_ _pressure_ is drained from the Tank"
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user