mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
*throws graphite bricks at you*
This commit is contained in:
parent
d1593aecb9
commit
5f72290510
@ -46,6 +46,12 @@ public class BlockPile extends BlockContainer implements IBlockCT, IToolable {
|
||||
public static final int META_CONTROL = 7;
|
||||
/** Edge of our pile "cube" to prevent channels from being drilled there */
|
||||
public static final int META_EDGE = 8;
|
||||
|
||||
@SideOnly(Side.CLIENT) public CTStitchReceiver rec;
|
||||
@SideOnly(Side.CLIENT) public CTStitchReceiver recTop;
|
||||
@SideOnly(Side.CLIENT) public CTStitchReceiver recChanIn;
|
||||
@SideOnly(Side.CLIENT) public CTStitchReceiver recChanOut;
|
||||
@SideOnly(Side.CLIENT) public CTStitchReceiver recCon;
|
||||
|
||||
@SideOnly(Side.CLIENT) protected IIcon iconTop;
|
||||
|
||||
@ -60,20 +66,24 @@ public class BlockPile extends BlockContainer implements IBlockCT, IToolable {
|
||||
@Override public int getRenderType() { return CT.renderID; }
|
||||
@Override public Item getItemDropped(int i, Random rand, int j) { return null; }
|
||||
|
||||
@SideOnly(Side.CLIENT) public CTStitchReceiver rec;
|
||||
@SideOnly(Side.CLIENT) public CTStitchReceiver recTop;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
super.registerBlockIcons(reg);
|
||||
this.iconTop = reg.registerIcon(RefStrings.MODID + ":pile_block_top");
|
||||
|
||||
this.rec = IBlockCT.primeReceiver(reg, this.blockIcon.getIconName(), this.blockIcon);
|
||||
this.recTop = IBlockCT.primeReceiver(reg, this.iconTop.getIconName(), this.iconTop);
|
||||
this.recChanIn = IBlockCT.primeReceiver(reg, "pile_block_input", this.blockIcon);
|
||||
this.recChanOut = IBlockCT.primeReceiver(reg, "pile_block_output", this.blockIcon);
|
||||
this.recCon = IBlockCT.primeReceiver(reg, "pile_block_control_top", this.iconTop);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon[] getFragments(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if(side == 0 || side == 1) return recTop.fragCache;
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if(side == 0 || side == 1) return meta == META_CONTROL ? recCon.fragCache : recTop.fragCache;
|
||||
if(meta == META_FUEL_IN || meta == META_AIR_IN) return recChanIn.fragCache;
|
||||
if(meta == META_FUEL_OUT || meta == META_AIR_OUT) return recChanOut.fragCache;
|
||||
return rec.fragCache;
|
||||
}
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.gui.GUIDiode;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
@ -17,6 +18,7 @@ import com.hbm.util.EnumUtil;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
@ -61,6 +63,17 @@ public class CableDiode extends BlockContainer implements IEnergyConnectorBlock,
|
||||
world.setBlockMetadataWithNotify(x, y, z, l, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float fX, float fY, float fZ) {
|
||||
|
||||
if(!player.isSneaking() && world.isRemote) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
return true;
|
||||
|
||||
@ -222,19 +222,12 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
|
||||
|
||||
ItemStack armor = player.inventory.armorInventory[i];
|
||||
|
||||
if(armor == null || !(armor.getItem() instanceof ArmorFSB))
|
||||
return false;
|
||||
|
||||
if(((ArmorFSB) armor.getItem()).getArmorMaterial() != chestplate.getArmorMaterial())
|
||||
return false;
|
||||
|
||||
if(!((ArmorFSB) armor.getItem()).isArmorEnabled(armor))
|
||||
return false;
|
||||
if(armor == null || !(armor.getItem() instanceof ArmorFSB)) return false;
|
||||
if(((ArmorFSB) armor.getItem()).getArmorMaterial() != chestplate.getArmorMaterial()) return false;
|
||||
if(!((ArmorFSB) armor.getItem()).isArmorEnabled(armor)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -251,16 +244,11 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
|
||||
|
||||
ItemStack armor = player.inventory.armorInventory[i];
|
||||
|
||||
if(armor == null || !(armor.getItem() instanceof ArmorFSB))
|
||||
return false;
|
||||
|
||||
if(((ArmorFSB) armor.getItem()).getArmorMaterial() != chestplate.getArmorMaterial())
|
||||
return false;
|
||||
if(armor == null || !(armor.getItem() instanceof ArmorFSB)) return false;
|
||||
if(((ArmorFSB) armor.getItem()).getArmorMaterial() != chestplate.getArmorMaterial()) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -43,7 +43,6 @@ public class ModDamageSource extends DamageSource {
|
||||
public static DamageSource vacuum = (new DamageSource("vacuum")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource overdose = (new DamageSource("overdose")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource microwave = (new DamageSource("microwave")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource nitan = (new DamageSource("nitan")).setDamageIsAbsolute().setDamageBypassesArmor().setDamageAllowedInCreativeMode();;
|
||||
|
||||
public static final String s_bullet = "revolverBullet";
|
||||
public static final String s_emplacer = "chopperBullet";
|
||||
|
||||
@ -67,6 +67,15 @@ public class TileEntityPileCore extends TileEntityTickingBase {
|
||||
for(int i = 0; i < ventCount; i++) ventilationChannels.add(readChannelFromNBT(nbt, "v" + i));
|
||||
for(int i = 0; i < contCount; i++) controlChannels.add(readChannelFromNBT(nbt, "c" + i));
|
||||
}
|
||||
|
||||
public PileChannel getFuelChannel(int x, int y, int z) { return getChannel(x, y, z, fuelChannels); }
|
||||
public PileChannel getVentilationChannel(int x, int y, int z) { return getChannel(x, y, z, ventilationChannels); }
|
||||
public PileChannel getControlChannel(int x, int y, int z) { return getChannel(x, y, z, controlChannels); }
|
||||
|
||||
public PileChannel getChannel(int x, int y, int z, List<PileChannel> list) {
|
||||
for(PileChannel channel : list) if(channel.entry.compare(x, y, z)) return channel;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
|
||||
@ -419,7 +419,11 @@ public class DamageResistanceHandler {
|
||||
LASER,
|
||||
MICROWAVE,
|
||||
SUBATOMIC,
|
||||
OTHER
|
||||
OTHER;
|
||||
|
||||
public boolean isApplicable(String name) {
|
||||
return name.toLowerCase(Locale.US).equals(this.name().toLowerCase(Locale.US));
|
||||
}
|
||||
}
|
||||
|
||||
public static void setup(float dt, float dr) {
|
||||
@ -471,11 +475,11 @@ public class DamageResistanceHandler {
|
||||
if(source.isExplosion()) return CATEGORY_EXPLOSION;
|
||||
if(source.isFireDamage()) return CATEGORY_FIRE;
|
||||
if(source.isProjectile()) return CATEGORY_PHYSICAL;
|
||||
if(source.damageType.toLowerCase(Locale.US).equals(DamageClass.LASER.name().toLowerCase(Locale.US))) return CATEGORY_ENERGY;
|
||||
if(source.damageType.toLowerCase(Locale.US).equals(DamageClass.PLASMA.name().toLowerCase(Locale.US))) return CATEGORY_ENERGY;
|
||||
if(source.damageType.toLowerCase(Locale.US).equals(DamageClass.MICROWAVE.name().toLowerCase(Locale.US))) return CATEGORY_ENERGY;
|
||||
if(source.damageType.toLowerCase(Locale.US).equals(DamageClass.SUBATOMIC.name().toLowerCase(Locale.US))) return CATEGORY_ENERGY;
|
||||
if(source.damageType.toLowerCase(Locale.US).equals(DamageClass.ELECTRIC.name().toLowerCase(Locale.US))) return CATEGORY_ENERGY;
|
||||
if(DamageClass.LASER.isApplicable(source.damageType)) return CATEGORY_ENERGY;
|
||||
if(DamageClass.PLASMA.isApplicable(source.damageType)) return CATEGORY_ENERGY;
|
||||
if(DamageClass.MICROWAVE.isApplicable(source.damageType)) return CATEGORY_ENERGY;
|
||||
if(DamageClass.SUBATOMIC.isApplicable(source.damageType)) return CATEGORY_ENERGY;
|
||||
if(DamageClass.ELECTRIC.isApplicable(source.damageType)) return CATEGORY_ENERGY;
|
||||
if(source == DamageSource.cactus) return CATEGORY_PHYSICAL;
|
||||
if(source == ModDamageSource.spikes) return CATEGORY_PHYSICAL;
|
||||
if(source == ModDamageSource.electricity) return CATEGORY_ENERGY;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user