mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
some pylon memes, spent fuel pool NEI handler
This commit is contained in:
parent
8037893637
commit
65830d76d1
@ -178,7 +178,9 @@ public abstract class BlockDummyable extends BlockContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!world.isRemote) {
|
if(!world.isRemote) {
|
||||||
world.setBlock(x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, this, dir.ordinal() + offset, 3);
|
//this is separate because the multiblock rotation and the final meta might not be the same
|
||||||
|
int meta = getMetaForCore(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, (EntityPlayer) player, dir.ordinal() + offset);
|
||||||
|
world.setBlock(x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, this, meta, 3);
|
||||||
fillSpace(world, x, y, z, dir, o);
|
fillSpace(world, x, y, z, dir, o);
|
||||||
}
|
}
|
||||||
y -= getHeightOffset();
|
y -= getHeightOffset();
|
||||||
@ -188,6 +190,28 @@ public abstract class BlockDummyable extends BlockContainer {
|
|||||||
super.onBlockPlacedBy(world, x, y, z, player, itemStack);
|
super.onBlockPlacedBy(world, x, y, z, player, itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A bit more advanced than the dir modifier, but it is important that the resulting direction meta is in the core range.
|
||||||
|
* Using the "extra" metas is technically possible but requires a bit of tinkering, e.g. preventing a recursive loop
|
||||||
|
* in the core finder and making sure the TE uses the right metas.
|
||||||
|
* @param world
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @param z
|
||||||
|
* @param player
|
||||||
|
* @param original
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
protected int getMetaForCore(World world, int x, int y, int z, EntityPlayer player, int original) {
|
||||||
|
return original;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows to modify the general placement direction as if the player had another rotation.
|
||||||
|
* Quite basic due to only having 1 param but it's more meant to fix/limit the amount of directions
|
||||||
|
* @param dir
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
protected ForgeDirection getDirModified(ForgeDirection dir) {
|
protected ForgeDirection getDirModified(ForgeDirection dir) {
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
@ -215,12 +239,10 @@ public abstract class BlockDummyable extends BlockContainer {
|
|||||||
this.safeRem = true;
|
this.safeRem = true;
|
||||||
world.setBlock(x, y, z, this, meta + extra, 3);
|
world.setBlock(x, y, z, this, meta + extra, 3);
|
||||||
this.safeRem = false;
|
this.safeRem = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// checks if the dummy metadata is within the extra range
|
// checks if the dummy metadata is within the extra range
|
||||||
public boolean hasExtra(int meta) {
|
public boolean hasExtra(int meta) {
|
||||||
|
|
||||||
return meta > 5 && meta < 12;
|
return meta > 5 && meta < 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -694,6 +694,7 @@ public class ModBlocks {
|
|||||||
public static Block red_cable;
|
public static Block red_cable;
|
||||||
public static Block red_connector;
|
public static Block red_connector;
|
||||||
public static Block red_pylon;
|
public static Block red_pylon;
|
||||||
|
public static Block red_pylon_large;
|
||||||
public static Block cable_switch;
|
public static Block cable_switch;
|
||||||
public static Block machine_detector;
|
public static Block machine_detector;
|
||||||
public static Block rf_cable;
|
public static Block rf_cable;
|
||||||
@ -1795,6 +1796,7 @@ public class ModBlocks {
|
|||||||
rf_cable = new BlockRFCable(Material.iron).setBlockName("rf_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":rf_cable_icon");
|
rf_cable = new BlockRFCable(Material.iron).setBlockName("rf_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":rf_cable_icon");
|
||||||
red_connector = new ConnectorRedWire(Material.iron).setBlockName("red_connector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_connector");
|
red_connector = new ConnectorRedWire(Material.iron).setBlockName("red_connector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_connector");
|
||||||
red_pylon = new PylonRedWire(Material.iron).setBlockName("red_pylon").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_pylon");
|
red_pylon = new PylonRedWire(Material.iron).setBlockName("red_pylon").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_pylon");
|
||||||
|
red_pylon_large = new PylonLarge(Material.iron).setBlockName("red_pylon_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_pylon_large");
|
||||||
cable_switch = new CableSwitch(Material.iron).setBlockName("cable_switch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cable_switch_off");
|
cable_switch = new CableSwitch(Material.iron).setBlockName("cable_switch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cable_switch_off");
|
||||||
machine_detector = new PowerDetector(Material.iron).setBlockName("machine_detector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_detector_off");
|
machine_detector = new PowerDetector(Material.iron).setBlockName("machine_detector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_detector_off");
|
||||||
oil_duct_solid = new OilDuctSolid(Material.iron).setBlockName("oil_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":oil_duct_solid_alt");
|
oil_duct_solid = new OilDuctSolid(Material.iron).setBlockName("oil_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":oil_duct_solid_alt");
|
||||||
@ -2875,6 +2877,7 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(red_connector, ItemBlockBase.class, red_connector.getUnlocalizedName());
|
GameRegistry.registerBlock(red_connector, ItemBlockBase.class, red_connector.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(red_pylon, ItemBlockBase.class, red_pylon.getUnlocalizedName());
|
GameRegistry.registerBlock(red_pylon, ItemBlockBase.class, red_pylon.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(red_pylon_large, ItemBlockBase.class, red_pylon_large.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(cable_switch, cable_switch.getUnlocalizedName());
|
GameRegistry.registerBlock(cable_switch, cable_switch.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(machine_detector, machine_detector.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_detector, machine_detector.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(rf_cable, rf_cable.getUnlocalizedName());
|
GameRegistry.registerBlock(rf_cable, rf_cable.getUnlocalizedName());
|
||||||
|
|||||||
48
src/main/java/com/hbm/blocks/network/PylonLarge.java
Normal file
48
src/main/java/com/hbm/blocks/network/PylonLarge.java
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
package com.hbm.blocks.network;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.blocks.BlockDummyable;
|
||||||
|
import com.hbm.blocks.ITooltipProvider;
|
||||||
|
import com.hbm.tileentity.network.TileEntityPylonLarge;
|
||||||
|
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class PylonLarge extends BlockDummyable implements ITooltipProvider {
|
||||||
|
|
||||||
|
public PylonLarge(Material mat) {
|
||||||
|
super(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int meta) {
|
||||||
|
return new TileEntityPylonLarge();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||||
|
list.add(EnumChatFormatting.GOLD + "Connection Type: " + EnumChatFormatting.YELLOW + "Quadruple");
|
||||||
|
list.add(EnumChatFormatting.GOLD + "Connection Range: " + EnumChatFormatting.YELLOW + "100m");
|
||||||
|
list.add(EnumChatFormatting.GOLD + "This pylon requires a substation!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getDimensions() {
|
||||||
|
return new int[] {9, 0, 1, 1, 1, 1};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getOffset() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getMetaForCore(World world, int x, int y, int z, EntityPlayer player, int original) {
|
||||||
|
return original;
|
||||||
|
}
|
||||||
|
}
|
||||||
108
src/main/java/com/hbm/handler/nei/FuelPoolHandler.java
Normal file
108
src/main/java/com/hbm/handler/nei/FuelPoolHandler.java
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
package com.hbm.handler.nei;
|
||||||
|
|
||||||
|
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||||
|
import com.hbm.inventory.recipes.FuelPoolRecipes;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
|
||||||
|
import codechicken.nei.NEIServerUtils;
|
||||||
|
import codechicken.nei.PositionedStack;
|
||||||
|
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class FuelPoolHandler extends TemplateRecipeHandler {
|
||||||
|
|
||||||
|
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
|
||||||
|
|
||||||
|
PositionedStack input;
|
||||||
|
PositionedStack output;
|
||||||
|
|
||||||
|
public RecipeSet(ItemStack in, ItemStack out) {
|
||||||
|
this.input = new PositionedStack(in, 48, 24);
|
||||||
|
this.output = new PositionedStack(out, 102, 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PositionedStack> getIngredients() {
|
||||||
|
return getCycledIngredients(cycleticks / 48, Arrays.asList(input));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PositionedStack getResult() {
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PositionedStack> getOtherStacks() {
|
||||||
|
return Arrays.asList(new PositionedStack(new ItemStack(ModBlocks.machine_waste_drum), 75, 31));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRecipeName() {
|
||||||
|
return "Spent Fuel Pool Drum";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGuiTexture() {
|
||||||
|
return RefStrings.MODID + ":textures/gui/nei/gui_nei.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawBackground(int recipe) {
|
||||||
|
super.drawBackground(recipe);
|
||||||
|
drawTexturedModalRect(47, 23, 5, 87, 18, 18);
|
||||||
|
drawTexturedModalRect(101, 23, 5, 87, 18, 18);
|
||||||
|
drawTexturedModalRect(74, 14, 59, 87, 18, 38);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||||
|
|
||||||
|
if(outputId.equals("ntmSpentDrum")) {
|
||||||
|
|
||||||
|
for(Entry<ComparableStack, ItemStack> recipe : FuelPoolRecipes.recipes.entrySet()) {
|
||||||
|
this.arecipes.add(new RecipeSet(recipe.getKey().toStack(), recipe.getValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
super.loadCraftingRecipes(outputId, results);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadCraftingRecipes(ItemStack result) {
|
||||||
|
|
||||||
|
for(Entry<ComparableStack, ItemStack> recipe : FuelPoolRecipes.recipes.entrySet()) {
|
||||||
|
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getValue(), result)) {
|
||||||
|
this.arecipes.add(new RecipeSet(recipe.getKey().toStack(), recipe.getValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||||
|
|
||||||
|
if(inputId.equals("ntmSpentDrum")) {
|
||||||
|
loadCraftingRecipes("ntmSpentDrum", new Object[0]);
|
||||||
|
} else {
|
||||||
|
super.loadUsageRecipes(inputId, ingredients);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadUsageRecipes(ItemStack ingredient) {
|
||||||
|
|
||||||
|
for(Entry<ComparableStack, ItemStack> recipe : FuelPoolRecipes.recipes.entrySet()) {
|
||||||
|
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getKey().toStack(), ingredient)) {
|
||||||
|
this.arecipes.add(new RecipeSet(recipe.getKey().toStack(), recipe.getValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
src/main/java/com/hbm/inventory/recipes/FuelPoolRecipes.java
Normal file
24
src/main/java/com/hbm/inventory/recipes/FuelPoolRecipes.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package com.hbm.inventory.recipes;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class FuelPoolRecipes {
|
||||||
|
|
||||||
|
public static final HashMap<ComparableStack, ItemStack> recipes = new HashMap<ComparableStack, ItemStack>();
|
||||||
|
|
||||||
|
public static void register() {
|
||||||
|
recipes.put(new ComparableStack(ModItems.waste_natural_uranium_hot), new ItemStack(ModItems.waste_natural_uranium));
|
||||||
|
recipes.put(new ComparableStack(ModItems.waste_uranium_hot), new ItemStack(ModItems.waste_uranium));
|
||||||
|
recipes.put(new ComparableStack(ModItems.waste_thorium_hot), new ItemStack(ModItems.waste_thorium));
|
||||||
|
recipes.put(new ComparableStack(ModItems.waste_mox_hot), new ItemStack(ModItems.waste_mox));
|
||||||
|
recipes.put(new ComparableStack(ModItems.waste_plutonium_hot), new ItemStack(ModItems.waste_plutonium));
|
||||||
|
recipes.put(new ComparableStack(ModItems.waste_u233_hot), new ItemStack(ModItems.waste_u233));
|
||||||
|
recipes.put(new ComparableStack(ModItems.waste_u235_hot), new ItemStack(ModItems.waste_u235));
|
||||||
|
recipes.put(new ComparableStack(ModItems.waste_schrabidium_hot), new ItemStack(ModItems.waste_schrabidium));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -956,6 +956,7 @@ public class MainRegistry {
|
|||||||
PressRecipes.register();
|
PressRecipes.register();
|
||||||
RefineryRecipes.registerFractions();
|
RefineryRecipes.registerFractions();
|
||||||
RefineryRecipes.registerCracking();
|
RefineryRecipes.registerCracking();
|
||||||
|
FuelPoolRecipes.register();
|
||||||
|
|
||||||
TileEntityNukeCustom.registerBombItems();
|
TileEntityNukeCustom.registerBombItems();
|
||||||
ArmorUtil.register();
|
ArmorUtil.register();
|
||||||
|
|||||||
@ -54,6 +54,8 @@ public class NEIConfig implements IConfigureNEI {
|
|||||||
API.registerUsageHandler(new SmithingRecipeHandler());
|
API.registerUsageHandler(new SmithingRecipeHandler());
|
||||||
API.registerRecipeHandler(new AnvilRecipeHandler());
|
API.registerRecipeHandler(new AnvilRecipeHandler());
|
||||||
API.registerUsageHandler(new AnvilRecipeHandler());
|
API.registerUsageHandler(new AnvilRecipeHandler());
|
||||||
|
API.registerRecipeHandler(new FuelPoolHandler());
|
||||||
|
API.registerUsageHandler(new FuelPoolHandler());
|
||||||
|
|
||||||
//Some things are even beyond my control...or are they?
|
//Some things are even beyond my control...or are they?
|
||||||
API.hideItem(ItemBattery.getEmptyBattery(ModItems.memory));
|
API.hideItem(ItemBattery.getEmptyBattery(ModItems.memory));
|
||||||
|
|||||||
@ -274,6 +274,7 @@ public class ResourceManager {
|
|||||||
|
|
||||||
//Network
|
//Network
|
||||||
public static final IModelCustom connector = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/network/connector.obj"));
|
public static final IModelCustom connector = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/network/connector.obj"));
|
||||||
|
public static final IModelCustom pylon_large = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/network/pylon_large.obj"));
|
||||||
|
|
||||||
////Textures TEs
|
////Textures TEs
|
||||||
|
|
||||||
@ -568,6 +569,7 @@ public class ResourceManager {
|
|||||||
|
|
||||||
//Electricity
|
//Electricity
|
||||||
public static final ResourceLocation connector_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/connector.png");
|
public static final ResourceLocation connector_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/connector.png");
|
||||||
|
public static final ResourceLocation pylon_large_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/pylon_large.png");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import net.minecraft.world.World;
|
|||||||
public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
|
public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
|
||||||
|
|
||||||
//TODO: adapt this into a more generic form for multi wire pylons
|
//TODO: adapt this into a more generic form for multi wire pylons
|
||||||
|
@Deprecated
|
||||||
public void renderSingleLine(TileEntityPylonBase pyl, double x, double y, double z) {
|
public void renderSingleLine(TileEntityPylonBase pyl, double x, double y, double z) {
|
||||||
|
|
||||||
for(int i = 0; i < pyl.connected.size(); i++) {
|
for(int i = 0; i < pyl.connected.size(); i++) {
|
||||||
@ -24,8 +25,8 @@ public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
|
|||||||
|
|
||||||
if(tile instanceof TileEntityPylonBase) {
|
if(tile instanceof TileEntityPylonBase) {
|
||||||
TileEntityPylonBase pylon = (TileEntityPylonBase) tile;
|
TileEntityPylonBase pylon = (TileEntityPylonBase) tile;
|
||||||
Vec3 myOffset = pyl.getMountPos();
|
Vec3 myOffset = pyl.getMountPos()[0];
|
||||||
Vec3 theirOffset = pylon.getMountPos();
|
Vec3 theirOffset = pylon.getMountPos()[0];
|
||||||
|
|
||||||
double conX0 = pyl.xCoord + myOffset.xCoord;
|
double conX0 = pyl.xCoord + myOffset.xCoord;
|
||||||
double conY0 = pyl.yCoord + myOffset.yCoord;
|
double conY0 = pyl.yCoord + myOffset.yCoord;
|
||||||
@ -70,6 +71,10 @@ public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void renderLinesGeneric(TileEntityPylonBase pyl, double x, double y, double z) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void renderLine(World world, TileEntityPylonBase pyl, double x, double y, double z, double x0, double y0, double z0, double x1, double y1, double z1) {
|
public void renderLine(World world, TileEntityPylonBase pyl, double x, double y, double z, double x0, double y0, double z0, double x1, double y1, double z1) {
|
||||||
|
|
||||||
GL11.glTranslated(x, y, z);
|
GL11.glTranslated(x, y, z);
|
||||||
|
|||||||
@ -75,6 +75,7 @@ public class TileMappings {
|
|||||||
put(TileEntityMachineRTG.class, "tileentity_machine_rtg");
|
put(TileEntityMachineRTG.class, "tileentity_machine_rtg");
|
||||||
put(TileEntityConnector.class, "tileentity_connector_redwire");
|
put(TileEntityConnector.class, "tileentity_connector_redwire");
|
||||||
put(TileEntityPylon.class, "tileentity_pylon_redwire");
|
put(TileEntityPylon.class, "tileentity_pylon_redwire");
|
||||||
|
put(TileEntityPylonLarge.class, "tileentity_pylon_large");
|
||||||
put(TileEntityStructureMarker.class, "tileentity_structure_marker");
|
put(TileEntityStructureMarker.class, "tileentity_structure_marker");
|
||||||
put(TileEntityMachineMiningDrill.class, "tileentity_mining_drill");
|
put(TileEntityMachineMiningDrill.class, "tileentity_mining_drill");
|
||||||
put(TileEntityMachineAssembler.class, "tileentity_assembly_machine");
|
put(TileEntityMachineAssembler.class, "tileentity_assembly_machine");
|
||||||
|
|||||||
@ -1,15 +1,12 @@
|
|||||||
package com.hbm.tileentity.machine;
|
package com.hbm.tileentity.machine;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.inventory.recipes.FuelPoolRecipes;
|
||||||
import com.hbm.items.machine.ItemRBMKRod;
|
import com.hbm.items.machine.ItemRBMKRod;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
@ -24,18 +21,6 @@ public class TileEntityWasteDrum extends TileEntity implements ISidedInventory {
|
|||||||
|
|
||||||
private String customName;
|
private String customName;
|
||||||
|
|
||||||
private static final HashMap<ComparableStack, ItemStack> wasteMap = new HashMap<ComparableStack, ItemStack>();
|
|
||||||
static {
|
|
||||||
wasteMap.put(new ComparableStack(ModItems.waste_natural_uranium_hot), new ItemStack(ModItems.waste_natural_uranium));
|
|
||||||
wasteMap.put(new ComparableStack(ModItems.waste_uranium_hot), new ItemStack(ModItems.waste_uranium));
|
|
||||||
wasteMap.put(new ComparableStack(ModItems.waste_thorium_hot), new ItemStack(ModItems.waste_thorium));
|
|
||||||
wasteMap.put(new ComparableStack(ModItems.waste_mox_hot), new ItemStack(ModItems.waste_mox));
|
|
||||||
wasteMap.put(new ComparableStack(ModItems.waste_plutonium_hot), new ItemStack(ModItems.waste_plutonium));
|
|
||||||
wasteMap.put(new ComparableStack(ModItems.waste_u233_hot), new ItemStack(ModItems.waste_u233));
|
|
||||||
wasteMap.put(new ComparableStack(ModItems.waste_u235_hot), new ItemStack(ModItems.waste_u235));
|
|
||||||
wasteMap.put(new ComparableStack(ModItems.waste_schrabidium_hot), new ItemStack(ModItems.waste_schrabidium));
|
|
||||||
}
|
|
||||||
|
|
||||||
public TileEntityWasteDrum() {
|
public TileEntityWasteDrum() {
|
||||||
slots = new ItemStack[12];
|
slots = new ItemStack[12];
|
||||||
}
|
}
|
||||||
@ -108,7 +93,7 @@ public class TileEntityWasteDrum extends TileEntity implements ISidedInventory {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||||
return wasteMap.keySet().contains(new ComparableStack(itemStack)) || itemStack.getItem() instanceof ItemRBMKRod;
|
return FuelPoolRecipes.recipes.keySet().contains(new ComparableStack(itemStack)) || itemStack.getItem() instanceof ItemRBMKRod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -171,10 +156,9 @@ public class TileEntityWasteDrum extends TileEntity implements ISidedInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
|
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||||
{
|
return slots_arr;
|
||||||
return slots_arr;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||||
@ -186,7 +170,7 @@ public class TileEntityWasteDrum extends TileEntity implements ISidedInventory {
|
|||||||
if(itemStack.getItem() instanceof ItemRBMKRod) {
|
if(itemStack.getItem() instanceof ItemRBMKRod) {
|
||||||
return ItemRBMKRod.getCoreHeat(itemStack) < 50 && ItemRBMKRod.getHullHeat(itemStack) < 50;
|
return ItemRBMKRod.getCoreHeat(itemStack) < 50 && ItemRBMKRod.getHullHeat(itemStack) < 50;
|
||||||
} else {
|
} else {
|
||||||
return wasteMap.containsValue(getStackInSlot(i));
|
return !FuelPoolRecipes.recipes.containsKey(getStackInSlot(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,8 +204,8 @@ public class TileEntityWasteDrum extends TileEntity implements ISidedInventory {
|
|||||||
} else if(worldObj.rand.nextInt(r) == 0) {
|
} else if(worldObj.rand.nextInt(r) == 0) {
|
||||||
|
|
||||||
ComparableStack comp = new ComparableStack(getStackInSlot(i));
|
ComparableStack comp = new ComparableStack(getStackInSlot(i));
|
||||||
if(wasteMap.keySet().contains(comp)) {
|
if(FuelPoolRecipes.recipes.containsKey(comp)) {
|
||||||
slots[i] = wasteMap.get(comp).copy();
|
slots[i] = FuelPoolRecipes.recipes.get(comp).copy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,8 +14,8 @@ public class TileEntityConnector extends TileEntityPylonBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Vec3 getMountPos() {
|
public Vec3[] getMountPos() {
|
||||||
return Vec3.createVectorHelper(0.5, 0.5, 0.5);
|
return new Vec3[] {Vec3.createVectorHelper(0.5, 0.5, 0.5)};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -13,8 +13,8 @@ public class TileEntityPylon extends TileEntityPylonBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Vec3 getMountPos() {
|
public Vec3[] getMountPos() {
|
||||||
return Vec3.createVectorHelper(0.5, 5.4, 0.5);
|
return new Vec3[] {Vec3.createVectorHelper(0.5, 5.4, 0.5)};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -27,8 +27,8 @@ public abstract class TileEntityPylonBase extends TileEntityCableBaseNT {
|
|||||||
double len = Math.min(first.getMaxWireLength(), second.getMaxWireLength());
|
double len = Math.min(first.getMaxWireLength(), second.getMaxWireLength());
|
||||||
double lenSq = len * len;
|
double lenSq = len * len;
|
||||||
|
|
||||||
Vec3 firstPos = first.getMountPos();
|
Vec3 firstPos = first.getConnectionPoint();
|
||||||
Vec3 secondPos = second.getMountPos();
|
Vec3 secondPos = second.getConnectionPoint();
|
||||||
|
|
||||||
Vec3 delta = Vec3.createVectorHelper(
|
Vec3 delta = Vec3.createVectorHelper(
|
||||||
(second.xCoord + secondPos.xCoord) - (first.xCoord + firstPos.xCoord),
|
(second.xCoord + secondPos.xCoord) - (first.xCoord + firstPos.xCoord),
|
||||||
@ -107,9 +107,18 @@ public abstract class TileEntityPylonBase extends TileEntityCableBaseNT {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public abstract ConnectionType getConnectionType();
|
public abstract ConnectionType getConnectionType();
|
||||||
public abstract Vec3 getMountPos();
|
public abstract Vec3[] getMountPos();
|
||||||
public abstract double getMaxWireLength();
|
public abstract double getMaxWireLength();
|
||||||
|
|
||||||
|
public Vec3 getConnectionPoint() {
|
||||||
|
Vec3[] mounts = this.getMountPos();
|
||||||
|
|
||||||
|
if(mounts == null || mounts.length == 0)
|
||||||
|
return Vec3.createVectorHelper(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
|
||||||
|
|
||||||
|
return mounts[0];
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToNBT(NBTTagCompound nbt) {
|
public void writeToNBT(NBTTagCompound nbt) {
|
||||||
super.writeToNBT(nbt);
|
super.writeToNBT(nbt);
|
||||||
@ -148,7 +157,8 @@ public abstract class TileEntityPylonBase extends TileEntityCableBaseNT {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static enum ConnectionType {
|
public static enum ConnectionType {
|
||||||
SINGLE
|
SINGLE,
|
||||||
|
QUAD
|
||||||
//more to follow
|
//more to follow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
package com.hbm.tileentity.network;
|
||||||
|
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
|
||||||
|
public class TileEntityPylonLarge extends TileEntityPylonBase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConnectionType getConnectionType() {
|
||||||
|
return ConnectionType.QUAD;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Vec3[] getMountPos() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getMaxWireLength() {
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
2835
src/main/resources/assets/hbm/models/network/pylon_large.obj
Normal file
2835
src/main/resources/assets/hbm/models/network/pylon_large.obj
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 1.4 KiB |
Loading…
x
Reference in New Issue
Block a user