more RTG pellets

This commit is contained in:
Boblet 2021-11-02 11:47:09 +01:00
parent 4bfbdd8a76
commit 77eefbb1a7
7 changed files with 37 additions and 15 deletions

View File

@ -1,8 +1,12 @@
package com.hbm.inventory.gui;
import java.util.List;
import org.lwjgl.opengl.GL11;
import com.hbm.interfaces.Untested;
import com.hbm.inventory.container.ContainerMachineDiFurnaceRTG;
import com.hbm.items.machine.ItemRTGPellet;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityDiFurnaceRTG;
import com.hbm.util.I18nUtil;
@ -25,14 +29,24 @@ public class GUIMachineDiFurnaceRTG extends GuiInfoContainer {
}
@Override
@Untested
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
String[] infoText = I18nUtil.resolveKeyArray("desc.gui.rtgBFurnace.pellets");
String[] descText = I18nUtil.resolveKeyArray("desc.gui.rtgBFurnace.desc");
String[] heatText = I18nUtil.resolveKeyArray("desc.gui.rtgBFurnace.heat", bFurnace.getPower());
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 15, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, infoText);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 15, guiTop + 36 + 16, 16, 16, guiLeft - 8, guiTop + 36 + 16, descText);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 58, guiTop + 36, 18, 16, mouseX, mouseY, heatText);
List<ItemRTGPellet> pellets = ItemRTGPellet.pelletList;
String[] pelletText = new String[pellets.size() + 1];
pelletText[0] = I18nUtil.resolveKey("desc.gui.rtgBFurnace.pellets");
for(int i = 0; i < pellets.size(); i++) {
ItemRTGPellet pellet = pellets.get(i);
pelletText[i + 1] = I18nUtil.resolveKey("desc.gui.rtgBFurnace.pellet", I18nUtil.resolveKey(pellet.getUnlocalizedName()), pellet.getHeat());
}
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 15, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, pelletText);
}
@Override

View File

