mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
sharticle accelerator
This commit is contained in:
parent
fb1e20c11f
commit
15645648c5
11
changelog
11
changelog
@ -18,15 +18,24 @@
|
||||
* RBMK dials now have gamerules for disabling rod depletion and xenon poison
|
||||
* Changed the way bullet spread is calculated. Instead of the gun's innate inaccuracy being reduced by 75% when using sights, guns now have separate stats for innate inaccuracy (only relevant for things like SMG) as well as a hipfire penalty (roughly the same for all guns)
|
||||
* This also includes a multiplier for ammo spread, which mainly concerns sawed-off shotguns (dual lever action shotguns, Broken and Sacred Dragon) and amplifies the inaccuracy for things like buckshot while slugs perform the same
|
||||
* Guns that cannot be aimed (no sights, akimbo) or where aiming is only useful for special effects (missile launcher lockon, quad launcher steering) do not have a hipfire penalty
|
||||
* Malachite now spawns in large deposits similar to hematite or bauxite, malachite veins are slightly smaller than bauxite veins
|
||||
* Limestone veins are now 50% larger
|
||||
* The compressor now has a NEI handler for any non-generic recipe
|
||||
* Removed compression recipes for steam, because why would you ever use those?
|
||||
* Fluid tanks that use pressurized fluids now say "pressurized, use compressor!" to avoid confusion over what "1PU" means
|
||||
* Damage should no longer register at all when the damage resistance is 100%, similar to how damage is completely nullified by DT (i.e. not even knockback is applied)
|
||||
|
||||
## Fixed
|
||||
* Fixed incorrect tooltip in the automatic control rod's GUI
|
||||
* Fixed recipe autogen creating recipes for nonexistant thorium bedrock ore
|
||||
* Fixed FBI agents spawning both the old and new bullet entities when firing
|
||||
* Fixed dupe concerning one of the weapon abilities
|
||||
* Fixed crates not sending a block update when the contents change, breaking redstone comparator functionality
|
||||
* Fixed crates not sending a block update when the contents change, breaking redstone comparator functionality
|
||||
* Fixed "unblockable" damage (like afterburn) not being covered by the "other" category of armor resistances, meaning things like DNT nano suits would get wrecked by phosphorus rounds
|
||||
* Fixed most mini nuke variants not going off when hitting an entity while the nuke has been in the air for less than 3 ticks
|
||||
* Gun damage now also does 0 points of vanilla damage, ensuring that certain entity events trigger, e.g. neutral mobs targeting the player
|
||||
* Fixed items being deleted by the crucible when using hotbar shortcuts by disabling hotkey shortcuts entirely
|
||||
* How about you shift-click like a normal person
|
||||
* Fixed legendary crafting causing disconnects on servers
|
||||
* Fixed a dupe caused by shift clicking
|
||||
@ -134,12 +134,12 @@ public class BlockPedestal extends BlockContainer {
|
||||
|
||||
if(recipe.extra == recipe.extra.FULL_MOON) {
|
||||
if(world.getCelestialAngle(0) < 0.35 || world.getCelestialAngle(0) > 0.65) continue;
|
||||
if(world.getMoonPhase() != 0) continue;
|
||||
if(world.provider.getMoonPhase(world.getWorldInfo().getWorldTime()) != 0) continue;
|
||||
}
|
||||
|
||||
if(recipe.extra == recipe.extra.NEW_MOON) {
|
||||
if(world.getCelestialAngle(0) < 0.35 || world.getCelestialAngle(0) > 0.65) continue;
|
||||
if(world.getMoonPhase() != 4) continue;
|
||||
if(world.provider.getMoonPhase(world.getWorldInfo().getWorldTime()) != 4) continue;
|
||||
}
|
||||
|
||||
if(recipe.extra == recipe.extra.SUN) {
|
||||
|
||||
@ -23,7 +23,7 @@ public class BlockPADetector extends BlockDummyable {
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityPADetector();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().power().fluid();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ public class BlockPASource extends BlockDummyable {
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityPASource();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().power().fluid();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -39,5 +39,15 @@ public class BlockPASource extends BlockDummyable {
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
this.makeExtra(world, x + rot.offsetX * 4, y, z + rot.offsetZ * 4);
|
||||
this.makeExtra(world, x + dir.offsetX, y, z + dir.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX + rot.offsetX * 2, y, z + dir.offsetZ + rot.offsetZ * 2);
|
||||
this.makeExtra(world, x + dir.offsetX - rot.offsetX * 2, y, z + dir.offsetZ - rot.offsetZ * 2);
|
||||
this.makeExtra(world, x - dir.offsetX, y, z - dir.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX + rot.offsetX * 2, y, z - dir.offsetZ + rot.offsetZ * 2);
|
||||
this.makeExtra(world, x - dir.offsetX - rot.offsetX * 2, y, z - dir.offsetZ - rot.offsetZ * 2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,6 +38,12 @@ public class ContainerCrucible extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack slotClick(int slot, int button, int mode, EntityPlayer player) {
|
||||
if(mode == 2) return null;
|
||||
return super.slotClick(slot, button, mode, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
ItemStack stack = null;
|
||||
|
||||
@ -42,8 +42,8 @@ public class ContainerFEL extends Container {
|
||||
ItemStack stack = slot.getStack();
|
||||
rStack = stack.copy();
|
||||
|
||||
if(index == 0) {
|
||||
if(!this.mergeItemStack(stack, 1, this.inventorySlots.size(), false)) {
|
||||
if(index <= 1) {
|
||||
if(!this.mergeItemStack(stack, 2, this.inventorySlots.size(), false)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -4,11 +4,15 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerPASource;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@ -34,6 +38,18 @@ public class GUIPASource extends GuiInfoContainer {
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 18, 16, 52, source.power, source.getMaxPower());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
|
||||
if(guiLeft + 105 <= x && guiLeft + 105 + 10 > x && guiTop + 30 < y && guiTop + 30 + 10 >= y) {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setBoolean("cancel", true);
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, source.xCoord, source.yCoord, source.zCoord));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer( int i, int j) {
|
||||
|
||||
|
||||
@ -10,6 +10,22 @@ public class ItemPACoil extends ItemEnumMulti {
|
||||
}
|
||||
|
||||
public static enum EnumCoilType {
|
||||
GOLD, NIOBIUM, BSCCO
|
||||
GOLD(0, 10_000, 0, 10_000, 0.01D),
|
||||
NIOBIUM(5_000, 100_000, 5_000, 100_000, 0.001D),
|
||||
BSCCO(50_000, 500_000, 50_000, 500_000, 0.00025D);
|
||||
|
||||
public int quadMin;
|
||||
public int quadMax;
|
||||
public int diMin;
|
||||
public int diMax;
|
||||
public double diMult;
|
||||
|
||||
private EnumCoilType(int quadMin, int quadMax, int diMin, int diMax, double diMult) {
|
||||
this.quadMin = quadMin;
|
||||
this.quadMax = quadMax;
|
||||
this.diMin = diMin;
|
||||
this.diMax = diMax;
|
||||
this.diMult = diMult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@ public class XFactory12ga {
|
||||
ModItems.gun_maresleg_akimbo = new ItemGunBaseNT(WeaponQuality.B_SIDE,
|
||||
new GunConfig().dura(600).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(16F).spreadAmmo(1.35F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
|
||||
.dmg(16F).spreadHipfire(0F).spreadAmmo(1.35F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 6).addConfigs(all))
|
||||
.offset(0.75, -0.0625, 0.1875D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG))
|
||||
@ -306,7 +306,7 @@ public class XFactory12ga {
|
||||
.anim(LAMBDA_MARESLEG_SHORT_ANIMS).orchestra(Orchestras.ORCHESTRA_MARESLEG_AKIMBO),
|
||||
new GunConfig().dura(600).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(16F).spreadAmmo(1.35F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
|
||||
.dmg(16F).spreadHipfire(0F).spreadAmmo(1.35F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(1, 6).addConfigs(all))
|
||||
.offset(0.75, -0.0625, -0.1875)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG))
|
||||
@ -339,7 +339,7 @@ public class XFactory12ga {
|
||||
ModItems.gun_spas12 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
.dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(32F).delay(20).reload(5, 10, 10, 10, 0).jam(36).sound("hbm:weapon.shotgunShoot", 1.0F, 1.0F)
|
||||
.dmg(32F).spreadHipfire(0F).delay(20).reload(5, 10, 10, 10, 0).jam(36).sound("hbm:weapon.shotgunShoot", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 8).addConfigs(all))
|
||||
.offset(0.75, -0.0625, -0.1875)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG))
|
||||
|
||||
@ -60,7 +60,7 @@ public class XFactory357 {
|
||||
ModItems.gun_light_revolver_dani = new ItemGunBaseNT(WeaponQuality.LEGENDARY,
|
||||
new GunConfig().dura(30_000).draw(20).inspect(23).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(15F).delay(11).reload(55).jam(45).sound("hbm:weapon.fire.pistol", 1.0F, 1.1F)
|
||||
.dmg(15F).spreadHipfire(0F).delay(11).reload(55).jam(45).sound("hbm:weapon.fire.pistol", 1.0F, 1.1F)
|
||||
.mag(new MagazineFullReload(0, 6).addConfigs(m357_bp, m357_sp, m357_fmj, m357_jhp, m357_ap, m357_express))
|
||||
.offset(0.75, -0.0625, 0.3125D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_DANI))
|
||||
@ -69,7 +69,7 @@ public class XFactory357 {
|
||||
.anim(LAMBDA_DANI_ANIMS).orchestra(Orchestras.ORCHESTRA_DANI),
|
||||
new GunConfig().dura(30_000).draw(20).inspect(23).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(15F).delay(11).reload(55).jam(45).sound("hbm:weapon.fire.pistol", 1.0F, 0.9F)
|
||||
.dmg(15F).spreadHipfire(0F).delay(11).reload(55).jam(45).sound("hbm:weapon.fire.pistol", 1.0F, 0.9F)
|
||||
.mag(new MagazineFullReload(1, 6).addConfigs(m357_bp, m357_sp, m357_fmj, m357_jhp, m357_ap, m357_express))
|
||||
.offset(0.75, -0.0625, -0.3125D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_DANI))
|
||||
|
||||
@ -78,7 +78,7 @@ public class XFactory9mm {
|
||||
ModItems.gun_uzi_akimbo = new ItemGunBaseNT(WeaponQuality.B_SIDE,
|
||||
new GunConfig().dura(3_000).draw(15).inspect(31).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(3F).delay(2).dry(25).auto(true).spread(0.005F).reload(55).jam(50).sound("hbm:weapon.fire.uzi", 1.0F, 1.0F)
|
||||
.dmg(3F).spreadHipfire(0F).delay(2).dry(25).auto(true).spread(0.005F).reload(55).jam(50).sound("hbm:weapon.fire.uzi", 1.0F, 1.0F)
|
||||
.mag(new MagazineFullReload(0, 30).addConfigs(p9_sp, p9_fmj, p9_jhp, p9_ap))
|
||||
.offset(1, -0.0625 * 2.5, 0.375D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_UZI))
|
||||
@ -87,7 +87,7 @@ public class XFactory9mm {
|
||||
.anim(LAMBDA_UZI_ANIMS).orchestra(Orchestras.ORCHESTRA_UZI_AKIMBO),
|
||||
new GunConfig().dura(3_000).draw(15).inspect(31).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(3F).delay(2).dry(25).auto(true).spread(0.005F).reload(55).jam(50).sound("hbm:weapon.fire.uzi", 1.0F, 1.0F)
|
||||
.dmg(3F).spreadHipfire(0F).delay(2).dry(25).auto(true).spread(0.005F).reload(55).jam(50).sound("hbm:weapon.fire.uzi", 1.0F, 1.0F)
|
||||
.mag(new MagazineFullReload(1, 30).addConfigs(p9_sp, p9_fmj, p9_jhp, p9_ap))
|
||||
.offset(1, -0.0625 * 2.5, -0.375D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_UZI))
|
||||
|
||||
@ -95,7 +95,7 @@ public class XFactoryAccelerator {
|
||||
ModItems.gun_tau = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
.dura(6_400).draw(10).inspect(10).crosshair(Crosshair.CIRCLE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(25F).delay(4).auto(true).spread(0F)
|
||||
.dmg(25F).spreadHipfire(0F).delay(4).auto(true).spread(0F)
|
||||
.mag(new MagazineBelt().addConfigs(tau_uranium))
|
||||
.offset(1, -0.0625 * 2.5, -0.25D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_TAU))
|
||||
|
||||
@ -60,7 +60,7 @@ public class XFactoryCatapult {
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_NUKE_DEMO = (bullet, mop) -> {
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3) return;
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3 && mop.entityHit == bullet.getThrower()) return;
|
||||
if(bullet.isDead) return;
|
||||
bullet.setDead();
|
||||
|
||||
@ -76,7 +76,7 @@ public class XFactoryCatapult {
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_NUKE_HIGH = (bullet, mop) -> {
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3) return;
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3 && mop.entityHit == bullet.getThrower()) return;
|
||||
if(bullet.isDead) return;
|
||||
bullet.setDead();
|
||||
bullet.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(bullet.worldObj, 35, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord));
|
||||
@ -101,7 +101,7 @@ public class XFactoryCatapult {
|
||||
}
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_NUKE_TINYTOT = (bullet, mop) -> {
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3) return;
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3 && mop.entityHit == bullet.getThrower()) return;
|
||||
if(bullet.isDead) return;
|
||||
bullet.setDead();
|
||||
|
||||
@ -119,7 +119,7 @@ public class XFactoryCatapult {
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_NUKE_HIVE = (bullet, mop) -> {
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3) return;
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3 && mop.entityHit == bullet.getThrower()) return;
|
||||
if(bullet.isDead) return;
|
||||
bullet.setDead();
|
||||
ExplosionVNT vnt = new ExplosionVNT(bullet.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 5);
|
||||
@ -140,7 +140,7 @@ public class XFactoryCatapult {
|
||||
ModItems.gun_fatman = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
.dura(300).draw(20).inspect(30).crosshair(Crosshair.L_CIRCUMFLEX).hideCrosshair(false)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(100F).delay(10).reload(57).jam(40).sound("hbm:weapon.fire.fatman", 1.0F, 1.0F)
|
||||
.dmg(100F).spreadHipfire(0F).delay(10).reload(57).jam(40).sound("hbm:weapon.fire.fatman", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 1).addConfigs(nuke_standard, nuke_demo, nuke_high, nuke_tots, nuke_hive))
|
||||
.offset(1, -0.0625 * 1.5, -0.1875D).offsetScoped(1, -0.0625 * 1.5, -0.125D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_FATMAN))
|
||||
|
||||
@ -138,7 +138,7 @@ public class XFactoryFlamer {
|
||||
ModItems.gun_flamer = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
.dura(20_000).draw(10).inspect(17).crosshair(Crosshair.L_CIRCLE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(1F).delay(1).auto(true).reload(90).jam(17)
|
||||
.dmg(1F).spreadHipfire(0F).delay(1).auto(true).reload(90).jam(17)
|
||||
.mag(new MagazineFullReload(0, 300).addConfigs(flame_diesel, flame_gas, flame_napalm, flame_balefire))
|
||||
.offset(0.75, -0.0625, -0.25D)
|
||||
.setupStandardFire())
|
||||
@ -148,7 +148,7 @@ public class XFactoryFlamer {
|
||||
ModItems.gun_flamer_topaz = new ItemGunBaseNT(WeaponQuality.B_SIDE, new GunConfig()
|
||||
.dura(20_000).draw(10).inspect(17).crosshair(Crosshair.L_CIRCLE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(1.5F).delay(1).auto(true).reload(90).jam(17)
|
||||
.dmg(1.5F).spreadHipfire(0F).delay(1).auto(true).reload(90).jam(17)
|
||||
.mag(new MagazineFullReload(0, 500).addConfigs(flame_topaz_diesel, flame_topaz_gas, flame_topaz_napalm, flame_topaz_balefire))
|
||||
.offset(0.75, -0.0625, -0.25D)
|
||||
.setupStandardFire())
|
||||
@ -158,7 +158,7 @@ public class XFactoryFlamer {
|
||||
ModItems.gun_flamer_daybreaker = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
|
||||
.dura(20_000).draw(10).inspect(17).crosshair(Crosshair.L_CIRCLE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(25F).delay(10).auto(true).reload(90).jam(17).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.dmg(25F).spreadHipfire(0F).delay(10).auto(true).reload(90).jam(17).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.mag(new MagazineFullReload(0, 50).addConfigs(flame_daybreaker_diesel, flame_daybreaker_gas, flame_daybreaker_napalm, flame_daybreaker_balefire))
|
||||
.offset(0.75, -0.0625, -0.25D)
|
||||
.setupStandardFire())
|
||||
@ -169,7 +169,7 @@ public class XFactoryFlamer {
|
||||
ModItems.gun_chemthrower = new ItemGunChemthrower(WeaponQuality.A_SIDE, new GunConfig()
|
||||
.dura(90_000).draw(10).inspect(17).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.delay(1).auto(true)
|
||||
.delay(1).spreadHipfire(0F).auto(true)
|
||||
.mag(new MagazineFluid(0, 3_000))
|
||||
.offset(0.75, -0.0625, -0.25D)
|
||||
.canFire(ItemGunChemthrower.LAMBDA_CAN_FIRE).fire(ItemGunChemthrower.LAMBDA_FIRE))
|
||||
|
||||
@ -188,7 +188,7 @@ public class XFactoryRocket {
|
||||
ModItems.gun_quadro = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
.dura(400).draw(7).inspect(40).crosshair(Crosshair.L_CIRCUMFLEX).hideCrosshair(false)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(40F).delay(10).reload(55).jam(40).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
|
||||
.dmg(40F).spreadHipfire(0F).delay(10).reload(55).jam(40).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
|
||||
.mag(new MagazineFullReload(0, 4).addConfigs(rocket_qd))
|
||||
.offset(1, -0.0625 * 1.5, -0.1875D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_ROCKET))
|
||||
@ -199,7 +199,7 @@ public class XFactoryRocket {
|
||||
ModItems.gun_missile_launcher = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
.dura(500).draw(20).inspect(40).crosshair(Crosshair.L_CIRCUMFLEX).hideCrosshair(false)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(50F).delay(5).reload(48).jam(33).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
|
||||
.dmg(50F).spreadHipfire(0F).delay(5).reload(48).jam(33).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 1).addConfigs(rocket_ml))
|
||||
.offset(1, -0.0625 * 1.5, -0.1875D)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_ROCKET))
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package com.hbm.tileentity.machine.albion;
|
||||
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource.Particle;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IParticleUser {
|
||||
|
||||
public boolean canParticleEnter(Particle particle, ForgeDirection dir);
|
||||
public boolean canParticleEnter(Particle particle, ForgeDirection dir, int x, int y, int z);
|
||||
public void onEnter(Particle particle, ForgeDirection dir);
|
||||
public BlockPos getExitPos(Particle particle);
|
||||
}
|
||||
|
||||
@ -60,6 +60,10 @@ public abstract class TileEntityCooledBase extends TileEntityMachineBase impleme
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCool() {
|
||||
return this.temperature <= this.temperature_target;
|
||||
}
|
||||
|
||||
public abstract DirPos[] getConPos();
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,11 +1,31 @@
|
||||
package com.hbm.tileentity.machine.albion;
|
||||
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource.Particle;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPABeamline extends TileEntity {
|
||||
public class TileEntityPABeamline extends TileEntity implements IParticleUser {
|
||||
|
||||
@Override
|
||||
public boolean canParticleEnter(Particle particle, ForgeDirection dir, int x, int y, int z) {
|
||||
ForgeDirection beamlineDir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getRotation(ForgeDirection.DOWN);
|
||||
BlockPos input = new BlockPos(xCoord, yCoord, zCoord).offset(beamlineDir, -1);
|
||||
return input.compare(x, y, z) && beamlineDir == dir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnter(Particle particle, ForgeDirection dir) { }
|
||||
|
||||
@Override
|
||||
public BlockPos getExitPos(Particle particle) {
|
||||
ForgeDirection beamlineDir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getRotation(ForgeDirection.DOWN);
|
||||
return new BlockPos(xCoord, yCoord, zCoord).offset(beamlineDir, 2);
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
@ -4,8 +4,13 @@ import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.container.ContainerPADipole;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.gui.GUIPADipole;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemPACoil.EnumCoilType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource.Particle;
|
||||
import com.hbm.util.EnumUtil;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -19,13 +24,15 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProvider, IControlReceiver {
|
||||
public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProvider, IControlReceiver, IParticleUser {
|
||||
|
||||
public int dirLower;
|
||||
public int dirUpper;
|
||||
public int dirRedstone;
|
||||
public int threshold;
|
||||
|
||||
public static final long usage = 1_000_000;
|
||||
|
||||
public TileEntityPADipole() {
|
||||
super(2);
|
||||
}
|
||||
@ -50,6 +57,49 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
||||
return "container.paDipole";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canParticleEnter(Particle particle, ForgeDirection dir, int x, int y, int z) {
|
||||
return this.yCoord == y && (this.xCoord == x || this.zCoord == z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnter(Particle particle, ForgeDirection dir) {
|
||||
EnumCoilType type = null;
|
||||
|
||||
int mult = 1;
|
||||
if(slots[1] != null && slots[1].getItem() == ModItems.pa_coil) {
|
||||
type = EnumUtil.grabEnumSafely(EnumCoilType.class, slots[1].getItemDamage());
|
||||
mult = type.diMin > particle.momentum ? 5 : 1;
|
||||
}
|
||||
|
||||
if(!isCool() || this.power < this.usage * mult || type == null || type.diMax < particle.momentum) {
|
||||
particle.crash();
|
||||
return;
|
||||
}
|
||||
|
||||
this.power -= this.usage * mult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getExitPos(Particle particle) {
|
||||
System.out.println(particle.momentum + " / " + this.threshold);
|
||||
if(particle.momentum >= this.threshold) {
|
||||
ForgeDirection dir = this.ditToForgeDir(checkRedstone() ? dirRedstone : dirUpper);
|
||||
particle.dir = dir;
|
||||
return new BlockPos(xCoord, yCoord, zCoord).offset(dir, 2);
|
||||
}
|
||||
ForgeDirection dir = this.ditToForgeDir(dirLower);
|
||||
particle.dir = dir;
|
||||
return new BlockPos(xCoord, yCoord, zCoord).offset(dir, 2);
|
||||
}
|
||||
|
||||
public boolean checkRedstone() {
|
||||
for(DirPos pos : getConPos()) {
|
||||
if(worldObj.isBlockIndirectlyGettingPowered(pos.getX(), pos.getY(), pos.getZ())) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
|
||||
@ -2,8 +2,13 @@ package com.hbm.tileentity.machine.albion;
|
||||
|
||||
import com.hbm.inventory.container.ContainerPAQuadrupole;
|
||||
import com.hbm.inventory.gui.GUIPAQuadrupole;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemPACoil.EnumCoilType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource.Particle;
|
||||
import com.hbm.util.EnumUtil;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -14,7 +19,10 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPAQuadrupole extends TileEntityCooledBase implements IGUIProvider {
|
||||
public class TileEntityPAQuadrupole extends TileEntityCooledBase implements IGUIProvider, IParticleUser {
|
||||
|
||||
public static final long usage = 1_000_000;
|
||||
public static final int focusGain = 100;
|
||||
|
||||
public TileEntityPAQuadrupole() {
|
||||
super(2);
|
||||
@ -30,6 +38,38 @@ public class TileEntityPAQuadrupole extends TileEntityCooledBase implements IGUI
|
||||
return "container.paQuadrupole";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canParticleEnter(Particle particle, ForgeDirection dir, int x, int y, int z) {
|
||||
ForgeDirection beamlineDir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getRotation(ForgeDirection.DOWN);
|
||||
BlockPos input = new BlockPos(xCoord, yCoord, zCoord).offset(beamlineDir, -1);
|
||||
return input.compare(x, y, z) && beamlineDir == dir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnter(Particle particle, ForgeDirection dir) {
|
||||
EnumCoilType type = null;
|
||||
|
||||
int mult = 1;
|
||||
if(slots[1] != null && slots[1].getItem() == ModItems.pa_coil) {
|
||||
type = EnumUtil.grabEnumSafely(EnumCoilType.class, slots[1].getItemDamage());
|
||||
mult = type.quadMin > particle.momentum ? 5 : 1;
|
||||
}
|
||||
|
||||
if(!isCool() || this.power < this.usage * mult || type == null || type.quadMax < particle.momentum) {
|
||||
particle.crash();
|
||||
return;
|
||||
}
|
||||
|
||||
particle.focus(focusGain);
|
||||
this.power -= this.usage * mult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getExitPos(Particle particle) {
|
||||
ForgeDirection beamlineDir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getRotation(ForgeDirection.DOWN);
|
||||
return new BlockPos(xCoord, yCoord, zCoord).offset(beamlineDir, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import com.hbm.inventory.container.ContainerPARFC;
|
||||
import com.hbm.inventory.gui.GUIPARFC;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource.Particle;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -14,7 +16,11 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPARFC extends TileEntityCooledBase implements IGUIProvider {
|
||||
public class TileEntityPARFC extends TileEntityCooledBase implements IGUIProvider, IParticleUser {
|
||||
|
||||
public static final long usage = 1_000_000;
|
||||
public static final int momentumGain = 100;
|
||||
public static final int defocusGain = 100;
|
||||
|
||||
public TileEntityPARFC() {
|
||||
super(1);
|
||||
@ -30,6 +36,31 @@ public class TileEntityPARFC extends TileEntityCooledBase implements IGUIProvide
|
||||
return "container.paRFC";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canParticleEnter(Particle particle, ForgeDirection dir, int x, int y, int z) {
|
||||
ForgeDirection rfcDir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getRotation(ForgeDirection.DOWN);
|
||||
BlockPos input = new BlockPos(xCoord, yCoord, zCoord).offset(rfcDir, -4);
|
||||
return input.compare(x, y, z) && rfcDir == dir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnter(Particle particle, ForgeDirection dir) {
|
||||
if(!isCool() || this.power < this.usage) {
|
||||
particle.crash();
|
||||
return;
|
||||
}
|
||||
|
||||
particle.momentum += this.momentumGain;
|
||||
particle.defocus(defocusGain);
|
||||
this.power -= this.usage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getExitPos(Particle particle) {
|
||||
ForgeDirection beamlineDir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getRotation(ForgeDirection.DOWN);
|
||||
return new BlockPos(xCoord, yCoord, zCoord).offset(beamlineDir, 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
|
||||
@ -1,19 +1,35 @@
|
||||
package com.hbm.tileentity.machine.albion;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.container.ContainerPASource;
|
||||
import com.hbm.inventory.gui.GUIPASource;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.particle.helper.ExplosionSmallCreator;
|
||||
import com.hbm.tileentity.IConditionalInvAccess;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPASource extends TileEntityCooledBase implements IGUIProvider {
|
||||
public class TileEntityPASource extends TileEntityCooledBase implements IGUIProvider, IConditionalInvAccess, IControlReceiver {
|
||||
|
||||
public static final long usage = 1_000_000;
|
||||
public Particle particle;
|
||||
|
||||
public int debugSpeed;
|
||||
|
||||
public TileEntityPASource() {
|
||||
super(5);
|
||||
@ -24,6 +40,78 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
||||
return "container.paSource";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
this.power = Library.chargeTEFromItems(slots, 0, power, this.getMaxPower());
|
||||
|
||||
if(particle != null) {
|
||||
steppy();
|
||||
this.debugSpeed = particle.momentum;
|
||||
if(particle.invalid) this.particle = null;
|
||||
} else if(this.power >= this.usage && slots[1] != null && slots[2] != null) {
|
||||
tryRun();
|
||||
}
|
||||
}
|
||||
|
||||
super.updateEntity();
|
||||
}
|
||||
|
||||
public void steppy() {
|
||||
if(!worldObj.getChunkProvider().chunkExists(particle.x >> 4, particle.z >> 4)) return; //halt if we reach unloaded areas
|
||||
System.out.println("ticking");
|
||||
ExplosionSmallCreator.composeEffect(worldObj, particle.x + 0.5, particle.y + 0.5, particle.z + 0.5, 10, 1, 1);
|
||||
|
||||
Block b = worldObj.getBlock(particle.x, particle.y, particle.z);
|
||||
if(b instanceof BlockDummyable) {
|
||||
int[] pos = ((BlockDummyable) b).findCore(worldObj, particle.x, particle.y, particle.z);
|
||||
if(pos == null) { particle.crash(); return; }
|
||||
TileEntity tile = worldObj.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(!(tile instanceof IParticleUser)) { particle.crash(); return; }
|
||||
IParticleUser pa = (IParticleUser) tile;
|
||||
System.out.println(pa + "");
|
||||
if(pa.canParticleEnter(particle, particle.dir, particle.x, particle.y, particle.z)) {
|
||||
pa.onEnter(particle, particle.dir);
|
||||
BlockPos exit = pa.getExitPos(particle);
|
||||
particle.move(exit);
|
||||
} else { particle.crash(); worldObj.createExplosion(null, particle.x + 0.5, particle.y + 0.5, particle.z + 0.5, 5, false); return; }
|
||||
} else {
|
||||
System.out.println("derailed!");
|
||||
particle.crash();
|
||||
}
|
||||
}
|
||||
|
||||
public void tryRun() {
|
||||
if(slots[1].getItem().hasContainerItem(slots[1]) && slots[3] != null) return;
|
||||
if(slots[2].getItem().hasContainerItem(slots[2]) && slots[4] != null) return;
|
||||
|
||||
this.power -= usage;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
this.particle = new Particle(xCoord + rot.offsetX * 5, yCoord, zCoord + rot.offsetZ * 5, rot, slots[1], slots[2]);
|
||||
this.slots[1] = null;
|
||||
this.slots[2] = null;
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeInt(debugSpeed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
debugSpeed = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirPos[] getConPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||
@ -39,6 +127,38 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
||||
};
|
||||
}
|
||||
|
||||
//ISidedInventory
|
||||
@Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return slot == 1 || slot == 2; }
|
||||
@Override public boolean canExtractItem(int slot, ItemStack stack, int side) { return slot == 3 || slot == 4; }
|
||||
@Override public int[] getAccessibleSlotsFromSide(int side) { return new int[] { 3, 4 }; }
|
||||
|
||||
//IConditionalInvAccess
|
||||
@Override public boolean isItemValidForSlot(int x, int y, int z, int slot, ItemStack stack) { return isItemValidForSlot(slot, stack); }
|
||||
@Override public boolean canExtractItem(int x, int y, int z, int slot, ItemStack stack, int side) { return canExtractItem(slot, stack, side); }
|
||||
|
||||
//reusing the same fucking instance because doing anything else would be retarded
|
||||
public static final BlockPos cheapAss = new BlockPos(0, 0, 0);
|
||||
public static final int[] slotsRed = new int[] {1};
|
||||
public static final int[] slotsYellow = new int[] {2};
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int x, int y, int z, int side) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
cheapAss.mutate(x, y, z);
|
||||
|
||||
if(cheapAss.compare(xCoord + dir.offsetX - rot.offsetX * 2, yCoord, zCoord + dir.offsetZ - rot.offsetZ * 2) ||
|
||||
cheapAss.compare(xCoord - dir.offsetX + rot.offsetX * 2, yCoord, zCoord - dir.offsetZ + rot.offsetZ * 2)) {
|
||||
return slotsYellow;
|
||||
}
|
||||
|
||||
if(cheapAss.compare(xCoord - dir.offsetX - rot.offsetX * 2, yCoord, zCoord - dir.offsetZ - rot.offsetZ * 2) ||
|
||||
cheapAss.compare(xCoord + dir.offsetX + rot.offsetX * 2, yCoord, zCoord + dir.offsetZ + rot.offsetZ * 2)) {
|
||||
return slotsRed;
|
||||
}
|
||||
|
||||
return getAccessibleSlotsFromSide(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return 10_000_000;
|
||||
@ -69,14 +189,17 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerPASource(player.inventory, this); }
|
||||
@Override public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIPASource(player.inventory, this); }
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerPASource(player.inventory, this);
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
return this.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIPASource(player.inventory, this);
|
||||
public void receiveControl(NBTTagCompound data) {
|
||||
if(data.hasKey("cancel")) this.particle = null;
|
||||
}
|
||||
|
||||
public static class Particle {
|
||||
@ -86,5 +209,40 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
||||
public int z;
|
||||
public ForgeDirection dir;
|
||||
public int momentum;
|
||||
public int defocus;
|
||||
public static final int maxDefocus = 100;
|
||||
public boolean invalid = false;
|
||||
|
||||
public ItemStack input1;
|
||||
public ItemStack input2;
|
||||
|
||||
public Particle(int x, int y, int z, ForgeDirection dir, ItemStack input1, ItemStack input2) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.dir = dir;
|
||||
this.input1 = input1;
|
||||
this.input2 = input2;
|
||||
}
|
||||
|
||||
public void crash() {
|
||||
this.invalid = true;
|
||||
}
|
||||
|
||||
public void move(BlockPos pos) {
|
||||
this.x = pos.getX();
|
||||
this.y = pos.getY();
|
||||
this.z = pos.getZ();
|
||||
}
|
||||
|
||||
public void defocus(int amount) {
|
||||
this.defocus += amount;
|
||||
if(this.defocus > this.maxDefocus) this.crash();
|
||||
}
|
||||
|
||||
public void focus(int amount) {
|
||||
this.defocus -= amount;
|
||||
if(this.defocus < 0) this.defocus = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,13 +267,16 @@ public class DamageResistanceHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityAttacked(LivingAttackEvent event) {
|
||||
if(event.source.isDamageAbsolute()) return;
|
||||
|
||||
EntityLivingBase e = event.entityLiving;
|
||||
float amount = event.ammount;
|
||||
|
||||
float[] vals = getDTDR(e, event.source, amount, currentPDT, currentPDR);
|
||||
float dt = vals[0] - currentPDT;
|
||||
float dr = vals[1] - currentPDR;
|
||||
|
||||
if(dt > 0 && dt >= event.ammount) {
|
||||
if((dt > 0 && dt >= event.ammount) || dr >= 1F) {
|
||||
event.setCanceled(true);
|
||||
EntityDamageUtil.damageArmorNT(e, amount);
|
||||
}
|
||||
@ -378,7 +381,7 @@ public class DamageResistanceHandler {
|
||||
if(exact != null) return exact;
|
||||
Resistance category = categoryResistances.get(typeToCategory(source));
|
||||
if(category != null) return category;
|
||||
return source.isUnblockable() ? null : otherResistance;
|
||||
return otherResistance;
|
||||
}
|
||||
|
||||
public ResistanceStats addExact(String type, float threshold, float resistance) { exactResistances.put(type, new Resistance(threshold, resistance)); return this; }
|
||||
|
||||
@ -45,6 +45,7 @@ public class EntityDamageUtil {
|
||||
if(!playerMP.canAttackPlayer(attacker)) return false; //handles wack-ass no PVP rule as well as scoreboard friendly fire
|
||||
}
|
||||
DamageResistanceHandler.setup(pierceDT, pierce);
|
||||
living.attackEntityFrom(source, 0F);
|
||||
boolean ret = attackEntityFromNTInternal(living, source, amount, ignoreIFrame, allowSpecialCancel, knockbackMultiplier);
|
||||
//boolean ret = living.attackEntityFrom(source, amount);
|
||||
DamageResistanceHandler.reset();
|
||||
|
||||
@ -36,6 +36,10 @@ public class BlockPos implements Cloneable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean compare(int x, int y, int z) {
|
||||
return this.x == x && this.y == y && this.z == z;
|
||||
}
|
||||
|
||||
public BlockPos add(int x, int y, int z) {
|
||||
return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.getX() + x, this.getY() + y, this.getZ() + z);
|
||||
}
|
||||
|
||||
@ -1672,7 +1672,7 @@ hbmmat.weaponsteel=Weapon Steel
|
||||
hbmmat.whitephosphorus=White Phosphorus
|
||||
hbmmat.wood=Wood
|
||||
hbmmat.workersalloy=Desh
|
||||
hbmmat.wroughtiron=Wroght Iron
|
||||
hbmmat.wroughtiron=Wrought Iron
|
||||
hbmmat.zirconium=Zirconium
|
||||
|
||||
matshape.block=%s Block
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 8.0 KiB |
Loading…
x
Reference in New Issue
Block a user