mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-25 06:27:41 +01:00
added some tags and changed a couple tooltips
- added limestone, weathered limestone, gabbro, dolomite and scoria (as well as their polished variants) to #forge:stone - added #forge:storage_blocks/copper to #forge:storage_blocks - added copper block to #forge:storage_blocks/copper - added config value for the furnace generators speed - added the generation speed of water wheel, encased fan and furnace generator to their tooltips - goggles now show the power of a analog lever when worn
This commit is contained in:
parent
b4cdcb9729
commit
9497c1c1d4
11 changed files with 111 additions and 27 deletions
|
@ -7,6 +7,7 @@ public class CKinetics extends ConfigBase {
|
||||||
public ConfigInt crushingDamage = i(4, 0, "crushingDamage", Comments.crushingDamage);
|
public ConfigInt crushingDamage = i(4, 0, "crushingDamage", Comments.crushingDamage);
|
||||||
public ConfigInt maxMotorSpeed = i(256, 64, "maxMotorSpeed", Comments.rpm, Comments.maxMotorSpeed);
|
public ConfigInt maxMotorSpeed = i(256, 64, "maxMotorSpeed", Comments.rpm, Comments.maxMotorSpeed);
|
||||||
public ConfigInt waterWheelSpeed = i(5, 1, "waterWheelSpeed", Comments.rpm, Comments.waterWheelSpeed);
|
public ConfigInt waterWheelSpeed = i(5, 1, "waterWheelSpeed", Comments.rpm, Comments.waterWheelSpeed);
|
||||||
|
public ConfigInt furnaceEngineSpeed = i(16, 1, "furnaceEngineSpeed", Comments.rpm, Comments.furnaceEngineSpeed);
|
||||||
public ConfigInt maxRotationSpeed = i(256, 64, "maxRotationSpeed", Comments.rpm, Comments.maxRotationSpeed);
|
public ConfigInt maxRotationSpeed = i(256, 64, "maxRotationSpeed", Comments.rpm, Comments.maxRotationSpeed);
|
||||||
public ConfigEnum<DeployerAggroSetting> ignoreDeployerAttacks =
|
public ConfigEnum<DeployerAggroSetting> ignoreDeployerAttacks =
|
||||||
e(DeployerAggroSetting.CREEPERS, "ignoreDeployerAttacks", Comments.ignoreDeployerAttacks);
|
e(DeployerAggroSetting.CREEPERS, "ignoreDeployerAttacks", Comments.ignoreDeployerAttacks);
|
||||||
|
@ -69,6 +70,7 @@ public class CKinetics extends ConfigBase {
|
||||||
static String stress = "Fine tune the kinetic stats of individual components";
|
static String stress = "Fine tune the kinetic stats of individual components";
|
||||||
static String ignoreDeployerAttacks = "Select what mobs should ignore Deployers when attacked by them.";
|
static String ignoreDeployerAttacks = "Select what mobs should ignore Deployers when attacked by them.";
|
||||||
static String waterWheelSpeed = "Rotation speed gained by a water wheel for each side with running water. (halved if not against blades)";
|
static String waterWheelSpeed = "Rotation speed gained by a water wheel for each side with running water. (halved if not against blades)";
|
||||||
|
static String furnaceEngineSpeed = "Base rotation speed for the furnace engine generator";
|
||||||
static String disableStress = "Disable the Stress mechanic altogether.";
|
static String disableStress = "Disable the Stress mechanic altogether.";
|
||||||
static String kineticValidationFrequency = "Game ticks between Kinetic Blocks checking whether their source is still valid.";
|
static String kineticValidationFrequency = "Game ticks between Kinetic Blocks checking whether their source is still valid.";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,5 @@
|
||||||
package com.simibubi.create.foundation.item;
|
package com.simibubi.create.foundation.item;
|
||||||
|
|
||||||
import static com.simibubi.create.foundation.item.TooltipHelper.cutString;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.AQUA;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.BLUE;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.DARK_GRAY;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.DARK_GREEN;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.DARK_PURPLE;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.DARK_RED;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.GOLD;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.GRAY;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.GREEN;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.LIGHT_PURPLE;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.RED;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.STRIKETHROUGH;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.WHITE;
|
|
||||||
import static net.minecraft.util.text.TextFormatting.YELLOW;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.simibubi.create.AllItems;
|
import com.simibubi.create.AllItems;
|
||||||
import com.simibubi.create.config.AllConfigs;
|
import com.simibubi.create.config.AllConfigs;
|
||||||
import com.simibubi.create.config.CKinetics;
|
import com.simibubi.create.config.CKinetics;
|
||||||
|
@ -28,8 +7,10 @@ import com.simibubi.create.foundation.utility.Lang;
|
||||||
import com.simibubi.create.modules.contraptions.base.IRotate;
|
import com.simibubi.create.modules.contraptions.base.IRotate;
|
||||||
import com.simibubi.create.modules.contraptions.base.IRotate.SpeedLevel;
|
import com.simibubi.create.modules.contraptions.base.IRotate.SpeedLevel;
|
||||||
import com.simibubi.create.modules.contraptions.base.IRotate.StressImpact;
|
import com.simibubi.create.modules.contraptions.base.IRotate.StressImpact;
|
||||||
|
import com.simibubi.create.modules.contraptions.components.fan.EncasedFanBlock;
|
||||||
import com.simibubi.create.modules.contraptions.components.flywheel.engine.EngineBlock;
|
import com.simibubi.create.modules.contraptions.components.flywheel.engine.EngineBlock;
|
||||||
|
import com.simibubi.create.modules.contraptions.components.flywheel.engine.FurnaceEngineBlock;
|
||||||
|
import com.simibubi.create.modules.contraptions.components.waterwheel.WaterWheelBlock;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
@ -40,6 +21,14 @@ import net.minecraft.util.text.StringTextComponent;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.simibubi.create.foundation.item.TooltipHelper.cutString;
|
||||||
|
import static net.minecraft.util.text.TextFormatting.*;
|
||||||
|
|
||||||
public class ItemDescription {
|
public class ItemDescription {
|
||||||
|
|
||||||
public static final ItemDescription MISSING = new ItemDescription(null);
|
public static final ItemDescription MISSING = new ItemDescription(null);
|
||||||
|
@ -144,6 +133,12 @@ public class ItemDescription {
|
||||||
|
|
||||||
add(linesOnShift, GRAY + Lang.translate("tooltip.capacityProvided"));
|
add(linesOnShift, GRAY + Lang.translate("tooltip.capacityProvided"));
|
||||||
add(linesOnShift, level);
|
add(linesOnShift, level);
|
||||||
|
|
||||||
|
String genSpeed = generatorSpeed(block, rpmUnit);
|
||||||
|
if (!genSpeed.equals("")){
|
||||||
|
add(linesOnShift, "");
|
||||||
|
add(linesOnShift, GREEN + genSpeed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasSpeedRequirement || hasStressImpact || hasStressCapacity)
|
if (hasSpeedRequirement || hasStressImpact || hasStressCapacity)
|
||||||
|
@ -269,4 +264,23 @@ public class ItemDescription {
|
||||||
return linesOnShift;
|
return linesOnShift;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String generatorSpeed(Block block, String unitRPM){
|
||||||
|
String value = "";
|
||||||
|
|
||||||
|
if (block instanceof WaterWheelBlock) {
|
||||||
|
int baseSpeed = AllConfigs.SERVER.kinetics.waterWheelSpeed.get();
|
||||||
|
value = baseSpeed + "-" + (baseSpeed * 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (block instanceof EncasedFanBlock)
|
||||||
|
value = AllConfigs.SERVER.kinetics.generatingFanSpeed.get().toString();
|
||||||
|
|
||||||
|
else if (block instanceof FurnaceEngineBlock) {
|
||||||
|
int baseSpeed = AllConfigs.SERVER.kinetics.furnaceEngineSpeed.get();
|
||||||
|
value = baseSpeed + "-" + (baseSpeed * 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return !value.equals("") ? Lang.translate("tooltip.generationSpeed", value, unitRPM) : "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,4 +69,7 @@ public class AnalogLeverTileEntity extends SmartTileEntity {
|
||||||
sendData();
|
sendData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import com.simibubi.create.modules.contraptions.base.IRotate.SpeedLevel;
|
||||||
import com.simibubi.create.modules.contraptions.base.IRotate.StressImpact;
|
import com.simibubi.create.modules.contraptions.base.IRotate.StressImpact;
|
||||||
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
|
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
|
||||||
|
|
||||||
|
import com.simibubi.create.modules.contraptions.redstone.AnalogLeverTileEntity;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
@ -42,6 +43,7 @@ import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
||||||
public class GaugeInformationRenderer {
|
public class GaugeInformationRenderer {
|
||||||
|
|
||||||
private static DecimalFormat decimalFormat = new DecimalFormat("#.##");
|
private static DecimalFormat decimalFormat = new DecimalFormat("#.##");
|
||||||
|
private static String spacing = " ";
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void lookingAtBlocksThroughGogglesShowsTooltip(RenderGameOverlayEvent.Post event) {
|
public static void lookingAtBlocksThroughGogglesShowsTooltip(RenderGameOverlayEvent.Post event) {
|
||||||
|
@ -64,7 +66,7 @@ public class GaugeInformationRenderer {
|
||||||
|
|
||||||
if (!AllItems.GOGGLES.typeOf(goggles) && !notFastEnough)
|
if (!AllItems.GOGGLES.typeOf(goggles) && !notFastEnough)
|
||||||
return;
|
return;
|
||||||
if (mc.player.isSneaking())
|
if (mc.player.isSneaking() && !(te instanceof AnalogLeverTileEntity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
List<String> tooltip = new ArrayList<>();
|
List<String> tooltip = new ArrayList<>();
|
||||||
|
@ -79,6 +81,8 @@ public class GaugeInformationRenderer {
|
||||||
addGeneratorTooltip(state, tooltip, (GeneratingKineticTileEntity) te);
|
addGeneratorTooltip(state, tooltip, (GeneratingKineticTileEntity) te);
|
||||||
if (te instanceof KineticTileEntity)
|
if (te instanceof KineticTileEntity)
|
||||||
addStressTooltip(state, tooltip, (KineticTileEntity) te);
|
addStressTooltip(state, tooltip, (KineticTileEntity) te);
|
||||||
|
if (te instanceof AnalogLeverTileEntity)
|
||||||
|
addLeverTooltip(state, tooltip, (AnalogLeverTileEntity) te);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tooltip.isEmpty())
|
if (tooltip.isEmpty())
|
||||||
|
@ -117,7 +121,6 @@ public class GaugeInformationRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addStressTooltip(BlockState state, List<String> tooltip, KineticTileEntity te) {
|
private static void addStressTooltip(BlockState state, List<String> tooltip, KineticTileEntity te) {
|
||||||
String spacing = " ";
|
|
||||||
float stressApplied = te.getStressApplied();
|
float stressApplied = te.getStressApplied();
|
||||||
if (stressApplied == 0 || !StressImpact.isEnabled())
|
if (stressApplied == 0 || !StressImpact.isEnabled())
|
||||||
return;
|
return;
|
||||||
|
@ -139,7 +142,6 @@ public class GaugeInformationRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addGeneratorTooltip(BlockState state, List<String> tooltip, GeneratingKineticTileEntity te) {
|
private static void addGeneratorTooltip(BlockState state, List<String> tooltip, GeneratingKineticTileEntity te) {
|
||||||
String spacing = " ";
|
|
||||||
float addedStressCapacity = te.getAddedStressCapacity();
|
float addedStressCapacity = te.getAddedStressCapacity();
|
||||||
if (addedStressCapacity == 0 || !StressImpact.isEnabled())
|
if (addedStressCapacity == 0 || !StressImpact.isEnabled())
|
||||||
return;
|
return;
|
||||||
|
@ -182,7 +184,6 @@ public class GaugeInformationRenderer {
|
||||||
String _atCurrentSpeed = Lang.translate("gui.goggles.at_current_speed");
|
String _atCurrentSpeed = Lang.translate("gui.goggles.at_current_speed");
|
||||||
String _baseValue = Lang.translate("gui.goggles.base_value");
|
String _baseValue = Lang.translate("gui.goggles.base_value");
|
||||||
|
|
||||||
String spacing = " ";
|
|
||||||
tooltip.add(spacing + _infoHeader);
|
tooltip.add(spacing + _infoHeader);
|
||||||
|
|
||||||
if (AllBlocks.STRESS_GAUGE.typeOf(state)) {
|
if (AllBlocks.STRESS_GAUGE.typeOf(state)) {
|
||||||
|
@ -261,6 +262,11 @@ public class GaugeInformationRenderer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void addLeverTooltip(BlockState state, List<String> tooltip, AnalogLeverTileEntity te) {
|
||||||
|
int leverState = te.getState();
|
||||||
|
tooltip.add(spacing + Lang.translate("tooltip.analogStrength", leverState));
|
||||||
|
}
|
||||||
|
|
||||||
private static String format(double d) {
|
private static String format(double d) {
|
||||||
return decimalFormat.format(d);
|
return decimalFormat.format(d);
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,7 +310,7 @@
|
||||||
"create.generic.unit.ticks": "Ticks",
|
"create.generic.unit.ticks": "Ticks",
|
||||||
"create.generic.unit.seconds": "Seconds",
|
"create.generic.unit.seconds": "Seconds",
|
||||||
"create.generic.unit.minutes": "Minutes",
|
"create.generic.unit.minutes": "Minutes",
|
||||||
"create.generic.unit.rpm": "rpm",
|
"create.generic.unit.rpm": "RPM",
|
||||||
"create.generic.unit.stress": "su",
|
"create.generic.unit.stress": "su",
|
||||||
"create.generic.unit.degrees": "°",
|
"create.generic.unit.degrees": "°",
|
||||||
|
|
||||||
|
@ -607,6 +607,9 @@
|
||||||
"create.tooltip.capacityProvided.medium": "Medium",
|
"create.tooltip.capacityProvided.medium": "Medium",
|
||||||
"create.tooltip.capacityProvided.high": "Large",
|
"create.tooltip.capacityProvided.high": "Large",
|
||||||
"create.tooltip.capacityProvided.asGenerator": "(As Generator)",
|
"create.tooltip.capacityProvided.asGenerator": "(As Generator)",
|
||||||
|
"create.tooltip.generationSpeed" : "Generates at %1$s %2$s",
|
||||||
|
|
||||||
|
"create.tooltip.analogStrength": "Analog Strength: %1$s/15",
|
||||||
|
|
||||||
"create.tooltip.wip": "WIP",
|
"create.tooltip.wip": "WIP",
|
||||||
"create.tooltip.workInProgress": "Work in progress!",
|
"create.tooltip.workInProgress": "Work in progress!",
|
||||||
|
|
16
src/main/resources/data/forge/tags/blocks/stone.json
Normal file
16
src/main/resources/data/forge/tags/blocks/stone.json
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"create:limestone",
|
||||||
|
"create:polished_limestone",
|
||||||
|
"create:weathered_limestone",
|
||||||
|
"create:polished_weathered_limestone",
|
||||||
|
"create:gabbro",
|
||||||
|
"create:polished_gabbro",
|
||||||
|
"create:dolomite",
|
||||||
|
"create:polished_dolomite",
|
||||||
|
"create:scoria",
|
||||||
|
"create:polished_scoria"
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"#forge:storage_blocks/copper"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"create:copper_block"
|
||||||
|
]
|
||||||
|
}
|
16
src/main/resources/data/forge/tags/items/stone.json
Normal file
16
src/main/resources/data/forge/tags/items/stone.json
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"create:limestone",
|
||||||
|
"create:polished_limestone",
|
||||||
|
"create:weathered_limestone",
|
||||||
|
"create:polished_weathered_limestone",
|
||||||
|
"create:gabbro",
|
||||||
|
"create:polished_gabbro",
|
||||||
|
"create:dolomite",
|
||||||
|
"create:polished_dolomite",
|
||||||
|
"create:scoria",
|
||||||
|
"create:polished_scoria"
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"#forge:storage_blocks/copper"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"create:copper_block"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in a new issue