mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
almost forgot about this one
This commit is contained in:
parent
efa790fe75
commit
65cda2b65b
@ -17,34 +17,33 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class BoilerRecipeHandler extends TemplateRecipeHandler {
|
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
|
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
|
||||||
{
|
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
|
||||||
PositionedStack input;
|
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
|
||||||
PositionedStack result;
|
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
||||||
|
|
||||||
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 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() {
|
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() {
|
public PositionedStack getResult() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "Boiler";
|
return "Boiler";
|
||||||
@ -55,23 +54,22 @@ public class BoilerRecipeHandler extends TemplateRecipeHandler {
|
|||||||
return RefStrings.MODID + ":textures/gui/nei/gui_nei_boiler.png";
|
return RefStrings.MODID + ":textures/gui/nei/gui_nei_boiler.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TemplateRecipeHandler newInstance() {
|
||||||
|
return super.newInstance();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public TemplateRecipeHandler newInstance() {
|
|
||||||
return super.newInstance();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
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();
|
Map<Object, Object> recipes = MachineRecipes.instance().getBoilerRecipes();
|
||||||
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
|
for(Map.Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||||
this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(),
|
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack) recipe.getValue()));
|
||||||
(ItemStack)recipe.getValue()));
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.loadCraftingRecipes(outputId, results);
|
super.loadCraftingRecipes(outputId, results);
|
||||||
@ -81,17 +79,15 @@ public class BoilerRecipeHandler extends TemplateRecipeHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void loadCraftingRecipes(ItemStack result) {
|
public void loadCraftingRecipes(ItemStack result) {
|
||||||
Map<Object, Object> recipes = MachineRecipes.instance().getBoilerRecipes();
|
Map<Object, Object> recipes = MachineRecipes.instance().getBoilerRecipes();
|
||||||
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
|
for(Map.Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||||
if (compareFluidStacks((ItemStack)recipe.getValue(), result) ||
|
if(compareFluidStacks((ItemStack) recipe.getValue(), result) || compareFluidStacks((ItemStack) recipe.getValue(), result))
|
||||||
compareFluidStacks((ItemStack)recipe.getValue(), result))
|
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack) recipe.getValue()));
|
||||||
this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(),
|
|
||||||
(ItemStack)recipe.getValue()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
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]);
|
loadCraftingRecipes("ntmboiler", new Object[0]);
|
||||||
} else {
|
} else {
|
||||||
super.loadUsageRecipes(inputId, ingredients);
|
super.loadUsageRecipes(inputId, ingredients);
|
||||||
@ -101,32 +97,31 @@ public class BoilerRecipeHandler extends TemplateRecipeHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void loadUsageRecipes(ItemStack ingredient) {
|
public void loadUsageRecipes(ItemStack ingredient) {
|
||||||
Map<Object, Object> recipes = MachineRecipes.instance().getBoilerRecipes();
|
Map<Object, Object> recipes = MachineRecipes.instance().getBoilerRecipes();
|
||||||
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
|
for(Map.Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||||
if (compareFluidStacks(ingredient, (ItemStack)recipe.getKey()))
|
if(compareFluidStacks(ingredient, (ItemStack) recipe.getKey()))
|
||||||
this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(),
|
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack) recipe.getValue()));
|
||||||
(ItemStack)recipe.getValue()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean compareFluidStacks(ItemStack sta1, ItemStack sta2) {
|
private boolean compareFluidStacks(ItemStack sta1, ItemStack sta2) {
|
||||||
return sta1.getItem() == sta2.getItem() && sta1.getItemDamage() == sta2.getItemDamage();
|
return sta1.getItem() == sta2.getItem() && sta1.getItemDamage() == sta2.getItemDamage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawExtras(int recipe) {
|
public void drawExtras(int recipe) {
|
||||||
drawProgressBar(80, 23, 0, 85, 6, 17, 240, 3);
|
drawProgressBar(80, 23, 0, 85, 6, 17, 240, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@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"));
|
@Override
|
||||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(18 * 2 + 2 + 36, 89 - 29 - 18 - 18, 18, 18 * 2), "ntmboiler"));
|
public void loadTransferRects() {
|
||||||
guiGui.add(GUIMachineBoiler.class);
|
transferRectsGui = new LinkedList<RecipeTransferRect>();
|
||||||
guiGui.add(GUIMachineBoilerElectric.class);
|
guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
||||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
|
||||||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
16
src/main/java/com/hbm/handler/nei/HydrotreatingHandler.java
Normal file
16
src/main/java/com/hbm/handler/nei/HydrotreatingHandler.java
Normal 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";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -38,8 +38,8 @@ public class GUILaunchPadLarge extends GuiInfoContainer {
|
|||||||
super.drawScreen(mouseX, mouseY, f);
|
super.drawScreen(mouseX, mouseY, f);
|
||||||
|
|
||||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 107, guiTop + 88 - 52, 16, 52, launchpad.power, launchpad.maxPower);
|
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[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 125, guiTop + 88 - 52, 16, 52);
|
||||||
launchpad.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 143, guiTop + 70 - 52, 16, 52);
|
launchpad.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 143, guiTop + 88 - 52, 16, 52);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -71,7 +71,7 @@ public class HydrotreatingRecipes extends SerializableRecipe {
|
|||||||
for(Entry<FluidType, Triplet<FluidStack, FluidStack, FluidStack>> recipe : recipes.entrySet()) {
|
for(Entry<FluidType, Triplet<FluidStack, FluidStack, FluidStack>> recipe : recipes.entrySet()) {
|
||||||
map.put(new ItemStack[] {
|
map.put(new ItemStack[] {
|
||||||
ItemFluidIcon.make(recipe.getKey(), 1000),
|
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[] {
|
new ItemStack[] {
|
||||||
ItemFluidIcon.make(recipe.getValue().getY().type, recipe.getValue().getY().fill * 10),
|
ItemFluidIcon.make(recipe.getValue().getY().type, recipe.getValue().getY().fill * 10),
|
||||||
ItemFluidIcon.make(recipe.getValue().getZ().type, recipe.getValue().getZ().fill * 10) });
|
ItemFluidIcon.make(recipe.getValue().getZ().type, recipe.getValue().getZ().fill * 10) });
|
||||||
|
|||||||
@ -35,6 +35,7 @@ public class ItemMissile extends ItemCustomLore {
|
|||||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
||||||
list.add(EnumChatFormatting.ITALIC + this.tier.display);
|
list.add(EnumChatFormatting.ITALIC + this.tier.display);
|
||||||
list.add("Fuel: " + this.fuel.display);
|
list.add("Fuel: " + this.fuel.display);
|
||||||
|
if(this.fuelCap > 0) list.add("Fuel capacity: " + this.fuelCap + "mB");
|
||||||
super.addInformation(itemstack, player, list, bool);
|
super.addInformation(itemstack, player, list, bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,7 @@ public class NEIConfig implements IConfigureNEI {
|
|||||||
registerHandler(new VacuumRecipeHandler());
|
registerHandler(new VacuumRecipeHandler());
|
||||||
registerHandler(new CrackingHandler());
|
registerHandler(new CrackingHandler());
|
||||||
registerHandler(new ReformingHandler());
|
registerHandler(new ReformingHandler());
|
||||||
|
registerHandler(new HydrotreatingHandler());
|
||||||
registerHandler(new BoilerRecipeHandler());
|
registerHandler(new BoilerRecipeHandler());
|
||||||
registerHandler(new ChemplantRecipeHandler());
|
registerHandler(new ChemplantRecipeHandler());
|
||||||
registerHandler(new CrystallizerRecipeHandler());
|
registerHandler(new CrystallizerRecipeHandler());
|
||||||
|
|||||||
@ -75,60 +75,62 @@ public class TileEntityLaunchPadLarge extends TileEntityLaunchPadBase implements
|
|||||||
delay = 20;
|
delay = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(delay > 0) {
|
if(this.power >= 75_000) {
|
||||||
delay--;
|
if(delay > 0) {
|
||||||
|
delay--;
|
||||||
if(delay < 10 && scheduleErect) {
|
|
||||||
this.erected = true;
|
if(delay < 10 && scheduleErect) {
|
||||||
this.scheduleErect = false;
|
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) {
|
// if there is no missile or the missile isn't ready (i.e. the erector hasn't returned to zero position yet), retract
|
||||||
//fold back erector
|
if(slots[0] == null || !readyToLoad) {
|
||||||
if(erector < 90F) {
|
//fold back erector
|
||||||
erector = Math.min(erector + erectorSpeed, 90F);
|
if(erector < 90F) {
|
||||||
if(erector == 90F) delay = 20;
|
erector = Math.min(erector + erectorSpeed, 90F);
|
||||||
//extend lift
|
if(erector == 90F) delay = 20;
|
||||||
} else if(lift < 1F) {
|
//extend lift
|
||||||
lift = Math.min(lift + liftSpeed, 1F);
|
} else if(lift < 1F) {
|
||||||
if(erector == 1F) {
|
lift = Math.min(lift + liftSpeed, 1F);
|
||||||
//if the lift is fully extended, the loading can begin
|
if(erector == 1F) {
|
||||||
readyToLoad = true;
|
//if the lift is fully extended, the loading can begin
|
||||||
delay = 20;
|
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//first, fold back the erector
|
|
||||||
if(erector < 90F) {
|
//only extend if the erector isn't up yet and the missile can be loaded
|
||||||
erector = Math.min(erector + erectorSpeed, 90F);
|
if(!erected && readyToLoad) {
|
||||||
if(erector == 90F) delay = 20;
|
//first, rotate the erector
|
||||||
//then extend the lift again
|
if(erector != 0F) {
|
||||||
} else if(lift < 1F) {
|
erector = Math.max(erector - erectorSpeed, 0F);
|
||||||
lift = Math.min(lift + liftSpeed, 1F);
|
if(erector == 0F) delay = 20;
|
||||||
if(erector == 1F) {
|
//then retract the lift
|
||||||
//if the lift is fully extended, the loading can begin
|
} else if(lift > 0) {
|
||||||
readyToLoad = true;
|
lift = Math.max(lift - liftSpeed, 0F);
|
||||||
delay = 20;
|
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 |
Loading…
x
Reference in New Issue
Block a user