@ -675,8 +675,12 @@ public class ModItems {
public static Item pellet_rtg;
public static Item pellet_rtg_weak;
public static Item pellet_rtg_polonium;
public static Item pellet_rtg_actinium;
public static Item pellet_rtg_strontium;
public static Item pellet_rtg_gold;
public static Item pellet_rtg_americium;
public static Item pellet_rtg_berkelium;
public static Item tritium_deuterium_cake;
public static Item pellet_schrabidium;
@ -3025,8 +3029,11 @@ public class ModItems {
pellet_rtg = new ItemRTGPellet(5).setUnlocalizedName("pellet_rtg").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg");
pellet_rtg_weak = new ItemRTGPellet(2).setUnlocalizedName("pellet_rtg_weak").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_weak");
pellet_rtg_polonium = new ItemRTGPellet(25).setUnlocalizedName("pellet_rtg_polonium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_polonium");
pellet_rtg_actinium = new ItemRTGPellet(15).setUnlocalizedName("pellet_rtg_actinium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pellet_rtg_actinium");
pellet_rtg_strontium = new ItemRTGPellet(15).setUnlocalizedName("pellet_rtg_strontium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pellet_rtg_strontium");
pellet_rtg_gold = new ItemRTGPellet(150).setUnlocalizedName("pellet_rtg_gold").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_gold");
pellet_rtg_americium = new ItemRTGPellet(15).setUnlocalizedName("pellet_rtg_americium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_americium");
pellet_rtg_berkelium = new ItemRTGPellet(20).setUnlocalizedName("pellet_rtg_berkelium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_berkelium");
tritium_deuterium_cake = new ItemCustomLore().setUnlocalizedName("tritium_deuterium_cake").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":tritium_deuterium_cake");
piston_selenium = new Item().setUnlocalizedName("piston_selenium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":piston_selenium");
@ -5999,8 +6006,11 @@ public class ModItems {
GameRegistry.registerItem(pellet_rtg, pellet_rtg.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_weak, pellet_rtg_weak.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_polonium, pellet_rtg_polonium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_strontium, pellet_rtg_strontium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_actinium, pellet_rtg_actinium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_gold, pellet_rtg_gold.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_americium, pellet_rtg_americium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_berkelium, pellet_rtg_berkelium.getUnlocalizedName());
GameRegistry.registerItem(tritium_deuterium_cake, tritium_deuterium_cake.getUnlocalizedName());
GameRegistry.registerItem(pellet_cluster, pellet_cluster.getUnlocalizedName());
GameRegistry.registerItem(pellet_buckshot, pellet_buckshot.getUnlocalizedName());

View File

@ -26,7 +26,7 @@ public class ItemRTGPellet extends Item implements IRadioisotopeFuel {
private ItemStack decayItem = null;
private long lifespan = 0;
private static final ArrayList<ItemRTGPellet> pelletList = new ArrayList<>();
public static final List<ItemRTGPellet> pelletList = new ArrayList();
public ItemRTGPellet(int heatIn) {
heat = (short) heatIn;
@ -67,7 +67,7 @@ public class ItemRTGPellet extends Item implements IRadioisotopeFuel {
}
@Override
public short getPower() {
public short getHeat() {
return heat;
}
@ -110,10 +110,6 @@ public class ItemRTGPellet extends Item implements IRadioisotopeFuel {
}
public String getData() {
return String.format("%s (%s HE/t) %s", I18nUtil.resolveKey(getUnlocalizedName().concat(".name")), getPower(), (getDoesDecay() ? " (decays)" : ""));
}
public static ImmutableSet<ItemRTGPellet> getPellets() {
return ImmutableSet.copyOf(pelletList);
return String.format("%s (%s HE/t) %s", I18nUtil.resolveKey(getUnlocalizedName().concat(".name")), getHeat(), (getDoesDecay() ? " (decays)" : ""));
}
}

View File

@ -28,7 +28,7 @@ public interface IRTGUser
public static short getPower(IRadioisotopeFuel fuel, ItemStack stack)
{
return MachineConfig.scaleRTGPower ? IRadioisotopeFuel.getScaledPower(fuel, stack) : fuel.getPower();
return MachineConfig.scaleRTGPower ? IRadioisotopeFuel.getScaledPower(fuel, stack) : fuel.getHeat();
}
/**

View File

@ -28,7 +28,7 @@ public interface IRadioisotopeFuel
public ItemStack getDecayItem();
public IRadioisotopeFuel setDecays(@Nonnull ItemStack stack, long lifespan);
public boolean getDoesDecay();
public short getPower();
public short getHeat();
/**
* Get the scaled power between max and 0, depending on decay
* @param fuel The fuel instance
@ -37,7 +37,7 @@ public interface IRadioisotopeFuel
*/
public static short getScaledPower(IRadioisotopeFuel fuel, ItemStack stack)
{
return (short) Math.ceil(fuel.getPower() * (fuel.getLifespan(stack) * fuel.getMaxLifespan()));
return (short) Math.ceil(fuel.getHeat() * (fuel.getLifespan(stack) * fuel.getMaxLifespan()));
}
@CheckForNull
@ -132,7 +132,7 @@ public interface IRadioisotopeFuel
public static void addTooltip(List<String> tooltip, ItemStack stack, boolean showAdv)
{
final IRadioisotopeFuel instance = (IRadioisotopeFuel) stack.getItem();
tooltip.add(I18nUtil.resolveKey("desc.item.rtgHeat", instance.getDoesDecay() && MachineConfig.scaleRTGPower ? getScaledPower(instance, stack) : instance.getPower()));
tooltip.add(I18nUtil.resolveKey("desc.item.rtgHeat", instance.getDoesDecay() && MachineConfig.scaleRTGPower ? getScaledPower(instance, stack) : instance.getHeat()));
if (instance.getDoesDecay())
{
tooltip.add(I18nUtil.resolveKey("desc.item.rtgDecay", I18nUtil.resolveKey(instance.getDecayItem().getUnlocalizedName() + ".name"), instance.getDecayItem().stackSize));

View File

@ -352,7 +352,8 @@ death.attack.teleporter=%1$s wurde ins Nichts teleportiert.
desc.item.rtgHeat=Hitzelevel: %s
desc.gui.rtgBFurnace.desc=Bönitigt mindestens 15 Hitze um zu starten$Je mehr Hitze, desto schneller der Vorgang$Hitze über dem maximalen Level hat keinen Effekt$Gold-198 kann zu Quecksilber zerfallen
desc.gui.rtgBFurnace.heat=§eHitzelevel: %s
desc.gui.rtgBFurnace.pellets=Akzeptierte Pellets:$ Pu238-Pellet (+5 Hitze)$ U238-Pellet (+1 Hitze)$ Po210-Pellet (+25 Hitze)$ Au198-Pellet (+150 Hitze)
desc.gui.rtgBFurnace.pellets=Akzeptierte Pellets:
desc.gui.rtgBFurnace.pellet=%s (%s Hitze)
digamma.playerDigamma=Digammabelastung:
digamma.playerHealth=Digammaeinfluss:

View File

@ -420,7 +420,8 @@ death.attack.teleporter=%1$s was teleported into nothingness.
desc.item.rtgHeat=Power Level: %s
desc.gui.rtgBFurnace.desc=Requires at least 15 heat to process$The more heat on top of that, the faster it runs$Heat going over maximum speed will have no effect$Gold-198 may decay into Mercury
desc.gui.rtgBFurnace.heat=§eCurrent heat level: %s
desc.gui.rtgBFurnace.pellets=Accepted Pellets:$ Pu238 Pellet (+5 heat)$ Weak U238 Pellet (+1 heat)$ Po210 Pellet (+25 heat)$ Au198 Pellet (+150 heat)
desc.gui.rtgBFurnace.pellets=Accepted Pellets:
desc.gui.rtgBFurnace.pellet=%s (%s heat)
digamma.playerDigamma=Digamma exposure:
digamma.playerHealth=Digamma influence: