almost forgot about this one

This commit is contained in:
Bob 2024-02-16 22:07:17 +01:00
parent efa790fe75
commit 65cda2b65b
9 changed files with 132 additions and 117 deletions

View File

@ -17,34 +17,33 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class BoilerRecipeHandler extends TemplateRecipeHandler {
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe
{
PositionedStack input;
PositionedStack result;
public SmeltingSet(ItemStack input, ItemStack result) {
input.stackSize = 1;
this.input = new PositionedStack(input, 21 + 9, 6 + 18);
this.result = new PositionedStack(result, 120, 24);
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
@Override
public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe {
PositionedStack input;
PositionedStack result;
public SmeltingSet(ItemStack input, ItemStack result) {
input.stackSize = 1;
this.input = new PositionedStack(input, 21 + 9, 6 + 18);
this.result = new PositionedStack(result, 120, 24);
}
@Override
public List<PositionedStack> getIngredients() {
return getCycledIngredients(cycleticks / 48, Arrays.asList(new PositionedStack[] {input}));
}
return getCycledIngredients(cycleticks / 48, Arrays.asList(new PositionedStack[] { input }));
}
@Override
@Override
public PositionedStack getResult() {
return result;
}
}
return result;
}
}
@Override
public String getRecipeName() {
return "Boiler";
@ -55,23 +54,22 @@ public class BoilerRecipeHandler extends TemplateRecipeHandler {
return RefStrings.MODID + ":textures/gui/nei/gui_nei_boiler.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return null;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return null;
}
@Override
public TemplateRecipeHandler newInstance() {
return super.newInstance();
}
@Override
public TemplateRecipeHandler newInstance() {
return super.newInstance();
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if ((outputId.equals("ntmboiler")) && getClass() == BoilerRecipeHandler.class) {
if((outputId.equals("ntmboiler")) && getClass() == BoilerRecipeHandler.class) {
Map<Object, Object> recipes = MachineRecipes.instance().getBoilerRecipes();
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(),
(ItemStack)recipe.getValue()));
for(Map.Entry<Object, Object> recipe : recipes.entrySet()) {
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack) recipe.getValue()));
}
} else {
super.loadCraftingRecipes(outputId, results);
@ -81,17 +79,15 @@ public class BoilerRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadCraftingRecipes(ItemStack result) {
Map<Object, Object> recipes = MachineRecipes.instance().getBoilerRecipes();
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
if (compareFluidStacks((ItemStack)recipe.getValue(), result) ||
compareFluidStacks((ItemStack)recipe.getValue(), result))
this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(),
(ItemStack)recipe.getValue()));
for(Map.Entry<Object, Object> recipe : recipes.entrySet()) {
if(compareFluidStacks((ItemStack) recipe.getValue(), result) || compareFluidStacks((ItemStack) recipe.getValue(), result))
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack) recipe.getValue()));
}
}
@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if ((inputId.equals("ntmboiler")) && getClass() == BoilerRecipeHandler.class) {
if((inputId.equals("ntmboiler")) && getClass() == BoilerRecipeHandler.class) {
loadCraftingRecipes("ntmboiler", new Object[0]);
} else {
super.loadUsageRecipes(inputId, ingredients);
@ -101,32 +97,31 @@ public class BoilerRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadUsageRecipes(ItemStack ingredient) {
Map<Object, Object> recipes = MachineRecipes.instance().getBoilerRecipes();
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
if (compareFluidStacks(ingredient, (ItemStack)recipe.getKey()))
this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(),
(ItemStack)recipe.getValue()));
for(Map.Entry<Object, Object> recipe : recipes.entrySet()) {
if(compareFluidStacks(ingredient, (ItemStack) recipe.getKey()))
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack) recipe.getValue()));
}
}
private boolean compareFluidStacks(ItemStack sta1, ItemStack sta2) {
return sta1.getItem() == sta2.getItem() && sta1.getItemDamage() == sta2.getItemDamage();
}
@Override
public void drawExtras(int recipe) {
drawProgressBar(80, 23, 0, 85, 6, 17, 240, 3);
}
@Override
public void loadTransferRects() {
transferRectsGui = new LinkedList<RecipeTransferRect>();
guiGui = new LinkedList<Class<? extends GuiContainer>>();
@Override
public void drawExtras(int recipe) {
drawProgressBar(80, 23, 0, 85, 6, 17, 240, 3);
}
transferRects.add(new RecipeTransferRect(new Rectangle(138 - 1 - 36 - 27 - 9, 23, 36, 18), "ntmboiler"));
transferRectsGui.add(new RecipeTransferRect(new Rectangle(18 * 2 + 2 + 36, 89 - 29 - 18 - 18, 18, 18 * 2), "ntmboiler"));
guiGui.add(GUIMachineBoiler.class);
guiGui.add(GUIMachineBoilerElectric.class);
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
}
@Override
public void loadTransferRects() {
transferRectsGui = new LinkedList<RecipeTransferRect>();
guiGui = new LinkedList<Class<? extends GuiContainer>>();
transferRects.add(new RecipeTransferRect(new Rectangle(138 - 1 - 36 - 27 - 9, 23, 36, 18), "ntmboiler"));
transferRectsGui.add(new RecipeTransferRect(new Rectangle(18 * 2 + 2 + 36, 89 - 29 - 18 - 18, 18, 18 * 2), "ntmboiler"));
guiGui.add(GUIMachineBoiler.class);
guiGui.add(GUIMachineBoilerElectric.class);
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
}
}

View File

