Merge remote-tracking branch 'origin/master'

This commit is contained in:
BallOfEnergy 2023-07-28 16:23:51 -05:00
commit 1570f2750a
36 changed files with 599 additions and 278 deletions

View File

@ -1,12 +1,13 @@
## Added
* Rubber ball
* can be thrown at people
* New chlorine processing chain
* Involves 240 processing steps of washing, electrolyzing, centrifuging and treating chlorocalcite
* New command `/ntmsatellites`
* `/ntmsatellites orbit` will send the held saatellite into orbit
* `/ntmsatellites descend <frequency>` will delete the given satellite
## Changed
* Glyphids now have a higher tracking range, being 256 blocks
* Standard glyphids now have a base health of 100
* Glyphid scouts are now immune to fire and explosive damage, have a 50% damage reduction against projectiles and have passive regeneration
* Increased hive block blast resistance, they can no longer be blown up wiith conventional explosives
* Rebar reinforced concrete and concrete bricks now have an appropriate blast resistance.
* Updated russian localization
* It's no longer possible to insert items into the satellite cargo pad, it's only for unloading
* The satellite linker will no longer assign new frequencies in the randomizer slot if that frequency is already taken
* Custom machines will now show a hologram showing how they are built
## Fixed
* Fixed crash caused by mobs spawning in highly polluted area

View File

@ -1,6 +1,6 @@
mod_version=1.0.27
# Empty build number makes a release type
mod_build_number=4663
mod_build_number=4671
credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\
\ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models,\
@ -14,5 +14,5 @@ credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion al
\ Toshayo (satellite loot system, project settings, gradle curse task), Silly541 (config for safe ME drives),\
\ Voxelstice (OpenComputers integration, turbine spinup), BallOfEnergy1 (OpenComputers integration), martemen\
\ (project settings), Pvndols (thorium fuel recipe, gas turbine), JamesH2 (blood mechanics, nitric acid,\
\ particle emitter), sdddddf80 (recipe configs, chinese localization), SuperCraftAlex (tooltips)\
\ LePeep (coilgun model), Maksymisio (polish localization)
\ particle emitter), sdddddf80 (recipe configs, chinese localization, custom machine holograms),\
\ SuperCraftAlex (tooltips) LePeep (coilgun model), Maksymisio (polish localization)

View File

@ -33,6 +33,14 @@ public class BlockEnums {
DESH,
BISMUTH
}
public static enum EnumCMCircuit {
ALUMINIUM,
COPPER,
RED_COPPER,
GOLD,
SCHRABIDIUM
}
/** DECO / STRUCTURE ENUMS */
//i apologize in advance

View File

