mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
sat dock fix, AP&DU nerf
This commit is contained in:
parent
f42b4b3dd4
commit
30f41fe1b0
49
changelog
49
changelog
@ -1,49 +1,6 @@
|
||||
## Added
|
||||
* Laser pistol
|
||||
* Saturnite-tier pistol using capacitors
|
||||
* Also has variants
|
||||
* B-side for the assault rifle
|
||||
* Ammo bag
|
||||
* Holds up to 8 stacks of items with no NBT
|
||||
* Reloading guns will access the contents of the bag directly without it having to be emptied first
|
||||
* Comes with a handy little indicator to shot roughly how full it is
|
||||
|
||||
## Changed
|
||||
* Trenchmaster armor now has the fast reload and more ammo traits again
|
||||
* Fast reload now also plays the animation twice as fast
|
||||
* More ammo does not apply to weapons that can only hold one round, like nuke and rocket launchers
|
||||
* Ace of spades now works as advertised again
|
||||
* Clay tablets now have "pools", tablets obtained from a black room no longer shows recipes for things not related to black rooms
|
||||
* Pedestal crafting extras `GOOD_KARMA` and `BAD_KARMA` are now properly implemented
|
||||
* If you don't know what this means, just ignore it
|
||||
* Pneumatic tubes now have a special case when supplying autocrafters, they will only send single items since larger stacks are not accepted
|
||||
* Simplified turbofan recipe
|
||||
* Solar boilers will now show a tooltip when they are too cold
|
||||
* Updated the satellite dish structure, due to the new spawn rules it's also no longer obscenely rare
|
||||
* The rare small lab structures have been removed and replaced with a new lighthouse
|
||||
* ReaSim connectors will no longer function if ReaSim boilers are disabled
|
||||
* Updated the placed geiger counter model
|
||||
* Updated random gear on hostile mobs, there's now more variety in what armor/weapons mobs can have
|
||||
* Removed the cryo cannon. It was the last true weapon to use the NT system and may return later
|
||||
* Mines will no longer trigger from all ambient creatures (originally just bats) and water creatures
|
||||
* Mines can no longer be triggered if a non-air block is above them
|
||||
* Moved the cooling tower particle toggle from `hbm.cfg` to the client config, named `COOLING_TOWER_PARTICLES`
|
||||
* Updated HSS textures
|
||||
* The diesel generator and turbofan will both now halt operation when powered by redstone
|
||||
* Infinite batteries will now also drain energy when put into a charging slot
|
||||
* TOREX effects now cause the sky to go fullbright again for 10 seconds after they spawn
|
||||
* Weapon tooltips now show the weapon's condition
|
||||
* Updated the catalytic cracking tower model
|
||||
* Leviathan turbine and powered condenser tooltip now use thousand separaators to make the numbers actually readable
|
||||
* Catalytic converters can now be crafted with `ANY_BISMOID` instead of just bismuth (that includes arsenic)
|
||||
* Nerfed AP and DU round damage multiplier
|
||||
* Effective damage is still much higher than on gunmetal ammo due to the armor piercing effect
|
||||
|
||||
## Fixed
|
||||
* Fixed fatal gamebreaking hard drive corrupting issue where taurun leggings were misspelled
|
||||
* Fixed minor display issue where compressed air ducts would visually connect to non-ejector pneumatic tubes
|
||||
* Fixed special creeper types being able to spawn in other dimensions
|
||||
* Fixed modeled armor using weird rotation rules, causing issues with Customizable Player Models
|
||||
* Fixed rotation issues for certain blocks using the new structure system
|
||||
* Fixed ReaSim water never moving if the reactor is at 20°
|
||||
* Fixed strand caster LPS gauge exceeding the limit
|
||||
* The SPAS-12 and congo lake now change type immediately when hitting the reload key, fixing an issue where the first loaded round may have the worng color when the ammo type changes
|
||||
* Fixed crash caused by `/ntmreload` when NEI is not installed
|
||||
* Fixed a potential crash caused by cargo dropships landing on cargo docks with no satellite chip installed
|
||||
@ -15,7 +15,7 @@ public class ServerConfig extends RunningConfig {
|
||||
public static ConfigWrapper<Float> MINE_HE_DAMAGE = new ConfigWrapper(35F);
|
||||
public static ConfigWrapper<Float> MINE_SHRAP_DAMAGE = new ConfigWrapper(7.5F);
|
||||
public static ConfigWrapper<Float> MINE_NUKE_DAMAGE = new ConfigWrapper(100F);
|
||||
public static ConfigWrapper<Float> MINE_NAVAL_DAMAGE = new ConfigWrapper(60F);
|
||||
public static ConfigWrapper<Float> MINE_NAVAL_DAMAGE = new ConfigWrapper(60F);
|
||||
public static ConfigWrapper<Boolean> TAINT_TRAILS = new ConfigWrapper(false);
|
||||
|
||||
private static void initDefaults() {
|
||||
|
||||
@ -42,7 +42,7 @@ public class XFactory22lr {
|
||||
.setCasing(casing22.clone().register("p22fmj"));
|
||||
p22_jhp = new BulletConfig().setItem(EnumAmmo.P22_JHP).setCasing(EnumCasingType.SMALL, 24).setKnockback(0F).setDamage(1.5F).setHeadshot(1.5F).setArmorPiercing(-0.25F)
|
||||
.setCasing(casing22.clone().register("p22jhp"));
|
||||
p22_ap = new BulletConfig().setItem(EnumAmmo.P22_AP).setCasing(EnumCasingType.SMALL_STEEL, 24).setKnockback(0F).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(2.5F).setArmorPiercing(0.15F)
|
||||
p22_ap = new BulletConfig().setItem(EnumAmmo.P22_AP).setCasing(EnumCasingType.SMALL_STEEL, 24).setKnockback(0F).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.25F).setThresholdNegation(2.5F).setArmorPiercing(0.15F)
|
||||
.setCasing(casing22.clone().setColor(SpentCasing.COLOR_CASE_44).register("p22ap"));
|
||||
|
||||
ModItems.gun_am180 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
|
||||
@ -35,7 +35,7 @@ public class XFactory357 {
|
||||
m357_sp = new BulletConfig().setItem(EnumAmmo.M357_SP).setCasing(EnumCasingType.SMALL, 8);
|
||||
m357_fmj = new BulletConfig().setItem(EnumAmmo.M357_FMJ).setCasing(EnumCasingType.SMALL, 8).setDamage(0.8F).setThresholdNegation(2F).setArmorPiercing(0.1F);
|
||||
m357_jhp = new BulletConfig().setItem(EnumAmmo.M357_JHP).setCasing(EnumCasingType.SMALL, 8).setDamage(1.5F).setHeadshot(1.5F).setArmorPiercing(-0.25F);
|
||||
m357_ap = new BulletConfig().setItem(EnumAmmo.M357_AP).setCasing(EnumCasingType.SMALL_STEEL, 8).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(5F).setArmorPiercing(0.15F);
|
||||
m357_ap = new BulletConfig().setItem(EnumAmmo.M357_AP).setCasing(EnumCasingType.SMALL_STEEL, 8).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.25F).setThresholdNegation(5F).setArmorPiercing(0.15F);
|
||||
m357_express = new BulletConfig().setItem(EnumAmmo.M357_EXPRESS).setCasing(EnumCasingType.SMALL, 8).setDoesPenetrate(true).setDamage(1.5F).setThresholdNegation(2F).setArmorPiercing(0.1F).setWear(1.5F);
|
||||
|
||||
ModItems.gun_light_revolver = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
|
||||
@ -77,7 +77,7 @@ public class XFactory44 {
|
||||
.setCasing(casing44.clone().register("m44fmj"));
|
||||
m44_jhp = new BulletConfig().setItem(EnumAmmo.M44_JHP).setCasing(EnumCasingType.SMALL, 6).setDamage(1.5F).setHeadshot(1.5F).setArmorPiercing(-0.25F)
|
||||
.setCasing(casing44.clone().register("m44jhp"));
|
||||
m44_ap = new BulletConfig().setItem(EnumAmmo.M44_AP).setCasing(EnumCasingType.SMALL_STEEL, 6).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(7.5F).setArmorPiercing(0.15F)
|
||||
m44_ap = new BulletConfig().setItem(EnumAmmo.M44_AP).setCasing(EnumCasingType.SMALL_STEEL, 6).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.25F).setThresholdNegation(7.5F).setArmorPiercing(0.15F)
|
||||
.setCasing(casing44.clone().setColor(SpentCasing.COLOR_CASE_44).register("m44ap"));
|
||||
m44_express = new BulletConfig().setItem(EnumAmmo.M44_EXPRESS).setCasing(EnumCasingType.SMALL, 6).setDoesPenetrate(true).setDamage(1.5F).setThresholdNegation(3F).setArmorPiercing(0.1F).setWear(1.5F)
|
||||
.setCasing(casing44.clone().register("m44express"));
|
||||
|
||||
@ -22,7 +22,7 @@ public class XFactory45 {
|
||||
.setCasing(casing9.clone().register("p45fmj"));
|
||||
p45_jhp = new BulletConfig().setItem(EnumAmmo.P45_JHP).setCasing(EnumCasingType.SMALL, 8).setDamage(1.5F).setHeadshot(1.5F).setArmorPiercing(-0.25F)
|
||||
.setCasing(casing9.clone().register("p45jhp"));
|
||||
p45_ap = new BulletConfig().setItem(EnumAmmo.P45_AP).setCasing(EnumCasingType.SMALL_STEEL, 8).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(5F).setArmorPiercing(0.15F)
|
||||
p45_ap = new BulletConfig().setItem(EnumAmmo.P45_AP).setCasing(EnumCasingType.SMALL_STEEL, 8).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.25F).setThresholdNegation(5F).setArmorPiercing(0.15F)
|
||||
.setCasing(casing9.clone().setColor(SpentCasing.COLOR_CASE_44).register("p45ap"));
|
||||
p45_du = new BulletConfig().setItem(EnumAmmo.P45_DU).setCasing(EnumCasingType.SMALL_STEEL, 8).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(2.5F).setThresholdNegation(15F).setArmorPiercing(0.25F)
|
||||
.setCasing(casing9.clone().setColor(SpentCasing.COLOR_CASE_44).register("p45du"));
|
||||
|
||||
@ -47,11 +47,11 @@ public class XFactory50 {
|
||||
.setCasing(casing762.clone().register("bmg50fmj"));
|
||||
bmg50_jhp = new BulletConfig().setItem(EnumAmmo.BMG50_JHP).setCasing(EnumCasingType.LARGE, 12).setDamage(1.5F).setHeadshot(1.5F).setArmorPiercing(-0.25F)
|
||||
.setCasing(casing762.clone().register("bmg50jhp"));
|
||||
bmg50_ap = new BulletConfig().setItem(EnumAmmo.BMG50_AP).setCasing(EnumCasingType.LARGE_STEEL, 12).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(17.5F).setArmorPiercing(0.15F)
|
||||
bmg50_ap = new BulletConfig().setItem(EnumAmmo.BMG50_AP).setCasing(EnumCasingType.LARGE_STEEL, 12).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.25F).setThresholdNegation(17.5F).setArmorPiercing(0.15F)
|
||||
.setCasing(casing762.clone().setColor(SpentCasing.COLOR_CASE_44).register("bmg50ap"));
|
||||
bmg50_du = new BulletConfig().setItem(EnumAmmo.BMG50_DU).setCasing(EnumCasingType.LARGE_STEEL, 12).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(2.5F).setThresholdNegation(21F).setArmorPiercing(0.25F)
|
||||
bmg50_du = new BulletConfig().setItem(EnumAmmo.BMG50_DU).setCasing(EnumCasingType.LARGE_STEEL, 12).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(21F).setArmorPiercing(0.25F)
|
||||
.setCasing(casing762.clone().setColor(SpentCasing.COLOR_CASE_44).register("bmg50du"));
|
||||
bmg50_he = new BulletConfig().setItem(EnumAmmo.BMG50_HE).setCasing(EnumCasingType.LARGE_STEEL, 12).setWear(3F).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(2F).setOnImpact(LAMBDA_STANDARD_EXPLODE)
|
||||
bmg50_he = new BulletConfig().setItem(EnumAmmo.BMG50_HE).setCasing(EnumCasingType.LARGE_STEEL, 12).setWear(3F).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.75F).setOnImpact(LAMBDA_STANDARD_EXPLODE)
|
||||
.setCasing(casing762.clone().setColor(SpentCasing.COLOR_CASE_44).register("bmg50he"));
|
||||
|
||||
ModItems.gun_m2 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
|
||||
@ -64,7 +64,7 @@ public class XFactory556mm {
|
||||
.setCasing(casing556.clone().register("r556fmj"));
|
||||
r556_jhp = new BulletConfig().setItem(EnumAmmo.R556_JHP).setCasing(EnumCasingType.SMALL, 8).setDamage(1.5F).setHeadshot(1.5F).setArmorPiercing(-0.25F)
|
||||
.setCasing(casing556.clone().register("r556jhp"));
|
||||
r556_ap = new BulletConfig().setItem(EnumAmmo.R556_AP).setCasing(EnumCasingType.SMALL_STEEL, 8).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(10F).setArmorPiercing(0.15F)
|
||||
r556_ap = new BulletConfig().setItem(EnumAmmo.R556_AP).setCasing(EnumCasingType.SMALL_STEEL, 8).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.25F).setThresholdNegation(10F).setArmorPiercing(0.15F)
|
||||
.setCasing(casing556.clone().setColor(SpentCasing.COLOR_CASE_44).register("r556ap"));
|
||||
|
||||
r556_inc_sp = r556_sp.clone().setOnImpact(INCENDIARY);
|
||||
|
||||
@ -54,11 +54,11 @@ public class XFactory762mm {
|
||||
.setCasing(casing762.clone().register("r762fmj"));
|
||||
r762_jhp = new BulletConfig().setItem(EnumAmmo.R762_JHP).setCasing(EnumCasingType.SMALL, 6).setDamage(1.5F).setHeadshot(1.5F).setArmorPiercing(-0.25F)
|
||||
.setCasing(casing762.clone().register("r762jhp"));
|
||||
r762_ap = new BulletConfig().setItem(EnumAmmo.R762_AP).setCasing(EnumCasingType.SMALL_STEEL, 6).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(12.5F).setArmorPiercing(0.15F)
|
||||
r762_ap = new BulletConfig().setItem(EnumAmmo.R762_AP).setCasing(EnumCasingType.SMALL_STEEL, 6).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.25F).setThresholdNegation(12.5F).setArmorPiercing(0.15F)
|
||||
.setCasing(casing762.clone().setColor(SpentCasing.COLOR_CASE_44).register("r762ap"));
|
||||
r762_du = new BulletConfig().setItem(EnumAmmo.R762_DU).setCasing(EnumCasingType.SMALL_STEEL, 6).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(2.5F).setThresholdNegation(15F).setArmorPiercing(0.25F)
|
||||
r762_du = new BulletConfig().setItem(EnumAmmo.R762_DU).setCasing(EnumCasingType.SMALL_STEEL, 6).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(15F).setArmorPiercing(0.25F)
|
||||
.setCasing(casing762.clone().setColor(SpentCasing.COLOR_CASE_44).register("r762du"));
|
||||
r762_he = new BulletConfig().setItem(EnumAmmo.R762_HE).setCasing(EnumCasingType.SMALL_STEEL, 6).setWear(3F).setDamage(2F).setOnImpact(LAMBDA_TINY_EXPLODE)
|
||||
r762_he = new BulletConfig().setItem(EnumAmmo.R762_HE).setCasing(EnumCasingType.SMALL_STEEL, 6).setWear(3F).setDamage(1.75F).setOnImpact(LAMBDA_TINY_EXPLODE)
|
||||
.setCasing(casing762.clone().setColor(SpentCasing.COLOR_CASE_44).register("r762he"));
|
||||
|
||||
energy_lacunae = new BulletConfig().setItem(EnumAmmo.CAPACITOR).setCasing(new ItemStack(ModItems.ingot_polymer, 2), 4 * 40).setupDamageClass(DamageClass.LASER).setBeam().setReloadCount(40).setSpread(0.0F).setLife(5).setRenderRotations(false).setOnBeamImpact(BulletConfig.LAMBDA_STANDARD_BEAM_HIT);
|
||||
|
||||
@ -47,7 +47,7 @@ public class XFactory9mm {
|
||||
.setCasing(casing9.clone().register("p9fmj"));
|
||||
p9_jhp = new BulletConfig().setItem(EnumAmmo.P9_JHP).setCasing(EnumCasingType.SMALL, 12).setDamage(1.5F).setHeadshot(1.5F).setArmorPiercing(-0.25F)
|
||||
.setCasing(casing9.clone().register("p9jhp"));
|
||||
p9_ap = new BulletConfig().setItem(EnumAmmo.P9_AP).setCasing(EnumCasingType.SMALL_STEEL, 12).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.5F).setThresholdNegation(5F).setArmorPiercing(0.15F)
|
||||
p9_ap = new BulletConfig().setItem(EnumAmmo.P9_AP).setCasing(EnumCasingType.SMALL_STEEL, 12).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(1.25F).setThresholdNegation(5F).setArmorPiercing(0.15F)
|
||||
.setCasing(casing9.clone().setColor(SpentCasing.COLOR_CASE_44).register("p9ap"));
|
||||
|
||||
ModItems.gun_greasegun = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
|
||||
@ -27,210 +27,165 @@ import net.minecraft.world.World;
|
||||
import java.util.List;
|
||||
|
||||
public class TileEntityMachineSatDock extends TileEntity implements ISidedInventory, IGUIProvider {
|
||||
private ItemStack[] slots;
|
||||
|
||||
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;
|
||||
|
||||
private String customName;
|
||||
public TileEntityMachineSatDock() { slots = new ItemStack[16]; }
|
||||
|
||||
private AxisAlignedBB renderBoundingBox;
|
||||
@Override public int getSizeInventory() { return slots.length; }
|
||||
@Override public ItemStack getStackInSlot(int i) { return slots[i]; }
|
||||
|
||||
public TileEntityMachineSatDock() {
|
||||
slots = new ItemStack[16];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return slots.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return slots[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if (slots[i] != null) {
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||
slots[i] = itemStack;
|
||||
if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) {
|
||||
itemStack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return this.hasCustomInventoryName() ? this.customName : "container.satDock";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomName(String name) {
|
||||
this.customName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
|
||||
return false;
|
||||
} else {
|
||||
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
|
||||
}
|
||||
}
|
||||
|
||||
//You scrubs aren't needed for anything (right now)
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return i != 2 && i != 3 && i != 4 && i != 5;
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if(slots[i] != null) {
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int 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) {
|
||||
slots[i] = null;
|
||||
}
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||
slots[i] = itemStack;
|
||||
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit()) {
|
||||
itemStack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
return itemStack1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override public String getInventoryName() { return this.hasCustomInventoryName() ? this.customName : "container.satDock"; }
|
||||
@Override public boolean hasCustomInventoryName() { return this.customName != null && this.customName.length() > 0; }
|
||||
public void setCustomName(String name) { this.customName = name; }
|
||||
@Override public int getInventoryStackLimit() { return 64; }
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
|
||||
return false;
|
||||
} else {
|
||||
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
|
||||
}
|
||||
}
|
||||
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
@Override public void openInventory() { }
|
||||
@Override public void closeInventory() { }
|
||||
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
|
||||
byte b0 = nbt1.getByte("slot");
|
||||
if (b0 >= 0 && b0 < slots.length) {
|
||||
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) { return i == 15; }
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
NBTTagList list = new NBTTagList();
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int 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) {
|
||||
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);
|
||||
list.appendTag(nbt1);
|
||||
}
|
||||
}
|
||||
nbt.setTag("items", list);
|
||||
}
|
||||
return itemStack1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return access;
|
||||
}
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
}
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return true;
|
||||
}
|
||||
for(int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
|
||||
byte b0 = nbt1.getByte("slot");
|
||||
if(b0 >= 0 && b0 < slots.length) {
|
||||
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!worldObj.isRemote) {
|
||||
SatelliteSavedData data = SatelliteSavedData.getData(worldObj);
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
if (slots[15] != null) {
|
||||
int freq = ISatChip.getFreqS(slots[15]);
|
||||
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);
|
||||
list.appendTag(nbt1);
|
||||
}
|
||||
}
|
||||
nbt.setTag("items", list);
|
||||
}
|
||||
|
||||
Satellite sat = data.getSatFromFreq(freq);
|
||||
@Override public int[] getAccessibleSlotsFromSide(int p_94128_1_) { return access; }
|
||||
@Override public boolean canInsertItem(int i, ItemStack itemStack, int j) { return this.isItemValidForSlot(i, itemStack); }
|
||||
@Override public boolean canExtractItem(int i, ItemStack itemStack, int j) { return true; }
|
||||
|
||||
int delay = 10 * 60 * 1000;
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(!worldObj.isRemote) {
|
||||
SatelliteSavedData data = SatelliteSavedData.getData(worldObj);
|
||||
|
||||
if (sat instanceof SatelliteMiner) {
|
||||
SatelliteMiner miner = (SatelliteMiner) sat;
|
||||
if(slots[15] != null) {
|
||||
int freq = ISatChip.getFreqS(slots[15]);
|
||||
|
||||
if (miner.lastOp + delay < System.currentTimeMillis()) {
|
||||
EntityMinerRocket rocket = new EntityMinerRocket(worldObj);
|
||||
rocket.posX = xCoord + 0.5;
|
||||
rocket.posY = 300;
|
||||
rocket.posZ = zCoord + 0.5;
|
||||
Satellite sat = data.getSatFromFreq(freq);
|
||||
|
||||
rocket.getDataWatcher().updateObject(17, freq);
|
||||
worldObj.spawnEntityInWorld(rocket);
|
||||
miner.lastOp = System.currentTimeMillis();
|
||||
data.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
int delay = 10 * 60 * 1000;
|
||||
|
||||
@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
|
||||
);
|
||||
if(sat instanceof SatelliteMiner) {
|
||||
SatelliteMiner miner = (SatelliteMiner) sat;
|
||||
|
||||
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(miner.lastOp + delay < System.currentTimeMillis()) {
|
||||
EntityMinerRocket rocket = new EntityMinerRocket(worldObj);
|
||||
rocket.posX = xCoord + 0.5;
|
||||
rocket.posY = 300;
|
||||
rocket.posZ = zCoord + 0.5;
|
||||
|
||||
if (rocket.getDataWatcher().getWatchableObjectInt(16) == 1 && rocket.timer == 50) {
|
||||
Satellite sat = data.getSatFromFreq(ISatChip.getFreqS(slots[15]));
|
||||
unloadCargo((SatelliteMiner) sat);
|
||||
}
|
||||
}
|
||||
rocket.getDataWatcher().updateObject(17, freq);
|
||||
worldObj.spawnEntityInWorld(rocket);
|
||||
miner.lastOp = System.currentTimeMillis();
|
||||
data.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ejectInto(xCoord + 2, yCoord, zCoord);
|
||||
ejectInto(xCoord - 2, yCoord, zCoord);
|
||||
ejectInto(xCoord, yCoord, zCoord + 2);
|
||||
ejectInto(xCoord, yCoord, zCoord - 2);
|
||||
}
|
||||
}
|
||||
@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(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(rocket.getDataWatcher().getWatchableObjectInt(16) == 1 && rocket.timer == 50) {
|
||||
Satellite sat = data.getSatFromFreq(ISatChip.getFreqS(slots[15]));
|
||||
if(sat != null) unloadCargo((SatelliteMiner) sat);
|
||||
}
|
||||
}
|
||||
|
||||
ejectInto(xCoord + 2, yCoord, zCoord);
|
||||
ejectInto(xCoord - 2, yCoord, zCoord);
|
||||
ejectInto(xCoord, yCoord, zCoord + 2);
|
||||
ejectInto(xCoord, yCoord, zCoord - 2);
|
||||
}
|
||||
}
|
||||
|
||||
private void unloadCargo(SatelliteMiner satellite) {
|
||||
int itemAmount = worldObj.rand.nextInt(6) + 10;
|
||||
@ -242,104 +197,98 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
|
||||
}
|
||||
}
|
||||
|
||||
private void addToInv(ItemStack stack) {
|
||||
for (int i = 0; i < 15; i++) {
|
||||
if (slots[i] != null && slots[i].getItem() == stack.getItem() && slots[i].getItemDamage() == stack.getItemDamage() && slots[i].stackSize < slots[i].getMaxStackSize()) {
|
||||
int toAdd = Math.min(slots[i].getMaxStackSize() - slots[i].stackSize, stack.stackSize);
|
||||
private void addToInv(ItemStack stack) {
|
||||
for(int i = 0; i < 15; i++) {
|
||||
if(slots[i] != null && slots[i].getItem() == stack.getItem() && slots[i].getItemDamage() == stack.getItemDamage() && slots[i].stackSize < slots[i].getMaxStackSize()) {
|
||||
int toAdd = Math.min(slots[i].getMaxStackSize() - slots[i].stackSize, stack.stackSize);
|
||||
|
||||
slots[i].stackSize += toAdd;
|
||||
stack.stackSize -= toAdd;
|
||||
slots[i].stackSize += toAdd;
|
||||
stack.stackSize -= toAdd;
|
||||
|
||||
if (stack.stackSize <= 0) return;
|
||||
}
|
||||
}
|
||||
if(stack.stackSize <= 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 15; i++) {
|
||||
if (slots[i] == null) {
|
||||
slots[i] = new ItemStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < 15; i++) {
|
||||
if(slots[i] == null) {
|
||||
slots[i] = new ItemStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ejectInto(int x, int y, int z) {
|
||||
TileEntity te = worldObj.getTileEntity(x, y, z);
|
||||
private void ejectInto(int x, int y, int z) {
|
||||
TileEntity te = worldObj.getTileEntity(x, y, z);
|
||||
|
||||
if (te instanceof IInventory) {
|
||||
IInventory chest = (IInventory) te;
|
||||
if(te instanceof IInventory) {
|
||||
IInventory chest = (IInventory) te;
|
||||
|
||||
for (int i = 0; i < 15; i++) {
|
||||
if (slots[i] != null) {
|
||||
for (int j = 0; j < chest.getSizeInventory(); j++) {
|
||||
ItemStack sta = slots[i].copy();
|
||||
sta.stackSize = 1;
|
||||
for(int i = 0; i < 15; i++) {
|
||||
if(slots[i] != null) {
|
||||
for(int j = 0; j < chest.getSizeInventory(); j++) {
|
||||
ItemStack sta = slots[i].copy();
|
||||
sta.stackSize = 1;
|
||||
|
||||
if (chest.getStackInSlot(j) != null && chest.getStackInSlot(j).isItemEqual(slots[i]) && ItemStack.areItemStackTagsEqual(chest.getStackInSlot(j), slots[i]) &&
|
||||
chest.getStackInSlot(j).stackSize < chest.getStackInSlot(j).getMaxStackSize()) {
|
||||
if(chest.getStackInSlot(j) != null && chest.getStackInSlot(j).isItemEqual(slots[i]) && ItemStack.areItemStackTagsEqual(chest.getStackInSlot(j), slots[i])
|
||||
&& chest.getStackInSlot(j).stackSize < chest.getStackInSlot(j).getMaxStackSize()) {
|
||||
|
||||
slots[i].stackSize--;
|
||||
slots[i].stackSize--;
|
||||
|
||||
if (slots[i].stackSize <= 0)
|
||||
slots[i] = null;
|
||||
if(slots[i].stackSize <= 0)
|
||||
slots[i] = null;
|
||||
|
||||
chest.getStackInSlot(j).stackSize++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
chest.getStackInSlot(j).stackSize++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 15; i++) {
|
||||
if (slots[i] != null) {
|
||||
for (int j = 0; j < chest.getSizeInventory(); j++) {
|
||||
ItemStack sta = slots[i].copy();
|
||||
sta.stackSize = 1;
|
||||
for(int i = 0; i < 15; i++) {
|
||||
if(slots[i] != null) {
|
||||
for(int j = 0; j < chest.getSizeInventory(); j++) {
|
||||
ItemStack sta = slots[i].copy();
|
||||
sta.stackSize = 1;
|
||||
|
||||
if (chest.getStackInSlot(j) == null && chest.isItemValidForSlot(j, sta)) {
|
||||
slots[i].stackSize--;
|
||||
if(chest.getStackInSlot(j) == null && chest.isItemValidForSlot(j, sta)) {
|
||||
slots[i].stackSize--;
|
||||
|
||||
if (slots[i].stackSize <= 0)
|
||||
slots[i] = null;
|
||||
if(slots[i].stackSize <= 0)
|
||||
slots[i] = null;
|
||||
|
||||
chest.setInventorySlotContents(j, sta);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
chest.setInventorySlotContents(j, sta);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
if (renderBoundingBox == null) {
|
||||
renderBoundingBox = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 1,
|
||||
yCoord,
|
||||
zCoord - 1,
|
||||
xCoord + 2,
|
||||
yCoord + 1,
|
||||
zCoord + 2
|
||||
);
|
||||
}
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
if(renderBoundingBox == null) {
|
||||
renderBoundingBox = AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 1, zCoord + 2);
|
||||
}
|
||||
|
||||
return renderBoundingBox;
|
||||
}
|
||||
return renderBoundingBox;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerSatDock(player.inventory, this);
|
||||
}
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerSatDock(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUISatDock(player.inventory, this);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUISatDock(player.inventory, this);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user