@ -0,0 +1,16 @@
package com.hbm.handler.nei;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.recipes.HydrotreatingRecipes;
public class HydrotreatingHandler extends NEIUniversalHandler {
public HydrotreatingHandler() {
super("Hydrotreating", ModBlocks.machine_hydrotreater, HydrotreatingRecipes.getRecipes());
}
@Override
public String getKey() {
return "ntmHydrotreating";
}
}

View File

@ -38,8 +38,8 @@ public class GUILaunchPadLarge extends GuiInfoContainer {
super.drawScreen(mouseX, mouseY, f);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 107, guiTop + 88 - 52, 16, 52, launchpad.power, launchpad.maxPower);
launchpad.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 125, guiTop + 70 - 52, 16, 52);
launchpad.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 143, guiTop + 70 - 52, 16, 52);
launchpad.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 125, guiTop + 88 - 52, 16, 52);
launchpad.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 143, guiTop + 88 - 52, 16, 52);
}
@Override

View File

@ -71,7 +71,7 @@ public class HydrotreatingRecipes extends SerializableRecipe {
for(Entry<FluidType, Triplet<FluidStack, FluidStack, FluidStack>> recipe : recipes.entrySet()) {
map.put(new ItemStack[] {
ItemFluidIcon.make(recipe.getKey(), 1000),
ItemFluidIcon.make(recipe.getValue().getX().type, recipe.getValue().getX().fill * 10) },
ItemFluidIcon.make(recipe.getValue().getX().type, recipe.getValue().getX().fill * 10, 1) },
new ItemStack[] {
ItemFluidIcon.make(recipe.getValue().getY().type, recipe.getValue().getY().fill * 10),
ItemFluidIcon.make(recipe.getValue().getZ().type, recipe.getValue().getZ().fill * 10) });

View File

@ -35,6 +35,7 @@ public class ItemMissile extends ItemCustomLore {
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add(EnumChatFormatting.ITALIC + this.tier.display);
list.add("Fuel: " + this.fuel.display);
if(this.fuelCap > 0) list.add("Fuel capacity: " + this.fuelCap + "mB");
super.addInformation(itemstack, player, list, bool);
}

View File

@ -42,6 +42,7 @@ public class NEIConfig implements IConfigureNEI {
registerHandler(new VacuumRecipeHandler());
registerHandler(new CrackingHandler());
registerHandler(new ReformingHandler());
registerHandler(new HydrotreatingHandler());
registerHandler(new BoilerRecipeHandler());
registerHandler(new ChemplantRecipeHandler());
registerHandler(new CrystallizerRecipeHandler());

View File

@ -75,60 +75,62 @@ public class TileEntityLaunchPadLarge extends TileEntityLaunchPadBase implements
delay = 20;
}
if(delay > 0) {
delay--;
if(delay < 10 && scheduleErect) {
this.erected = true;
this.scheduleErect = false;
}
// if there is no missile or the missile isn't ready (i.e. the erector hasn't returned to zero position yet), retract
if(slots[0] == null || !readyToLoad) {
//fold back erector
if(erector < 90F) {
erector = Math.min(erector + erectorSpeed, 90F);
if(erector == 90F) delay = 20;
//extend lift
} else if(lift < 1F) {
lift = Math.min(lift + liftSpeed, 1F);
if(erector == 1F) {
//if the lift is fully extended, the loading can begin
readyToLoad = true;
delay = 20;
}
}
}
} else {
//only extend if the erector isn't up yet and the missile can be loaded
if(!erected && readyToLoad) {
//first, rotate the erector
if(erector != 0F) {
erector = Math.max(erector - erectorSpeed, 0F);
if(erector == 0F) delay = 20;
//then retract the lift
} else if(lift > 0) {
lift = Math.max(lift - liftSpeed, 0F);
if(lift == 0F) {
//once the lift is at the bottom, the missile is deployed
scheduleErect = true;
delay = 20;
if(this.power >= 75_000) {
if(delay > 0) {
delay--;
if(delay < 10 && scheduleErect) {
this.erected = true;
this.scheduleErect = false;
}
// if there is no missile or the missile isn't ready (i.e. the erector hasn't returned to zero position yet), retract
if(slots[0] == null || !readyToLoad) {
//fold back erector
if(erector < 90F) {
erector = Math.min(erector + erectorSpeed, 90F);
if(erector == 90F) delay = 20;
//extend lift
} else if(lift < 1F) {
lift = Math.min(lift + liftSpeed, 1F);
if(erector == 1F) {
//if the lift is fully extended, the loading can begin
readyToLoad = true;
delay = 20;
}
}
}
} else {
//first, fold back the erector
if(erector < 90F) {
erector = Math.min(erector + erectorSpeed, 90F);
if(erector == 90F) delay = 20;
//then extend the lift again
} else if(lift < 1F) {
lift = Math.min(lift + liftSpeed, 1F);
if(erector == 1F) {
//if the lift is fully extended, the loading can begin
readyToLoad = true;
delay = 20;
//only extend if the erector isn't up yet and the missile can be loaded
if(!erected && readyToLoad) {
//first, rotate the erector
if(erector != 0F) {
erector = Math.max(erector - erectorSpeed, 0F);
if(erector == 0F) delay = 20;
//then retract the lift
} else if(lift > 0) {
lift = Math.max(lift - liftSpeed, 0F);
if(lift == 0F) {
//once the lift is at the bottom, the missile is deployed
scheduleErect = true;
delay = 20;
}
}
} else {
//first, fold back the erector
if(erector < 90F) {
erector = Math.min(erector + erectorSpeed, 90F);
if(erector == 90F) delay = 20;
//then extend the lift again
} else if(lift < 1F) {
lift = Math.min(lift + liftSpeed, 1F);
if(erector == 1F) {
//if the lift is fully extended, the loading can begin
readyToLoad = true;
delay = 20;
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 10 KiB