@ -868,6 +868,7 @@ public class ModBlocks {
public static Block cm_sheet;
public static Block cm_engine;
public static Block cm_tank;
public static Block cm_circuit;
public static Block cm_port;
public static Block custom_machine;
@ -2020,12 +2021,13 @@ public class ModBlocks {
factory_advanced_furnace = new FactoryHatch(Material.iron).setBlockName("factory_advanced_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":factory_advanced_furnace");
factory_advanced_conductor = new BlockPillar(Material.iron, RefStrings.MODID + ":factory_advanced_conductor").setBlockName("factory_advanced_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":factory_advanced_hull");
cm_block = new BlockCM(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_block").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_block");
cm_sheet = new BlockCM(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_sheet").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_sheet");
cm_engine = new BlockCM(Material.iron, EnumCMEngines.class, true, true).setBlockName("cm_engine").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_engine");
cm_tank = new BlockCMGlass(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_tank").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_tank");
cm_port = new BlockCMPort(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_port").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_port");
custom_machine = new BlockCustomMachine().setBlockName("custom_machine").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
cm_block = new BlockCM(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_block").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_block");
cm_sheet = new BlockCM(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_sheet").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_sheet");
cm_engine = new BlockCM(Material.iron, EnumCMEngines.class, true, true).setBlockName("cm_engine").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_engine");
cm_tank = new BlockCMGlass(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_tank").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_tank");
cm_circuit = new BlockCM(Material.iron, EnumCMCircuit.class, true, true).setBlockName("cm_circuit").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_circuit");
cm_port = new BlockCMPort(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_port").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_port");
custom_machine = new BlockCustomMachine().setBlockName("custom_machine").setCreativeTab(MainRegistry.machineTab).setLightLevel(1F).setHardness(5.0F).setResistance(10.0F);
reactor_element = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_element_top", RefStrings.MODID + ":reactor_element_base").setBlockName("reactor_element").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":reactor_element_side");
reactor_control = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_control_top").setBlockName("reactor_control").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":reactor_control_side");
@ -3351,6 +3353,7 @@ public class ModBlocks {
register(cm_sheet);
register(cm_engine);
register(cm_tank);
register(cm_circuit);
register(cm_port);
//Multiblock Generators

View File

@ -1,9 +1,12 @@
package com.hbm.blocks.generic;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.hbm.blocks.IBlockMulti;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemLock;
@ -36,7 +39,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class BlockStorageCrate extends BlockContainer implements IBlockMulti {
public class BlockStorageCrate extends BlockContainer implements IBlockMulti, ITooltipProvider {
@SideOnly(Side.CLIENT)
private IIcon iconTop;
@ -282,4 +285,35 @@ public class BlockStorageCrate extends BlockContainer implements IBlockMulti {
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
return Container.calcRedstoneFromInventory((IInventory) world.getTileEntity(x, y, z));
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
if(stack.hasTagCompound()) {
List<String> contents = new ArrayList();
int amount = 0;
for(int i = 0; i < 100; i++) { //whatever the biggest container is, i can't be bothered to check
ItemStack content = ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("slot" + i));
if(content != null) {
amount++;
if(contents.size() < 10) {
contents.add(EnumChatFormatting.AQUA + " - " + content.getDisplayName() + (content.stackSize > 1 ? (" x" + content.stackSize) : ""));
}
}
}
if(!contents.isEmpty()) {
list.add(EnumChatFormatting.AQUA + "Contains:");
list.addAll(contents);
amount -= contents.size();
if(amount > 0) {
list.add(EnumChatFormatting.AQUA + "...and " + amount + " more.");
}
}
}
}
}

View File

@ -1,7 +1,9 @@
package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.Random;
import com.hbm.config.CustomMachineConfigJSON;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
@ -10,11 +12,14 @@ import com.hbm.tileentity.machine.TileEntityCustomMachine;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -49,6 +54,7 @@ public class BlockCustomMachine extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
if(metadata >= 100) return side == 3 ? this.iconFront : this.blockIcon;
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
}
@ -116,15 +122,14 @@ public class BlockCustomMachine extends BlockContainer {
Item item = getItemDropped(metadata, world.rand, fortune);
if(item != null) {
ItemStack stack = new ItemStack(item);
TileEntityCustomMachine tile = (TileEntityCustomMachine) world.getTileEntity(x, y, z);
if(tile != null) {
ItemStack stack = new ItemStack(item, 1, CustomMachineConfigJSON.niceList.indexOf(tile.config) + 100);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setString("machineType", tile.machineType);
ret.add(stack);
}
ret.add(stack);
}
return ret;
@ -134,10 +139,9 @@ public class BlockCustomMachine extends BlockContainer {
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { //using the deprecated one to make NEI happy
TileEntityCustomMachine tile = (TileEntityCustomMachine) world.getTileEntity(x, y, z);
ItemStack stack = new ItemStack(this);
if(tile != null && tile.machineType != null && !tile.machineType.isEmpty()) {
ItemStack stack = new ItemStack(this, 1, CustomMachineConfigJSON.niceList.indexOf(tile.config) + 100);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setString("machineType", tile.machineType);
return stack;
@ -145,4 +149,52 @@ public class BlockCustomMachine extends BlockContainer {
return super.getPickBlock(target, world, x, y, z);
}
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
ISidedInventory sided = (ISidedInventory) world.getTileEntity(x, y, z);
Random rand = world.rand;
if(sided != null) {
for(int i1 = 0; i1 < sided.getSizeInventory(); ++i1) {
if(i1 >= 10 && i1 <= 15)
continue; // do NOT drop the filters
ItemStack itemstack = sided.getStackInSlot(i1);
if(itemstack != null) {
float f = rand.nextFloat() * 0.8F + 0.1F;
float f1 = rand.nextFloat() * 0.8F + 0.1F;
float f2 = rand.nextFloat() * 0.8F + 0.1F;
while(itemstack.stackSize > 0) {
int j1 = rand.nextInt(21) + 10;
if(j1 > itemstack.stackSize) {
j1 = itemstack.stackSize;
}
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if(itemstack.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
float f3 = 0.05F;
entityitem.motionX = (float) rand.nextGaussian() * f3;
entityitem.motionY = (float) rand.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) rand.nextGaussian() * f3;
world.spawnEntityInWorld(entityitem);
}
}
}
world.func_147453_f(x, y, z, block);
}
super.breakBlock(world, x, y, z, block, meta);
}
}

View File

@ -0,0 +1,87 @@
package com.hbm.commands;
import com.hbm.items.ISatChip;
import com.hbm.items.ModItems;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.saveddata.satellites.Satellite;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
public class CommandSatellites extends CommandBase {
@Override
public String getCommandName() {
return "ntmsatellites";
}
@Override
public String getCommandUsage(ICommandSender iCommandSender) {
return String.format(
"%s/%s orbit %s- Launch the held satellite\n" +
"%s/%s descend <frequency> %s- Deletes satellite by frequency.",
EnumChatFormatting.GREEN, getCommandName(), EnumChatFormatting.LIGHT_PURPLE,
EnumChatFormatting.GREEN, getCommandName(), EnumChatFormatting.LIGHT_PURPLE
);
}
@Override
public void processCommand(ICommandSender sender, String[] args) {
if(!(sender instanceof EntityPlayer)) {
sender.addChatMessage(new ChatComponentTranslation( "commands.satellite.should_be_run_as_player").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
return;
}
switch (args[0]) {
case "orbit":
EntityPlayer player = getCommandSenderAsPlayer(sender);
if(player.getHeldItem().getItem() instanceof ISatChip && player.getHeldItem().getItem() != ModItems.sat_chip) {
Satellite.orbit(
player.worldObj,
Satellite.getIDFromItem(player.getHeldItem().getItem()),
ISatChip.getFreqS(player.getHeldItem()),
player.posX, player.posY, player.posZ
);
player.getHeldItem().stackSize -= 1;
sender.addChatMessage(new ChatComponentTranslation("commands.satellite.satellite_orbited").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
} else {
sender.addChatMessage(new ChatComponentTranslation("commands.satellite.not_a_satellite").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
}
break;
case "descend":
int freq = parseInt(sender, args[1]);
SatelliteSavedData data = SatelliteSavedData.getData(sender.getEntityWorld());
if(data.sats.containsKey(freq)) {
data.sats.remove(freq);
data.markDirty();
sender.addChatMessage(new ChatComponentTranslation( "commands.satellite.satellite_descended").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
} else {
sender.addChatMessage(new ChatComponentTranslation( "commands.satellite.no_satellite").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
}
break;
}
}
@SuppressWarnings("rawtypes")
@Override
public List addTabCompletionOptions(ICommandSender sender, String[] args) {
if(!(sender instanceof EntityPlayer)) {
return Collections.emptyList();
}
if(args.length < 1) {
return Collections.emptyList();
}
if(args.length == 1) {
return getListOfStringsMatchingLastWord(args, "orbit", "descend");
}
if (args[0].equals("descend")) {
return getListOfStringsFromIterableMatchingLastWord(args, SatelliteSavedData.getData(sender.getEntityWorld()).sats.keySet().stream().map(String::valueOf).collect(Collectors.toList()));
}
return Collections.emptyList();
}
}

View File

@ -14,15 +14,26 @@ import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration.ComponentDefinition;
import com.hbm.inventory.OreDictManager;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ModItems;
import com.hbm.main.CraftingManager;
import com.hbm.main.MainRegistry;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class CustomMachineConfigJSON {
public static final Gson gson = new Gson();
public static HashMap<String, MachineConfiguration> customMachines = new HashMap();
public static List<MachineConfiguration> niceList = new ArrayList();
public static void initialize() {
File folder = MainRegistry.configHbmDir;
@ -59,6 +70,21 @@ public class CustomMachineConfigJSON {
writer.name("recipeConsumptionMult").value(1.0D);
writer.name("maxPower").value(10_000L);
writer.name("recipeShape").beginArray();
writer.value("IPI").value("PCP").value("IPI");
writer.endArray();
writer.name("recipeParts").beginArray().setIndent("");
writer.value("I");
SerializableRecipe.writeAStack(new OreDictStack(OreDictManager.STEEL.ingot()), writer);
writer.setIndent("");
writer.value("P");
SerializableRecipe.writeAStack(new OreDictStack(OreDictManager.STEEL.plate()), writer);
writer.setIndent("");
writer.value("C");
SerializableRecipe.writeAStack(new ComparableStack(ModItems.circuit_aluminium), writer);
writer.endArray().setIndent(" ");
writer.name("components").beginArray();
for(int x = -1; x <= 1; x++) {
@ -134,6 +160,38 @@ public class CustomMachineConfigJSON {
configuration.recipeConsumptionMult = machineObject.get("recipeConsumptionMult").getAsDouble();
configuration.maxPower = machineObject.get("maxPower").getAsLong();
if(machineObject.has("recipeShape") && machineObject.has("recipeParts")) {
JsonArray recipeShape = machineObject.get("recipeShape").getAsJsonArray();
JsonArray recipeParts = machineObject.get("recipeParts").getAsJsonArray();
Object[] parts = new Object[recipeShape.size() + recipeParts.size()];
for(int j = 0; j < recipeShape.size(); j++) {
parts[j] = recipeShape.get(j).getAsString();
}
for(int j = 0; j < recipeParts.size(); j++) {
Object o = null;
if(j % 2 == 0) {
o = recipeParts.get(j).getAsString().charAt(0); //god is dead and we killed him
} else {
AStack a = SerializableRecipe.readAStack(recipeParts.get(j).getAsJsonArray());
if(a instanceof ComparableStack) o = ((ComparableStack) a).toStack();
if(a instanceof OreDictStack) o = ((OreDictStack) a).name;
}
parts[j + recipeShape.size()] = o;
}
ItemStack stack = new ItemStack(ModBlocks.custom_machine, 1, i + 100);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setString("machineType", configuration.unlocalizedName);
CraftingManager.addRecipeAuto(stack, parts);
}
JsonArray components = machineObject.get("components").getAsJsonArray();
configuration.components = new ArrayList();
@ -145,15 +203,16 @@ public class CustomMachineConfigJSON {
compDef.y = compObject.get("y").getAsInt();
compDef.z = compObject.get("z").getAsInt();
compDef.allowedMetas = new HashSet();
JsonArray metas = compObject.get("metas").getAsJsonArray();
for(int k = 0; k < metas.size(); k++) {
compDef.allowedMetas.add(metas.get(k).getAsInt());
compDef.metas = compObject.get("metas").getAsJsonArray();
for(int k = 0; k < compDef.metas.size(); k++) {
compDef.allowedMetas.add(compDef.metas.get(k).getAsInt());
}
configuration.components.add(compDef);
}
customMachines.put(configuration.unlocalizedName, configuration);
niceList.add(configuration);
}
} catch(Exception ex) {
@ -189,6 +248,7 @@ public class CustomMachineConfigJSON {
public static class ComponentDefinition {
public Block block;
public Set<Integer> allowedMetas;
public JsonArray metas;
public int x;
public int y;
public int z;

View File

@ -370,6 +370,8 @@ public class EntityEffectHandler {
double asbestos = Math.min(HbmLivingProps.getAsbestos(entity), HbmLivingProps.maxAsbestos);
double soot = PollutionHandler.getPollution(entity.worldObj, (int) Math.floor(entity.posX), (int) Math.floor(entity.posY + entity.getEyeHeight()), (int) Math.floor(entity.posZ), PollutionType.SOOT);
if(!(entity instanceof EntityPlayer)) soot = 0;
if(ArmorRegistry.hasProtection(entity, 3, HazardClass.PARTICLE_COARSE)) soot = 0;
boolean coughs = blacklung / HbmLivingProps.maxBlacklung > 0.25D || asbestos / HbmLivingProps.maxAsbestos > 0.25D || soot > 30;

View File

@ -6,6 +6,7 @@ import java.io.FileOutputStream;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map.Entry;
import java.util.UUID;
import com.hbm.config.RadiationConfig;
@ -304,6 +305,8 @@ public class PollutionHandler {
/// MOB EFFECTS ///
///////////////////
public static final UUID maxHealth = UUID.fromString("25462f6c-2cb2-4ca8-9b47-3a011cc61207");
public static final UUID attackDamage = UUID.fromString("8f442d7c-d03f-49f6-a040-249ae742eed9");
@SubscribeEvent
public void decorateMob(LivingSpawnEvent event) {
@ -320,8 +323,8 @@ public class PollutionHandler {
if(living instanceof IMob) {
if(data.pollution[PollutionType.SOOT.ordinal()] > RadiationConfig.buffMobThreshold) {
if(living.getEntityAttribute(SharedMonsterAttributes.maxHealth) != null) living.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Soot Anger Health Increase", 1D, 1));
if(living.getEntityAttribute(SharedMonsterAttributes.attackDamage) != null) living.getEntityAttribute(SharedMonsterAttributes.attackDamage).applyModifier(new AttributeModifier("Soot Anger Damage Increase", 1.5D, 1));
if(living.getEntityAttribute(SharedMonsterAttributes.maxHealth) != null && living.getEntityAttribute(SharedMonsterAttributes.maxHealth).getModifier(maxHealth) == null) living.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier(maxHealth, "Soot Anger Health Increase", 1D, 1));
if(living.getEntityAttribute(SharedMonsterAttributes.attackDamage) != null && living.getEntityAttribute(SharedMonsterAttributes.attackDamage).getModifier(attackDamage) == null) living.getEntityAttribute(SharedMonsterAttributes.attackDamage).applyModifier(new AttributeModifier(attackDamage, "Soot Anger Damage Increase", 1.5D, 1));
living.heal(living.getMaxHealth());
}
}

View File

@ -1,7 +1,8 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.items.machine.ItemSatChip;
import com.hbm.tileentity.machine.TileEntityMachineSatDock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@ -11,41 +12,42 @@ import net.minecraft.item.ItemStack;
public class ContainerSatDock extends Container {
private TileEntityMachineSatDock diFurnace;
private final TileEntityMachineSatDock tileSatelliteDock;
public ContainerSatDock(InventoryPlayer invPlayer, TileEntityMachineSatDock tedf) {
diFurnace = tedf;
public ContainerSatDock(InventoryPlayer invPlayer, TileEntityMachineSatDock tesd) {
tileSatelliteDock = tesd;
//Storage
this.addSlotToContainer(new Slot(tedf, 0, 62, 17));
this.addSlotToContainer(new Slot(tedf, 1, 80, 17));
this.addSlotToContainer(new Slot(tedf, 2, 98, 17));
this.addSlotToContainer(new Slot(tedf, 3, 116, 17));
this.addSlotToContainer(new Slot(tedf, 4, 134, 17));
this.addSlotToContainer(new Slot(tedf, 5, 62, 35));
this.addSlotToContainer(new Slot(tedf, 6, 80, 35));
this.addSlotToContainer(new Slot(tedf, 7, 98, 35));
this.addSlotToContainer(new Slot(tedf, 8, 116, 35));
this.addSlotToContainer(new Slot(tedf, 9, 134, 35));
this.addSlotToContainer(new Slot(tedf, 10, 62, 53));
this.addSlotToContainer(new Slot(tedf, 11, 80, 53));
this.addSlotToContainer(new Slot(tedf, 12, 98, 53));
this.addSlotToContainer(new Slot(tedf, 13, 116, 53));
this.addSlotToContainer(new Slot(tedf, 14, 134, 53));
this.addSlotToContainer(new SlotTakeOnly(tesd, 0, 62, 17));
this.addSlotToContainer(new SlotTakeOnly(tesd, 1, 80, 17));
this.addSlotToContainer(new SlotTakeOnly(tesd, 2, 98, 17));
this.addSlotToContainer(new SlotTakeOnly(tesd, 3, 116, 17));
this.addSlotToContainer(new SlotTakeOnly(tesd, 4, 134, 17));
this.addSlotToContainer(new SlotTakeOnly(tesd, 5, 62, 35));
this.addSlotToContainer(new SlotTakeOnly(tesd, 6, 80, 35));
this.addSlotToContainer(new SlotTakeOnly(tesd, 7, 98, 35));
this.addSlotToContainer(new SlotTakeOnly(tesd, 8, 116, 35));
this.addSlotToContainer(new SlotTakeOnly(tesd, 9, 134, 35));
this.addSlotToContainer(new SlotTakeOnly(tesd, 10, 62, 53));
this.addSlotToContainer(new SlotTakeOnly(tesd, 11, 80, 53));
this.addSlotToContainer(new SlotTakeOnly(tesd, 12, 98, 53));
this.addSlotToContainer(new SlotTakeOnly(tesd, 13, 116, 53));
this.addSlotToContainer(new SlotTakeOnly(tesd, 14, 134, 53));
//Chip
this.addSlotToContainer(new Slot(tedf, 15, 26, 35));
this.addSlotToContainer(new Slot(tesd, 15, 26, 35) {
@Override
public boolean isItemValid(ItemStack stack) {
return stack.getItem() instanceof ItemSatChip;
}
});
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 9; j++)
{
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for(int i = 0; i < 9; i++)
{
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
}
}
@ -56,33 +58,25 @@ public class ContainerSatDock extends Container {
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
{
public ItemStack transferStackInSlot(EntityPlayer player, int par2) {
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack())
{
if (var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 <= 15) {
if (!this.mergeItemStack(var5, 16, this.inventorySlots.size(), true))
{
if (!this.mergeItemStack(var5, 16, this.inventorySlots.size(), true)) {
return null;
}
}
else if (!this.mergeItemStack(var5, 0, 15, false))
{
return null;
} else if (!this.mergeItemStack(var5, 0, 15, false)) {
return null;
}
if (var5.stackSize == 0)
{
var4.putStack((ItemStack) null);
}
else
{
if (var5.stackSize == 0) {
var4.putStack(null);
} else {
var4.onSlotChanged();
}
}
@ -92,6 +86,6 @@ public class ContainerSatDock extends Container {
@Override
public boolean canInteractWith(EntityPlayer player) {
return diFurnace.isUseableByPlayer(player);
return tileSatelliteDock.isUseableByPlayer(player);
}
}

View File

@ -1,24 +1,22 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerSatDock;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityMachineSatDock;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class GUISatDock extends GuiInfoContainer {
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_dock.png");
private TileEntityMachineSatDock diFurnace;
public static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_dock.png");
private final TileEntityMachineSatDock tileSatelliteDock;
public GUISatDock(InventoryPlayer invPlayer, TileEntityMachineSatDock tedf) {
super(new ContainerSatDock(invPlayer, tedf));
diFurnace = tedf;
public GUISatDock(InventoryPlayer invPlayer, TileEntityMachineSatDock tesd) {
super(new ContainerSatDock(invPlayer, tesd));
tileSatelliteDock = tesd;
this.xSize = 176;
this.ySize = 168;
@ -36,10 +34,10 @@ public class GUISatDock extends GuiInfoContainer {
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
String name = this.tileSatelliteDock.hasCustomInventoryName() ? this.tileSatelliteDock.getInventoryName() : I18n.format(this.tileSatelliteDock.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 0x404040);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 0x404040);
}
@Override

View File

@ -188,7 +188,7 @@ public abstract class SerializableRecipe {
* JSON IO UTIL
*/
protected static AStack readAStack(JsonArray array) {
public static AStack readAStack(JsonArray array) {
try {
String type = array.get(0).getAsString();
int stacksize = array.size() > 2 ? array.get(2).getAsInt() : 1;
@ -206,7 +206,7 @@ public abstract class SerializableRecipe {
return new ComparableStack(ModItems.nothing);
}
protected static AStack[] readAStackArray(JsonArray array) {
public static AStack[] readAStackArray(JsonArray array) {
try {
AStack[] items = new AStack[array.size()];
for(int i = 0; i < items.length; i++) { items[i] = readAStack((JsonArray) array.get(i)); }
@ -216,7 +216,7 @@ public abstract class SerializableRecipe {
return new AStack[0];
}
protected static void writeAStack(AStack astack, JsonWriter writer) throws IOException {
public static void writeAStack(AStack astack, JsonWriter writer) throws IOException {
writer.beginArray();
writer.setIndent("");
if(astack instanceof ComparableStack) {
@ -236,7 +236,7 @@ public abstract class SerializableRecipe {
writer.setIndent(" ");
}
protected static ItemStack readItemStack(JsonArray array) {
public static ItemStack readItemStack(JsonArray array) {
try {
Item item = (Item) Item.itemRegistry.getObject(array.get(0).getAsString());
int stacksize = array.size() > 1 ? array.get(1).getAsInt() : 1;
@ -247,7 +247,7 @@ public abstract class SerializableRecipe {
return new ItemStack(ModItems.nothing);
}
protected static Pair<ItemStack, Float> readItemStackChance(JsonArray array) {
public static Pair<ItemStack, Float> readItemStackChance(JsonArray array) {
try {
Item item = (Item) Item.itemRegistry.getObject(array.get(0).getAsString());
int stacksize = array.size() > 2 ? array.get(1).getAsInt() : 1;
@ -259,7 +259,7 @@ public abstract class SerializableRecipe {
return new Pair(new ItemStack(ModItems.nothing), 1F);
}
protected static ItemStack[] readItemStackArray(JsonArray array) {
public static ItemStack[] readItemStackArray(JsonArray array) {
try {
ItemStack[] items = new ItemStack[array.size()];
for(int i = 0; i < items.length; i++) { items[i] = readItemStack((JsonArray) array.get(i)); }
@ -269,7 +269,7 @@ public abstract class SerializableRecipe {
return new ItemStack[0];
}
protected static Pair<ItemStack, Float>[] readItemStackArrayChance(JsonArray array) {
public static Pair<ItemStack, Float>[] readItemStackArrayChance(JsonArray array) {
try {
Pair<ItemStack, Float>[] items = new Pair[array.size()];
for(int i = 0; i < items.length; i++) { items[i] = readItemStackChance((JsonArray) array.get(i)); }
@ -279,7 +279,7 @@ public abstract class SerializableRecipe {
return new Pair[0];
}
protected static void writeItemStack(ItemStack stack, JsonWriter writer) throws IOException {
public static void writeItemStack(ItemStack stack, JsonWriter writer) throws IOException {
writer.beginArray();
writer.setIndent("");
writer.value(Item.itemRegistry.getNameForObject(stack.getItem())); //item name
@ -289,7 +289,7 @@ public abstract class SerializableRecipe {
writer.setIndent(" ");
}
protected static void writeItemStackChance(Pair<ItemStack, Float> stack, JsonWriter writer) throws IOException {
public static void writeItemStackChance(Pair<ItemStack, Float> stack, JsonWriter writer) throws IOException {
writer.beginArray();
writer.setIndent("");
writer.value(Item.itemRegistry.getNameForObject(stack.getKey().getItem())); //item name
@ -300,7 +300,7 @@ public abstract class SerializableRecipe {
writer.setIndent(" ");
}
protected static FluidStack readFluidStack(JsonArray array) {
public static FluidStack readFluidStack(JsonArray array) {
try {
FluidType type = Fluids.fromName(array.get(0).getAsString());
int fill = array.get(1).getAsInt();
@ -311,7 +311,7 @@ public abstract class SerializableRecipe {
return new FluidStack(Fluids.NONE, 0);
}
protected static FluidStack[] readFluidArray(JsonArray array) {
public static FluidStack[] readFluidArray(JsonArray array) {
try {
FluidStack[] fluids = new FluidStack[array.size()];
for(int i = 0; i < fluids.length; i++) { fluids[i] = readFluidStack((JsonArray) array.get(i)); }
@ -321,7 +321,7 @@ public abstract class SerializableRecipe {
return new FluidStack[0];
}
protected static void writeFluidStack(FluidStack stack, JsonWriter writer) throws IOException {
public static void writeFluidStack(FluidStack stack, JsonWriter writer) throws IOException {
writer.beginArray();
writer.setIndent("");
writer.value(stack.type.getName()); //fluid type

View File

@ -17,7 +17,6 @@ import com.hbm.items.armor.*;
import com.hbm.items.armor.IArmorDisableModel.EnumPlayerPart;
import com.hbm.items.bomb.*;
import com.hbm.items.food.*;
import com.hbm.items.food.ItemConserve.EnumFoodType;
import com.hbm.items.machine.*;
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
@ -3452,34 +3451,6 @@ public class ModItems {
coffee = new ItemEnergy().setUnlocalizedName("coffee").setTextureName(RefStrings.MODID + ":coffee");
coffee_radium = new ItemEnergy().setUnlocalizedName("coffee_radium").setTextureName(RefStrings.MODID + ":coffee_radium");
chocolate = new ItemPill(0).setUnlocalizedName("chocolate").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":chocolate");
//canned_beef = new ItemLemon(8, 5, false).setUnlocalizedName("canned_beef").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_beef");
//canned_tuna = new ItemLemon(4, 5, false).setUnlocalizedName("canned_tuna").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_tuna");
//canned_mystery = new ItemLemon(6, 5, false).setUnlocalizedName("canned_mystery").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_mystery");
//canned_pashtet = new ItemLemon(4, 5, false).setUnlocalizedName("canned_pashtet").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_pashtet");
//canned_cheese = new ItemLemon(3, 5, false).setUnlocalizedName("canned_cheese").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_cheese");
//canned_jizz = new ItemLemon(15, 5, false).setUnlocalizedName("canned_jizz").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_jizz");
//canned_milk = new ItemLemon(5, 5, false).setUnlocalizedName("canned_milk").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_milk");
//canned_ass = new ItemLemon(6, 5, false).setUnlocalizedName("canned_ass").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_ass");
//canned_pizza = new ItemLemon(8, 5, false).setUnlocalizedName("canned_pizza").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_pizza");
//canned_tube = new ItemLemon(2, 5, false).setUnlocalizedName("canned_tube").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_tube");
//canned_tomato = new ItemLemon(4, 5, false).setUnlocalizedName("canned_tomato").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_tomato");
//canned_asbestos = new ItemLemon(7, 5, false).setUnlocalizedName("canned_asbestos").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_asbestos");
//canned_bhole = new ItemLemon(10, 5, false).setUnlocalizedName("canned_bhole").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_bhole");
//canned_hotdogs = new ItemLemon(5, 5, false).setUnlocalizedName("canned_hotdogs").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_hotdogs");
//canned_leftovers = new ItemLemon(1, 5, false).setUnlocalizedName("canned_leftovers").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_leftovers");
//canned_yogurt = new ItemLemon(3, 5, false).setUnlocalizedName("canned_yogurt").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_yogurt");
//canned_stew = new ItemLemon(5, 5, false).setUnlocalizedName("canned_stew").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_stew");
//canned_chinese = new ItemLemon(6, 5, false).setUnlocalizedName("canned_chinese").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_chinese");
//canned_oil = new ItemLemon(3, 5, false).setUnlocalizedName("canned_oil").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_oil");
//canned_fist = new ItemLemon(6, 5, false).setUnlocalizedName("canned_fist").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_fist");
//canned_spam = new ItemLemon(8, 5, false).setUnlocalizedName("canned_spam").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_spam");
//canned_fried = new ItemLemon(10, 5, false).setUnlocalizedName("canned_fried").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_fried");
//canned_napalm = new ItemLemon(6, 5, false).setUnlocalizedName("canned_napalm").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_napalm");
//canned_diesel = new ItemLemon(6, 5, false).setUnlocalizedName("canned_diesel").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_diesel");
//canned_kerosene = new ItemLemon(6, 5, false).setUnlocalizedName("canned_kerosene").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_kerosene");
//canned_recursion = new ItemLemon(1, 5, false).setUnlocalizedName("canned_recursion").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_recursion");
//canned_bark = new ItemLemon(2, 5, false).setUnlocalizedName("canned_bark").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned_bark");
canned_conserve = (ItemEnumMulti) new ItemConserve().setUnlocalizedName("canned_conserve").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":canned");
can_key = new Item().setUnlocalizedName("can_key").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_key");
@ -8117,35 +8088,6 @@ public class ModItems {
GameRegistry.registerItem(mysteryshovel, mysteryshovel.getUnlocalizedName());
GameRegistry.registerItem(memory, memory.getUnlocalizedName());
//CONSERVE REMAP
addRemap("canned_beef", canned_conserve, EnumFoodType.BEEF);
addRemap("canned_tuna", canned_conserve, EnumFoodType.TUNA);
addRemap("canned_mystery", canned_conserve, EnumFoodType.MYSTERY);
addRemap("canned_pashtet", canned_conserve, EnumFoodType.PASHTET);
addRemap("canned_cheese", canned_conserve, EnumFoodType.CHEESE);
addRemap("canned_jizz", canned_conserve, EnumFoodType.JIZZ);
addRemap("canned_milk", canned_conserve, EnumFoodType.MILK);
addRemap("canned_ass", canned_conserve, EnumFoodType.ASS);
addRemap("canned_pizza", canned_conserve, EnumFoodType.PIZZA);
addRemap("canned_tube", canned_conserve, EnumFoodType.TUBE);
addRemap("canned_tomato", canned_conserve, EnumFoodType.TOMATO);
addRemap("canned_asbestos", canned_conserve, EnumFoodType.ASBESTOS);
addRemap("canned_bhole", canned_conserve, EnumFoodType.BHOLE);
addRemap("canned_hotdogs", canned_conserve, EnumFoodType.HOTDOGS);
addRemap("canned_leftovers", canned_conserve, EnumFoodType.LEFTOVERS);
addRemap("canned_yogurt", canned_conserve, EnumFoodType.YOGURT);
addRemap("canned_stew", canned_conserve, EnumFoodType.STEW);
addRemap("canned_chinese", canned_conserve, EnumFoodType.CHINESE);
addRemap("canned_oil", canned_conserve, EnumFoodType.OIL);
addRemap("canned_fist", canned_conserve, EnumFoodType.FIST);
addRemap("canned_spam", canned_conserve, EnumFoodType.SPAM);
addRemap("canned_fried", canned_conserve, EnumFoodType.FRIED);
addRemap("canned_napalm", canned_conserve, EnumFoodType.NAPALM);
addRemap("canned_diesel", canned_conserve, EnumFoodType.DIESEL);
addRemap("canned_kerosene", canned_conserve, EnumFoodType.KEROSENE);
addRemap("canned_recursion", canned_conserve, EnumFoodType.RECURSION);
addRemap("canned_bark", canned_conserve, EnumFoodType.BARK);
addRemap("rod_zirnox_natural_uranium_fuel", rod_zirnox, EnumZirnoxType.NATURAL_URANIUM_FUEL);
addRemap("rod_zirnox_uranium_fuel", rod_zirnox, EnumZirnoxType.URANIUM_FUEL);
addRemap("rod_zirnox_th232", rod_zirnox, EnumZirnoxType.TH232);

View File

@ -1,7 +1,6 @@
package com.hbm.items.block;
import java.util.List;
import java.util.Map.Entry;
import com.hbm.config.CustomMachineConfigJSON;
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration;
@ -24,10 +23,11 @@ public class ItemCustomMachine extends ItemBlock {
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list) {
for(Entry<String, MachineConfiguration> entry : CustomMachineConfigJSON.customMachines.entrySet()) {
ItemStack stack = new ItemStack(item);
for(int i = 0; i < CustomMachineConfigJSON.niceList.size(); i++) {
MachineConfiguration conf = CustomMachineConfigJSON.niceList.get(i);
ItemStack stack = new ItemStack(item, 1, i + 100);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setString("machineType", entry.getKey());
stack.stackTagCompound.setString("machineType", conf.unlocalizedName);
list.add(stack);
}
}

View File

@ -49,8 +49,8 @@ public class ItemFlask extends ItemEnumMulti {
if(stack.getItemDamage() == EnumInfusion.SHIELD.ordinal()) {
float infusion = 5F;
HbmPlayerProps props = HbmPlayerProps.getData(player);
props.maxShield = Math.min(props.shieldCap, props.shield + infusion);
props.shield += infusion;
props.maxShield = Math.min(props.shieldCap, props.maxShield + infusion);
props.shield = Math.min(props.shield + infusion, props.maxShield);
}
return stack;

View File

@ -275,7 +275,7 @@ public class ItemRBMKRod extends Item {
break;
case ARCH: function = "(%1$s - %1$s² / 10000) / 100 * %2$s [0;∞]";
break;
case SIGMOID: function = "%2$s / (1 + e^(-(%1$s - 50) / 10)";
case SIGMOID: function = "%2$s / (1 + e^(-(%1$s - 50) / 10))";
break;
case SQUARE_ROOT: function = "sqrt(%1$s) * %2$s / 10";
break;

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (4663)";
public static final String VERSION = "1.0.27 BETA (4671)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -325,6 +325,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityITERStruct.class, new RenderITERMultiblock());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPlasmaStruct.class, new RenderPlasmaMultiblock());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatzStruct.class, new RenderWatzMultiblock());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCustomMachine.class, new RenderCustomMachine());
//RBMK
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKControlManual.class, new RenderRBMKControlRod());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKControlAuto.class, new RenderRBMKControlRod());

View File

@ -1096,6 +1096,26 @@ public class CraftingManager {
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin, 1, 1), new ItemStack(ModItems.sliding_blast_door_skin, 1, 0));
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin, 1, 2), new ItemStack(ModItems.sliding_blast_door_skin, 1, 1));
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin), new ItemStack(ModItems.sliding_blast_door_skin, 1, 2));
addRecipeAuto(new ItemStack(ModBlocks.cm_block, 4, 0), " I ", "IPI", " I ", 'I', STEEL.ingot(), 'P', STEEL.plateCast());
addRecipeAuto(new ItemStack(ModBlocks.cm_block, 4, 1), " I ", "IPI", " I ", 'I', ALLOY.ingot(), 'P', ALLOY.plateCast());
addRecipeAuto(new ItemStack(ModBlocks.cm_block, 4, 2), " I ", "IPI", " I ", 'I', DESH.ingot(), 'P', DESH.plateCast());
addRecipeAuto(new ItemStack(ModBlocks.cm_block, 4, 3), " I ", "IPI", " I ", 'I', ANY_RESISTANTALLOY.ingot(), 'P', ANY_RESISTANTALLOY.plateCast());
for(int i = 0; i < 4; i++) {
addRecipeAuto(new ItemStack(ModBlocks.cm_sheet, 16, i), "BB", "BB", 'B', new ItemStack(ModBlocks.cm_block, 1, i));
addRecipeAuto(new ItemStack(ModBlocks.cm_tank, 4, i), " B ", "BGB", " B ", 'B', new ItemStack(ModBlocks.cm_block, 1, i), 'G', KEY_ANYGLASS);
addRecipeAuto(new ItemStack(ModBlocks.cm_port, 1, i), "P", "B", "P", 'B', new ItemStack(ModBlocks.cm_block, 1, i), 'P', IRON.plate());
}
addRecipeAuto(new ItemStack(ModBlocks.cm_engine, 1, 0), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.motor);
addRecipeAuto(new ItemStack(ModBlocks.cm_engine, 1, 1), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.motor_desh);
addRecipeAuto(new ItemStack(ModBlocks.cm_engine, 1, 2), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.motor_bismuth);
addRecipeAuto(new ItemStack(ModBlocks.cm_circuit, 1, 0), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.circuit_aluminium);
addRecipeAuto(new ItemStack(ModBlocks.cm_circuit, 1, 1), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.circuit_copper);
addRecipeAuto(new ItemStack(ModBlocks.cm_circuit, 1, 2), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.circuit_red_copper);
addRecipeAuto(new ItemStack(ModBlocks.cm_circuit, 1, 3), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.circuit_gold);
addRecipeAuto(new ItemStack(ModBlocks.cm_circuit, 1, 4), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.circuit_schrabidium);
}
public static void crumple() {

View File

@ -1,5 +1,6 @@
package com.hbm.main;
import com.hbm.commands.CommandSatellites;
import net.minecraft.block.BlockDispenser;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
@ -926,6 +927,7 @@ public class MainRegistry {
SiegeOrchestrator.createGameRules(world);
event.registerServerCommand(new CommandReloadRecipes());
event.registerServerCommand(new CommandDebugChunkLoad());
event.registerServerCommand(new CommandSatellites());
}
@EventHandler
@ -1132,6 +1134,33 @@ public class MainRegistry {
ignoreMappings.add("hbm:tile.gas_duct");
ignoreMappings.add("hbm:tile.dummy_block_assembler");
ignoreMappings.add("hbm:tile.dummy_port_assembler");
ignoreMappings.add("hbm:item.canned_beef");
ignoreMappings.add("hbm:item.canned_tuna");
ignoreMappings.add("hbm:item.canned_mystery");
ignoreMappings.add("hbm:item.canned_pashtet");
ignoreMappings.add("hbm:item.canned_cheese");
ignoreMappings.add("hbm:item.canned_jizz");
ignoreMappings.add("hbm:item.canned_milk");
ignoreMappings.add("hbm:item.canned_ass");
ignoreMappings.add("hbm:item.canned_pizza");
ignoreMappings.add("hbm:item.canned_tube");
ignoreMappings.add("hbm:item.canned_tomato");
ignoreMappings.add("hbm:item.canned_asbestos");
ignoreMappings.add("hbm:item.canned_bhole");
ignoreMappings.add("hbm:item.canned_hotdogs");
ignoreMappings.add("hbm:item.canned_leftovers");
ignoreMappings.add("hbm:item.canned_yogurt");
ignoreMappings.add("hbm:item.canned_stew");
ignoreMappings.add("hbm:item.canned_chinese");
ignoreMappings.add("hbm:item.canned_oil");
ignoreMappings.add("hbm:item.canned_fist");
ignoreMappings.add("hbm:item.canned_spam");
ignoreMappings.add("hbm:item.canned_fried");
ignoreMappings.add("hbm:item.canned_napalm");
ignoreMappings.add("hbm:item.canned_diesel");
ignoreMappings.add("hbm:item.canned_kerosene");
ignoreMappings.add("hbm:item.canned_recursion");
ignoreMappings.add("hbm:item.canned_bark");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);

View File

@ -0,0 +1,50 @@
package com.hbm.render.tileentity;
import com.hbm.config.CustomMachineConfigJSON;
import com.hbm.render.util.SmallBlockPronter;
import com.hbm.tileentity.machine.TileEntityCustomMachine;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
public class RenderCustomMachine extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
TileEntityCustomMachine custom = (TileEntityCustomMachine) tile;
CustomMachineConfigJSON.MachineConfiguration config = custom.config;
ForgeDirection dir = ForgeDirection.getOrientation(tile.getBlockMetadata());
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
if(config != null && !custom.structureOK) {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
bindTexture(TextureMap.locationBlocksTexture);
SmallBlockPronter.startDrawing();
for(CustomMachineConfigJSON.MachineConfiguration.ComponentDefinition comp : config.components) {
int rx = -dir.offsetX * comp.x + rot.offsetX * comp.x;
int ry = +comp.y;
int rz = -dir.offsetZ * comp.z + rot.offsetZ * comp.z;
if(dir == ForgeDirection.EAST || dir == ForgeDirection.WEST) {
rx = +dir.offsetZ * comp.z - rot.offsetZ * comp.z;
rz = +dir.offsetX * comp.x - rot.offsetX * comp.x;
}
int index = (int) ((System.currentTimeMillis() / 1000) % comp.metas.size());
SmallBlockPronter.drawSmolBlockAt(comp.block, comp.metas.get(index).getAsInt(), rx, ry, rz);
}
SmallBlockPronter.draw();
GL11.glPopMatrix();
}
}
}

View File

@ -1,35 +1,38 @@
package com.hbm.saveddata;
import java.util.HashMap;
import java.util.Map.Entry;
import com.hbm.saveddata.satellites.Satellite;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.world.WorldSavedData;
import java.util.HashMap;
import java.util.Map.Entry;
public class SatelliteSavedData extends WorldSavedData {
public HashMap<Integer, Satellite> sats = new HashMap();
public final HashMap<Integer, Satellite> sats = new HashMap<>();
public SatelliteSavedData(String p_i2141_1_) {
super(p_i2141_1_);
/**
* Constructor used for deserialization
* @param name - Map data name
*/
public SatelliteSavedData(String name) {
super(name);
}
public SatelliteSavedData()
{
/**
* Default constructor for satellites map data.
*/
public SatelliteSavedData() {
super("satellites");
this.markDirty();
}
public boolean isFreqTaken(int freq) {
return getSatFromFreq(freq) != null;
}
public Satellite getSatFromFreq(int freq) {
return sats.get(freq);
}
@ -38,7 +41,6 @@ public class SatelliteSavedData extends WorldSavedData {
int satCount = nbt.getInteger("satCount");
for(int i = 0; i < satCount; i++) {
Satellite sat = Satellite.create(nbt.getInteger("sat_id_" + i));
sat.readFromNBT((NBTTagCompound) nbt.getTag("sat_data_" + i));
@ -55,7 +57,6 @@ public class SatelliteSavedData extends WorldSavedData {
int i = 0;
for(Entry<Integer, Satellite> struct : sats.entrySet()) {
NBTTagCompound data = new NBTTagCompound();
struct.getValue().writeToNBT(data);
@ -67,7 +68,6 @@ public class SatelliteSavedData extends WorldSavedData {
}
public static SatelliteSavedData getData(World worldObj) {
SatelliteSavedData data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
if(data == null) {
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData());
@ -77,5 +77,4 @@ public class SatelliteSavedData extends WorldSavedData {
return data;
}
}

View File

@ -1,23 +1,22 @@
package com.hbm.saveddata.satellites;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.hbm.items.ModItems;
import com.hbm.saveddata.SatelliteSavedData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public abstract class Satellite {
public static List<Class> satellites = new ArrayList();
public static HashMap<Item, Class> itemToClass = new HashMap();
public static final List<Class<? extends Satellite>> satellites = new ArrayList<>();
public static final HashMap<Item, Class<? extends Satellite>> itemToClass = new HashMap<>();
public static enum InterfaceActions {
public enum InterfaceActions {
HAS_MAP, //lets the interface display loaded chunks
CAN_CLICK, //enables onClick events
SHOW_COORDS, //enables coordinates as a mouse tooltip
@ -25,18 +24,18 @@ public abstract class Satellite {
HAS_ORES //like HAS_MAP but only shows ores
}
public static enum CoordActions {
public enum CoordActions {
HAS_Y //enables the Y-coord field which is disabled by default
}
public static enum Interfaces {
public enum Interfaces {
NONE, //does not interact with any sat interface (i.e. asteroid miners)
SAT_PANEL, //allows to interact with the sat interface panel (for graphical applications)
SAT_COORD //allows to interact with the sat coord remote (for teleportation or other coord related actions)
}
public List<InterfaceActions> ifaceAcs = new ArrayList();
public List<CoordActions> coordAcs = new ArrayList();
public List<InterfaceActions> ifaceAcs = new ArrayList<>();
public List<CoordActions> coordAcs = new ArrayList<>();
public Interfaces satIface = Interfaces.NONE;
public static void register() {
@ -64,10 +63,13 @@ public abstract class Satellite {
}
public static void orbit(World world, int id, int freq, double x, double y, double z) {
if(world.isRemote) {
return;
}
Satellite sat = create(id);
if(sat != null && !world.isRemote) {
if(sat != null) {
SatelliteSavedData data = SatelliteSavedData.getData(world);
data.sats.put(freq, sat);
sat.onOrbit(world, x, y, z);
@ -76,25 +78,22 @@ public abstract class Satellite {
}
public static Satellite create(int id) {
Satellite sat = null;
try {
Class c = satellites.get(id);
sat = (Satellite) c.newInstance();
} catch(Exception ex) {
Class<? extends Satellite> c = satellites.get(id);
sat = c.newInstance();
} catch(Exception e) {
e.printStackTrace();
}
return sat;
}
public static int getIDFromItem(Item item) {
Class<? extends Satellite> sat = itemToClass.get(item);
int i = satellites.indexOf(sat);
return i;
return satellites.indexOf(sat);
}
public int getID() {

View File

@ -20,7 +20,7 @@ public class TileEntityProxyBase extends TileEntityLoadedBase {
if(cachedPosition != null) {
TileEntity te = Compat.getTileStandard(worldObj, cachedPosition.getX(), cachedPosition.getY(), cachedPosition.getZ());
if(te != null && te != this) return te;
if(te != null && !(te instanceof TileEntityProxyBase)) return te;
cachedPosition = null;
this.markDirty();
}
@ -34,7 +34,7 @@ public class TileEntityProxyBase extends TileEntityLoadedBase {
if(pos != null) {
TileEntity te = Compat.getTileStandard(worldObj, pos[0], pos[1], pos[2]);
if(te != null && te != this) return te;
if(te != null && !(te instanceof TileEntityProxyBase)) return te;
}
}
@ -42,7 +42,7 @@ public class TileEntityProxyBase extends TileEntityLoadedBase {
IProxyController controller = (IProxyController) this.getBlockType();
TileEntity tile = controller.getCore(worldObj, xCoord, yCoord, zCoord);
if(tile != null && tile != this) return tile;
if(tile != null && !(tile instanceof TileEntityProxyBase)) return tile;
}
return null;

View File

@ -6,7 +6,6 @@ import java.util.List;
import com.hbm.config.CustomMachineConfigJSON;
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration;
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration.ComponentDefinition;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.container.ContainerMachineCustom;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
@ -175,6 +174,7 @@ public class TileEntityCustomMachine extends TileEntityMachineBase implements IF
NBTTagCompound data = new NBTTagCompound();
data.setString("type", this.machineType);
data.setLong("power", power);
data.setBoolean("structureOK", structureOK);
data.setInteger("progress", progress);
data.setInteger("maxProgress", maxProgress);
for(int i = 0; i < inputTanks.length; i++) inputTanks[i].writeToNBT(data, "i" + i);
@ -370,6 +370,7 @@ public class TileEntityCustomMachine extends TileEntityMachineBase implements IF
this.power = nbt.getLong("power");
this.progress = nbt.getInteger("progress");
this.structureOK = nbt.getBoolean("structureOK");
this.maxProgress = nbt.getInteger("maxProgress");
for(int i = 0; i < inputTanks.length; i++) inputTanks[i].readFromNBT(nbt, "i" + i);
for(int i = 0; i < outputTanks.length; i++) outputTanks[i].readFromNBT(nbt, "o" + i);
@ -465,7 +466,7 @@ public class TileEntityCustomMachine extends TileEntityMachineBase implements IF
@Override
public long getMaxPower() {
return this.config != null ? this.getMaxPower() : 1;
return this.config != null ? this.config.maxPower : 1;
}
@Override

View File

@ -184,8 +184,8 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements IEn
for(int i = 0; i < nearbyMissiles.size(); i++) {
if(nearbyMissiles.get(i)[3] + 1 > power) {
power = nearbyMissiles.get(i)[3] + 1;
if(nearbyMissiles.get(i)[2] + 1 > power) {
power = nearbyMissiles.get(i)[2] + 1;
}
}

View File

@ -13,7 +13,6 @@ import com.hbm.util.WeightedRandomObject;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
@ -27,15 +26,16 @@ import net.minecraft.util.WeightedRandom;
import net.minecraft.world.World;
import java.util.List;
import java.util.Random;
public class TileEntityMachineSatDock extends TileEntity implements ISidedInventory, IGUIProvider {
private ItemStack[] slots;
private static final int[] access = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
private static final int[] access = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
private String customName;
private AxisAlignedBB renderBoundingBox;
public TileEntityMachineSatDock() {
slots = new ItemStack[16];
}
@ -177,21 +177,12 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
return true;
}
SatelliteSavedData data = null;
@Override
public void updateEntity() {
if (!worldObj.isRemote) {
if (data == null)
data = (SatelliteSavedData) worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
SatelliteSavedData data = SatelliteSavedData.getData(worldObj);
if (data == null) {
worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData());
data = (SatelliteSavedData) worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites");
}
data.markDirty();
if (data != null && slots[15] != null) {
if (slots[15] != null) {
int freq = ISatChip.getFreqS(slots[15]);
Satellite sat = data.getSatFromFreq(freq);
@ -215,22 +206,23 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
}
}
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord - 0.25 + 0.5, yCoord + 0.75, zCoord - 0.25 + 0.5, xCoord + 0.25 + 0.5, yCoord + 2, zCoord + 0.25 + 0.5));
@SuppressWarnings("unchecked")
List<EntityMinerRocket> list = worldObj.getEntitiesWithinAABBExcludingEntity(
null,
AxisAlignedBB.getBoundingBox(xCoord - 0.25 + 0.5, yCoord + 0.75, zCoord - 0.25 + 0.5, xCoord + 0.25 + 0.5, yCoord + 2, zCoord + 0.25 + 0.5),
entity -> entity instanceof EntityMinerRocket
);
for (Entity e : list) {
if (e instanceof EntityMinerRocket) {
EntityMinerRocket rocket = (EntityMinerRocket) e;
for (EntityMinerRocket rocket : list) {
if (slots[15] != null && ISatChip.getFreqS(slots[15]) != rocket.getDataWatcher().getWatchableObjectInt(17)) {
rocket.setDead();
ExplosionNukeSmall.explode(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, ExplosionNukeSmall.PARAMS_TOTS);
break;
}
if (slots[15] != null && ISatChip.getFreqS(slots[15]) != rocket.getDataWatcher().getWatchableObjectInt(17)) {
rocket.setDead();
ExplosionNukeSmall.explode(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, ExplosionNukeSmall.PARAMS_TOTS);
break;
}
if (rocket.getDataWatcher().getWatchableObjectInt(16) == 1 && rocket.timer == 50) {
Satellite sat = data.getSatFromFreq(ISatChip.getFreqS(slots[15]));
unloadCargo((SatelliteMiner) sat);
}
if (rocket.getDataWatcher().getWatchableObjectInt(16) == 1 && rocket.timer == 50) {
Satellite sat = data.getSatFromFreq(ISatChip.getFreqS(slots[15]));
unloadCargo((SatelliteMiner) sat);
}
}
@ -241,15 +233,13 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
}
}
static final Random rand = new Random();
private void unloadCargo(SatelliteMiner satellite) {
int items = rand.nextInt(6) + 10;
int itemAmount = worldObj.rand.nextInt(6) + 10;
WeightedRandomObject[] cargo = satellite.getCargo();
for (int i = 0; i < items; i++) {
ItemStack stack = ((WeightedRandomObject) WeightedRandom.getRandomItem(rand, cargo)).asStack();
for (int i = 0; i < itemAmount; i++) {
ItemStack stack = ((WeightedRandomObject) WeightedRandom.getRandomItem(worldObj.rand, cargo)).asStack();
addToInv(stack.copy());
}
}
@ -322,12 +312,10 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
}
}
AxisAlignedBB bb = null;
@Override
public AxisAlignedBB getRenderBoundingBox() {
if (bb == null) {
bb = AxisAlignedBB.getBoundingBox(
if (renderBoundingBox == null) {
renderBoundingBox = AxisAlignedBB.getBoundingBox(
xCoord - 1,
yCoord,
zCoord - 1,
@ -337,7 +325,7 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
);
}
return bb;
return renderBoundingBox;
}
@Override

View File

@ -3,6 +3,7 @@ package com.hbm.tileentity.machine;
import com.hbm.inventory.container.ContainerMachineSatLinker;
import com.hbm.inventory.gui.GUIMachineSatLinker;
import com.hbm.items.ISatChip;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.tileentity.IGUIProvider;
import cpw.mods.fml.relauncher.Side;
@ -18,8 +19,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class TileEntityMachineSatLinker extends TileEntity implements ISidedInventory, IGUIProvider {
private ItemStack slots[];
private ItemStack[] slots;
//public static final int maxFill = 64 * 3;
@ -45,21 +45,19 @@ public class TileEntityMachineSatLinker extends TileEntity implements ISidedInve
@Override
public ItemStack getStackInSlotOnClosing(int i) {
if(slots[i] != null)
{
if(slots[i] != null) {
ItemStack itemStack = slots[i];
slots[i] = null;
return itemStack;
} else {
return null;
return null;
}
}
@Override
public void setInventorySlotContents(int i, ItemStack itemStack) {
slots[i] = itemStack;
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
{
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit()) {
itemStack.stackSize = getInventoryStackLimit();
}
}
@ -85,11 +83,10 @@ public class TileEntityMachineSatLinker extends TileEntity implements ISidedInve
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
{
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
return false;
}else{
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
} else {
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
}
}
@ -105,17 +102,14 @@ public class TileEntityMachineSatLinker extends TileEntity implements ISidedInve
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
if(slots[i].stackSize <= j)
{
if(slots[i] != null) {
if(slots[i].stackSize <= j) {
ItemStack itemStack = slots[i];
slots[i] = null;
return itemStack;
}
ItemStack itemStack1 = slots[i].splitStack(j);
if (slots[i].stackSize == 0)
{
if (slots[i].stackSize == 0) {
slots[i] = null;
}
@ -132,12 +126,10 @@ public class TileEntityMachineSatLinker extends TileEntity implements ISidedInve
slots = new ItemStack[getSizeInventory()];
for(int i = 0; i < list.tagCount(); i++)
{
for(int i = 0; i < list.tagCount(); i++) {
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
if(b0 >= 0 && b0 < slots.length) {
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
@ -148,10 +140,8 @@ public class TileEntityMachineSatLinker extends TileEntity implements ISidedInve
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
for(int i = 0; i < slots.length; i++)
{
if(slots[i] != null)
{
for(int i = 0; i < slots.length; i++) {
if(slots[i] != null) {
NBTTagCompound nbt1 = new NBTTagCompound();
nbt1.setByte("slot", (byte)i);
slots[i].writeToNBT(nbt1);
@ -162,8 +152,7 @@ public class TileEntityMachineSatLinker extends TileEntity implements ISidedInve
}
@Override
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
{
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
}
@ -179,15 +168,17 @@ public class TileEntityMachineSatLinker extends TileEntity implements ISidedInve
@Override
public void updateEntity() {
if(!worldObj.isRemote)
{
if(!worldObj.isRemote) {
if(slots[0] != null && slots[1] != null && slots[0].getItem() instanceof ISatChip && slots[1].getItem() instanceof ISatChip) {
ISatChip.setFreqS(slots[1], ISatChip.getFreqS(slots[0]));
}
if(slots[2] != null && slots[2].getItem() instanceof ISatChip) {
ISatChip.setFreqS(slots[2], worldObj.rand.nextInt(100000));
SatelliteSavedData satelliteData = SatelliteSavedData.getData(worldObj);
int newId = worldObj.rand.nextInt(100000);
if(!satelliteData.isFreqTaken(newId)) {
ISatChip.setFreqS(slots[2], newId);
}
}
}
}

View File

@ -604,6 +604,12 @@ chem.XENON=Linde Xenon Cycle
chem.XENON_OXY=Boosted Linde Xenon Cycle
chem.YELLOWCAKE=Yellowcake Production
commands.satellite.no_satellite=No satellite using this frequency found!
commands.satellite.not_a_satellite=The held item is not a satellite!
commands.satellite.satellite_descended=Satellite successfully descended.
commands.satellite.satellite_orbited=Satellite launched.
commands.satellite.should_be_run_as_player=This command should be run by a player!
container.amsBase=AMS Base (Deco)
container.amsEmitter=AMS Emitter (Deco)
container.amsLimiter=AMS Stabilizer (Deco)
@ -4522,6 +4528,30 @@ tile.cluster_depth_titanium.name=Depth Titanium Ore Cluster
tile.cluster_depth_tungsten.name=Depth Tungsten Ore Cluster
tile.cluster_iron.name=Iron Ore Cluster
tile.cluster_titanium.name=Titanium Ore Cluster
tile.cm_block.alloy.name=Advanced Alloy Machine Casing
tile.cm_block.desh.name=Desh Machine Casing
tile.cm_block.steel.name=Steel Machine Casing
tile.cm_block.tcalloy.name=Technetium Steel Machine Casing
tile.cm_circuit.aluminium.name=Tier 1 Circuit Block
tile.cm_circuit.copper.name=Tier 2 Circuit Block
tile.cm_circuit.gold.name=Tier 4 Circuit Block
tile.cm_circuit.red_copper.name=Tier 3 Circuit Block
tile.cm_circuit.schrabidium.name=Tier 5 Circuit Block
tile.cm_engine.bismuth.name=Bismuth Motor Block
tile.cm_engine.desh.name=Desh Motor Block
tile.cm_engine.standard.name=Motor Block
tile.cm_port.alloy.name=Advanced Alloy Port
tile.cm_port.desh.name=Desh Port
tile.cm_port.steel.name=Steel Port
tile.cm_port.tcalloy.name=Technetium Steel Port
tile.cm_sheet.alloy.name=Advanced Alloy Sheet
tile.cm_sheet.desh.name=Desh Sheet
tile.cm_sheet.steel.name=Steel Sheet
tile.cm_sheet.tcalloy.name=Technetium Steel Sheet
tile.cm_tank.alloy.name=Advanced Alloy Tank
tile.cm_tank.desh.name=Desh Tank
tile.cm_tank.steel.name=Steel Tank
tile.cm_tank.tcalloy.name=Technetium Steel Tank
tile.cmb_brick.name=CMB Steel Tile
tile.cmb_brick_reinforced.name=Reinforced CMB Bricks
tile.compact_launcher.name=Compact Launch Pad

View File

@ -2167,6 +2167,33 @@ tile.radio_torch_counter.desc=Ставится на плоские поверх
container.rttyCounter=Редстоун-радио счётчик предметов
tile.machine_industrial_boiler.name=Промышленный бойлер
tile.machine_industrial_boiler.desc=Большой бойлер, в котором можно вскипятить воду или разогреть нефть.$Требует внешний источник тепла.$Скорость передачи тепла: ΔT*0.01 TU/t$Не может взорваться
container.crateTemplate=Сборочный ящик
tile.crate_template.name=Сборочный ящик
tile.cm_block.alloy.name=Корпус машины из продвинутого сплава
tile.cm_block.desh.name=Корпус машины из деша
tile.cm_block.steel.name=Корпус машины из стали
tile.cm_block.tcalloy.name=Корпус машины из технециевой стали
tile.cm_engine.bismuth.name=Моторный блок из висмута
tile.cm_engine.desh.name=Моторный блок из деша
tile.cm_engine.standard.name=Моторный блок
tile.cm_port.alloy.name=Люк из продвинутого сплава
tile.cm_port.desh.name=Люк из деша
tile.cm_port.steel.name=Люк из стали
tile.cm_port.tcalloy.name=Люк из технециевой стали
tile.cm_sheet.alloy.name=Лист из продвинутого сплава
tile.cm_sheet.desh.name=Лист из деша
tile.cm_sheet.steel.name=Лист из стали
tile.cm_sheet.tcalloy.name=Лист из технециевой стали
tile.cm_tank.alloy.name=Бак из продвинутого сплава
tile.cm_tank.desh.name=Бак из деша
tile.cm_tank.steel.name=Бак из стали
tile.cm_tank.tcalloy.name=Бак из технециевой стали
tile.cm_circuit.aluminium.name=Блок микросхем 1-го уровня
tile.cm_circuit.copper.name=Блок микросхем 2-го уровня
tile.cm_circuit.gold.name=Блок микросхем 4-го уровня
tile.cm_circuit.red_copper.name=Блок микросхем 3-го уровня
tile.cm_circuit.schrabidium.name=Блок микросхем 5-го уровня
container.hadron=Ускоритель частиц
tile.hadron_access.name=Терминал доступа ускорителя частиц
@ -4370,7 +4397,9 @@ item.ammo_luna_explosive.name=Лунный снайперский взрывно
item.ammo_luna_incendiary.name=Лунный снайперский зажигательный снаряд
item.gun_benelli.name=Автоматический дробовик Benelli (Барабан)
item.gun_coilgun.name=Гаусс-пушка
item.gun_coilgun_ammo.name=Вольфрамовый шар для гаусс-пушки
item.ammo_coilgun.name=Вольфрамовый шар для гаусс-пушки
item.ammo_coilgun_du.name=Ферроураниевый шар для гаусс-пушки
item.ammo_coilgun_rubber.name=Резиновый шар для гаусс-пушки
item.gun_fireext.name=Огнетушитель
item.ammo_fireext.name=Бак с водой для огнетушителя
@ -5724,7 +5753,7 @@ item.gun_twr.name=Time Warp Rifle (PLACEHOLDER)
item.gun_uac_carbine.name=UAC Carbine
item.gun_uac_dmr.name=UAC DMR
item.gun_uac_lmg.name=UAC LMG
item.gun_uac_pistol.name=UAC .45 Pistol
item.gun_uac_pistol.name=Пистолет UAC .45
item.gun_uac_smg.name=UAC SMG
item.gun_detonator.name=Лазерный детонатор
item.ingot_bk247.name=Berkelium-247 Ingot

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B