Merge branch 'HbmMods:master' into zg

This commit is contained in:
Lazzzycat 2025-06-28 21:01:25 +02:00 committed by GitHub
commit 92bce167f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 661 additions and 46 deletions

View File

@ -79,6 +79,18 @@ repositories {
// name = "CurseForge"
// url = "https://minecraft.curseforge.com/api/maven/"
//}
maven {
name = "Jitpack"
url = "https://jitpack.io"
}
maven {
name = "CurseMaven"
url = "https://cursemaven.com"
}
maven {
name = "OpenComputers"
url = "https://maven.cil.li/"
}
}
dependencies {
@ -94,6 +106,8 @@ dependencies {
compileOnly "inventorytweaks:InventoryTweaks:1.59-dev:deobf"
implementation "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api"
compileOnly "com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta.56-GTNH:dev"
}
processResources {

View File

@ -791,6 +791,7 @@ public class ModBlocks {
public static Block fluid_duct_paintable;
public static Block fluid_duct_gauge;
public static Block fluid_duct_exhaust;
public static Block fluid_duct_paintable_block_exhaust;
public static Block fluid_valve;
public static Block fluid_switch;
public static Block fluid_pump;
@ -1920,6 +1921,7 @@ public class ModBlocks {
fluid_duct_neo = new FluidDuctStandard(Material.iron).setBlockName("fluid_duct_neo").setStepSound(ModSoundTypes.pipe).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":pipe_neo");
fluid_duct_box = new FluidDuctBox(Material.iron).setBlockName("fluid_duct_box").setStepSound(ModSoundTypes.pipe).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_box");
fluid_duct_exhaust = new FluidDuctBoxExhaust(Material.iron).setBlockName("fluid_duct_exhaust").setStepSound(ModSoundTypes.pipe).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_box");
fluid_duct_paintable_block_exhaust = new FluidDuctPaintableBlockExhaust().setBlockName("fluid_duct_paintable_block_exhaust").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
fluid_duct_paintable = new FluidDuctPaintable().setBlockName("fluid_duct_paintable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
fluid_duct_gauge = new FluidDuctGauge().setBlockName("fluid_duct_gauge").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
fluid_valve = new FluidValve(Material.iron).setBlockName("fluid_valve").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
@ -3187,6 +3189,7 @@ public class ModBlocks {
register(fluid_duct_neo);
register(fluid_duct_box);
register(fluid_duct_exhaust);
register(fluid_duct_paintable_block_exhaust);
register(fluid_duct_paintable);
register(fluid_duct_gauge);
register(fluid_valve);

View File

@ -1,15 +1,23 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ILookOverlay;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.TileEntityMachineRotaryFurnace;
import com.hbm.util.fauxpointtwelve.DirPos;
import com.hbm.util.i18n.I18nUtil;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.common.util.ForgeDirection;
public class MachineRotaryFurnace extends BlockDummyable {
import java.util.ArrayList;
import java.util.List;
public class MachineRotaryFurnace extends BlockDummyable implements ILookOverlay {
public MachineRotaryFurnace(Material mat) {
super(mat);
@ -56,4 +64,54 @@ public class MachineRotaryFurnace extends BlockDummyable {
//solid fuel
this.makeExtra(world, x + dir.offsetX + rot.offsetX, y, z + dir.offsetZ + rot.offsetZ);
}
@Override
public void printHook(RenderGameOverlayEvent.Pre event, World world, int x, int y, int z) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null) return;
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
if(!(te instanceof TileEntityMachineRotaryFurnace)) return;
TileEntityMachineRotaryFurnace furnace = (TileEntityMachineRotaryFurnace) te;
ForgeDirection dir = ForgeDirection.getOrientation(furnace.getBlockMetadata() - offset);
List<String> text = new ArrayList<>();
//steam
if(hitCheck(dir, pos[0], pos[1], pos[2], -1, -1, 0, x, y, z) || hitCheck(dir, pos[0], pos[1], pos[2], -1, -2, 0, x, y, z)) {
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + furnace.tanks[1].getTankType().getLocalizedName());
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + furnace.tanks[2].getTankType().getLocalizedName());
}
//fluids
if(hitCheck(dir, pos[0], pos[1], pos[2], 1, 2, 0, x, y, z) || hitCheck(dir, pos[0], pos[1], pos[2], -1, 2, 0, x, y, z)) {
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + furnace.tanks[0].getTankType().getLocalizedName());
}
if(hitCheck(dir, pos[0], pos[1], pos[2], 1, 1, 0, x, y, z)) {
text.add(EnumChatFormatting.YELLOW + "-> " + EnumChatFormatting.RESET + "Fuel");
}
if(!text.isEmpty()) {
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}
}
protected boolean hitCheck(ForgeDirection dir, int coreX, int coreY, int coreZ, int exDir, int exRot, int exY, int hitX, int hitY, int hitZ) {
ForgeDirection turn = dir.getRotation(ForgeDirection.DOWN);
int iX = coreX + dir.offsetX * exDir + turn.offsetX * exRot;
int iY = coreY + exY;
int iZ = coreZ + dir.offsetZ * exDir + turn.offsetZ * exRot;
return iX == hitX && iZ == hitZ && iY == hitY;
}
}

View File

@ -0,0 +1,212 @@
package com.hbm.blocks.network;
import api.hbm.block.IToolable;
import com.hbm.blocks.IBlockMultiPass;
import com.hbm.blocks.ILookOverlay;
import com.hbm.interfaces.ICopiable;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.lib.Library;
import com.hbm.lib.RefStrings;
import com.hbm.render.block.RenderBlockMultipass;
import com.hbm.tileentity.network.TileEntityPipeExhaust;
import com.hbm.util.i18n.I18nUtil;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.ArrayList;
import java.util.List;
public class FluidDuctPaintableBlockExhaust extends FluidDuctBase implements IToolable, IBlockMultiPass, ILookOverlay {
@SideOnly(Side.CLIENT) protected IIcon overlay;
public FluidDuctPaintableBlockExhaust() {
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityPipeExhaustPaintable();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister reg) {
this.blockIcon = reg.registerIcon(RefStrings.MODID + ":fluid_duct_paintable_block_exhaust");
this.overlay = reg.registerIcon(RefStrings.MODID + ":fluid_duct_paintable_overlay");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileEntityPipeExhaustPaintable) {
TileEntityPipeExhaustPaintable pipe = (TileEntityPipeExhaustPaintable) tile;
if(pipe.block != null) {
if(RenderBlockMultipass.currentPass == 1) {
return this.overlay;
} else {
return pipe.block.getIcon(side, pipe.meta);
}
}
}
return this.blockIcon;
}
@Override
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
if(tool != ToolType.SCREWDRIVER) return false;
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileEntityPipeExhaustPaintable) {
TileEntityPipeExhaustPaintable pipe = (TileEntityPipeExhaustPaintable) tile;
if(pipe.block != null) {
pipe.block = null;
world.markBlockForUpdate(x, y, z);
pipe.markDirty();
return true;
}
}
return false;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float fX, float fY, float fZ) {
ItemStack stack = player.getHeldItem();
if(stack != null && stack.getItem() instanceof ItemBlock) {
ItemBlock ib = (ItemBlock) stack.getItem();
Block block = ib.field_150939_a;
if(block.renderAsNormalBlock() && block != this) {
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileEntityPipeExhaustPaintable) {
TileEntityPipeExhaustPaintable pipe = (TileEntityPipeExhaustPaintable) tile;
if(pipe.block == null) {
pipe.block = block;
pipe.meta = stack.getItemDamage() & 15;
world.markBlockForUpdate(x, y, z);
pipe.markDirty();
return true;
}
}
}
}
return super.onBlockActivated(world, x, y, z, player, side, fX, fY, fZ);
}
@Override
public int getPasses() {
return 2;
}
@Override
public int getRenderType(){
return IBlockMultiPass.getRenderType();
}
@Override
public void printHook(Pre event, World world, int x, int y, int z) {
List<String> text = new ArrayList();
text.add(Fluids.SMOKE.getLocalizedName());
text.add(Fluids.SMOKE_LEADED.getLocalizedName());
text.add(Fluids.SMOKE_POISON.getLocalizedName());
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}
public static class TileEntityPipeExhaustPaintable extends TileEntityPipeExhaust implements ICopiable {
private Block block;
private int meta;
private Block lastBlock;
private int lastMeta;
@Override
public void updateEntity() {
super.updateEntity();
if(worldObj.isRemote && (lastBlock != block || lastMeta != meta)) {
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
lastBlock = block;
lastMeta = meta;
}
}
@Override
public Packet getDescriptionPacket() {
NBTTagCompound nbt = new NBTTagCompound();
this.writeToNBT(nbt);
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
this.readFromNBT(pkt.func_148857_g());
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
int id = nbt.getInteger("block");
this.block = id == 0 ? null : Block.getBlockById(id);
this.meta = nbt.getInteger("meta");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
if(block != null) nbt.setInteger("block", Block.getIdFromBlock(block));
nbt.setInteger("meta", meta);
}
@Override
public NBTTagCompound getSettings(World world, int x, int y, int z) {
NBTTagCompound nbt = new NBTTagCompound();
if(block != null) {
nbt.setInteger("paintblock", Block.getIdFromBlock(block));
nbt.setInteger("paintmeta", meta);
}
return nbt;
}
@Override
public void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z) {
if(nbt.hasKey("paintblock")) {
this.block = Block.getBlockById(nbt.getInteger("paintblock"));
this.meta = nbt.getInteger("paintmeta");
}
}
}
}

