Undo rebar fix but remove rod tag.
- Also add publicly visible getTimer method and a new getRecipeCompletion method to VatBlockEntity for machines to read.
This commit is contained in:
@@ -20,6 +20,7 @@ import com.simibubi.create.foundation.item.SmartInventory;
|
||||
import com.simibubi.create.foundation.recipe.RecipeFinder;
|
||||
import com.simibubi.create.foundation.utility.CreateLang;
|
||||
import com.simibubi.create.infrastructure.config.AllConfigs;
|
||||
import io.netty.util.internal.MathUtil;
|
||||
import net.createmod.catnip.animation.LerpedFloat;
|
||||
import net.createmod.catnip.lang.LangBuilder;
|
||||
import net.createmod.catnip.theme.Color;
|
||||
@@ -30,6 +31,7 @@ import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
@@ -54,6 +56,7 @@ import net.minecraftforge.network.PacketDistributor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
@@ -856,6 +859,11 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addMachineTooltip(String operationId, List<Component> tooltip) {
|
||||
CreateLang.translate("goggles.vat."+operationId.replace(":","."))
|
||||
.forGoggles(tooltip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addToGoggleTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
||||
|
||||
@@ -872,8 +880,7 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor
|
||||
.style(ChatFormatting.GRAY)
|
||||
.forGoggles(tooltip);
|
||||
for (String operation : machines)
|
||||
CreateLang.translate("goggles.vat."+operation.replace(":","."))
|
||||
.forGoggles(tooltip);
|
||||
addMachineTooltip(operation, tooltip);
|
||||
|
||||
|
||||
CreateLang.translate("goggles.vat.heat_status")
|
||||
@@ -1158,6 +1165,15 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getTimer() {
|
||||
return timer;
|
||||
}
|
||||
|
||||
public float getRecipeCompletion() {
|
||||
if (recipe == null) return 0.0f;
|
||||
return (float) timer / recipe.getProcessingDuration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWidth(int width) {
|
||||
this.width = width;
|
||||
|
||||
@@ -94,8 +94,7 @@ public class TFMGItems {
|
||||
|
||||
public static final ItemEntry<Item>
|
||||
REBAR = REGISTRATE.item("rebar", Item::new)
|
||||
.tag(AllTags.forgeItemTag("rods/steel"))
|
||||
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/steel")), RecipeCategory.BUILDING_BLOCKS, c::get, 2))
|
||||
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/steel")), RecipeCategory.BUILDING_BLOCKS, c::get, 4))
|
||||
.register(),
|
||||
SYNTHETIC_STRING = REGISTRATE.item("synthetic_string", Item::new)
|
||||
.tag(Tags.Items.STRING, AllTags.forgeItemTag("string"))
|
||||
|
||||
Reference in New Issue
Block a user