View File

@ -81,8 +81,8 @@ public class CommonConfig {
prop.comment = comment;
return prop.getIntList();
}
public static String[] createConfigStringList(Configuration config, String category, String name, String comment) {
Property prop = config.get(category, name, new String[] { "PLACEHOLDER" });
public static String[] createConfigStringList(Configuration config, String category, String name, String comment, String[] def) {
Property prop = config.get(category, name, def);
prop.comment = comment;
return prop.getStringList();
}

View File

@ -1,7 +1,7 @@
package com.hbm.config;
import net.minecraftforge.common.config.Configuration;
import com.hbm.lib.RefStrings;
public class GeneralConfig {
public static boolean enableThermosPreventer = true;
@ -70,6 +70,7 @@ public class GeneralConfig {
public static boolean enableLBSMSafeMEDrives = true;
public static boolean enableLBSMIGen = true;
public static int schrabRate = 20;
public static String[] preferredOutputMod = new String[] {RefStrings.MODID};
public static void loadFromConfig(Configuration config) {
@ -117,7 +118,8 @@ public class GeneralConfig {
normalSoundChannels = CommonConfig.createConfigInt(config, CATEGORY_GENERAL, "1.41_normalSoundChannels",
"The amount of channels to create while 1.39_enableSoundExtension is enabled.\n" +
"Note that a value below 28 or above 200 can cause buggy sounds and issues with other mods running out of sound memory.", 100);
preferredOutputMod = CommonConfig.createConfigStringList(config,CATEGORY_GENERAL,"1.42_preferredOutputMod",
"The mod which is preferred as output when certain machines autogenerate recipes. Currently used for the shredder", new String[] {RefStrings.MODID});
enableExpensiveMode = config.get(CATEGORY_GENERAL, "1.99_enableExpensiveMode", false, "It does what the name implies.").getBoolean(false);
final String CATEGORY_528 = CommonConfig.CATEGORY_528;

View File

@ -31,7 +31,6 @@ public class EntityModFX extends Entity
public static double interpPosX;
public static double interpPosY;
public static double interpPosZ;
public static final String __OBFID = "CL_00000914";
float smokeParticleScale;
public int particleAge;
public int maxAge;
@ -39,7 +38,7 @@ public class EntityModFX extends Entity
public EntityModFX(World world) {
super(world);
}
protected EntityModFX(World p_i1218_1_, double p_i1218_2_, double p_i1218_4_, double p_i1218_6_)
{
super(p_i1218_1_);
@ -257,7 +256,7 @@ public class EntityModFX extends Entity
{
return this.getClass().getSimpleName() + ", Pos (" + this.posX + "," + this.posY + "," + this.posZ + "), RGBA (" + this.particleRed + "," + this.particleGreen + "," + this.particleBlue + "," + this.particleAlpha + "), Age " + this.particleAge;
}
@Override
@SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance)

View File

@ -0,0 +1,18 @@
package com.hbm.handler.ae2;
import appeng.api.AEApi;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
public class AE2CompatHandler {
public static void init() {
if (Loader.isModLoaded("appliedenergistics2")) {
registerHandler();
}
}
@Optional.Method(modid = "appliedenergistics2")
private static void registerHandler() {
AEApi.instance().registries().externalStorage().addExternalStorageInterface(new MSUExternalStorageHandler());
}
}

View File

@ -0,0 +1,46 @@
package com.hbm.handler.ae2;
import com.hbm.tileentity.machine.storage.TileEntityMassStorage;
import com.hbm.util.ItemStackUtil;
import cpw.mods.fml.common.Optional;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.storage.IExternalStorageHandler;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.me.storage.MEMonitorIInventory;
import appeng.util.inv.IMEAdaptor;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
@Optional.InterfaceList({@Optional.Interface(iface = "appeng.api.storage.IExternalStorageHandler", modid = "appliedenergistics2")})
public class MSUExternalStorageHandler implements IExternalStorageHandler {
public MSUExternalStorageHandler() {}
@Override
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource mySrc) {
return channel == StorageChannel.ITEMS && te instanceof TileEntityMassStorage;
}
@Override
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src) {
if (!canHandle(te, d, channel, src))
return null;
// Note: apparently I need this, though I'm not sure why. Storage drawers does it.
// Here's a relevant discussion, if anyone wants to dive into that rabbit hole:
// https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/418
return new MEMonitorIInventory(new IMEAdaptor(new MassStorageMEInventory((TileEntityMassStorage)te), src)) {
@Override
public boolean isPrioritized(IAEItemStack stack) {
ItemStack type = ((TileEntityMassStorage)te).getType();
return type != null && ItemStackUtil.areStacksCompatible(stack.getItemStack(), type);
}
};
}
}

View File

@ -0,0 +1,85 @@
package com.hbm.handler.ae2;
import com.hbm.tileentity.machine.storage.TileEntityMassStorage;
import com.hbm.util.ItemStackUtil;
import cpw.mods.fml.common.Optional;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import net.minecraft.item.ItemStack;
@Optional.InterfaceList({@Optional.Interface(iface = "appeng.api.storage.IMEInventory", modid = "appliedenergistics2")})
public class MassStorageMEInventory implements IMEInventory<IAEItemStack> {
private TileEntityMassStorage tile;
public MassStorageMEInventory(TileEntityMassStorage tile) {
this.tile = tile;
}
@Override
public IAEItemStack injectItems(IAEItemStack input, Actionable type, BaseActionSource src) {
ItemStack typeStack = tile.getType();
if (typeStack == null || !ItemStackUtil.areStacksCompatible(input.getItemStack(), typeStack))
return input;
// If you're working with amounts greater than MAX_INT, you shouldn't use MSUs in the first place
int remaining = tile.increaseTotalStockpile((int)input.getStackSize(), type == Actionable.MODULATE);
if (remaining == 0) {
return null;
}
return AEApi.instance().storage()
.createItemStack(typeStack)
.setStackSize(remaining);
}
@Override
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src) {
ItemStack typeStack = tile.getType();
if (typeStack == null || !ItemStackUtil.areStacksCompatible(request.getItemStack(), typeStack))
return null;
// If you're working with amounts greater than MAX_INT, you shouldn't use MSUs in the first place
int missing = tile.decreaseTotalStockpile((int)request.getStackSize(), mode == Actionable.MODULATE);
long fulfilled = request.getStackSize() - missing;
if (fulfilled == 0) {
return null;
}
return AEApi.instance().storage()
.createItemStack(typeStack)
.setStackSize(fulfilled);
}
@Override
public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out) {
ItemStack typeStack = tile.getType();
if (typeStack != null) {
out.add(
AEApi.instance().storage()
.createItemStack(typeStack)
.setStackSize(tile.getTotalStockpile())
);
}
return out;
}
@Override
public StorageChannel getChannel() {
return StorageChannel.ITEMS;
}
}

View File

@ -360,9 +360,9 @@ public class ShredderRecipes extends SerializableRecipe {
/* AR COMPAT */
Block arMoonTurf = Compat.tryLoadBlock(Compat.MOD_AR, "turf");
if(arMoonTurf != null && gcMoonBlock != Blocks.air) ShredderRecipes.setRecipe(arMoonTurf, new ItemStack(ModBlocks.moon_turf)); //i assume it's moon turf
if(arMoonTurf != null && arMoonTurf != Blocks.air) ShredderRecipes.setRecipe(arMoonTurf, new ItemStack(ModBlocks.moon_turf)); //i assume it's moon turf
Block arMoonTurfDark = Compat.tryLoadBlock(Compat.MOD_AR, "turfDark");
if(arMoonTurfDark != null && gcMoonBlock != Blocks.air) ShredderRecipes.setRecipe(arMoonTurfDark, new ItemStack(ModBlocks.moon_turf)); //probably moon dirt? would have helped if i had ever played AR for more than 5 seconds
if(arMoonTurfDark != null && arMoonTurfDark != Blocks.air) ShredderRecipes.setRecipe(arMoonTurfDark, new ItemStack(ModBlocks.moon_turf)); //probably moon dirt? would have helped if i had ever played AR for more than 5 seconds
}
/**
@ -374,8 +374,9 @@ public class ShredderRecipes extends SerializableRecipe {
List<ItemStack> matches = OreDictionary.getOres("dust" + name);
if(matches != null && !matches.isEmpty())
return matches.get(0).copy();
if(matches != null && !matches.isEmpty()) {
return Compat.getPreferredOreOutput(matches);
}
return new ItemStack(ModItems.scrap);
}

View File

@ -604,6 +604,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.fluid_duct_neo, 8, 1), new Object[] { "IAI", " ", "IAI", 'I', IRON.plate(), 'A', AL.plate() });
addRecipeAuto(new ItemStack(ModBlocks.fluid_duct_neo, 8, 2), new Object[] { "ASA", " ", "ASA", 'S', STEEL.plate(), 'A', AL.plate() });
addRecipeAuto(new ItemStack(ModBlocks.fluid_duct_paintable, 8), new Object[] { "SAS", "A A", "SAS", 'S', STEEL.ingot(), 'A', AL.plate() });
addRecipeAuto(new ItemStack(ModBlocks.fluid_duct_paintable_block_exhaust, 8), new Object[] { "SAS", "A A", "SAS", 'S', IRON.ingot(), 'A', ModItems.plate_polymer});
addShapelessAuto(new ItemStack(ModBlocks.fluid_duct_gauge), new Object[] { ModBlocks.fluid_duct_paintable, STEEL.ingot(), DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC) });
addRecipeAuto(new ItemStack(ModBlocks.fluid_valve, 1), new Object[] { "S", "W", 'S', Blocks.lever, 'W', ModBlocks.fluid_duct_paintable });
addRecipeAuto(new ItemStack(ModBlocks.fluid_switch, 1), new Object[] { "S", "W", 'S', REDSTONE.dust(), 'W', ModBlocks.fluid_duct_paintable });

View File

@ -13,6 +13,7 @@ import com.hbm.entity.grenade.*;
import com.hbm.entity.logic.IChunkLoader;
import com.hbm.entity.mob.siege.SiegeTier;
import com.hbm.handler.*;
import com.hbm.handler.ae2.AE2CompatHandler;
import com.hbm.handler.imc.IMCBlastFurnace;
import com.hbm.handler.imc.IMCCentrifuge;
import com.hbm.handler.imc.IMCCrystallizer;
@ -881,6 +882,9 @@ public class MainRegistry {
// Load compatibility for OC.
CompatHandler.init();
// Load compatibility for AE2.
AE2CompatHandler.init();
//expand for the largest entity we have (currently Quackos who is 17.5m in diameter, that's one fat duck)
World.MAX_ENTITY_RADIUS = Math.max(World.MAX_ENTITY_RADIUS, 8.75);

View File

@ -35,6 +35,7 @@ import com.hbm.blocks.network.CableDiode.TileEntityDiode;
import com.hbm.blocks.network.CranePartitioner.TileEntityCranePartitioner;
import com.hbm.blocks.network.FluidDuctGauge.TileEntityPipeGauge;
import com.hbm.blocks.network.FluidDuctPaintable.TileEntityPipePaintable;
import com.hbm.blocks.network.FluidDuctPaintableBlockExhaust.TileEntityPipeExhaustPaintable;
import com.hbm.blocks.network.FluidPump.TileEntityFluidPump;
import com.hbm.blocks.rail.RailStandardSwitch.TileEntityRailSwitch;
import com.hbm.tileentity.bomb.*;
@ -412,6 +413,7 @@ public class TileMappings {
put(TileEntityPipePaintable.class, "tileentity_pipe_paintable");
put(TileEntityPipeGauge.class, "tileentity_pipe_gauge");
put(TileEntityPipeExhaust.class, "tileentity_pipe_exhaust");
put(TileEntityPipeExhaustPaintable.class, "tileentity_pipe_exhaust_paintable");
put(TileEntityFluidValve.class, "tileentity_pipe_valve");
put(TileEntityFluidPump.class, "tileentity_pipe_pump");

View File

@ -7,6 +7,7 @@ import com.hbm.tileentity.IBufPacketReceiver;
import com.hbm.tileentity.IControlReceiverFilter;
import com.hbm.util.BufferUtil;
import com.hbm.util.ItemStackUtil;
import api.hbm.redstoneoverradio.IRORInteractive;
import api.hbm.redstoneoverradio.IRORValueProvider;
@ -15,6 +16,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Vec3;
@ -133,6 +135,109 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements IBufPa
return result;
}
// Note: the following three methods are used for AE2 integration, and aren't meant to be called in any other context by default
public int getTotalStockpile() {
ItemStack type = getType();
if (type == null)
return 0;
int result = getStockpile();
ItemStack inStack = slots[0];
if (inStack != null && ItemStackUtil.areStacksCompatible(type, inStack)) {
result += inStack.stackSize;
}
ItemStack outStack = slots[2];
if (outStack != null && ItemStackUtil.areStacksCompatible(type, outStack)) {
result += outStack.stackSize;
}
return result;
}
// Returns the remainder that didn't fit.
// If `actually` is false, only predicts the outcome, but doesn't change the state
public int increaseTotalStockpile(int amount, boolean actually) {
return changeTotalStockpile(amount, actually, +1);
}
// Returns the remainder that couldn't be extracted.
// If `actually` is false, only predicts the outcome, but doesn't change the state
public int decreaseTotalStockpile(int amount, boolean actually) {
return changeTotalStockpile(amount, actually, -1);
}
private int changeTotalStockpile(int amount, boolean actually, int sign) {
ItemStack type = getType();
if (type == null)
return amount;
int stockpileAvail = sign > 0 ? getCapacity() - getStockpile() : getStockpile();
if (amount > 0 && stockpileAvail > 0) {
int depositStockpile = Math.min(amount, stockpileAvail);
if (actually) {
this.stack += sign * depositStockpile;
}
amount -= depositStockpile;
}
int inputAvail = 0;
ItemStack inStack = slots[0];
if (inStack != null && ItemStackUtil.areStacksCompatible(type, inStack)) {
inputAvail = sign > 0 ? inStack.getMaxStackSize() - inStack.stackSize : inStack.stackSize;
} else if (inStack == null) {
inputAvail = sign > 0 ? type.getMaxStackSize() : 0;
}
if (amount > 0 && inputAvail > 0) {
int depositInput = Math.min(amount, inputAvail);
if (actually) {
if (slots[0] == null) { // Only possible with sign == +1
slots[0] = slots[1].copy();
slots[0].stackSize = 0;
}
slots[0].stackSize += sign * depositInput;
if (slots[0].stackSize == 0) {
slots[0] = null;
}
}
amount -= depositInput;
}
int outputAvail = 0;
ItemStack outStack = slots[2];
if (outStack != null && ItemStackUtil.areStacksCompatible(type, outStack)) {
outputAvail = sign > 0 ? outStack.getMaxStackSize() - outStack.stackSize : outStack.stackSize;
} else if (outStack == null) {
outputAvail = sign > 0 ? type.getMaxStackSize() : 0;
}
if (amount > 0 && outputAvail > 0) {
int depositOutput = Math.min(amount, outputAvail);
if (actually) {
if (slots[2] == null) { // Only possible with sign == +1
slots[2] = slots[1].copy();
slots[2].stackSize = 0;
}
slots[2].stackSize += sign * depositOutput;
if (slots[2].stackSize == 0) {
slots[2] = null;
}
}
amount -= depositOutput;
}
if (actually) {
this.markDirty();
}
return amount;
}
@Override
public void serialize(ByteBuf buf) {
buf.writeInt(this.stack);

View File

@ -49,7 +49,29 @@ public class Compat {
private static String getReg(String domain, String name) {
return domain + ":" + name;
}
public static ItemStack getPreferredOreOutput(List<ItemStack> oreList) {
int lowestPref = -1;
ItemStack preferredStack = null;
for(ItemStack item : oreList) {
String modid = ItemStackUtil.getModIdFromItemStack(item);
for(int i = 0; i < GeneralConfig.preferredOutputMod.length; i++) {
if (modid.equals(GeneralConfig.preferredOutputMod[i])){
if (lowestPref<0 || i <lowestPref) {
preferredStack = item;
lowestPref = i;
}
break;
}
}
}
if (preferredStack != null) {
return preferredStack.copy();
}
return oreList.get(0).copy();
}
public static boolean isModLoaded(String modid) {
return Loader.isModLoaded(modid);
}

View File

@ -15,6 +15,9 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
public class ItemStackUtil {
public static ItemStack carefulCopy(ItemStack stack) {
@ -166,6 +169,19 @@ public class ItemStackUtil {
return list;
}
/**
* Returns a String of the mod id of an itemstack. If a unique identifier can't be found in the registry, returns null.
* @param stack
* @return
*/
public static String getModIdFromItemStack(ItemStack stack) {
UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor(stack.getItem());
if(id!=null) {
return id.modId;
}
return null;
}
public static void spillItems(World world, int x, int y, int z, Block block, Random rand) {
IInventory tileentityfurnace = (IInventory) world.getTileEntity(x, y, z);

View File

@ -4184,6 +4184,7 @@ tile.floodlight.name=Elektrischer Scheinwerfer
tile.fluid_duct.name=Universelles Flüssigkeitsrohr (Veraltet)
tile.fluid_duct_box.name=Universelles Flüssigkeitsrohr (Boxrohr)
tile.fluid_duct_exhaust.name=Abgasrohr
tile.fluid_duct_paintable_block_exhaust.name=Geschirmtes Abgasrohr (Färbbar)
tile.fluid_duct_gauge.name=Flussmessrohr
tile.fluid_duct_gauge.desc=Rohr welches anzeight, wie viel Flüssigkeit$sich pro Tick im Netzwerk bewegt.$Geteilte Netzwerke die über Fässer oder Tanks$verbunden sind, werden als ein einzelnes gezählt.
tile.fluid_duct_neo.name=Universelles Flüssigkeitsrohr

View File

@ -5309,6 +5309,7 @@ tile.floodlight.name=Powered Floodlight
tile.fluid_duct.name=Universal Fluid Duct (Deprecated)
tile.fluid_duct_box.name=Universal Fluid Duct (Boxduct)
tile.fluid_duct_exhaust.name=Exhaust Pipe
tile.fluid_duct_paintable_block_exhaust.name=Paintable Coated Exhaust Pipe
tile.fluid_duct_gauge.name=Flow Gauge Pipe
tile.fluid_duct_gauge.desc=Pipe that displays how much fluid$moves within the network per tick.$Split networks connected by barrels$or tanks are considered as one shared network.
tile.fluid_duct_neo.name=Universal Fluid Duct

View File

@ -5551,6 +5551,7 @@ tile.floodlight.name=Электрический прожектор
tile.fluid_duct.name=Универсальная жидкостная труба (Устаревшее)
tile.fluid_duct_box.name=Универсальная жидкостная труба (Boxduct)
tile.fluid_duct_exhaust.name=Выхлопная труба
tile.fluid_duct_paintable_block_exhaust.name=Окрашиваемая покрытая выхлопная труба
tile.fluid_duct_gauge.name=Труба с измерителем потока
tile.fluid_duct_gauge.desc=Труба которая показывает сколько жидкости$перемещается внутри сети за тик.$Разделенные сети, соединенные бочками$или резервуары рассматриваются как одна общая сеть.
tile.fluid_duct_neo.name=Универсальная жидкостная труба

View File

@ -566,6 +566,21 @@ cannery.schottky.7=If any virtual particles encounter any malformed segments, al
cannery.schottky.8=Note that virtual particles will never use the same Diode exit twice. Infinite loops will fail, but re-entering a Diode is otherwise fine
cannery.schottky.9=Your Schottky Particle Diode should be properly enclosed, with free paths for each intersection exit
chem.hydrogen=Водень
chem.hydrogencoke=Hydrogen from CokeAdd commentMore actions
chem.oxygen=Кисень
chem.xenon=Ксеноновий газ
chem.xenonoxy=Ксеноновий газ (Охолоджений)
chem.helium3=Гелій-3
chem.ethanol=Етанол
chem.biogas=Біогаз
chem.biofuel=Трансестерифікація біопалива
chem.reoil=Очищення оливи
chem.gasoline=Газолін
chem.tarsand=Бітум з бітумінозного піску
chem.meatprocessing=Обробка м'яса гліфідів
chem.birkeland=Азотна кислота з повітря
chem.ARSENIC=Екстракція миш'яку
chem.ASPHALT=Виробництво асфальту
chem.BAKELITE=Виробництво карболіту
@ -759,6 +774,8 @@ container.machineAmmoPress=Прес для боєприпасів
container.machineArcWelder=Дуговий зварювальник
container.machineArcFurnaceLarge=Дугова піч
container.machineBoiler=Нагрівач нафти
container.machineChemicalFactory=Хімічна фабрика
container.machineChemicalPlant=Хімічний завод
container.machineCMB=CMB Steel Furnace
container.machineCoal=Твердопаливний генератор
container.machineCoker=Коксова установка
@ -1398,22 +1415,25 @@ hazard.particleFine=Твердих часток
hazard.sand=Подразників очей
hbm.key=NTM Hotkeys
hbm.key.calculator=Calculator
hbm.key.copyToolAlt=Copy Tool: Switch Paste
hbm.key.copyToolCtrl=Copy Tool: Paste to Pipes
hbm.key.craneLoad=Load/Unload Crane
hbm.key.craneMoveDown=Move Crane Backward
hbm.key.craneMoveLeft=Move Crane Left
hbm.key.craneMoveRight=Move Crane Right
hbm.key.craneMoveUp=Move Crane Forward
hbm.key.dash=Dash
hbm.key.gunPrimary=Primary Fire
hbm.key.gunSecondary=Secondary Fire
hbm.key.gunTertitary=Gun Sights
hbm.key.toggleBack=Toggle Jetpack
hbm.key.toggleHUD=Toggle HUD
hbm.key.trainInv=Train Inventory
hbm.key.reload=Reload
hbm.key.ability=Перемикання здібностей інструмента
hbm.key.abilityAlt=Конфігурація здібностей інструмента
hbm.key.calculator=Калькулятор
hbm.key.copyToolAlt=Інструмент копіювання: Перемикнути вставку
hbm.key.copyToolCtrl=Інструмент копіювання: Застосувати до труб
hbm.key.craneLoad=Завантажити/Розвантажити кран
hbm.key.craneMoveDown=Рухати кран назад
hbm.key.craneMoveLeft=Рухати кран вліво
hbm.key.craneMoveRight=Рухати кран вправо
hbm.key.craneMoveUp=Рухати кран вперед
hbm.key.dash=Ривок
hbm.key.gunPrimary=Основний вогонь
hbm.key.gunSecondary=Альтернативний вогонь
hbm.key.gunTertitary=Приціл
hbm.key.toggleBack=Перемикання реактивного ранця
hbm.key.toggleHUD=Перемикання HUD
hbm.key.toggleMagnet=Перемикання магніта
hbm.key.trainInv=Інвентар поїзда
hbm.key.reload=Перезарядити
hbmfluid.air=Стиснене повітря
hbmfluid.alumina=Оксид алюмінію
@ -1449,8 +1469,8 @@ hbmfluid.death=Розчин осмистого іридію
hbmfluid.deuterium=Дейтерій
hbmfluid.diesel=Дизель
hbmfluid.diesel_crack=Крекінговий дизель
hbmfluid.diesel_crack_reform=Високооктановий крекінговий дизель
hbmfluid.diesel_reform=Високооктановий дизель
hbmfluid.diesel_crack_reform=Високоцетановий крекінговий дизель
hbmfluid.diesel_reform=Високоцетановий дизель
hbmfluid.egg=Розчинене яйце
hbmfluid.estradiol=Розчин естрадіолу
hbmfluid.ethanol=Етанол
@ -3620,6 +3640,7 @@ item.part_barrel_light.name=Легкий ствол %s
item.part_beryllium.name=Коробка з берилієвим пилом
item.part_carbon.name=Коробка з вугільним пилом
item.part_copper.name=Коробка з мідним пилом
item.part_generic.glass_polarized.name=Поляризована лінза
item.part_generic.hde.name=Елемент для важких умов експлуатації
item.part_generic.lde.name=Елемент низької щільності
item.part_generic.piston_electric.name=Електричний поршень
@ -3685,7 +3706,7 @@ item.pellet_rtg_cobalt.name=РІТЕГ гранула кобальту-60
item.pellet_rtg_cobalt.desc=Не найкращий як РІТЕГ, але чудовий для гамма-випромінювання!
item.pellet_rtg_depleted.bismuth.name=Розкладена вісмутова РІТЕГ гранула
item.pellet_rtg_depleted.lead.name=Розкладена свинцева РІТЕГ гранула
item.pellet_rtg_depleted.neptunium.name=Розкладена немтунієва РІТЕГ гранула
item.pellet_rtg_depleted.neptunium.name=Розкладена нептунієва РІТЕГ гранула
item.pellet_rtg_depleted.mercury.name=Розкладена ртутна РІТЕГ гранула
item.pellet_rtg_depleted.nickel.name=Розкладена нікелева РІТЕГ гранула
item.pellet_rtg_depleted.zirconium.name=Розкладена цирконієва РІТЕГ гранула
@ -5288,6 +5309,7 @@ tile.floodlight.name=Потужний прожектор
tile.fluid_duct.name=Універсальний рідинний трубопровід (Застаріло)
tile.fluid_duct_box.name=Універсальний рідинний трубопровід (Boxduct)
tile.fluid_duct_exhaust.name=Вихлопна труба
tile.fluid_duct_paintable_block_exhaust.name=Вихлопна труба з покриттям
tile.fluid_duct_gauge.name=Вимірювальна труба
tile.fluid_duct_gauge.desc=Труба, що показує, скільки рідини$переміщується в мережі за один тік.$Розділені мережі, з'єднані бочками$або цистернами, вважаються однією спільною мережею.
tile.fluid_duct_neo.name=Універсальний рідинний трубопровід
@ -5346,6 +5368,7 @@ tile.geiger.name=Лічильник Гейгера
tile.glass_ash.name=Попелясте скло
tile.glass_boron.name=Борне скло
tile.glass_lead.name=Свинцеве скло
tile.glass_polarized.name=Поляризоване скло
tile.glass_polonium.name=Полонієве скло
tile.glass_quartz.name=Кварцове скло
tile.glass_trinitite.name=Тринітитове скло
@ -5369,10 +5392,6 @@ tile.hadron_coil_neodymium.name=Щільна неодимова котушка
tile.hadron_coil_schrabidate.name=Щільна шрабідатова котушка
tile.hadron_coil_schrabidium.name=Щільна шрабідієва котушка
tile.hadron_coil_starmetal.name=Щільна котушка з зіркового металу
tile.hadron_cooler.name=Блок охолодження прискорювача частинок
tile.hadron_cooler.desc=Cooling power: 10$Overcooling threshold: 10$Cooling bonus: +10%%$Overcooling penalty: -25%%
tile.hadron_cooler_mk2.name=Particle Accelerator Cooling Unit - The Palindrome Special
tile.hadron_cooler_mk2.desc=Cooling power: 5$Efficiency function: 2-(cooling-15)²/225$Maximum penalty: -90%%
tile.hadron_core.name=Particle Accelerator Core Component
tile.hadron_diode.name=Schottky Particle Diode
tile.hadron_plating.name=Particle Accelerator Plating
@ -5472,8 +5491,11 @@ tile.machine_boiler_off.name=Старий бойлер
tile.machine_catalytic_cracker.name=Вежа каталітичного крекінгу
tile.machine_catalytic_reformer.name=Каталітичний риформер
tile.machine_centrifuge.name=Центрифуга
tile.machine_chemfac.name=Хімічна фабрика
tile.machine_chemplant.name=Хімічний завод
tile.machine_chemfac.name=Хімічна фабрика (Застаріла)
tile.machine_chemical_factory.name=Хімічна фабрика
tile.machine_chemical_factory.desc=Четверний хімічний завод.$Рецепти обробляються вдвічі швидше,$але потребують вдвічі більше енергії.$Потрібно охолодження водою,$виробляє пару низького тиску.
tile.machine_chemical_plant.name=Хімічний завод
tile.machine_chemplant.name=Хімічний завод (Застарілий)
tile.machine_chungus.name=Парова турбіна "Левіафан"
tile.machine_chungus.desc=Ефективність: 85%%
tile.machine_coal_off.name=Combustion Generator
@ -5788,7 +5810,7 @@ tile.pump_electric.desc=Використовує електроенергію д
tile.pump_steam.name=Паровий насос ґрунтових вод
tile.pump_steam.desc=Використовує пару для відкачування ґрунтових вод$Генерує до 1,000mB/t$Повинен бути розміщений нижче Y:70
tile.pwr_block.name=ВВЕР
tile.pwr_casing.name=Корпус рекатора ВВЕР
tile.pwr_casing.name=Корпус реактора ВВЕР
tile.pwr_casing.desc=Потрібно покрити всі внутрішні частини реактора для формування$Розміщення: Корпус
tile.pwr_channel.name=Канал теплоносія ВВЕР
tile.pwr_channel.desc=Використовує тепло корпусу для нагрівання охолоджувальної рідини$Розміщення: Будь-яке
@ -6148,12 +6170,13 @@ upgrade.acid=Необхідна кислота %s
upgrade.burn=Burn %smb/t for %sHE
upgrade.consumption=Споживання %s
upgrade.coolantConsumption=Витрата охолоджувальної рідини %s
upgrade.delay=Швидкість роботи %s
upgrade.delay=Час роботи %s
upgrade.efficiency=Ефективність %s
upgrade.fortune=Вдача %s
upgrade.overheatChance=Ймовірність перегріву %s
upgrade.productivity=Продуктивність %s
upgrade.range=Радіус %s
upgrade.speed=Швидкість роботи %s
upgrade.gui.title=§lДопустимі покращення:§r
upgrade.gui.afterburner= * §dФорсаж§r: Складається до %s рівнів

View File

@ -1340,8 +1340,8 @@ hbmfluid.death=锇酸溶液
hbmfluid.deuterium=氘
hbmfluid.diesel=柴油
hbmfluid.diesel_crack=裂化柴油
hbmfluid.diesel_crack_reform=高烷值裂化柴油
hbmfluid.diesel_reform=高烷值柴油
hbmfluid.diesel_crack_reform=高十六烷值裂化柴油
hbmfluid.diesel_reform=高十六烷值柴油
hbmfluid.egg=蛋溶解液
hbmfluid.estradiol=雌二醇溶液
hbmfluid.ethanol=乙醇
@ -5021,6 +5021,7 @@ tile.floodlight.name=电力泛光灯
tile.fluid_duct.name=通用流体管道
tile.fluid_duct_box.name=通用流体管道(方形)
tile.fluid_duct_exhaust.name=排气管
tile.fluid_duct_paintable_block_exhaust.name=具有涂装性的排气管
tile.fluid_duct_gauge.name=流量计管
tile.fluid_duct_gauge.desc=显示每个游戏刻在管网有多少流体移动的管道$由桶或罐连接的分离网络被视为一个共享网络。
tile.fluid_duct_neo.name=通用流体管道
@ -5101,10 +5102,6 @@ tile.hadron_coil_neodymium.name=致密钕线圈
tile.hadron_coil_schrabidate.name=致密Sa酸铁线圈
tile.hadron_coil_schrabidium.name=致密Sa326线圈
tile.hadron_coil_starmetal.name=致密星辉线圈
tile.hadron_cooler.name=粒子加速器冷却装置
tile.hadron_cooler.desc=冷却功率10$过冷阈值10$冷却加成:+10%%$过冷惩罚:-25%%
tile.hadron_cooler_mk2.name=粒子加速器冷却装置-回文特制
tile.hadron_cooler_mk2.desc=冷却功率5$效率功能2-(冷却-15)²/225$最高惩罚:-90%%
tile.hadron_core.name=粒子加速器核心组件
tile.hadron_diode.name=肖基特二极管
tile.hadron_plating.name=粒子加速器镀层
@ -6091,3 +6088,7 @@ tile.fan.falloffOff=稳定的风扇功率
tile.glass_polarized.name=偏光玻璃
tile.machine_autosaw.suspended=暂停
tile.machine_chemical_plant.name=化工厂二代 : 电子布加洛
hbm.key.ability=循环工具能力
hbm.key.abilityAlt=配置工具能力
hbm.key.toggleMagnet=开关磁铁
upgrade.speed=工作速度 %s

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B