mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-03-11 20:25:36 +00:00
Merge remote-tracking branch 'HbmMods/master'
This commit is contained in:
commit
6a8fa58f76
@ -18,6 +18,8 @@ Things you should also avoid include:
|
||||
|
||||
This should go without saying, but please don't PR code that was never actually tested or has obvious compiler errors in it.
|
||||
|
||||
**Addendum:** Because apparently some people think that testing is somehow optional, it is now **mandatory** to test the code both on a client and on a server. If the PR contains compat code, the game has to work **with and without** the mod that the compat is for.
|
||||
|
||||
## Communication
|
||||
|
||||
If you're planning on adding some new thing or doing a grand change, it's best to ask whether that's a good idea before spending 50 hours on a project that won't end up getting merged, due to issues that could have been entirely avoidable with communication.
|
||||
|
||||
19
changelog
19
changelog
@ -1,16 +1,5 @@
|
||||
## Changed
|
||||
* Chlorophyte rounds now deal 2x more damage than their standard counterparts instead of 1.5x
|
||||
* Chlorophyte rounds now penetrate multiple enemies
|
||||
* Decreased chlorophyte targeting range from 200 to 30 blocks
|
||||
* Josh now has recoil and reload animations
|
||||
* Anvil recipes for upgrading ammo types have been adjusted to match the crafting batch size
|
||||
* Adjusted the corium block destruction function to be more in line with the recent concrete nerfs
|
||||
* Reduced the blast resistance threshold for FEL, making concrete once again resistant to lasers
|
||||
* Crafting bullet assemblies now only yields one item, it's that one assembly that turns into a full set of bullets after being pressed once. This should reduce the amount of press operations by up to a factor of 64.
|
||||
* 5mm assemblies now yield 64 instead of 32 bullets
|
||||
* The production complexity and time for making thermoelectric elements in the assembler has been reduced
|
||||
* Thermoelectric elements can now also be made in a tier 2 anvil
|
||||
|
||||
## Fixed
|
||||
* Fixed logspam when pollution handler tries to save the pollution data for dimensions that have never been loaded before
|
||||
* Fixed dead leaves layer not being replacable by other blocks
|
||||
* The watz now cools up to 20% of its current heat level instead of 10%, making reactors a lot cooler and therefore react faster, which means more energy and faster depletion rates
|
||||
* Mud production rates have been halved, to prevent currently working setups from exploding instantly
|
||||
* This is your reminder that you can achieve more power, mud and depletion by building larger watz powerplants, i.e. stacking more watz segments on top of each other. Your tiny poo reactors make me sick.
|
||||
* Watz pellets now have a 50% smaller yield, halving the expected time until depletion
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=4707
|
||||
mod_build_number=4837
|
||||
|
||||
credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\
|
||||
\ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models,\
|
||||
@ -8,11 +8,12 @@ credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion al
|
||||
\ (chinese localization), Frooz (models), Minecreep (models), VT-6/24 (models, textures), Pheo (textures,\
|
||||
\ various machines, models, weapons), Vær (gas centrifuges, better worldgen, ZIRNOX, CP-1 parts, starter guide),\
|
||||
\ Adam29 (liquid petroleum, ethanol, electric furnace), Pashtet (russian localization), MartinTheDragon\
|
||||
\ (calculator, chunk-based fallout, bendable cranes), haru315 (spiral point algorithm), Sten89 (models), Pixelguru26\
|
||||
\ (textures), TheBlueHat (textures), Alcater (GUI textures, porting), impbk2002 (project settings), Nos (models),\
|
||||
\ Burningwater202 (laminate glass), OvermindDL1 (project settings), TehTemmie (reacher radiation function),\
|
||||
\ 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, custom machine holograms),\
|
||||
\ SuperCraftAlex (tooltips) LePeep (coilgun model, BDCL QC), 70k (textures), Maksymisio (polish localization)
|
||||
\ (calculator, chunk-based fallout, bendable cranes, pipe improvements), haru315 (spiral point algorithm),\
|
||||
\ Sten89 (models), Pixelguru26 (textures), TheBlueHat (textures), Alcater (GUI textures, porting), impbk2002\
|
||||
\ (project settings), Nos (models), Burningwater202 (laminate glass), OvermindDL1 (project settings), TehTemmie\
|
||||
\ (reacher radiation function), 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,\
|
||||
\ custom machine holograms, I18n improvements), SuperCraftAlex (tooltips) LePeep (coilgun model, BDCL QC),\
|
||||
\ 70k (textures), Maksymisio (polish localization) Ice-Arrow (research reactor tweaks)
|
||||
|
||||
@ -28,15 +28,17 @@ public interface IEnergyUser extends IEnergyConnector {
|
||||
@Override
|
||||
public default long transferPower(long power) {
|
||||
|
||||
this.setPower(this.getPower() + power);
|
||||
|
||||
if(this.getPower() > this.getMaxPower()) {
|
||||
if(this.getPower() + power > this.getMaxPower()) {
|
||||
|
||||
long overshoot = this.getPower() - this.getMaxPower();
|
||||
long overshoot = this.getPower() + power - this.getMaxPower();
|
||||
this.setPower(this.getMaxPower());
|
||||
return overshoot;
|
||||
}
|
||||
|
||||
if(this.getPower() + power < 0) return 0; //safeguard for negative energy or overflows
|
||||
|
||||
this.setPower(this.getPower() + power);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -138,10 +138,17 @@ public class PowerNet implements IPowerNet {
|
||||
cleanup(this.subscribers);
|
||||
lastCleanup = System.currentTimeMillis();
|
||||
}*/
|
||||
|
||||
List<PowerNet> cache = new ArrayList();
|
||||
if(trackingInstances != null && !trackingInstances.isEmpty()) {
|
||||
cache.addAll(trackingInstances);
|
||||
}
|
||||
|
||||
trackingInstances = new ArrayList();
|
||||
trackingInstances.add(this);
|
||||
return fairTransfer(this.subscribers, power);
|
||||
long result = fairTransfer(this.subscribers, power);
|
||||
trackingInstances.addAll(cache);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void cleanup(List<IEnergyConnector> subscribers) {
|
||||
@ -153,6 +160,8 @@ public class PowerNet implements IPowerNet {
|
||||
|
||||
public static long fairTransfer(List<IEnergyConnector> subscribers, long power) {
|
||||
|
||||
if(power <= 0) return 0;
|
||||
|
||||
if(subscribers.isEmpty())
|
||||
return power;
|
||||
|
||||
@ -196,6 +205,11 @@ public class PowerNet implements IPowerNet {
|
||||
long given = (long) Math.floor(fraction * power);
|
||||
|
||||
totalGiven += (given - con.transferPower(given));
|
||||
|
||||
if(con instanceof TileEntity) {
|
||||
TileEntity tile = (TileEntity) con;
|
||||
tile.getWorldObj().markTileEntityChunkModified(tile.xCoord, tile.yCoord, tile.zCoord, tile);
|
||||
}
|
||||
}
|
||||
|
||||
power -= totalGiven;
|
||||
@ -208,6 +222,8 @@ public class PowerNet implements IPowerNet {
|
||||
PowerNet net = trackingInstances.get(i);
|
||||
net.totalTransfer = net.totalTransfer.add(BigInteger.valueOf(totalTransfer));
|
||||
}
|
||||
|
||||
trackingInstances.clear();
|
||||
}
|
||||
|
||||
return power;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package api.hbm.entity;
|
||||
|
||||
@Deprecated //Use IRadarDetectableNT instead, old interface will still work though
|
||||
public interface IRadarDetectable {
|
||||
|
||||
public static enum RadarTargetType {
|
||||
@ -15,7 +16,7 @@ public interface IRadarDetectable {
|
||||
MISSILE_20("Size 20 Custom Missile"), //size 20 custom missiles
|
||||
MISSILE_AB("Anti-Ballistic Missile"), //anti ballistic missile
|
||||
PLAYER("Player"), //airborne players
|
||||
ARTILLERY("Artillery Shell"); //airborne players
|
||||
ARTILLERY("Artillery Shell"); //artillery shells
|
||||
|
||||
public String name;
|
||||
|
||||
|
||||
45
src/main/java/api/hbm/entity/IRadarDetectableNT.java
Normal file
45
src/main/java/api/hbm/entity/IRadarDetectableNT.java
Normal file
@ -0,0 +1,45 @@
|
||||
package api.hbm.entity;
|
||||
|
||||
public interface IRadarDetectableNT {
|
||||
|
||||
public static final int TIER0 = 0;
|
||||
public static final int TIER1 = 1;
|
||||
public static final int TIER2 = 2;
|
||||
public static final int TIER3 = 3;
|
||||
public static final int TIER4 = 4;
|
||||
public static final int TIER10 = 5;
|
||||
public static final int TIER10_15 = 6;
|
||||
public static final int TIER15 = 7;
|
||||
public static final int TIER15_20 = 8;
|
||||
public static final int TIER20 = 9;
|
||||
public static final int TIER_AB = 10;
|
||||
public static final int PLAYER = 11;
|
||||
public static final int ARTY = 12;
|
||||
/** Reserved type that shows a unique purple blip. Used for when nothing else applies. */
|
||||
public static final int SPECIAL = 13;
|
||||
|
||||
/** Name use for radar display, uses I18n for lookup */
|
||||
public String getUnlocalizedName();
|
||||
/** The type of dot to show on the radar as well as the redstone level in tier mode */
|
||||
public int getBlipLevel();
|
||||
/** Whether the object can be seen by this type of radar */
|
||||
public boolean canBeSeenBy(Object radar);
|
||||
/** Whether the object is currently visible, as well as whether the radar's setting allow for picking this up */
|
||||
public boolean paramsApplicable(RadarScanParams params);
|
||||
/** Whether this radar entry should be counted for the redstone output */
|
||||
public boolean suppliesRedstone(RadarScanParams params);
|
||||
|
||||
public static class RadarScanParams {
|
||||
public boolean scanMissiles = true;
|
||||
public boolean scanShells = true;
|
||||
public boolean scanPlayers = true;
|
||||
public boolean smartMode = true;
|
||||
|
||||
public RadarScanParams(boolean m, boolean s, boolean p, boolean smart) {
|
||||
this.scanMissiles = m;
|
||||
this.scanShells = s;
|
||||
this.scanPlayers = p;
|
||||
this.smartMode = smart;
|
||||
}
|
||||
}
|
||||
}
|
||||
66
src/main/java/api/hbm/entity/RadarEntry.java
Normal file
66
src/main/java/api/hbm/entity/RadarEntry.java
Normal file
@ -0,0 +1,66 @@
|
||||
package api.hbm.entity;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class RadarEntry {
|
||||
|
||||
/** Name use for radar display, uses I18n for lookup */
|
||||
public String unlocalizedName;
|
||||
/** The type of dot to show on the radar as well as the redstone level in tier mode */
|
||||
public int blipLevel;
|
||||
public int posX;
|
||||
public int posY;
|
||||
public int posZ;
|
||||
public int dim;
|
||||
public int entityID;
|
||||
/** Whether this radar entry should be counted for the redstone output */
|
||||
public boolean redstone;
|
||||
|
||||
public RadarEntry() { } //blank ctor for packets
|
||||
|
||||
public RadarEntry(String name, int level, int x, int y, int z, int dim, int entityID, boolean redstone) {
|
||||
this.unlocalizedName = name;
|
||||
this.blipLevel = level;
|
||||
this.posX = x;
|
||||
this.posY = y;
|
||||
this.posZ = z;
|
||||
this.dim = dim;
|
||||
this.entityID = entityID;
|
||||
this.redstone = redstone;
|
||||
}
|
||||
|
||||
public RadarEntry(IRadarDetectableNT detectable, Entity entity, boolean redstone) {
|
||||
this(detectable.getUnlocalizedName(), detectable.getBlipLevel(), (int) Math.floor(entity.posX), (int) Math.floor(entity.posY), (int) Math.floor(entity.posZ), entity.dimension, entity.getEntityId(), redstone);
|
||||
}
|
||||
|
||||
public RadarEntry(IRadarDetectable detectable, Entity entity) {
|
||||
this(detectable.getTargetType().name, detectable.getTargetType().ordinal(), (int) Math.floor(entity.posX), (int) Math.floor(entity.posY), (int) Math.floor(entity.posZ), entity.dimension, entity.getEntityId(), entity.motionY < 0);
|
||||
}
|
||||
|
||||
public RadarEntry(EntityPlayer player) {
|
||||
this(player.getDisplayName(), IRadarDetectableNT.PLAYER, (int) Math.floor(player.posX), (int) Math.floor(player.posY), (int) Math.floor(player.posZ), player.dimension, player.getEntityId(), true);
|
||||
}
|
||||
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
this.unlocalizedName = ByteBufUtils.readUTF8String(buf);
|
||||
this.blipLevel = buf.readShort();
|
||||
this.posX = buf.readInt();
|
||||
this.posY = buf.readInt();
|
||||
this.posZ = buf.readInt();
|
||||
this.dim = buf.readShort();
|
||||
this.entityID = buf.readInt();
|
||||
}
|
||||
|
||||
public void toBytes(ByteBuf buf) {
|
||||
ByteBufUtils.writeUTF8String(buf, this.unlocalizedName);
|
||||
buf.writeShort(this.blipLevel);
|
||||
buf.writeInt(this.posX);
|
||||
buf.writeInt(this.posY);
|
||||
buf.writeInt(this.posZ);
|
||||
buf.writeShort(this.dim);
|
||||
buf.writeInt(this.entityID);
|
||||
}
|
||||
}
|
||||
@ -37,8 +37,11 @@ public interface IFluidUser extends IFluidConnector {
|
||||
|
||||
if(con.canConnect(type, dir.getOpposite())) {
|
||||
long toSend = this.getTotalFluidForSend(type, pressure);
|
||||
long transfer = toSend - con.transferFluid(type, pressure, toSend);
|
||||
this.removeFluidForTransfer(type, pressure, transfer);
|
||||
|
||||
if(toSend > 0) {
|
||||
long transfer = toSend - con.transferFluid(type, pressure, toSend);
|
||||
this.removeFluidForTransfer(type, pressure, transfer);
|
||||
}
|
||||
red = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,6 +106,8 @@ public class PipeNet implements IPipeNet {
|
||||
|
||||
public static long fairTransfer(List<IFluidConnector> subList, FluidType type, int pressure, long fill) {
|
||||
|
||||
if(fill <= 0) return 0;
|
||||
|
||||
List<Long> weight = new ArrayList();
|
||||
long totalReq = 0;
|
||||
|
||||
@ -127,14 +129,22 @@ public class PipeNet implements IPipeNet {
|
||||
|
||||
long given = (long) Math.floor(fraction * fill);
|
||||
|
||||
totalGiven += (given - con.transferFluid(type, pressure, given));
|
||||
|
||||
if(trackingInstances != null) {
|
||||
for(int j = 0; j < trackingInstances.size(); j++) {
|
||||
PipeNet net = trackingInstances.get(j);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss:SSS");
|
||||
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
log(net, sdf.format(new Date(System.currentTimeMillis())) + " Sending " + given + "mB to " + conToString(con));
|
||||
if(given > 0) {
|
||||
|
||||
totalGiven += (given - con.transferFluid(type, pressure, given));
|
||||
|
||||
if(con instanceof TileEntity) {
|
||||
TileEntity tile = (TileEntity) con;
|
||||
tile.getWorldObj().markTileEntityChunkModified(tile.xCoord, tile.yCoord, tile.zCoord, tile);
|
||||
}
|
||||
|
||||
if(trackingInstances != null) {
|
||||
for(int j = 0; j < trackingInstances.size(); j++) {
|
||||
PipeNet net = trackingInstances.get(j);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss:SSS");
|
||||
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
log(net, sdf.format(new Date(System.currentTimeMillis())) + " Sending " + given + "mB to " + conToString(con));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
96
src/main/java/com/hbm/blocks/BlockFallingNT.java
Normal file
96
src/main/java/com/hbm/blocks/BlockFallingNT.java
Normal file
@ -0,0 +1,96 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.entity.item.EntityFallingBlockNT;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockFallingNT extends Block {
|
||||
|
||||
public static boolean fallInstantly;
|
||||
|
||||
public BlockFallingNT() {
|
||||
super(Material.sand);
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
}
|
||||
|
||||
public BlockFallingNT(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
if(!world.isRemote) {
|
||||
this.fall(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
protected void fall(World world, int x, int y, int z) {
|
||||
|
||||
if(canFallThrough(world, x, y - 1, z) && y >= 0) {
|
||||
byte range = 32;
|
||||
|
||||
if(!fallInstantly && world.checkChunksExist(x - range, y - range, z - range, x + range, y + range, z + range)) {
|
||||
if(!world.isRemote) {
|
||||
EntityFallingBlockNT entityfallingblock = new EntityFallingBlockNT(world, x + 0.5D, y + 0.5D, z + 0.5D, this, world.getBlockMetadata(x, y, z));
|
||||
this.modifyFallingBlock(entityfallingblock);
|
||||
world.spawnEntityInWorld(entityfallingblock);
|
||||
}
|
||||
} else {
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
while(canFallThrough(world, x, y - 1, z) && y > 0) {
|
||||
--y;
|
||||
}
|
||||
|
||||
if(y > 0) {
|
||||
world.setBlock(x, y, z, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void modifyFallingBlock(EntityFallingBlockNT falling) { }
|
||||
|
||||
@Override
|
||||
public int tickRate(World world) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
public static boolean canFallThrough(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
if(block.isAir(world, x, y, z)) {
|
||||
return true;
|
||||
} else if(block == Blocks.fire) {
|
||||
return true;
|
||||
} else {
|
||||
Material material = block.getMaterial();
|
||||
return material == Material.water ? true : material == Material.lava;
|
||||
}
|
||||
}
|
||||
|
||||
public void onLand(World world, int x, int y, int z, int meta) { }
|
||||
|
||||
@SideOnly(Side.CLIENT) public boolean shouldOverrideRenderer() { return false; }
|
||||
@SideOnly(Side.CLIENT) public void overrideRenderer(EntityFallingBlockNT falling, RenderBlocks renderBlocks, Tessellator tessellator) { }
|
||||
}
|
||||
@ -1,38 +1,37 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import com.hbm.blocks.generic.*;
|
||||
import com.hbm.blocks.generic.BlockHazard.ExtDisplayEffect;
|
||||
import com.hbm.blocks.generic.BlockMotherOfAllOres.ItemRandomOreBlock;
|
||||
import com.hbm.blocks.BlockEnums.*;
|
||||
import com.hbm.blocks.bomb.*;
|
||||
import com.hbm.blocks.fluid.*;
|
||||
import com.hbm.blocks.gas.*;
|
||||
import com.hbm.blocks.generic.*;
|
||||
import com.hbm.blocks.generic.BlockHazard.ExtDisplayEffect;
|
||||
import com.hbm.blocks.generic.BlockMotherOfAllOres.ItemRandomOreBlock;
|
||||
import com.hbm.blocks.machine.*;
|
||||
import com.hbm.blocks.machine.pile.*;
|
||||
import com.hbm.blocks.machine.rbmk.*;
|
||||
import com.hbm.blocks.network.*;
|
||||
import com.hbm.blocks.rail.RailNarrowCurve;
|
||||
import com.hbm.blocks.rail.RailNarrowStraight;
|
||||
import com.hbm.blocks.rail.RailStandardBuffer;
|
||||
import com.hbm.blocks.rail.RailStandardCurve;
|
||||
import com.hbm.blocks.rail.RailStandardRamp;
|
||||
import com.hbm.blocks.rail.RailStandardStraight;
|
||||
import com.hbm.blocks.siege.*;
|
||||
import com.hbm.blocks.rail.*;
|
||||
import com.hbm.blocks.siege.SiegeCircuit;
|
||||
import com.hbm.blocks.siege.SiegeHole;
|
||||
import com.hbm.blocks.siege.SiegeInternal;
|
||||
import com.hbm.blocks.siege.SiegeShield;
|
||||
import com.hbm.blocks.test.*;
|
||||
import com.hbm.blocks.turret.*;
|
||||
import com.hbm.items.block.*;
|
||||
import com.hbm.items.bomb.*;
|
||||
import com.hbm.items.bomb.ItemPrototypeBlock;
|
||||
import com.hbm.items.special.ItemOreBlock;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityFileCabinet;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.*;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialLiquid;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
@ -133,6 +132,8 @@ public class ModBlocks {
|
||||
public static Block cluster_depth_iron;
|
||||
public static Block cluster_depth_titanium;
|
||||
public static Block cluster_depth_tungsten;
|
||||
|
||||
public static Block stone_keyhole;
|
||||
|
||||
public static Block stone_depth_nether;
|
||||
public static Block ore_depth_nether_neodymium;
|
||||
@ -304,6 +305,7 @@ public class ModBlocks {
|
||||
public static Block deco_emitter;
|
||||
public static Block part_emitter;
|
||||
public static Block deco_loot;
|
||||
public static Block pedestal;
|
||||
public static Block bobblehead;
|
||||
public static Block snowglobe;
|
||||
|
||||
@ -426,12 +428,8 @@ public class ModBlocks {
|
||||
public static Block brick_jungle_glyph;
|
||||
public static Block brick_jungle_circle;
|
||||
|
||||
public static Block brick_dungeon;
|
||||
public static Block brick_dungeon_flat;
|
||||
public static Block brick_dungeon_tile;
|
||||
public static Block brick_dungeon_circle;
|
||||
|
||||
public static Block brick_forgotten;
|
||||
public static Block brick_red;
|
||||
|
||||
public static Block deco_computer;
|
||||
|
||||
@ -596,7 +594,6 @@ public class ModBlocks {
|
||||
|
||||
public static Block boxcar;
|
||||
public static Block boat;
|
||||
public static Block bomber;
|
||||
|
||||
public static Block seal_frame;
|
||||
public static Block seal_controller;
|
||||
@ -608,9 +605,19 @@ public class ModBlocks {
|
||||
public static Block fire_door;
|
||||
public static Block transition_seal;
|
||||
|
||||
// 1.12.2 Doors
|
||||
public static Block secure_access_door;
|
||||
public static Block large_vehicle_door;
|
||||
public static Block qe_containment;
|
||||
public static Block qe_sliding_door;
|
||||
public static Block round_airlock_door;
|
||||
public static Block sliding_seal_door;
|
||||
public static Block water_door;
|
||||
|
||||
public static Block door_metal;
|
||||
public static Block door_office;
|
||||
public static Block door_bunker;
|
||||
public static Block door_red;
|
||||
|
||||
public static Block barbed_wire;
|
||||
public static Block barbed_wire_fire;
|
||||
@ -657,9 +664,11 @@ public class ModBlocks {
|
||||
public static Block nuke_custom;
|
||||
public static Block nuke_solinium;
|
||||
public static Block nuke_n2;
|
||||
public static Block nuke_n45;
|
||||
public static Block nuke_fstbmb;
|
||||
public static Block bomb_multi;
|
||||
|
||||
public static Block pump_steam;
|
||||
public static Block pump_electric;
|
||||
|
||||
public static Block heater_firebox;
|
||||
public static Block heater_oven;
|
||||
@ -717,8 +726,9 @@ public class ModBlocks {
|
||||
public static Block machine_generator;
|
||||
|
||||
public static Block machine_industrial_generator;
|
||||
|
||||
|
||||
public static Block machine_cyclotron;
|
||||
public static Block machine_exposure_chamber;
|
||||
|
||||
public static Block hadron_plating;
|
||||
public static Block hadron_plating_blue;
|
||||
@ -771,14 +781,17 @@ public class ModBlocks {
|
||||
public static Block capacitor_gold;
|
||||
public static Block capacitor_niobium;
|
||||
public static Block capacitor_tantalium;
|
||||
public static Block capacitor_schrabidate;
|
||||
|
||||
public static Block machine_coal_off;
|
||||
public static Block machine_coal_on;
|
||||
@Deprecated public static Block machine_coal_off;
|
||||
@Deprecated public static Block machine_coal_on;
|
||||
public static Block machine_wood_burner;
|
||||
|
||||
public static Block red_wire_coated;
|
||||
public static Block red_cable;
|
||||
public static Block red_cable_classic;
|
||||
public static Block red_cable_paintable;
|
||||
public static Block red_cable_gauge;
|
||||
public static Block red_connector;
|
||||
public static Block red_pylon;
|
||||
public static Block red_pylon_large;
|
||||
@ -799,8 +812,10 @@ public class ModBlocks {
|
||||
public static Block radio_torch_sender;
|
||||
public static Block radio_torch_receiver;
|
||||
public static Block radio_torch_counter;
|
||||
public static Block radio_telex;
|
||||
|
||||
public static Block conveyor;
|
||||
public static Block conveyor_express;
|
||||
//public static Block conveyor_classic;
|
||||
public static Block conveyor_double;
|
||||
public static Block conveyor_triple;
|
||||
@ -813,6 +828,13 @@ public class ModBlocks {
|
||||
public static Block crane_boxer;
|
||||
public static Block crane_unboxer;
|
||||
public static Block crane_splitter;
|
||||
|
||||
public static Block drone_waypoint;
|
||||
public static Block drone_crate;
|
||||
public static Block drone_waypoint_request;
|
||||
public static Block drone_dock;
|
||||
public static Block drone_crate_provider;
|
||||
public static Block drone_crate_requester;
|
||||
|
||||
public static Block fan;
|
||||
|
||||
@ -874,6 +896,7 @@ public class ModBlocks {
|
||||
public static Block cm_circuit;
|
||||
public static Block cm_port;
|
||||
public static Block custom_machine;
|
||||
public static Block cm_anchor;
|
||||
|
||||
public static Block pwr_fuel;
|
||||
public static Block pwr_control;
|
||||
@ -886,13 +909,13 @@ public class ModBlocks {
|
||||
public static Block pwr_controller;
|
||||
public static Block pwr_block;
|
||||
|
||||
public static Block reactor_element;
|
||||
public static Block reactor_control;
|
||||
public static Block reactor_hatch;
|
||||
public static Block reactor_ejector;
|
||||
public static Block reactor_inserter;
|
||||
public static Block reactor_conductor;
|
||||
public static Block reactor_computer;
|
||||
@Deprecated public static Block reactor_element;
|
||||
@Deprecated public static Block reactor_control;
|
||||
@Deprecated public static Block reactor_hatch;
|
||||
@Deprecated public static Block reactor_ejector;
|
||||
@Deprecated public static Block reactor_inserter;
|
||||
@Deprecated public static Block reactor_conductor;
|
||||
@Deprecated public static Block reactor_computer;
|
||||
|
||||
public static Block fusion_conductor;
|
||||
public static Block fusion_center;
|
||||
@ -974,6 +997,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block machine_flare;
|
||||
public static Block chimney_brick;
|
||||
public static Block chimney_industrial;
|
||||
|
||||
public static Block machine_refinery;
|
||||
public static Block machine_vacuum_distill;
|
||||
@ -1004,6 +1028,7 @@ public class ModBlocks {
|
||||
public static Block machine_condenser;
|
||||
public static Block machine_tower_small;
|
||||
public static Block machine_tower_large;
|
||||
public static Block machine_condenser_powered;
|
||||
|
||||
public static Block machine_electrolyser;
|
||||
|
||||
@ -1021,6 +1046,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block machine_assembler;
|
||||
public static Block machine_assemfac;
|
||||
public static Block machine_arc_welder;
|
||||
|
||||
public static Block machine_chemplant;
|
||||
public static Block machine_chemfac;
|
||||
@ -1039,8 +1065,9 @@ public class ModBlocks {
|
||||
public static Block launch_table;
|
||||
|
||||
public static Block soyuz_launcher;
|
||||
|
||||
|
||||
public static Block machine_radar;
|
||||
public static Block radar_screen;
|
||||
|
||||
public static Block machine_turbofan;
|
||||
public static Block machine_turbinegas;
|
||||
@ -1050,6 +1077,7 @@ public class ModBlocks {
|
||||
public static Block press_preheater;
|
||||
public static Block machine_press;
|
||||
public static Block machine_epress;
|
||||
public static Block machine_conveyor_press;
|
||||
|
||||
public static Block machine_siren;
|
||||
|
||||
@ -1076,8 +1104,9 @@ public class ModBlocks {
|
||||
|
||||
public static Block machine_waste_drum;
|
||||
public static Block machine_storage_drum;
|
||||
|
||||
|
||||
public static Block machine_autocrafter;
|
||||
public static Block machine_funnel;
|
||||
|
||||
public static Block anvil_iron;
|
||||
public static Block anvil_lead;
|
||||
@ -1142,9 +1171,14 @@ public class ModBlocks {
|
||||
public static Block rail_narrow_straight;
|
||||
public static Block rail_narrow_curve;
|
||||
public static Block rail_large_straight;
|
||||
public static Block rail_large_straight_short;
|
||||
public static Block rail_large_curve;
|
||||
public static Block rail_large_curve_7;
|
||||
public static Block rail_large_curve_9;
|
||||
public static Block rail_large_ramp;
|
||||
public static Block rail_large_buffer;
|
||||
public static Block rail_large_switch;
|
||||
public static Block rail_large_switch_flipped;
|
||||
|
||||
public static Block statue_elb;
|
||||
public static Block statue_elb_g;
|
||||
@ -1256,19 +1290,6 @@ public class ModBlocks {
|
||||
|
||||
public static Material materialGas = new MaterialGas();
|
||||
|
||||
public static Block.SoundType soundTypeGrate = new ModSoundType("metalBlock", 0.5F, 1.0F) {
|
||||
|
||||
@Override
|
||||
public String func_150496_b() {
|
||||
return Block.soundTypeMetal.func_150496_b();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBreakSound() {
|
||||
return "dig.stone";
|
||||
}
|
||||
};
|
||||
|
||||
private static void initializeBlock() {
|
||||
|
||||
test_render = new TestRender(Material.rock).setBlockName("test_render").setCreativeTab(null);
|
||||
@ -1355,6 +1376,8 @@ public class ModBlocks {
|
||||
cluster_depth_tungsten = new BlockDepthOre().setBlockName("cluster_depth_tungsten").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":cluster_depth_tungsten");
|
||||
ore_alexandrite = new BlockDepthOre().setBlockName("ore_alexandrite").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ore_alexandrite");
|
||||
|
||||
stone_keyhole = new BlockKeyhole().setBlockName("stone_keyhole").setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":stone_keyhole");
|
||||
|
||||
ore_random = new BlockMotherOfAllOres().setBlockName("ore_random").setCreativeTab(MainRegistry.blockTab);
|
||||
ore_bedrock = new BlockBedrockOreTE().setBlockName("ore_bedrock").setCreativeTab(null);
|
||||
ore_volcano = new BlockFissure().setBlockName("ore_volcano").setLightLevel(1F).setCreativeTab(MainRegistry.blockTab);
|
||||
@ -1531,6 +1554,7 @@ public class ModBlocks {
|
||||
deco_emitter = new BlockEmitter().setBlockName("deco_emitter").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(20.0F).setBlockTextureName(RefStrings.MODID + ":emitter");
|
||||
part_emitter = new PartEmitter().setBlockName("part_emitter").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(20.0F).setBlockTextureName(RefStrings.MODID + ":part_top");
|
||||
deco_loot = new BlockLoot().setBlockName("deco_loot").setCreativeTab(null).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
pedestal = new BlockPedestal().setBlockName("pedestal").setCreativeTab(null).setHardness(2.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":pedestal_top");
|
||||
bobblehead = new BlockBobble().setBlockName("bobblehead").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
snowglobe = new BlockSnowglobe().setBlockName("snowglobe").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":glass_boron");
|
||||
hazmat = new BlockGeneric(Material.cloth).setBlockName("hazmat").setStepSound(Block.soundTypeCloth).setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":hazmat");
|
||||
@ -1541,8 +1565,8 @@ public class ModBlocks {
|
||||
asphalt_light = new BlockSpeedy(Material.rock, 1.5).setBlockName("asphalt_light").setCreativeTab(MainRegistry.blockTab).setLightLevel(1F).setHardness(15.0F).setResistance(120.0F).setBlockTextureName(RefStrings.MODID + ":asphalt_light");
|
||||
|
||||
reinforced_brick = new BlockGeneric(Material.rock).setBlockName("reinforced_brick").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(300.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_brick");
|
||||
reinforced_glass = new BlockNTMGlassCT(0, RefStrings.MODID + ":reinforced_glass", Material.rock).setBlockName("reinforced_glass").setCreativeTab(MainRegistry.blockTab).setLightOpacity(0).setHardness(15.0F).setResistance(25.0F);
|
||||
reinforced_glass_pane = new BlockNTMGlassPane(0, RefStrings.MODID + ":reinforced_glass_pane", RefStrings.MODID + ":reinforced_glass_pane_edge", Material.rock, false).setBlockName("reinforced_glass_pane").setCreativeTab(MainRegistry.blockTab).setLightOpacity(1).setHardness(15.0F).setResistance(200.0F);
|
||||
reinforced_glass = new BlockNTMGlassCT(0, RefStrings.MODID + ":reinforced_glass", Material.rock).setBlockName("reinforced_glass").setCreativeTab(MainRegistry.blockTab).setLightOpacity(0).setHardness(2.0F).setResistance(25.0F);
|
||||
reinforced_glass_pane = new BlockNTMGlassPane(0, RefStrings.MODID + ":reinforced_glass_pane", RefStrings.MODID + ":reinforced_glass_pane_edge", Material.rock, false).setBlockName("reinforced_glass_pane").setCreativeTab(MainRegistry.blockTab).setLightOpacity(1).setHardness(2.0F).setResistance(25.0F);
|
||||
reinforced_light = new BlockGeneric(Material.rock).setBlockName("reinforced_light").setCreativeTab(MainRegistry.blockTab).setLightLevel(1.0F).setHardness(15.0F).setResistance(80.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_light");
|
||||
reinforced_sand = new BlockGeneric(Material.rock).setBlockName("reinforced_sand").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(40.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_sand");
|
||||
reinforced_lamp_off = new ReinforcedLamp(Material.rock, false).setBlockName("reinforced_lamp_off").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(80.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_lamp_off");
|
||||
@ -1649,13 +1673,9 @@ public class ModBlocks {
|
||||
brick_jungle_trap = new TrappedBrick(Material.rock).setBlockName("brick_jungle_trap").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(360.0F).setBlockTextureName(RefStrings.MODID + ":brick_jungle_trap");
|
||||
brick_jungle_glyph = new BlockGlyph(Material.rock).setBlockName("brick_jungle_glyph").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(360.0F);
|
||||
brick_jungle_circle = new BlockBallsSpawner(Material.rock).setBlockName("brick_jungle_circle").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(360.0F).setBlockTextureName(RefStrings.MODID + ":brick_jungle_circle");
|
||||
|
||||
brick_dungeon = new BlockGeneric(Material.rock).setBlockName("brick_dungeon").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":brick_dungeon");
|
||||
brick_dungeon_flat = new BlockGeneric(Material.rock).setBlockName("brick_dungeon_flat").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":brick_dungeon_flat");
|
||||
brick_dungeon_tile = new BlockGeneric(Material.rock).setBlockName("brick_dungeon_tile").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":brick_dungeon_tile");
|
||||
brick_dungeon_circle = new BlockGeneric(Material.rock).setBlockName("brick_dungeon_circle").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":brick_dungeon_circle");
|
||||
|
||||
brick_forgotten = new BlockGeneric(Material.rock).setBlockName("brick_forgotten").setCreativeTab(MainRegistry.blockTab).setBlockUnbreakable().setResistance(1000000).setBlockTextureName(RefStrings.MODID + ":brick_forgotten");
|
||||
brick_red = new BlockRedBrick(Material.rock).setBlockName("brick_red").setResistance(10_000);
|
||||
|
||||
deco_computer = new BlockDecoModel(Material.iron, DecoComputerEnum.class, true, false).setBlockBoundsTo(.160749F, 0F, 0F, .839251F, .867849F, .622184F).setBlockName("deco_computer").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_computer");
|
||||
filing_cabinet = new BlockDecoContainer(Material.iron, DecoCabinetEnum.class, true, false, TileEntityFileCabinet.class).setBlockBoundsTo(.1875F, 0F, 0F, .8125F, 1F, .75F).setBlockName("filing_cabinet").setCreativeTab(MainRegistry.blockTab).setHardness(10.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -1669,33 +1689,33 @@ public class ModBlocks {
|
||||
steel_roof = new DecoBlock(Material.iron).setBlockName("steel_roof").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_roof");
|
||||
steel_beam = new DecoBlock(Material.iron).setBlockName("steel_beam").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_beam");
|
||||
steel_scaffold = new BlockScaffold().setBlockName("steel_scaffold").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_steel_orig");
|
||||
steel_grate = new BlockGrate(Material.iron).setBlockName("steel_grate").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F);
|
||||
steel_grate_wide = new BlockGrate(Material.iron).setBlockName("steel_grate_wide").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F);
|
||||
steel_grate = new BlockGrate(Material.iron).setBlockName("steel_grate").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F);
|
||||
steel_grate_wide = new BlockGrate(Material.iron).setBlockName("steel_grate_wide").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F);
|
||||
|
||||
deco_pipe = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side", 0).setBlockName("deco_pipe").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top");
|
||||
deco_pipe_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_rusty", 0).setBlockName("deco_pipe_rusted").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_rusty");
|
||||
deco_pipe_green = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green", 0).setBlockName("deco_pipe_green").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green");
|
||||
deco_pipe_green_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green_rusty", 0).setBlockName("deco_pipe_green_rusted").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green_rusty");
|
||||
deco_pipe_red = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_red", 0).setBlockName("deco_pipe_red").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_red");
|
||||
deco_pipe_marked = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_marked", 0).setBlockName("deco_pipe_marked").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_marked");
|
||||
deco_pipe_rim = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side", 1).setBlockName("deco_pipe_rim").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top");
|
||||
deco_pipe_rim_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_rusty", 1).setBlockName("deco_pipe_rim_rusted").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_rusty");
|
||||
deco_pipe_rim_green = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green", 1).setBlockName("deco_pipe_rim_green").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green");
|
||||
deco_pipe_rim_green_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green_rusty", 1).setBlockName("deco_pipe_rim_green_rusted").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green_rusty");
|
||||
deco_pipe_rim_red = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_red", 1).setBlockName("deco_pipe_rim_red").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_red");
|
||||
deco_pipe_rim_marked = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_marked", 1).setBlockName("deco_pipe_rim_marked").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_marked");
|
||||
deco_pipe_framed = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side", 3).setBlockName("deco_pipe_framed").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top");
|
||||
deco_pipe_framed_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_rusty", 3).setBlockName("deco_pipe_framed_rusted").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_rusty");
|
||||
deco_pipe_framed_green = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green", 3).setBlockName("deco_pipe_framed_green").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green");
|
||||
deco_pipe_framed_green_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green_rusty", 3).setBlockName("deco_pipe_framed_green_rusted").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green_rusty");
|
||||
deco_pipe_framed_red = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_red", 3).setBlockName("deco_pipe_framed_red").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_red");
|
||||
deco_pipe_framed_marked = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_marked", 3).setBlockName("deco_pipe_framed_marked").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_marked");
|
||||
deco_pipe_quad = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side", 2).setBlockName("deco_pipe_quad").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top");
|
||||
deco_pipe_quad_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_rusty", 2).setBlockName("deco_pipe_quad_rusted").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_rusty");
|
||||
deco_pipe_quad_green = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green", 2).setBlockName("deco_pipe_quad_green").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green");
|
||||
deco_pipe_quad_green_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green_rusty", 2).setBlockName("deco_pipe_quad_green_rusted").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green_rusty");
|
||||
deco_pipe_quad_red = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_red", 2).setBlockName("deco_pipe_quad_red").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_red");
|
||||
deco_pipe_quad_marked = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_marked", 2).setBlockName("deco_pipe_quad_marked").setStepSound(soundTypeGrate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_marked");
|
||||
deco_pipe = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side", 0).setBlockName("deco_pipe").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top");
|
||||
deco_pipe_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_rusty", 0).setBlockName("deco_pipe_rusted").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_rusty");
|
||||
deco_pipe_green = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green", 0).setBlockName("deco_pipe_green").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green");
|
||||
deco_pipe_green_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green_rusty", 0).setBlockName("deco_pipe_green_rusted").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green_rusty");
|
||||
deco_pipe_red = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_red", 0).setBlockName("deco_pipe_red").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_red");
|
||||
deco_pipe_marked = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_marked", 0).setBlockName("deco_pipe_marked").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_marked");
|
||||
deco_pipe_rim = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side", 1).setBlockName("deco_pipe_rim").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top");
|
||||
deco_pipe_rim_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_rusty", 1).setBlockName("deco_pipe_rim_rusted").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_rusty");
|
||||
deco_pipe_rim_green = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green", 1).setBlockName("deco_pipe_rim_green").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green");
|
||||
deco_pipe_rim_green_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green_rusty", 1).setBlockName("deco_pipe_rim_green_rusted").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green_rusty");
|
||||
deco_pipe_rim_red = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_red", 1).setBlockName("deco_pipe_rim_red").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_red");
|
||||
deco_pipe_rim_marked = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_marked", 1).setBlockName("deco_pipe_rim_marked").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_marked");
|
||||
deco_pipe_framed = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side", 3).setBlockName("deco_pipe_framed").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top");
|
||||
deco_pipe_framed_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_rusty", 3).setBlockName("deco_pipe_framed_rusted").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_rusty");
|
||||
deco_pipe_framed_green = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green", 3).setBlockName("deco_pipe_framed_green").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green");
|
||||
deco_pipe_framed_green_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green_rusty", 3).setBlockName("deco_pipe_framed_green_rusted").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green_rusty");
|
||||
deco_pipe_framed_red = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_red", 3).setBlockName("deco_pipe_framed_red").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_red");
|
||||
deco_pipe_framed_marked = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_marked", 3).setBlockName("deco_pipe_framed_marked").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_marked");
|
||||
deco_pipe_quad = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side", 2).setBlockName("deco_pipe_quad").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top");
|
||||
deco_pipe_quad_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_rusty", 2).setBlockName("deco_pipe_quad_rusted").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_rusty");
|
||||
deco_pipe_quad_green = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green", 2).setBlockName("deco_pipe_quad_green").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green");
|
||||
deco_pipe_quad_green_rusted = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_green_rusty", 2).setBlockName("deco_pipe_quad_green_rusted").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_green_rusty");
|
||||
deco_pipe_quad_red = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_red", 2).setBlockName("deco_pipe_quad_red").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_red");
|
||||
deco_pipe_quad_marked = new BlockPipe(Material.iron, RefStrings.MODID + ":pipe_side_marked", 2).setBlockName("deco_pipe_quad_marked").setStepSound(ModSoundTypes.grate).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":pipe_top_marked");
|
||||
|
||||
broadcaster_pc = new PinkCloudBroadcaster(Material.iron).setBlockName("broadcaster_pc").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":broadcaster_pc");
|
||||
geiger = new GeigerCounter(Material.iron).setBlockName("geiger").setCreativeTab(MainRegistry.machineTab).setHardness(15.0F).setResistance(0.25F).setBlockTextureName(RefStrings.MODID + ":geiger");
|
||||
@ -1722,8 +1742,8 @@ public class ModBlocks {
|
||||
mush = new BlockMush(Material.plants).setBlockName("mush").setCreativeTab(MainRegistry.blockTab).setLightLevel(0.5F).setStepSound(Block.soundTypeGrass).setBlockTextureName(RefStrings.MODID + ":mush");
|
||||
mush_block = new BlockMushHuge(Material.plants).setBlockName("mush_block").setLightLevel(1.0F).setStepSound(Block.soundTypeGrass).setHardness(0.2F).setBlockTextureName(RefStrings.MODID + ":mush_block_skin");
|
||||
mush_block_stem = new BlockMushHuge(Material.plants).setBlockName("mush_block_stem").setLightLevel(1.0F).setStepSound(Block.soundTypeGrass).setHardness(0.2F).setBlockTextureName(RefStrings.MODID + ":mush_block_stem");
|
||||
glyphid_base = new BlockBase(Material.coral).setBlockName("glyphid_base").setStepSound(Block.soundTypeCloth).setHardness(0.5F);
|
||||
glyphid_spawner = new BlockGlyphidSpawner(Material.coral).setBlockName("glyphid_spawner").setStepSound(Block.soundTypeCloth).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":glyphid_base");
|
||||
glyphid_base = new BlockGlyphid(Material.coral).setBlockName("glyphid_base").setStepSound(Block.soundTypeCloth).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":glyphid_base");
|
||||
glyphid_spawner = new BlockGlyphidSpawner(Material.coral).setBlockName("glyphid_spawner").setStepSound(Block.soundTypeCloth).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":glyphid_eggs_alt");
|
||||
|
||||
plant_flower = new BlockNTMFlower().setBlockName("plant_flower").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.0F);
|
||||
plant_tall = new BlockTallPlant().setBlockName("plant_tall").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.0F);
|
||||
@ -1783,7 +1803,6 @@ public class ModBlocks {
|
||||
nuke_custom = new NukeCustom(Material.iron).setBlockName("nuke_custom").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(200.0F).setBlockTextureName(RefStrings.MODID + ":custom");
|
||||
nuke_solinium = new NukeSolinium(Material.iron).setBlockName("nuke_solinium").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(200.0F).setBlockTextureName(RefStrings.MODID + ":nuke_solinium");
|
||||
nuke_n2 = new NukeN2(Material.iron).setBlockName("nuke_n2").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(200.0F).setBlockTextureName(RefStrings.MODID + ":nuke_n2");
|
||||
nuke_n45 = new NukeN45(Material.iron).setBlockName("nuke_n45").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(200.0F).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
nuke_fstbmb = new NukeBalefire(Material.iron).setBlockName("nuke_fstbmb").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(200.0F).setBlockTextureName(RefStrings.MODID + ":nuke_fstbmb");
|
||||
|
||||
bomb_multi = new BombMulti(Material.iron).setBlockName("bomb_multi").setCreativeTab(MainRegistry.nukeTab).setResistance(200.0F).setBlockTextureName(RefStrings.MODID + ":bomb_multi1");
|
||||
@ -1819,6 +1838,9 @@ public class ModBlocks {
|
||||
semtex = new BlockSemtex().setBlockName("semtex").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":semtex");
|
||||
c4 = new BlockC4().setBlockName("c4").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":c4");
|
||||
fissure_bomb = new BlockFissureBomb().setBlockName("fissure_bomb").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":fissure_bomb");
|
||||
|
||||
pump_steam = new MachinePump().setBlockName("pump_steam").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
pump_electric = new MachinePump().setBlockName("pump_electric").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
heater_firebox = new HeaterFirebox().setBlockName("heater_firebox").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
heater_oven = new HeaterOven().setBlockName("heater_oven").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
@ -1873,6 +1895,7 @@ public class ModBlocks {
|
||||
machine_generator = new MachineGenerator(Material.iron).setBlockName("machine_generator").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null);
|
||||
machine_industrial_generator = new MachineIGenerator(Material.iron).setBlockName("machine_industrial_generator").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":industrial_generator");
|
||||
machine_cyclotron = new MachineCyclotron(Material.iron).setBlockName("machine_cyclotron").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cyclotron");
|
||||
machine_exposure_chamber = new MachineExposureChamber(Material.iron).setBlockName("machine_exposure_chamber").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_aluminium");
|
||||
machine_radgen = new MachineRadGen(Material.iron).setBlockName("machine_radgen").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_radgen");
|
||||
|
||||
hadron_plating = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating");
|
||||
@ -1881,7 +1904,7 @@ public class ModBlocks {
|
||||
hadron_plating_yellow = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_yellow").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_yellow");
|
||||
hadron_plating_striped = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_striped").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_striped");
|
||||
hadron_plating_voltz = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_voltz").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_voltz");
|
||||
hadron_plating_glass = new BlockNTMGlass(0, RefStrings.MODID + ":hadron_plating_glass", Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_glass");
|
||||
hadron_plating_glass = new BlockNTMGlass(0, RefStrings.MODID + ":hadron_plating_glass", Material.iron, true).setStepSound(Block.soundTypeMetal).setBlockName("hadron_plating_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_plating_glass");
|
||||
hadron_coil_alloy = new BlockHadronCoil(Material.iron, 10).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_alloy").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_alloy");
|
||||
hadron_coil_gold = new BlockHadronCoil(Material.iron, 25).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_gold").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_gold");
|
||||
hadron_coil_neodymium = new BlockHadronCoil(Material.iron, 50).setStepSound(Block.soundTypeMetal).setBlockName("hadron_coil_neodymium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_coil_neodymium");
|
||||
@ -1898,7 +1921,7 @@ public class ModBlocks {
|
||||
hadron_power_10g = new BlockHadronPower(Material.iron, 10000000000L).setStepSound(Block.soundTypeMetal).setBlockName("hadron_power_10g").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_power");
|
||||
hadron_diode = new BlockHadronDiode(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_diode").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
hadron_analysis = new BlockHadronPlating(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_analysis").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_analysis");
|
||||
hadron_analysis_glass = new BlockNTMGlass(0, RefStrings.MODID + ":hadron_analysis_glass", Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_analysis_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_analysis_glass");
|
||||
hadron_analysis_glass = new BlockNTMGlass(0, RefStrings.MODID + ":hadron_analysis_glass", Material.iron, true).setStepSound(Block.soundTypeMetal).setBlockName("hadron_analysis_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_analysis_glass");
|
||||
hadron_access = new BlockHadronAccess(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_access").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_access");
|
||||
hadron_core = new BlockHadronCore(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_core");
|
||||
hadron_cooler = new BlockHadronCooler(Material.iron).setBlockName("hadron_cooler").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
|
||||
@ -1922,10 +1945,12 @@ public class ModBlocks {
|
||||
capacitor_copper = new MachineCapacitor(Material.iron, 1_000_000L, "copper").setBlockName("capacitor_copper").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
capacitor_gold = new MachineCapacitor(Material.iron, 5_000_000L, "gold").setBlockName("capacitor_gold").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName("gold_block");
|
||||
capacitor_niobium = new MachineCapacitor(Material.iron, 25_000_000L, "niobium").setBlockName("capacitor_niobium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_niobium");
|
||||
capacitor_tantalium = new MachineCapacitor(Material.iron, 100_000_000L, "tantalium").setBlockName("capacitor_tantalium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_tantalium");
|
||||
capacitor_tantalium = new MachineCapacitor(Material.iron, 150_000_000L, "tantalium").setBlockName("capacitor_tantalium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_tantalium");
|
||||
capacitor_schrabidate = new MachineCapacitor(Material.iron, 50_000_000_000L, "schrabidate").setBlockName("capacitor_schrabidate").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_schrabidate");
|
||||
|
||||
machine_coal_off = new MachineCoal(false).setBlockName("machine_coal_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_coal_on = new MachineCoal(true).setBlockName("machine_coal_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
machine_coal_off = new MachineCoal(false).setBlockName("machine_coal_off").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
machine_coal_on = new MachineCoal(true).setBlockName("machine_coal_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
machine_wood_burner = new MachineWoodBurner(Material.iron).setBlockName("machine_wood_burner").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
machine_diesel = new MachineDiesel().setBlockName("machine_diesel").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_combustion_engine = new MachineCombustionEngine().setBlockName("machine_combustion_engine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -1951,6 +1976,7 @@ public class ModBlocks {
|
||||
red_cable = new BlockCable(Material.iron).setBlockName("red_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cable_neo");
|
||||
red_cable_classic = new BlockCable(Material.iron).setBlockName("red_cable_classic").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_cable_classic");
|
||||
red_cable_paintable = new BlockCablePaintable().setBlockName("red_cable_paintable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
red_cable_gauge = new BlockCableGauge().setBlockName("red_cable_gauge").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
red_connector = new ConnectorRedWire(Material.iron).setBlockName("red_connector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_connector");
|
||||
red_pylon = new PylonRedWire(Material.iron).setBlockName("red_pylon").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_pylon");
|
||||
red_pylon_large = new PylonLarge(Material.iron).setBlockName("red_pylon_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_pylon_large");
|
||||
@ -1961,9 +1987,9 @@ public class ModBlocks {
|
||||
machine_detector = new PowerDetector(Material.iron).setBlockName("machine_detector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_detector_off");
|
||||
fluid_duct = new BlockFluidDuct(Material.iron).setBlockName("fluid_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":fluid_duct_icon");
|
||||
fluid_duct_solid = new BlockFluidDuctSolid(Material.iron).setBlockName("fluid_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":fluid_duct_solid");
|
||||
fluid_duct_neo = new FluidDuctStandard(Material.iron).setBlockName("fluid_duct_neo").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":pipe_neo");
|
||||
fluid_duct_box = new FluidDuctBox(Material.iron).setBlockName("fluid_duct_box").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_box");
|
||||
fluid_duct_exhaust = new FluidDuctBoxExhaust(Material.iron).setBlockName("fluid_duct_exhaust").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_box");
|
||||
fluid_duct_neo = new FluidDuctStandard(Material.iron).setBlockName("fluid_duct_neo").setStepSound(ModSoundTypes.pipe).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":pipe_neo");
|
||||
fluid_duct_box = new FluidDuctBox(Material.iron).setBlockName("fluid_duct_box").setStepSound(ModSoundTypes.pipe).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_box");
|
||||
fluid_duct_exhaust = new FluidDuctBoxExhaust(Material.iron).setBlockName("fluid_duct_exhaust").setStepSound(ModSoundTypes.pipe).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_box");
|
||||
fluid_duct_paintable = new FluidDuctPaintable().setBlockName("fluid_duct_paintable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
fluid_duct_gauge = new FluidDuctGauge().setBlockName("fluid_duct_gauge").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
fluid_valve = new FluidValve(Material.iron).setBlockName("fluid_valve").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
@ -1971,8 +1997,10 @@ public class ModBlocks {
|
||||
radio_torch_sender = new RadioTorchSender().setBlockName("radio_torch_sender").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
radio_torch_receiver = new RadioTorchReceiver().setBlockName("radio_torch_receiver").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
radio_torch_counter = new RadioTorchCounter().setBlockName("radio_torch_counter").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rtty_counter");
|
||||
radio_telex = new RadioTelex().setBlockName("radio_telex").setHardness(3F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":radio_telex");
|
||||
|
||||
conveyor = new BlockConveyor().setBlockName("conveyor").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor");
|
||||
conveyor_express = new BlockConveyorExpress().setBlockName("conveyor_express").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor_express");
|
||||
//conveyor_classic = new BlockConveyorClassic().setBlockName("conveyor_classic").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor");
|
||||
conveyor_double = new BlockConveyorDouble().setBlockName("conveyor_double").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor_double");
|
||||
conveyor_triple = new BlockConveyorTriple().setBlockName("conveyor_triple").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor_triple");
|
||||
@ -1988,6 +2016,13 @@ public class ModBlocks {
|
||||
fan = new MachineFan().setBlockName("fan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
piston_inserter = new PistonInserter().setBlockName("piston_inserter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
drone_waypoint = new DroneWaypoint().setBlockName("drone_waypoint").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":drone_waypoint");
|
||||
drone_crate = new DroneCrate().setBlockName("drone_crate").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
drone_waypoint_request = new DroneWaypointRequest().setBlockName("drone_waypoint_request").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":drone_waypoint_request");
|
||||
drone_dock = new DroneDock().setBlockName("drone_dock").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":drone_dock");
|
||||
drone_crate_provider = new DroneDock().setBlockName("drone_crate_provider").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":drone_crate_provider");
|
||||
drone_crate_requester = new DroneDock().setBlockName("drone_crate_requester").setHardness(0.1F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":drone_crate_requester");
|
||||
|
||||
chain = new BlockChain(Material.iron).setBlockName("dungeon_chain").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":chain");
|
||||
|
||||
ladder_sturdy = new BlockNTMLadder().setBlockName("ladder_sturdy").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ladder_sturdy");
|
||||
@ -2043,6 +2078,7 @@ public class ModBlocks {
|
||||
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);
|
||||
cm_anchor = new BlockCMAnchor().setBlockName("custom_machine_anchor").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F);
|
||||
|
||||
pwr_fuel = new BlockPillarPWR(Material.iron, RefStrings.MODID + ":pwr_fuel_top").setBlockName("pwr_fuel").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":pwr_fuel_side");
|
||||
pwr_control = new BlockPillarPWR(Material.iron, RefStrings.MODID + ":pwr_control_top").setBlockName("pwr_control").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":pwr_control_side");
|
||||
@ -2055,20 +2091,19 @@ public class ModBlocks {
|
||||
pwr_controller = new MachinePWRController(Material.iron).setBlockName("pwr_controller").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":pwr_casing_blank");
|
||||
pwr_block = new BlockPWR(Material.iron).setBlockName("pwr_block").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pwr_block");
|
||||
|
||||
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");
|
||||
reactor_hatch = new ReactorHatch(Material.iron).setBlockName("reactor_hatch").setHardness(5.0F).setResistance(1000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
reactor_ejector = new BlockRotatable(Material.iron).setBlockName("reactor_ejector").setHardness(5.0F).setResistance(1000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
reactor_inserter = new BlockRotatable(Material.iron).setBlockName("reactor_inserter").setHardness(5.0F).setResistance(1000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
reactor_conductor = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_conductor_top").setBlockName("reactor_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":reactor_conductor_side");
|
||||
reactor_computer = new ReactorCore(Material.iron).setBlockName("reactor_computer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":reactor_computer");
|
||||
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).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).setBlockTextureName(RefStrings.MODID + ":reactor_control_side");
|
||||
reactor_hatch = new ReactorHatch(Material.iron).setBlockName("reactor_hatch").setHardness(5.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
reactor_ejector = new BlockRotatable(Material.iron).setBlockName("reactor_ejector").setHardness(5.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
reactor_inserter = new BlockRotatable(Material.iron).setBlockName("reactor_inserter").setHardness(5.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
reactor_conductor = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_conductor_top").setBlockName("reactor_conductor").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":reactor_conductor_side");
|
||||
reactor_computer = new ReactorCore(Material.iron).setBlockName("reactor_computer").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":reactor_computer");
|
||||
|
||||
fusion_conductor = new BlockToolConversionPillar(Material.iron).addVariant("_welded").setBlockName("fusion_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fusion_conductor");
|
||||
fusion_center = new BlockPillar(Material.iron, RefStrings.MODID + ":fusion_center_top_alt").setBlockName("fusion_center").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fusion_center_side_alt");
|
||||
fusion_motor = new BlockPillar(Material.iron, RefStrings.MODID + ":fusion_motor_top_alt").setBlockName("fusion_motor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fusion_motor_side_alt");
|
||||
fusion_heater = new BlockPillar(Material.iron, RefStrings.MODID + ":fusion_heater_top").setBlockName("fusion_heater").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fusion_heater_side");
|
||||
fusion_hatch = new FusionHatch(Material.iron).setBlockName("fusion_hatch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fusion_hatch");
|
||||
//fusion_core = new FusionCore(Material.iron).setBlockName("fusion_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":fusion_core_side");
|
||||
plasma = new BlockPlasma(Material.iron).setBlockName("plasma").setHardness(5.0F).setResistance(6000.0F).setLightLevel(1.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":plasma");
|
||||
iter = new MachineITER().setBlockName("iter").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":iter");
|
||||
plasma_heater = new MachinePlasmaHeater().setBlockName("plasma_heater").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":plasma_heater");
|
||||
@ -2113,17 +2148,24 @@ public class ModBlocks {
|
||||
seal_controller = new BlockSeal(Material.iron).setBlockName("seal_controller").setHardness(10.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
seal_hatch = new BlockHatch(Material.iron).setBlockName("seal_hatch").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":seal_hatch_3");
|
||||
|
||||
vault_door = new VaultDoor(Material.iron).setBlockName("vault_door").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":vault_door");
|
||||
blast_door = new BlastDoor(Material.iron).setBlockName("blast_door").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":blast_door");
|
||||
vault_door = new VaultDoor(Material.iron).setBlockName("vault_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":vault_door");
|
||||
blast_door = new BlastDoor(Material.iron).setBlockName("blast_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":blast_door");
|
||||
|
||||
sliding_blast_door = new BlockDoorGeneric(Material.iron, DoorDecl.SLIDE_DOOR).setBlockName("sliding_blast_door").setHardness(150.0F).setResistance(7500.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":sliding_blast_door");
|
||||
|
||||
fire_door = new BlockDoorGeneric(Material.iron, DoorDecl.FIRE_DOOR).setBlockName("fire_door").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fire_door");
|
||||
transition_seal = new BlockDoorGeneric(Material.iron, DoorDecl.TRANSITION_SEAL).setBlockName("transition_seal").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":transition_seal");
|
||||
sliding_blast_door = new BlockDoorGeneric(Material.iron, DoorDecl.SLIDE_DOOR).setBlockName("sliding_blast_door").setHardness(10.0F).setResistance(750.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":sliding_blast_door");
|
||||
fire_door = new BlockDoorGeneric(Material.iron, DoorDecl.FIRE_DOOR).setBlockName("fire_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fire_door");
|
||||
transition_seal = new BlockDoorGeneric(Material.iron, DoorDecl.TRANSITION_SEAL).setBlockName("transition_seal").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":transition_seal");
|
||||
secure_access_door = new BlockDoorGeneric(Material.iron, DoorDecl.SECURE_ACCESS_DOOR).setBlockName("secure_access_door").setHardness(20.0F).setResistance(2_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
large_vehicle_door = new BlockDoorGeneric(Material.iron, DoorDecl.LARGE_VEHICLE_DOOR).setBlockName("large_vehicle_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
qe_containment = new BlockDoorGeneric(Material.iron, DoorDecl.QE_CONTAINMENT).setBlockName("qe_containment").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
qe_sliding_door = new BlockDoorGeneric(Material.iron, DoorDecl.QE_SLIDING).setBlockName("qe_sliding_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
round_airlock_door = new BlockDoorGeneric(Material.iron, DoorDecl.ROUND_AIRLOCK_DOOR).setBlockName("round_airlock_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
sliding_seal_door = new BlockDoorGeneric(Material.iron, DoorDecl.SLIDING_SEAL_DOOR).setBlockName("sliding_seal_door").setHardness(10.0F).setResistance(1_000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
water_door = new BlockDoorGeneric(Material.iron, DoorDecl.WATER_DOOR).setBlockName("water_door").setHardness(5.0F).setResistance(50.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
door_metal = new BlockModDoor(Material.iron).setBlockName("door_metal").setHardness(5.0F).setResistance(5.0F).setBlockTextureName(RefStrings.MODID + ":door_metal");
|
||||
door_office = new BlockModDoor(Material.iron).setBlockName("door_office").setHardness(10.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":door_office");
|
||||
door_bunker = new BlockModDoor(Material.iron).setBlockName("door_bunker").setHardness(10.0F).setResistance(100.0F).setBlockTextureName(RefStrings.MODID + ":door_bunker");
|
||||
door_red = new BlockModDoor(Material.iron).setBlockName("door_red").setHardness(10.0F).setResistance(100.0F).setBlockTextureName(RefStrings.MODID + ":door_red");
|
||||
|
||||
barbed_wire = new BarbedWire(Material.iron).setBlockName("barbed_wire").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":barbed_wire_model");
|
||||
barbed_wire_fire = new BarbedWire(Material.iron).setBlockName("barbed_wire_fire").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":barbed_wire_fire_model");
|
||||
@ -2143,6 +2185,7 @@ public class ModBlocks {
|
||||
|
||||
launch_pad = new LaunchPad(Material.iron).setBlockName("launch_pad").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":launch_pad");
|
||||
machine_radar = new MachineRadar(Material.iron).setBlockName("machine_radar").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":machine_radar");
|
||||
radar_screen = new MachineRadarScreen(Material.iron).setBlockName("radar_screen").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
machine_missile_assembly = new MachineMissileAssembly(Material.iron).setBlockName("machine_missile_assembly").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":machine_missile_assembly");
|
||||
compact_launcher = new CompactLauncher(Material.iron).setBlockName("compact_launcher").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":compact_launcher");
|
||||
@ -2208,10 +2251,15 @@ public class ModBlocks {
|
||||
rail_booster = new RailBooster().setBlockName("rail_booster").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_booster");
|
||||
rail_narrow_straight = new RailNarrowStraight().setBlockName("rail_narrow_straight").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":rail_narrow_neo");
|
||||
rail_narrow_curve = new RailNarrowCurve().setBlockName("rail_narrow_curve").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":rail_narrow_neo");
|
||||
rail_large_straight = new RailStandardStraight().setBlockName("rail_large_straight").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":rail_standard_straight");
|
||||
rail_large_curve = new RailStandardCurve().setBlockName("rail_large_curve").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":rail_standard_straight");
|
||||
rail_large_ramp = new RailStandardRamp().setBlockName("rail_large_ramp").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":rail_standard_straight");
|
||||
rail_large_buffer = new RailStandardBuffer().setBlockName("rail_large_buffer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":rail_standard_buffer");
|
||||
rail_large_straight = new RailStandardStraight().setBlockName("rail_large_straight").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_standard_straight");
|
||||
rail_large_straight_short = new RailStandardStraightShort().setBlockName("rail_large_straight_short").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_standard_straight");
|
||||
rail_large_curve = new RailStandardCurveBase().setBlockName("rail_large_curve").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_standard_straight");
|
||||
rail_large_curve_7 = new RailStandardCurveWide7().setBlockName("rail_large_curve_7").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_standard_straight");
|
||||
rail_large_curve_9 = new RailStandardCurveWide9().setBlockName("rail_large_curve_9").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_standard_straight");
|
||||
rail_large_ramp = new RailStandardRamp().setBlockName("rail_large_ramp").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_standard_straight");
|
||||
rail_large_buffer = new RailStandardBuffer().setBlockName("rail_large_buffer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_standard_buffer");
|
||||
rail_large_switch = new RailStandardSwitch().setBlockName("rail_large_switch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_standard_straight");
|
||||
rail_large_switch_flipped = new RailStandardSwitchFlipped().setBlockName("rail_large_switch_flipped").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_standard_straight");
|
||||
|
||||
crate = new BlockCrate(Material.wood).setBlockName("crate").setStepSound(Block.soundTypeWood).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.consumableTab).setBlockTextureName(RefStrings.MODID + ":crate");
|
||||
crate_weapon = new BlockCrate(Material.wood).setBlockName("crate_weapon").setStepSound(Block.soundTypeWood).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.consumableTab).setBlockTextureName(RefStrings.MODID + ":crate_weapon");
|
||||
@ -2231,7 +2279,6 @@ public class ModBlocks {
|
||||
|
||||
boxcar = new DecoBlock(Material.iron).setBlockName("boxcar").setStepSound(Block.soundTypeMetal).setHardness(10.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":boxcar");
|
||||
boat = new DecoBlock(Material.iron).setBlockName("boat").setStepSound(Block.soundTypeMetal).setHardness(10.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":boat");
|
||||
bomber = new DecoBlock(Material.iron).setBlockName("bomber").setStepSound(Block.soundTypeMetal).setHardness(10.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
|
||||
machine_well = new MachineOilWell().setBlockName("machine_well").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_well");
|
||||
machine_pumpjack = new MachinePumpjack().setBlockName("machine_pumpjack").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_pumpjack");
|
||||
@ -2239,6 +2286,7 @@ public class ModBlocks {
|
||||
oil_pipe = new BlockNoDrop(Material.iron).setBlockName("oil_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":oil_pipe");
|
||||
machine_flare = new MachineGasFlare(Material.iron).setBlockName("machine_flare").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
chimney_brick = new MachineChimneyBrick(Material.iron).setBlockName("chimney_brick").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
chimney_industrial = new MachineChimneyIndustrial(Material.iron).setBlockName("chimney_industrial").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":concrete_colored_ext.machine");
|
||||
machine_refinery = new MachineRefinery(Material.iron).setBlockName("machine_refinery").setHardness(5.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_refinery");
|
||||
machine_vacuum_distill = new MachineVacuumDistill(Material.iron).setBlockName("machine_vacuum_distill").setHardness(5.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_fraction_tower = new MachineFractionTower(Material.iron).setBlockName("machine_fraction_tower").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -2247,13 +2295,14 @@ public class ModBlocks {
|
||||
machine_catalytic_reformer = new MachineCatalyticReformer(Material.iron).setBlockName("machine_catalytic_reformer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_coker = new MachineCoker(Material.iron).setBlockName("machine_coker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_autosaw = new MachineAutosaw().setBlockName("machine_autosaw").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_drill = new MachineMiningDrill(Material.iron).setBlockName("machine_drill").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_drill");
|
||||
machine_drill = new MachineMiningDrill(Material.iron).setBlockName("machine_drill").setHardness(5.0F).setResistance(100.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":machine_drill");
|
||||
machine_excavator = new MachineExcavator().setBlockName("machine_excavator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
drill_pipe = new BlockNoDrop(Material.iron).setBlockName("drill_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":drill_pipe");
|
||||
machine_mining_laser = new MachineMiningLaser(Material.iron).setBlockName("machine_mining_laser").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_mining_laser");
|
||||
barricade = new BlockNoDrop(Material.sand).setBlockName("barricade").setHardness(1.0F).setResistance(2.5F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":barricade");
|
||||
machine_assembler = new MachineAssembler(Material.iron).setBlockName("machine_assembler").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_assembler");
|
||||
machine_assemfac = new MachineAssemfac(Material.iron).setBlockName("machine_assemfac").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_arc_welder = new MachineArcWelder(Material.iron).setBlockName("machine_arc_welder").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_chemplant = new MachineChemplant(Material.iron).setBlockName("machine_chemplant").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_chemfac = new MachineChemfac(Material.iron).setBlockName("machine_chemfac").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_mixer = new MachineMixer(Material.iron).setBlockName("machine_mixer").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -2265,11 +2314,12 @@ public class ModBlocks {
|
||||
press_preheater = new BlockBase(Material.iron).setBlockName("press_preheater").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":press_preheater");
|
||||
machine_press = new MachinePress(Material.iron).setBlockName("machine_press").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_press");
|
||||
machine_epress = new MachineEPress(Material.iron).setBlockName("machine_epress").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_epress");
|
||||
machine_conveyor_press = new MachineConveyorPress(Material.iron).setBlockName("machine_conveyor_press").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_selenium = new MachineSeleniumEngine(Material.iron).setBlockName("machine_selenium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_selenium");
|
||||
reactor_research = new ReactorResearch(Material.iron).setBlockName("machine_reactor_small").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_reactor_small");
|
||||
reactor_zirnox = new ReactorZirnox(Material.iron).setBlockName("machine_zirnox").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
zirnox_destroyed = new ZirnoxDestroyed(Material.iron).setBlockName("zirnox_destroyed").setHardness(100.0F).setResistance(800.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_controller = new MachineReactorControl(Material.iron).setBlockName("machine_controller").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_controller = new MachineReactorControl(Material.iron).setBlockName("machine_controller").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null);
|
||||
|
||||
machine_boiler_off = new MachineBoiler(false).setBlockName("machine_boiler_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_boiler_off");
|
||||
machine_boiler_on = new MachineBoiler(true).setBlockName("machine_boiler_on").setHardness(5.0F).setResistance(10.0F).setLightLevel(1.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":machine_boiler_on");
|
||||
@ -2283,6 +2333,7 @@ public class ModBlocks {
|
||||
machine_condenser = new MachineCondenser(Material.iron).setBlockName("machine_condenser").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":condenser");
|
||||
machine_tower_small = new MachineTowerSmall(Material.iron).setBlockName("machine_tower_small").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
machine_tower_large = new MachineTowerLarge(Material.iron).setBlockName("machine_tower_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":concrete");
|
||||
machine_condenser_powered = new MachineCondenserPowered(Material.iron).setBlockName("machine_condenser_powered").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
|
||||
machine_deuterium_extractor = new MachineDeuteriumExtractor(Material.iron).setBlockName("machine_deuterium_extractor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_deuterium_extractor_side");
|
||||
machine_deuterium_tower = new DeuteriumTower(Material.iron).setBlockName("machine_deuterium_tower").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":concrete");
|
||||
@ -2294,6 +2345,7 @@ public class ModBlocks {
|
||||
machine_electrolyser = new MachineElectrolyser().setBlockName("machine_electrolyser").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
|
||||
machine_autocrafter = new MachineAutocrafter().setBlockName("machine_autocrafter").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_funnel = new MachineFunnel().setBlockName("machine_funnel").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
anvil_iron = new NTMAnvil(Material.iron, 1).setBlockName("anvil_iron").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_iron");
|
||||
anvil_lead = new NTMAnvil(Material.iron, 1).setBlockName("anvil_lead").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_lead");
|
||||
@ -2550,6 +2602,9 @@ public class ModBlocks {
|
||||
register(ore_bedrock);
|
||||
register(ore_volcano);
|
||||
|
||||
//Secret
|
||||
register(stone_keyhole);
|
||||
|
||||
//Crystals
|
||||
GameRegistry.registerBlock(crystal_power, crystal_power.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crystal_energy, crystal_energy.getUnlocalizedName());
|
||||
@ -2704,6 +2759,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(deco_emitter, ItemBlockBase.class, deco_emitter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(part_emitter, ItemBlockBase.class, part_emitter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(deco_loot, deco_loot.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(pedestal, pedestal.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(bobblehead, ItemBlockMeta.class, bobblehead.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(snowglobe, ItemBlockMeta.class, snowglobe.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(hazmat, hazmat.getUnlocalizedName());
|
||||
@ -2842,11 +2898,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(brick_jungle_trap, ItemTrapBlock.class, brick_jungle_trap.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_jungle_glyph, ItemGlyphBlock.class, brick_jungle_glyph.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_jungle_circle, brick_jungle_circle.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_dungeon, brick_dungeon.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_dungeon_flat, brick_dungeon_flat.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_dungeon_tile, brick_dungeon_tile.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_dungeon_circle, brick_dungeon_circle.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_forgotten, brick_forgotten.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(brick_red, brick_red.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(deco_computer, ItemBlockBase.class, deco_computer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(filing_cabinet, ItemBlockBase.class, filing_cabinet.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(tape_recorder, tape_recorder.getUnlocalizedName());
|
||||
@ -2891,8 +2944,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(mush, mush.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(mush_block, mush_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(mush_block_stem, mush_block_stem.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(glyphid_base, glyphid_base.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(glyphid_spawner, glyphid_spawner.getUnlocalizedName());
|
||||
register(glyphid_base);
|
||||
register(glyphid_spawner);
|
||||
GameRegistry.registerBlock(moon_turf, moon_turf.getUnlocalizedName());
|
||||
|
||||
//Waste
|
||||
@ -2941,7 +2994,6 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(nuke_fleija, nuke_fleija.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(nuke_solinium, nuke_solinium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(nuke_n2, nuke_n2.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(nuke_n45, nuke_n45.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(nuke_fstbmb, nuke_fstbmb.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(nuke_custom, nuke_custom.getUnlocalizedName());
|
||||
|
||||
@ -3048,6 +3100,14 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(door_metal, door_metal.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(door_office, door_office.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(door_bunker, door_bunker.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(door_red, door_red.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(secure_access_door, secure_access_door.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(large_vehicle_door, large_vehicle_door.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(qe_containment, qe_containment.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(qe_sliding_door, qe_sliding_door.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(round_airlock_door, round_airlock_door.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(sliding_seal_door, sliding_seal_door.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(water_door, water_door.getUnlocalizedName());
|
||||
|
||||
//Crates
|
||||
register(crate_iron);
|
||||
@ -3061,13 +3121,10 @@ public class ModBlocks {
|
||||
//Junk
|
||||
GameRegistry.registerBlock(boxcar, boxcar.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(boat, boat.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(bomber, bomber.getUnlocalizedName());
|
||||
|
||||
//Machines
|
||||
//GameRegistry.registerBlock(observer_off, observer_off.getUnlocalizedName());
|
||||
//GameRegistry.registerBlock(observer_on, observer_on.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(machine_autocrafter, ItemBlockBase.class, machine_autocrafter.getUnlocalizedName());
|
||||
register(machine_autocrafter);
|
||||
register(machine_funnel);
|
||||
|
||||
GameRegistry.registerBlock(anvil_iron, ItemBlockBase.class, anvil_iron.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(anvil_lead, ItemBlockBase.class, anvil_lead.getUnlocalizedName());
|
||||
@ -3084,6 +3141,9 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(press_preheater, press_preheater.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_press, machine_press.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_epress, machine_epress.getUnlocalizedName());
|
||||
register(machine_conveyor_press);
|
||||
register(pump_steam);
|
||||
register(pump_electric);
|
||||
register(heater_firebox);
|
||||
register(heater_oven);
|
||||
register(machine_ashpit);
|
||||
@ -3126,6 +3186,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_rtg_furnace_on, machine_rtg_furnace_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_coal_off, machine_coal_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_coal_on, machine_coal_on.getUnlocalizedName());
|
||||
register(machine_wood_burner);
|
||||
register(machine_diesel);
|
||||
register(machine_selenium);
|
||||
register(machine_combustion_engine);
|
||||
@ -3137,6 +3198,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_industrial_generator, machine_industrial_generator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_radgen, machine_radgen.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_cyclotron, machine_cyclotron.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_exposure_chamber, machine_exposure_chamber.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_rtg_grey, machine_rtg_grey.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_geo, machine_geo.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_amgen, machine_amgen.getUnlocalizedName());
|
||||
@ -3205,6 +3267,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(red_cable, red_cable.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_cable_classic, red_cable_classic.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_cable_paintable, red_cable_paintable.getUnlocalizedName());
|
||||
register(red_cable_gauge);
|
||||
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_connector, ItemBlockBase.class, red_connector.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_pylon, ItemBlockBase.class, red_pylon.getUnlocalizedName());
|
||||
@ -3226,6 +3289,7 @@ public class ModBlocks {
|
||||
register(radio_torch_sender);
|
||||
register(radio_torch_receiver);
|
||||
register(radio_torch_counter);
|
||||
register(radio_telex);
|
||||
|
||||
register(crane_extractor);
|
||||
register(crane_inserter);
|
||||
@ -3234,11 +3298,18 @@ public class ModBlocks {
|
||||
register(crane_boxer);
|
||||
register(crane_unboxer);
|
||||
register(conveyor);
|
||||
register(conveyor_express);
|
||||
register(conveyor_double);
|
||||
register(conveyor_triple);
|
||||
register(conveyor_chute);
|
||||
register(conveyor_lift);
|
||||
register(crane_splitter);
|
||||
register(drone_waypoint);
|
||||
register(drone_crate);
|
||||
register(drone_waypoint_request);
|
||||
register(drone_dock);
|
||||
register(drone_crate_provider);
|
||||
register(drone_crate_requester);
|
||||
register(fan);
|
||||
register(piston_inserter);
|
||||
|
||||
@ -3271,6 +3342,7 @@ public class ModBlocks {
|
||||
register(capacitor_gold);
|
||||
register(capacitor_niobium);
|
||||
register(capacitor_tantalium);
|
||||
register(capacitor_schrabidate);
|
||||
GameRegistry.registerBlock(machine_transformer, machine_transformer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_transformer_20, machine_transformer_20.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_transformer_dnt, machine_transformer_dnt.getUnlocalizedName());
|
||||
@ -3286,6 +3358,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_assemfac, machine_assemfac.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_chemplant, machine_chemplant.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_chemfac, machine_chemfac.getUnlocalizedName());
|
||||
register(machine_arc_welder);
|
||||
register(machine_mixer);
|
||||
register(machine_fluidtank);
|
||||
register(machine_bat9000);
|
||||
@ -3301,6 +3374,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_condenser, machine_condenser.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_tower_small, machine_tower_small.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_tower_large, machine_tower_large.getUnlocalizedName());
|
||||
register(machine_condenser_powered);
|
||||
GameRegistry.registerBlock(machine_deuterium_extractor, machine_deuterium_extractor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_deuterium_tower, machine_deuterium_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_liquefactor, ItemBlockBase.class, machine_liquefactor.getUnlocalizedName());
|
||||
@ -3317,6 +3391,7 @@ public class ModBlocks {
|
||||
register(machine_fracking_tower);
|
||||
register(machine_flare);
|
||||
register(chimney_brick);
|
||||
register(chimney_industrial);
|
||||
register(machine_refinery);
|
||||
register(machine_vacuum_distill);
|
||||
register(machine_fraction_tower);
|
||||
@ -3383,6 +3458,7 @@ public class ModBlocks {
|
||||
register(cm_tank);
|
||||
register(cm_circuit);
|
||||
register(cm_port);
|
||||
register(cm_anchor);
|
||||
|
||||
//PWR
|
||||
register(pwr_fuel);
|
||||
@ -3461,6 +3537,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(sat_dock, sat_dock.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(soyuz_capsule, soyuz_capsule.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_radar, machine_radar.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(radar_screen, radar_screen.getUnlocalizedName());
|
||||
|
||||
//Guide
|
||||
GameRegistry.registerBlock(book_guide, book_guide.getUnlocalizedName());
|
||||
@ -3481,9 +3558,14 @@ public class ModBlocks {
|
||||
register(rail_narrow_straight);
|
||||
register(rail_narrow_curve);
|
||||
register(rail_large_straight);
|
||||
register(rail_large_straight_short);
|
||||
register(rail_large_curve);
|
||||
register(rail_large_curve_7);
|
||||
register(rail_large_curve_9);
|
||||
register(rail_large_ramp);
|
||||
register(rail_large_buffer);
|
||||
register(rail_large_switch);
|
||||
register(rail_large_switch_flipped);
|
||||
|
||||
//Crate
|
||||
GameRegistry.registerBlock(crate, crate.getUnlocalizedName());
|
||||
|
||||
@ -2,18 +2,168 @@ package com.hbm.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class ModSoundType extends Block.SoundType {
|
||||
protected final String placeSound;
|
||||
protected final String breakSound;
|
||||
protected final String stepSound;
|
||||
|
||||
public ModSoundType(String name, float volume, float pitch) {
|
||||
super(name, volume, pitch);
|
||||
protected ModSoundType(String placeSound, String breakSound, String stepSound, float volume, float pitch) {
|
||||
super("", volume, pitch);
|
||||
this.placeSound = placeSound;
|
||||
this.breakSound = breakSound;
|
||||
this.stepSound = stepSound;
|
||||
}
|
||||
|
||||
public ModEnvelopedSoundType enveloped() {
|
||||
return new ModEnvelopedSoundType(placeSound, breakSound, stepSound, volume, frequency);
|
||||
}
|
||||
|
||||
public ModEnvelopedSoundType enveloped(Random random) {
|
||||
return new ModEnvelopedSoundType(placeSound, breakSound, stepSound, volume, frequency, random);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String func_150496_b() {
|
||||
return placeSound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBreakSound() {
|
||||
return "hbm:" + super.getBreakSound();
|
||||
return breakSound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStepResourcePath() {
|
||||
return "hbm:" + super.getStepResourcePath();
|
||||
return stepSound;
|
||||
}
|
||||
|
||||
// creates a sound type with vanilla-like sound strings name-spaced to the mod
|
||||
public static ModSoundType mod(String soundName, float volume, float pitch) {
|
||||
return new ModSoundType(modDig(soundName), modDig(soundName), modStep(soundName), volume, pitch);
|
||||
}
|
||||
|
||||
// these permutations allow creating a sound type with one of the three sounds being custom
|
||||
// and the other ones defaulting to vanilla-like sound strings name-spaced to the mod
|
||||
|
||||
public static ModSoundType customPlace(String soundName, String placeSound, float volume, float pitch) {
|
||||
return new ModSoundType(placeSound, modDig(soundName), modStep(soundName), volume, pitch);
|
||||
}
|
||||
|
||||
public static ModSoundType customBreak(String soundName, String breakSound, float volume, float pitch) {
|
||||
return new ModSoundType(modDig(soundName), breakSound, modStep(soundName), volume, pitch);
|
||||
}
|
||||
|
||||
public static ModSoundType customStep(String soundName, String stepSound, float volume, float pitch) {
|
||||
return new ModSoundType(modDig(soundName), modDig(soundName), stepSound, volume, pitch);
|
||||
}
|
||||
|
||||
public static ModSoundType customDig(String soundName, String digSound, float volume, float pitch) {
|
||||
return new ModSoundType(digSound, digSound, modStep(soundName), volume, pitch);
|
||||
}
|
||||
|
||||
// these permutations copy sounds from an existing sound type and modify one of the sounds,
|
||||
// but with a manual path for the custom sound
|
||||
|
||||
public static ModSoundType customPlace(Block.SoundType from, String placeSound, float volume, float pitch) {
|
||||
return new ModSoundType(placeSound, from.getBreakSound(), from.getStepResourcePath(), volume, pitch);
|
||||
}
|
||||
|
||||
public static ModSoundType customBreak(Block.SoundType from, String breakSound, float volume, float pitch) {
|
||||
return new ModSoundType(from.func_150496_b(), breakSound, from.getStepResourcePath(), volume, pitch);
|
||||
}
|
||||
|
||||
public static ModSoundType customStep(Block.SoundType from, String stepSound, float volume, float pitch) {
|
||||
return new ModSoundType(from.func_150496_b(), from.getBreakSound(), stepSound, volume, pitch);
|
||||
}
|
||||
|
||||
public static ModSoundType customDig(Block.SoundType from, String dig, float volume, float pitch) {
|
||||
return new ModSoundType(dig, dig, from.getStepResourcePath(), volume, pitch);
|
||||
}
|
||||
|
||||
// customizes all sounds
|
||||
public static ModSoundType placeBreakStep(String placeSound, String breakSound, String stepSound, float volume, float pitch) {
|
||||
return new ModSoundType(placeSound, breakSound, stepSound, volume, pitch);
|
||||
}
|
||||
|
||||
private static String modDig(String soundName) {
|
||||
return "hbm:dig." + soundName;
|
||||
}
|
||||
|
||||
private static String modStep(String soundName) {
|
||||
return "hbm:step." + soundName;
|
||||
}
|
||||
|
||||
public static class ModEnvelopedSoundType extends ModSoundType {
|
||||
private final Random random;
|
||||
|
||||
ModEnvelopedSoundType(String placeSound, String breakSound, String stepSound, float volume, float pitch, Random random) {
|
||||
super(placeSound, breakSound, stepSound, volume, pitch);
|
||||
this.random = random;
|
||||
}
|
||||
|
||||
ModEnvelopedSoundType(String placeSound, String breakSound, String stepSound, float volume, float pitch) {
|
||||
this(placeSound, breakSound, stepSound, volume, pitch, new Random());
|
||||
}
|
||||
|
||||
// a bit of a hack, but most of the time, playSound is called with the sound path queried first, and then volume and pitch
|
||||
private SubType probableSubType = SubType.PLACE;
|
||||
|
||||
@Override
|
||||
public String func_150496_b() {
|
||||
probableSubType = SubType.PLACE;
|
||||
return super.func_150496_b();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBreakSound() {
|
||||
probableSubType = SubType.BREAK;
|
||||
return super.getBreakSound();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStepResourcePath() {
|
||||
probableSubType = SubType.STEP;
|
||||
return super.getStepResourcePath();
|
||||
}
|
||||
|
||||
private Envelope volumeEnvelope = null;
|
||||
private Envelope pitchEnvelope = null;
|
||||
|
||||
public ModEnvelopedSoundType volumeFunction(Envelope volumeEnvelope) {
|
||||
this.volumeEnvelope = volumeEnvelope;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ModEnvelopedSoundType pitchFunction(Envelope pitchEnvelope) {
|
||||
this.pitchEnvelope = pitchEnvelope;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getVolume() {
|
||||
if (volumeEnvelope == null)
|
||||
return super.getVolume();
|
||||
else
|
||||
return volumeEnvelope.compute(super.getVolume(), random, probableSubType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPitch() {
|
||||
if (pitchEnvelope == null)
|
||||
return super.getPitch();
|
||||
else
|
||||
return pitchEnvelope.compute(super.getPitch(), random, probableSubType);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
public interface Envelope {
|
||||
float compute(float in, Random rand, SubType type);
|
||||
}
|
||||
}
|
||||
|
||||
public enum SubType {
|
||||
PLACE, BREAK, STEP
|
||||
}
|
||||
}
|
||||
|
||||
13
src/main/java/com/hbm/blocks/ModSoundTypes.java
Normal file
13
src/main/java/com/hbm/blocks/ModSoundTypes.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import com.hbm.main.MainRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class ModSoundTypes {
|
||||
|
||||
public static final ModSoundType grate = ModSoundType.customStep(Block.soundTypeStone, "hbm:step.metalBlock", 0.5F, 1.0F);
|
||||
public static final ModSoundType pipe = ModSoundType.customDig(Block.soundTypeMetal, "hbm:block.pipePlaced", 0.85F, 0.85F).enveloped(MainRegistry.instance.rand).pitchFunction((in, rand, type) -> {
|
||||
if(type == ModSoundType.SubType.BREAK) in -= 0.15F;
|
||||
return in + rand.nextFloat() * 0.2F;
|
||||
});
|
||||
}
|
||||
@ -145,8 +145,8 @@ public abstract class BlockTNTBase extends BlockFlammable implements IToolable {
|
||||
|
||||
if(tool == ToolType.DEFUSER) {
|
||||
if(!world.isRemote) {
|
||||
world.func_147480_a(x, y, z, true);
|
||||
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
world.func_147480_a(x, y, z, false);
|
||||
this.dropBlockAsItem(world, x, y, z, 0, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ public class CompactLauncher extends BlockContainer implements IMultiblock, IBom
|
||||
TileEntityCompactLauncher entity = (TileEntityCompactLauncher) world.getTileEntity(x, y, z);
|
||||
|
||||
if(entity.canLaunch()) {
|
||||
entity.launch();
|
||||
entity.launchFromDesignator();
|
||||
return BombReturnCode.LAUNCHED;
|
||||
}
|
||||
|
||||
|
||||
@ -2,38 +2,27 @@ package com.hbm.blocks.bomb;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.entity.missile.*;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.bomb.TileEntityLaunchPad;
|
||||
|
||||
import api.hbm.item.IDesignatorItem;
|
||||
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.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class LaunchPad extends BlockContainer implements IBomb {
|
||||
|
||||
public TileEntityLaunchPad tetn = new TileEntityLaunchPad();
|
||||
public static boolean keepInventory = false;
|
||||
private final static Random field_149933_a = new Random();
|
||||
|
||||
@ -46,11 +35,6 @@ public class LaunchPad extends BlockContainer implements IBomb {
|
||||
return new TileEntityLaunchPad();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return Item.getItemFromBlock(ModBlocks.launch_pad);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
|
||||
if(!keepInventory) {
|
||||
@ -132,186 +116,16 @@ public class LaunchPad extends BlockContainer implements IBomb {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
}
|
||||
if(i == 1) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
}
|
||||
if(i == 2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
if(i == 3) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @Override public void setBlockBoundsBasedOnState(IBlockAccess
|
||||
* p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { float f
|
||||
* = 0.0625F; this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); }
|
||||
*
|
||||
* @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World
|
||||
* world, int x, int y, int z) { float f = 0.0625F;
|
||||
* this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 8*f, 1.0F); return
|
||||
* AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ,
|
||||
* x + this.maxX, y + this.maxY, z + this.maxZ); }
|
||||
*/
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
|
||||
return Item.getItemFromBlock(ModBlocks.launch_pad);
|
||||
}
|
||||
|
||||
@Spaghetti("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA *takes breath* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
|
||||
@Override
|
||||
public BombReturnCode explode(World world, int x, int y, int z) {
|
||||
|
||||
TileEntityLaunchPad entity = (TileEntityLaunchPad) world.getTileEntity(x, y, z);
|
||||
|
||||
if(entity.slots[0] == null || world.isRemote)
|
||||
return BombReturnCode.ERROR_MISSING_COMPONENT;
|
||||
|
||||
if(entity.slots[1] != null && entity.slots[1].getItem() instanceof IDesignatorItem && entity.power >= 75000) {
|
||||
|
||||
if(!((IDesignatorItem)entity.slots[1].getItem()).isReady(world, entity.slots[1], x, y, z))
|
||||
return BombReturnCode.ERROR_MISSING_COMPONENT;
|
||||
|
||||
int xCoord = entity.slots[1].stackTagCompound.getInteger("xCoord");
|
||||
int zCoord = entity.slots[1].stackTagCompound.getInteger("zCoord");
|
||||
|
||||
if(xCoord == entity.xCoord && zCoord == entity.zCoord) {
|
||||
xCoord += 1;
|
||||
}
|
||||
|
||||
Entity missile = null;
|
||||
|
||||
if(entity.slots[0].getItem() == ModItems.missile_generic) {
|
||||
missile = new EntityMissileGeneric(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_incendiary) {
|
||||
missile = new EntityMissileIncendiary(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_cluster) {
|
||||
missile = new EntityMissileCluster(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_buster) {
|
||||
missile = new EntityMissileBunkerBuster(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_strong) {
|
||||
missile = new EntityMissileStrong(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_incendiary_strong) {
|
||||
missile = new EntityMissileIncendiaryStrong(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_cluster_strong) {
|
||||
missile = new EntityMissileClusterStrong(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_buster_strong) {
|
||||
missile = new EntityMissileBusterStrong(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_burst) {
|
||||
missile = new EntityMissileBurst(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_inferno) {
|
||||
missile = new EntityMissileInferno(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_rain) {
|
||||
missile = new EntityMissileRain(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_drill) {
|
||||
missile = new EntityMissileDrill(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_nuclear) {
|
||||
missile = new EntityMissileNuclear(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_endo) {
|
||||
missile = new EntityMissileEndo(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_exo) {
|
||||
missile = new EntityMissileExo(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_nuclear_cluster) {
|
||||
missile = new EntityMissileMirv(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_doomsday) {
|
||||
missile = new EntityMissileDoomsday(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_taint) {
|
||||
missile = new EntityMissileTaint(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_micro) {
|
||||
missile = new EntityMissileMicro(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_bhole) {
|
||||
missile = new EntityMissileBHole(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_schrabidium) {
|
||||
missile = new EntityMissileSchrabidium(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_emp) {
|
||||
missile = new EntityMissileEMP(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_emp_strong) {
|
||||
missile = new EntityMissileEMPStrong(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_volcano) {
|
||||
missile = new EntityMissileVolcano(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
if(entity.slots[0].getItem() == ModItems.missile_shuttle) {
|
||||
missile = new EntityMissileShuttle(world, x + 0.5F, y + 2F, z + 0.5F, xCoord, zCoord);
|
||||
}
|
||||
|
||||
if(missile != null) {
|
||||
world.spawnEntityInWorld(missile);
|
||||
world.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
||||
entity.power -= 75000;
|
||||
entity.slots[0] = null;
|
||||
|
||||
if(GeneralConfig.enableExtendedLogging)
|
||||
MainRegistry.logger.log(Level.INFO, "[MISSILE] Tried to launch missile at " + x + " / " + y + " / " + z + " to " + xCoord + " / " + zCoord + "!");
|
||||
return BombReturnCode.LAUNCHED;
|
||||
}
|
||||
}
|
||||
|
||||
if(entity.slots[0] != null && entity.slots[0].getItem() == ModItems.missile_carrier && entity.power >= 75000) {
|
||||
EntityCarrier missile = new EntityCarrier(world);
|
||||
missile.posX = x + 0.5F;
|
||||
missile.posY = y + 1F;
|
||||
missile.posZ = z + 0.5F;
|
||||
|
||||
if(entity.slots[1] != null)
|
||||
missile.setPayload(entity.slots[1]);
|
||||
|
||||
world.spawnEntityInWorld(missile);
|
||||
entity.power -= 75000;
|
||||
|
||||
entity.slots[0] = null;
|
||||
entity.slots[1] = null;
|
||||
world.playSoundEffect(x, y, z, "hbm:entity.rocketTakeoff", 100.0F, 1.0F);
|
||||
return BombReturnCode.LAUNCHED;
|
||||
}
|
||||
|
||||
if(entity.slots[0] != null && entity.slots[0].getItem() == ModItems.missile_anti_ballistic && entity.power >= 75000) {
|
||||
EntityMissileAntiBallistic missile = new EntityMissileAntiBallistic(world);
|
||||
missile.posX = x + 0.5F;
|
||||
missile.posY = y + 0.5F;
|
||||
missile.posZ = z + 0.5F;
|
||||
|
||||
world.spawnEntityInWorld(missile);
|
||||
entity.power -= 75000;
|
||||
|
||||
entity.slots[0] = null;
|
||||
world.playSoundEffect(x, y, z, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
||||
return BombReturnCode.LAUNCHED;
|
||||
}
|
||||
|
||||
return BombReturnCode.ERROR_MISSING_COMPONENT;
|
||||
return entity.launchFromDesignator();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ public class LaunchTable extends BlockContainer implements IMultiblock, IBomb {
|
||||
TileEntityLaunchTable entity = (TileEntityLaunchTable) world.getTileEntity(x, y, z);
|
||||
|
||||
if(entity.canLaunch()) {
|
||||
entity.launch();
|
||||
entity.launchFromDesignator();
|
||||
return BombReturnCode.LAUNCHED;
|
||||
}
|
||||
|
||||
|
||||
@ -1,137 +0,0 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeN45;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
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;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class NukeN45 extends BlockContainer implements IBomb {
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private static boolean keepInventory = false;
|
||||
|
||||
public NukeN45(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityNukeN45();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
|
||||
if(!keepInventory) {
|
||||
ISidedInventory tileentityfurnace = (ISidedInventory) p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if(tileentityfurnace != null) {
|
||||
for(int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if(itemstack != null) {
|
||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while(itemstack.stackSize > 0) {
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
|
||||
if(j1 > itemstack.stackSize) {
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + 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) this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) this.field_149933_a.nextGaussian() * f3;
|
||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
TileEntityNukeN45 entity = (TileEntityNukeN45) world.getTileEntity(x, y, z);
|
||||
if(entity != null) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return Item.getItemFromBlock(ModBlocks.nuke_n45);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BombReturnCode explode(World world, int x, int y, int z) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
TileEntityNukeN45 entity = (TileEntityNukeN45) world.getTileEntity(x, y, z);
|
||||
|
||||
if(entity.getType() == 100) {
|
||||
entity.primed = true;
|
||||
return BombReturnCode.TRIGGERED;
|
||||
} else if(!entity.primed && entity.getType() > 0) {
|
||||
int t = entity.getType();
|
||||
entity.clearSlots();
|
||||
entity.explode(world, x, y, z, t);
|
||||
return BombReturnCode.DETONATED;
|
||||
}
|
||||
|
||||
return BombReturnCode.ERROR_MISSING_COMPONENT;
|
||||
}
|
||||
|
||||
return BombReturnCode.UNDEFINED;
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
@ -38,11 +39,31 @@ public class BlockAmmoCrate extends Block {
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side == 0 ? this.iconBottom : (side == 1 ? this.iconTop : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem().equals(ModItems.crowbar)) {
|
||||
if(!world.isRemote) {
|
||||
dropContents(world, x, y, z);
|
||||
world.setBlockToAir(x, y, z);
|
||||
world.playSoundEffect(x, y, z, "hbm:block.crateBreak", 0.5F, 1.0F);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
public void dropContents(World world, int x, int y, int z) {
|
||||
ArrayList<ItemStack> items = getContents(world, x, y, z);
|
||||
|
||||
for(ItemStack item : items) {
|
||||
this.dropBlockAsItem(world, x, y, z, item);
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<ItemStack> getContents(World world, int x, int y, int z) {
|
||||
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
|
||||
|
||||
@ -145,7 +145,7 @@ public class BlockBedrockOreTE extends BlockContainer implements ILookOverlay, I
|
||||
text.add("Tier: " + ore.tier);
|
||||
|
||||
if(ore.acidRequirement != null) {
|
||||
text.add("Requires: " + ore.acidRequirement.fill + "mB " + I18nUtil.resolveKey(ore.acidRequirement.type.getUnlocalizedName()));
|
||||
text.add("Requires: " + ore.acidRequirement.fill + "mB " + ore.acidRequirement.type.getLocalizedName());
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
|
||||
@ -191,7 +191,7 @@ public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
NOS( "Dr Nostalgia", "Dr Nostalgia", "SSG and Vortex models", "Take a picture, I'ma pose, paparazzi$I've been drinking, moving like a zombie", true, ScrapType.BOARD_TRANSISTOR),
|
||||
DRILLGON( "Drillgon200", "Drillgon200", "1.12 Port", null, false, ScrapType.CPU_LOGIC),
|
||||
CIRNO( "Cirno", "Cirno", "the only multi layered skin i had", "No brain. Head empty.", true, ScrapType.BOARD_BLANK),
|
||||
MICROWAVE( "Microwave", "Microwave", "OC compat", "they call me the food heater", true, ScrapType.BRIDGE_BIOS),
|
||||
MICROWAVE( "Microwave", "Microwave", "OC Compatibility", "they call me the food heater", true, ScrapType.BRIDGE_BIOS),
|
||||
PEEP( "Peep", "LePeeperSauvage", "Coilgun, Leadburster and Congo Lake models, BDCL QC", "Fluffy ears can't hide in ash, nor snow.", true, ScrapType.CPU_CLOCK);
|
||||
|
||||
public String name; //the title of the tooltip
|
||||
|
||||
@ -11,9 +11,7 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCanCrate extends Block {
|
||||
@ -21,79 +19,77 @@ public class BlockCanCrate extends Block {
|
||||
public BlockCanCrate(Material p_i45394_1_) {
|
||||
super(p_i45394_1_);
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
public int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
|
||||
|
||||
if(world.isRemote)
|
||||
{
|
||||
player.addChatMessage(new ChatComponentText("The one crate you are allowed to smash!"));
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem().equals(ModItems.crowbar)) {
|
||||
if(!world.isRemote) {
|
||||
dropContents(world, x, y, z);
|
||||
world.setBlockToAir(x, y, z);
|
||||
world.playSoundEffect(x, y, z, "hbm:block.crateBreak", 0.5F, 1.0F);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
|
||||
int count = quantityDropped(metadata, fortune, world.rand);
|
||||
for(int i = 0; i < count; i++) {
|
||||
Item item = getItemDropped(metadata, world.rand, fortune);
|
||||
if(item != null)
|
||||
ret.add(new ItemStack(item, 1, damageDropped(metadata, world.rand, item)));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
//pain
|
||||
public int damageDropped(int meta, Random rand, Item item) {
|
||||
if(item != ModItems.canned_conserve)
|
||||
return damageDropped(meta);
|
||||
else
|
||||
return Math.abs(rand.nextInt() % EnumFoodType.values().length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
|
||||
List<Item> items = new ArrayList();
|
||||
for(int a = 0; a < EnumFoodType.values().length; a++)
|
||||
items.add(ModItems.canned_conserve);
|
||||
items.add(ModItems.can_smart);
|
||||
items.add(ModItems.can_creature);
|
||||
items.add(ModItems.can_redbomb);
|
||||
items.add(ModItems.can_mrsugar);
|
||||
items.add(ModItems.can_overcharge);
|
||||
items.add(ModItems.can_luna);
|
||||
items.add(ModItems.can_breen);
|
||||
items.add(ModItems.can_bepis);
|
||||
items.add(ModItems.pudding);
|
||||
|
||||
return items.get(rand.nextInt(items.size()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random rand) {
|
||||
|
||||
return 5 + rand.nextInt(4);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
public void dropContents(World world, int x, int y, int z) {
|
||||
ArrayList<ItemStack> items = getContents(world, x, y, z);
|
||||
|
||||
for(ItemStack item : items) {
|
||||
this.dropBlockAsItem(world, x, y, z, item);
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<ItemStack> getContents(World world, int x, int y, int z) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
|
||||
int count = getContentAmount(world.rand);
|
||||
for(int i = 0; i < count; i++) {
|
||||
ret.add(getRandomItem(world.rand));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public ItemStack getRandomItem(Random rand) {
|
||||
|
||||
List<ItemStack> items = new ArrayList();
|
||||
for(int a = 0; a < EnumFoodType.values().length; a++)
|
||||
items.add(new ItemStack(ModItems.canned_conserve, 1, a));
|
||||
items.add(new ItemStack(ModItems.can_smart));
|
||||
items.add(new ItemStack(ModItems.can_creature));
|
||||
items.add(new ItemStack(ModItems.can_redbomb));
|
||||
items.add(new ItemStack(ModItems.can_mrsugar));
|
||||
items.add(new ItemStack(ModItems.can_overcharge));
|
||||
items.add(new ItemStack(ModItems.can_luna));
|
||||
items.add(new ItemStack(ModItems.can_breen));
|
||||
items.add(new ItemStack(ModItems.can_bepis));
|
||||
items.add(new ItemStack(ModItems.pudding));
|
||||
|
||||
return items.get(rand.nextInt(items.size()));
|
||||
}
|
||||
|
||||
public int getContentAmount(Random rand) {
|
||||
return 5 + rand.nextInt(4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,6 @@ import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCrate extends BlockFalling {
|
||||
@ -29,25 +28,17 @@ public class BlockCrate extends BlockFalling {
|
||||
super(p_i45394_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem().equals(ModItems.crowbar)) {
|
||||
dropItems(world, x, y, z);
|
||||
world.setBlockToAir(x, y, z);
|
||||
world.playSoundEffect(x, y, z, "hbm:block.crateBreak", 0.5F, 1.0F);
|
||||
return true;
|
||||
} else {
|
||||
if(world.isRemote) {
|
||||
player.addChatMessage(new ChatComponentText("I'll need a crate opening device to get the loot, smashing the whole thing won't work..."));
|
||||
if(!world.isRemote) {
|
||||
dropItems(world, x, y, z);
|
||||
world.setBlockToAir(x, y, z);
|
||||
world.playSoundEffect(x, y, z, "hbm:block.crateBreak", 0.5F, 1.0F);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setDrops() {
|
||||
|
||||
@ -58,9 +58,9 @@ public class BlockDecoContainer extends BlockDecoModel implements ITileEntityPro
|
||||
} else {
|
||||
TileEntity entity = world.getTileEntity(x, y, z);
|
||||
if(entity instanceof TileEntityLockableBase) { //annoying accommodations for the filing cabinet, but whatever, could potentially be useful
|
||||
if(player.getHeldItem() != null && (player.getHeldItem().getItem() instanceof ItemLock || player.getHeldItem().getItem() == ModItems.key_kit))
|
||||
if(player.getHeldItem() != null && (player.getHeldItem().getItem() instanceof ItemLock || player.getHeldItem().getItem() == ModItems.key_kit)) {
|
||||
return false;
|
||||
else if(!player.isSneaking() && ((TileEntityLockableBase) entity).canAccess(player)) {
|
||||
} else if(!player.isSneaking() && ((TileEntityLockableBase) entity).canAccess(player)) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
@ -99,13 +99,13 @@ public class BlockDecoContainer extends BlockDecoModel implements ITileEntityPro
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -91,6 +91,11 @@ public class BlockDoorGeneric extends BlockDummyable {
|
||||
// return;
|
||||
//super.addCollisionBoxesToList(worldIn, x, y, z, entityBox, collidingBoxes, entityIn);
|
||||
}
|
||||
|
||||
@Override //should fix AI pathfinding
|
||||
public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) { //btw the method name is the exact opposite of that it's doing, check net.minecraft.pathfinding.PathNavigate#512
|
||||
return hasExtra(world.getBlockMetadata(x, y, z)); //if it's open
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block blockIn){
|
||||
|
||||
77
src/main/java/com/hbm/blocks/generic/BlockGlyphid.java
Normal file
77
src/main/java/com/hbm/blocks/generic/BlockGlyphid.java
Normal file
@ -0,0 +1,77 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.IBlockMulti;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockGlyphid extends Block implements IBlockMulti {
|
||||
|
||||
public IIcon[] iconsStandard = new IIcon[2];
|
||||
public IIcon[] iconsInfested = new IIcon[2];
|
||||
|
||||
public BlockGlyphid(Material mat) {
|
||||
super(mat);
|
||||
this.setCreativeTab(MainRegistry.blockTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
long l = (long) (x * 3129871) ^ (long)y * 116129781L ^ (long)z;
|
||||
l = l * l * 42317861L + l * 11L;
|
||||
int i = (int)(l >> 16 & 3L);
|
||||
IIcon[] icons = this.getIconArray(world.getBlockMetadata(x, y, z));
|
||||
return icons[(int)(Math.abs(i) % icons.length)];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
IIcon[] icons = this.getIconArray(meta);
|
||||
return icons[meta % icons.length];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
iconsStandard[0] = reg.registerIcon(RefStrings.MODID + ":glyphid_base");
|
||||
iconsStandard[1] = reg.registerIcon(RefStrings.MODID + ":glyphid_base_alt");
|
||||
iconsInfested[0] = reg.registerIcon(RefStrings.MODID + ":glyphid_base_infested");
|
||||
iconsInfested[1] = reg.registerIcon(RefStrings.MODID + ":glyphid_base_infested_alt");
|
||||
}
|
||||
|
||||
protected IIcon[] getIconArray(int meta) {
|
||||
if(meta == 1) return this.iconsInfested;
|
||||
return this.iconsStandard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSubCount() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for(int i = 0; i < getSubCount(); ++i) list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
@ -1,33 +1,40 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.hbm.blocks.IBlockMulti;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.entity.mob.EntityGlyphid;
|
||||
import com.hbm.entity.mob.EntityGlyphidBehemoth;
|
||||
import com.hbm.entity.mob.EntityGlyphidBlaster;
|
||||
import com.hbm.entity.mob.EntityGlyphidBombardier;
|
||||
import com.hbm.entity.mob.EntityGlyphidBrawler;
|
||||
import com.hbm.entity.mob.EntityGlyphidBrenda;
|
||||
import com.hbm.entity.mob.EntityGlyphidNuclear;
|
||||
import com.hbm.entity.mob.EntityGlyphidScout;
|
||||
import com.hbm.entity.mob.*;
|
||||
import com.hbm.handler.pollution.PollutionHandler;
|
||||
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.EnumDifficulty;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockGlyphidSpawner extends BlockContainer {
|
||||
public class BlockGlyphidSpawner extends BlockContainer implements IBlockMulti {
|
||||
|
||||
public IIcon[] icons = new IIcon[2];
|
||||
|
||||
public BlockGlyphidSpawner(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
public BlockGlyphidSpawner(Material mat) {
|
||||
super(mat);
|
||||
this.setCreativeTab(MainRegistry.blockTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -35,6 +42,44 @@ public class BlockGlyphidSpawner extends BlockContainer {
|
||||
return ModItems.egg_glyphid;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icons[meta % icons.length];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
icons[0] = reg.registerIcon(RefStrings.MODID + ":glyphid_eggs_alt");
|
||||
icons[1] = reg.registerIcon(RefStrings.MODID + ":glyphid_eggs_infested");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSubCount() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for(int i = 0; i < getSubCount(); ++i) list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
private static final ArrayList<Pair<Function<World, EntityGlyphid>, int[]>> spawnMap = new ArrayList<>();
|
||||
|
||||
static {
|
||||
// big thanks to martin for the suggestion of using functions
|
||||
spawnMap.add(new Pair<>(EntityGlyphid::new, MobConfig.glyphidChance));
|
||||
spawnMap.add(new Pair<>(EntityGlyphidBombardier::new, MobConfig.bombardierChance));
|
||||
spawnMap.add(new Pair<>(EntityGlyphidBrawler::new, MobConfig.brawlerChance));
|
||||
spawnMap.add(new Pair<>(EntityGlyphidDigger::new, MobConfig.diggerChance));
|
||||
spawnMap.add(new Pair<>(EntityGlyphidBlaster::new, MobConfig.blasterChance));
|
||||
spawnMap.add(new Pair<>(EntityGlyphidBehemoth::new, MobConfig.behemothChance));
|
||||
spawnMap.add(new Pair<>(EntityGlyphidBrenda::new, MobConfig.brendaChance));
|
||||
spawnMap.add(new Pair<>(EntityGlyphidNuclear::new, MobConfig.johnsonChance));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(int meta, int fortune, Random rand) {
|
||||
return 1 + rand.nextInt(3) + fortune;
|
||||
@ -46,47 +91,95 @@ public class BlockGlyphidSpawner extends BlockContainer {
|
||||
}
|
||||
|
||||
public static class TileEntityGlpyhidSpawner extends TileEntity {
|
||||
|
||||
|
||||
boolean initialSpawn = true;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote && worldObj.getTotalWorldTime() % 60 == 0 && this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL) {
|
||||
|
||||
int count = 0;
|
||||
|
||||
for(Object e : worldObj.loadedEntityList) {
|
||||
if(e instanceof EntityGlyphid) {
|
||||
count++;
|
||||
if(count >= MobConfig.spawnMax) return;
|
||||
}
|
||||
}
|
||||
|
||||
float soot = PollutionHandler.getPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT);
|
||||
List<EntityGlyphid> list = worldObj.getEntitiesWithinAABB(EntityGlyphid.class, AxisAlignedBB.getBoundingBox(xCoord - 6, yCoord + 1, zCoord - 6, xCoord + 7, yCoord + 9, zCoord + 7));
|
||||
|
||||
if(list.size() < 3) {
|
||||
EntityGlyphid glyphid = createGlyphid(soot);
|
||||
glyphid.setLocationAndAngles(xCoord + 0.5, yCoord + 1, zCoord + 0.5, worldObj.rand.nextFloat() * 360.0F, 0.0F);
|
||||
this.worldObj.spawnEntityInWorld(glyphid);
|
||||
}
|
||||
|
||||
if(worldObj.rand.nextInt(20) == 0 && soot >= MobConfig.scoutThreshold) {
|
||||
EntityGlyphidScout scout = new EntityGlyphidScout(worldObj);
|
||||
scout.setLocationAndAngles(xCoord + 0.5, yCoord + 1, zCoord + 0.5, worldObj.rand.nextFloat() * 360.0F, 0.0F);
|
||||
this.worldObj.spawnEntityInWorld(scout);
|
||||
if(!worldObj.isRemote && this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL) {
|
||||
|
||||
if(initialSpawn || worldObj.getTotalWorldTime() % MobConfig.swarmCooldown == 0) {
|
||||
|
||||
int count = 0;
|
||||
|
||||
for(Object e : worldObj.loadedEntityList) {
|
||||
if(e instanceof EntityGlyphid) {
|
||||
count++;
|
||||
if(count >= MobConfig.spawnMax) return;
|
||||
}
|
||||
}
|
||||
|
||||
List<EntityGlyphid> list = worldObj.getEntitiesWithinAABB(EntityGlyphid.class, AxisAlignedBB.getBoundingBox(xCoord - 5, yCoord + 1, zCoord - 5, xCoord + 6, yCoord + 7, zCoord + 6));
|
||||
float soot = PollutionHandler.getPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT);
|
||||
|
||||
if(list.size() <= 3) {
|
||||
|
||||
ArrayList<EntityGlyphid> currentSwarm = createSwarm(soot, this.getBlockMetadata());
|
||||
|
||||
for(EntityGlyphid glyphid : currentSwarm) {
|
||||
trySpawnEntity(glyphid);
|
||||
}
|
||||
|
||||
if(!initialSpawn && worldObj.rand.nextInt(MobConfig.scoutSwarmSpawnChance + 1) == 0 && soot >= MobConfig.scoutThreshold) {
|
||||
EntityGlyphidScout scout = new EntityGlyphidScout(worldObj);
|
||||
if(this.getBlockMetadata() == 1) scout.getDataWatcher().updateObject(EntityGlyphid.DW_SUBTYPE, (byte) EntityGlyphid.TYPE_INFECTED);
|
||||
trySpawnEntity(scout);
|
||||
}
|
||||
|
||||
initialSpawn = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public EntityGlyphid createGlyphid(float soot) {
|
||||
Random rand = new Random();
|
||||
|
||||
if(soot < MobConfig.tier2Threshold) return rand.nextInt(5) == 0 ? new EntityGlyphidBombardier(worldObj) : new EntityGlyphid(worldObj);
|
||||
if(soot < MobConfig.tier3Threshold) return rand.nextInt(5) == 0 ? new EntityGlyphidBombardier(worldObj) : new EntityGlyphidBrawler(worldObj);
|
||||
if(soot < MobConfig.tier4Threshold) return rand.nextInt(5) == 0 ? new EntityGlyphidBlaster(worldObj) : new EntityGlyphidBehemoth(worldObj);
|
||||
if(soot < MobConfig.tier5Threshold) return rand.nextInt(5) == 0 ? new EntityGlyphidBlaster(worldObj) : new EntityGlyphidBrenda(worldObj);
|
||||
public void trySpawnEntity(EntityGlyphid glyphid) {
|
||||
double offsetX = glyphid.getRNG().nextGaussian() * 3;
|
||||
double offsetZ = glyphid.getRNG().nextGaussian() * 3;
|
||||
|
||||
return rand.nextInt(3) == 0 ? new EntityGlyphidBlaster(worldObj) : new EntityGlyphidNuclear(worldObj);
|
||||
for(int i = 0; i < 7; i++) {
|
||||
glyphid.setLocationAndAngles(xCoord + 0.5 + offsetX, yCoord - 2 + i, zCoord + 0.5 + offsetZ, worldObj.rand.nextFloat() * 360.0F, 0.0F);
|
||||
if(glyphid.getCanSpawnHere()) {
|
||||
worldObj.spawnEntityInWorld(glyphid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<EntityGlyphid> createSwarm(float soot, int meta) {
|
||||
|
||||
Random rand = new Random();
|
||||
ArrayList<EntityGlyphid> currentSpawns = new ArrayList<>();
|
||||
int swarmAmount = (int) Math.min(MobConfig.baseSwarmSize * Math.max(MobConfig.swarmScalingMult * (soot / MobConfig.sootStep), 1), 10);
|
||||
int cap = 100;
|
||||
|
||||
while(currentSpawns.size() <= swarmAmount && cap >= 0) {
|
||||
// (dys)functional programing
|
||||
for(Pair<Function<World, EntityGlyphid>, int[]> glyphid : spawnMap) {
|
||||
int[] chance = glyphid.getValue();
|
||||
int adjustedChance = (int) (chance[0] + (chance[1] - chance[1] / Math.max(((soot + 1) / 3), 1)));
|
||||
if(soot >= chance[2] && rand.nextInt(100) <= adjustedChance) {
|
||||
EntityGlyphid entity = glyphid.getKey().apply(worldObj);
|
||||
if(meta == 1) entity.getDataWatcher().updateObject(EntityGlyphid.DW_SUBTYPE, (byte) EntityGlyphid.TYPE_INFECTED);
|
||||
currentSpawns.add(entity);
|
||||
}
|
||||
}
|
||||
|
||||
cap--;
|
||||
}
|
||||
return currentSpawns;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setBoolean("initialSpawn", initialSpawn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.initialSpawn = nbt.getBoolean("initialSpawn");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
245
src/main/java/com/hbm/blocks/generic/BlockKeyhole.java
Normal file
245
src/main/java/com/hbm/blocks/generic/BlockKeyhole.java
Normal file
@ -0,0 +1,245 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockLoot.TileEntityLoot;
|
||||
import com.hbm.blocks.generic.BlockPedestal.TileEntityPedestal;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemModDoor;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.WeightedRandomObject;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockStone;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockKeyhole extends BlockStone {
|
||||
|
||||
protected IIcon iconTop;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconTop = iconRegister.registerIcon("stone");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 0 || side == 1 ? this.iconTop : this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return new ItemStack(Blocks.stone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.key_red && side != 0 && side != 1) {
|
||||
if(world.isRemote) return true;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(side);
|
||||
generateRoom(world, x - dir.offsetX * 4, y - 2, z - dir.offsetZ * 4);
|
||||
int b = 0;
|
||||
if(side == 2) b = 1;
|
||||
if(side == 5) b = 2;
|
||||
if(side == 3) b = 3;
|
||||
if(side == 4) b = 0;
|
||||
ItemModDoor.placeDoorBlock(world, x, y - 1, z, b, ModBlocks.door_red);
|
||||
world.playSoundAtEntity(player, "hbm:block.lockOpen", 1.0F, 1.0F);
|
||||
player.triggerAchievement(MainRegistry.achRedRoom);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected static void generateRoom(World world, int x, int y, int z) {
|
||||
|
||||
int size = 9;
|
||||
int height = 5;
|
||||
int width = size / 2;
|
||||
|
||||
//Outer Edges, top and bottom
|
||||
for(int i = -width; i <= width; i++) {
|
||||
world.setBlock(x + i, y, z + width, ModBlocks.brick_red, 6, 3);
|
||||
world.setBlock(x + i, y, z - width, ModBlocks.brick_red, 6, 3);
|
||||
world.setBlock(x + width, y, z + i, ModBlocks.brick_red, 6, 3);
|
||||
world.setBlock(x - width, y, z + i, ModBlocks.brick_red, 6, 3);
|
||||
world.setBlock(x + i, y + height - 1, z + width, ModBlocks.brick_red, 6, 3);
|
||||
world.setBlock(x + i, y + height - 1, z - width, ModBlocks.brick_red, 6, 3);
|
||||
world.setBlock(x + width, y + height - 1, z + i, ModBlocks.brick_red, 6, 3);
|
||||
world.setBlock(x - width, y + height - 1, z + i, ModBlocks.brick_red, 6, 3);
|
||||
}
|
||||
|
||||
for(int i = 1; i <= height - 2; i++) {
|
||||
//Outer edges, sides
|
||||
world.setBlock(x + width, y + i, z + width, ModBlocks.brick_red, 6, 3);
|
||||
world.setBlock(x + width, y + i, z - width, ModBlocks.brick_red, 6, 3);
|
||||
world.setBlock(x - width, y + i, z + width, ModBlocks.brick_red, 6, 3);
|
||||
world.setBlock(x - width, y + i, z - width, ModBlocks.brick_red, 6, 3);
|
||||
|
||||
//Walls
|
||||
for(int j = -width + 1; j <= width - 1; j++) {
|
||||
world.setBlock(x + width, y + i, z + j, ModBlocks.brick_red, 4, 3);
|
||||
world.setBlock(x - width, y + i, z + j, ModBlocks.brick_red, 5, 3);
|
||||
world.setBlock(x + j, y + i, z + width, ModBlocks.brick_red, 2, 3);
|
||||
world.setBlock(x + j, y + i, z - width, ModBlocks.brick_red, 3, 3);
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = -width + 1; i <= width - 1; i++) {
|
||||
for(int j = -width + 1; j <= width - 1; j++) {
|
||||
//Floor and ceiling
|
||||
world.setBlock(x + i, y, z + j, ModBlocks.brick_red, 1, 3);
|
||||
world.setBlock(x + i, y + height - 1, z + j, ModBlocks.brick_red, 0, 3);
|
||||
|
||||
for(int k = 1; k <= height - 2; k++) {
|
||||
world.setBlock(x + i, y + k, z + j, Blocks.air);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Torches
|
||||
int torchDist = width - 1;
|
||||
int torchOff = torchDist - 1;
|
||||
world.setBlock(x + torchDist, y + 2, z + torchOff, Blocks.torch);
|
||||
world.setBlock(x + torchDist, y + 2, z - torchOff, Blocks.torch);
|
||||
world.setBlock(x - torchDist, y + 2, z + torchOff, Blocks.torch);
|
||||
world.setBlock(x - torchDist, y + 2, z - torchOff, Blocks.torch);
|
||||
world.setBlock(x + torchOff, y + 2, z + torchDist, Blocks.torch);
|
||||
world.setBlock(x - torchOff, y + 2, z + torchDist, Blocks.torch);
|
||||
world.setBlock(x + torchOff, y + 2, z - torchDist, Blocks.torch);
|
||||
world.setBlock(x - torchOff, y + 2, z - torchDist, Blocks.torch);
|
||||
|
||||
//Cobwebs
|
||||
if(world.rand.nextInt(4) == 0) {
|
||||
for(int i = -width + 1; i <= width - 1; i++) {
|
||||
for(int j = -width + 1; j <= width - 1; j++) {
|
||||
if(world.rand.nextBoolean()) world.setBlock(x + i, y + height - 2, z + j, Blocks.web);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Pillars
|
||||
if(world.rand.nextInt(4) == 0) {
|
||||
for(int i = 1; i <= height - 2; i++) {
|
||||
world.setBlock(x + width - 2, y + i, z + width - 2, ModBlocks.concrete_colored, 14, 3);
|
||||
world.setBlock(x + width - 2, y + i, z - width + 2, ModBlocks.concrete_colored, 14, 3);
|
||||
world.setBlock(x - width + 2, y + i, z + width - 2, ModBlocks.concrete_colored, 14, 3);
|
||||
world.setBlock(x - width + 2, y + i, z - width + 2, ModBlocks.concrete_colored, 14, 3);
|
||||
}
|
||||
}
|
||||
|
||||
//Fire
|
||||
if(world.rand.nextInt(4) == 0) {
|
||||
world.setBlock(x + width - 1, y, z + width - 1, Blocks.netherrack);
|
||||
world.setBlock(x + width - 1, y, z - width + 1, Blocks.netherrack);
|
||||
world.setBlock(x - width + 1, y, z + width - 1, Blocks.netherrack);
|
||||
world.setBlock(x - width + 1, y, z - width + 1, Blocks.netherrack);
|
||||
world.setBlock(x + width - 1, y + 1, z + width - 1, Blocks.fire);
|
||||
world.setBlock(x + width - 1, y + 1, z - width + 1, Blocks.fire);
|
||||
world.setBlock(x - width + 1, y + 1, z + width - 1, Blocks.fire);
|
||||
world.setBlock(x - width + 1, y + 1, z - width + 1, Blocks.fire);
|
||||
}
|
||||
|
||||
//Circle
|
||||
if(world.rand.nextInt(4) == 0) {
|
||||
for(int i = -1; i <= 1; i++) {
|
||||
for(int j = -1; j <= 1; j++) {
|
||||
if(i != 0 || j != 0) world.setBlock(x + i, y, z + j, ModBlocks.concrete_colored, 14, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Lava
|
||||
if(world.rand.nextInt(4) == 0) {
|
||||
world.setBlock(x + width - 2, y, z + width - 1, Blocks.lava);
|
||||
world.setBlock(x + width - 3, y, z + width - 1, Blocks.lava);
|
||||
world.setBlock(x - width + 2, y, z + width - 1, Blocks.lava);
|
||||
world.setBlock(x - width + 3, y, z + width - 1, Blocks.lava);
|
||||
world.setBlock(x + width - 2, y, z - width + 1, Blocks.lava);
|
||||
world.setBlock(x + width - 3, y, z - width + 1, Blocks.lava);
|
||||
world.setBlock(x - width + 2, y, z - width + 1, Blocks.lava);
|
||||
world.setBlock(x - width + 3, y, z - width + 1, Blocks.lava);
|
||||
world.setBlock(x + width - 1, y, z + width - 2, Blocks.lava);
|
||||
world.setBlock(x + width - 1, y, z + width - 3, Blocks.lava);
|
||||
world.setBlock(x + width - 1, y, z - width + 2, Blocks.lava);
|
||||
world.setBlock(x + width - 1, y, z - width + 3, Blocks.lava);
|
||||
world.setBlock(x - width + 1, y, z + width - 2, Blocks.lava);
|
||||
world.setBlock(x - width + 1, y, z + width - 3, Blocks.lava);
|
||||
world.setBlock(x - width + 1, y, z - width + 2, Blocks.lava);
|
||||
world.setBlock(x - width + 1, y, z - width + 3, Blocks.lava);
|
||||
}
|
||||
|
||||
int rand = world.rand.nextInt(20);
|
||||
|
||||
if(rand == 0) {
|
||||
world.setBlock(x, y + 1, z, ModBlocks.deco_loot);
|
||||
TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(x, y + 1, z);
|
||||
loot.addItem(new ItemStack(ModItems.trenchmaster_helmet), 0, 0, 0);
|
||||
loot.addItem(new ItemStack(ModItems.trenchmaster_plate), 0, 0, 0);
|
||||
loot.addItem(new ItemStack(ModItems.trenchmaster_legs), 0, 0, 0);
|
||||
loot.addItem(new ItemStack(ModItems.trenchmaster_boots), 0, 0, 0);
|
||||
} else {
|
||||
spawnPedestalItem(world, x, y + 1, z);
|
||||
}
|
||||
|
||||
//Clear dropped items
|
||||
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x + 0.5, y, z + 0.5, x + 0.5, y + height, z + 0.5).expand(size / 2D, 0, size / 2D));
|
||||
for(EntityItem item : items) item.setDead();
|
||||
}
|
||||
|
||||
public static List<WeightedRandomObject> pedestalItems;
|
||||
|
||||
public static void spawnPedestalItem(World world, int x, int y, int z) {
|
||||
world.setBlock(x, y, z, ModBlocks.pedestal);
|
||||
TileEntityPedestal pedestal = (TileEntityPedestal) world.getTileEntity(x, y, z);
|
||||
if(pedestalItems == null) initPedestal();
|
||||
pedestal.item = ((WeightedRandomObject) WeightedRandom.getRandomItem(world.rand, pedestalItems)).asStack().copy();
|
||||
}
|
||||
|
||||
public static void initPedestal() {
|
||||
pedestalItems = new ArrayList();
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.ballistic_gauntlet), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.night_vision), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.protection_charm), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.armor_polish), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.bandaid), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.serum), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.quartz_plutonium), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.morning_glory), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.lodestone), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.spider_milk), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.ink), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.heart_container), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.black_diamond), 5));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.wd40), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.scrumpy), 10));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.wild_p), 5));
|
||||
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.starmetal_sword), 5));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.radaway_flush), 5));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.gem_alexandrite), 5));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.crackpipe), 5));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.flask_infusion), 5));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModBlocks.boxcar), 5));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.book_of_), 5));
|
||||
pedestalItems.add(new WeightedRandomObject(new ItemStack(ModItems.gun_revolver_pip), 5));
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.tileentity.IRepairable;
|
||||
import com.hbm.tileentity.deco.TileEntityLanternBehemoth;
|
||||
|
||||
@ -48,7 +49,14 @@ public class BlockLanternBehemoth extends BlockDummyable implements IToolable, I
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
|
||||
if(tool != ToolType.TORCH) return false;
|
||||
return IRepairable.tryRepairMultiblock(world, x, y, z, this, player);
|
||||
boolean didRepair = IRepairable.tryRepairMultiblock(world, x, y, z, this, player);
|
||||
|
||||
if(didRepair) {
|
||||
HbmPlayerProps data = HbmPlayerProps.getData(player);
|
||||
data.reputation++;
|
||||
}
|
||||
|
||||
return didRepair;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -48,19 +48,6 @@ public class BlockLoot extends BlockContainer {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
|
||||
/*TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(x, y, z);
|
||||
|
||||
if(loot != null && loot.items.isEmpty()) {
|
||||
loot.addItem(new ItemStack(ModItems.gun_lever_action), 0, 0, 0);
|
||||
}*/
|
||||
|
||||
//LootGenerator.lootCapStash(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
|
||||
|
||||
@ -319,6 +319,8 @@ public class BlockModDoor extends Block {
|
||||
return ModItems.door_metal;
|
||||
else if (this == ModBlocks.door_office)
|
||||
return ModItems.door_office;
|
||||
else if (this == ModBlocks.door_red)
|
||||
return ModItems.door_red;
|
||||
else
|
||||
return ModItems.door_bunker;
|
||||
}
|
||||
@ -379,6 +381,8 @@ public class BlockModDoor extends Block {
|
||||
return ModItems.door_metal;
|
||||
else if (this == ModBlocks.door_office)
|
||||
return ModItems.door_office;
|
||||
else if (this == ModBlocks.door_red)
|
||||
return ModItems.door_red;
|
||||
else
|
||||
return ModItems.door_bunker;
|
||||
}
|
||||
|
||||
148
src/main/java/com/hbm/blocks/generic/BlockPedestal.java
Normal file
148
src/main/java/com/hbm/blocks/generic/BlockPedestal.java
Normal file
@ -0,0 +1,148 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
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.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPedestal extends BlockContainer {
|
||||
|
||||
protected IIcon iconSide;
|
||||
|
||||
public BlockPedestal() {
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityPedestal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":pedestal_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 0 || side == 1 ? this.blockIcon : this.iconSide;
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) return true;
|
||||
if(player.isSneaking()) return false;
|
||||
|
||||
TileEntityPedestal pedestal = (TileEntityPedestal) world.getTileEntity(x, y, z);
|
||||
|
||||
if(pedestal.item == null && player.getHeldItem() != null) {
|
||||
pedestal.item = player.getHeldItem().copy();
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = null;
|
||||
pedestal.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
} else if(pedestal.item != null && player.getHeldItem() == null) {
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = pedestal.item.copy();
|
||||
pedestal.item = null;
|
||||
pedestal.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
TileEntityPedestal entity = (TileEntityPedestal) world.getTileEntity(x, y, z);
|
||||
if(entity != null && entity.item != null) {
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y, z + 0.5, entity.item.copy());
|
||||
world.spawnEntityInWorld(item);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
public static class TileEntityPedestal extends TileEntity {
|
||||
|
||||
public ItemStack item;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.writeToNBT(nbt);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
this.readFromNBT(pkt.func_148857_g());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.item = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("item"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
if(this.item != null) {
|
||||
NBTTagCompound stack = new NBTTagCompound();
|
||||
this.item.writeToNBT(stack);
|
||||
nbt.setTag("item", stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
52
src/main/java/com/hbm/blocks/generic/BlockRedBrick.java
Normal file
52
src/main/java/com/hbm/blocks/generic/BlockRedBrick.java
Normal file
@ -0,0 +1,52 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockRedBrick extends Block {
|
||||
|
||||
protected IIcon iconFront;
|
||||
protected IIcon iconTop;
|
||||
|
||||
public BlockRedBrick(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":brick_red");
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":brick_red_top");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":brick_base");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == meta ? (side == 0 || side == 1 ? this.iconTop : this.iconFront) : this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
int l = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
||||
world.setBlockMetadataWithNotify(x, y, z, l, 2);
|
||||
}
|
||||
}
|
||||
@ -13,7 +13,6 @@ import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.MetaBlock;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
@ -151,7 +150,7 @@ public class BlockToolConversion extends BlockMulti implements IToolable, ILookO
|
||||
public static HashMap<Pair<ToolType, MetaBlock>, Pair<AStack[], MetaBlock>> conversions = new HashMap();
|
||||
|
||||
public static void registerRecipes() {
|
||||
conversions.put(new Pair(ToolType.BOLT, new MetaBlock(ModBlocks.watz_end, 0)), new Pair(new AStack[] {new ComparableStack(ModItems.bolt_dura_steel, 4)}, new MetaBlock(ModBlocks.watz_end, 1)));
|
||||
conversions.put(new Pair(ToolType.BOLT, new MetaBlock(ModBlocks.watz_end, 0)), new Pair(new AStack[] {new OreDictStack(OreDictManager.DURA.bolt(), 4)}, new MetaBlock(ModBlocks.watz_end, 1)));
|
||||
conversions.put(new Pair(ToolType.TORCH, new MetaBlock(ModBlocks.fusion_conductor, 0)), new Pair(new AStack[] {new OreDictStack(OreDictManager.STEEL.plateCast())}, new MetaBlock(ModBlocks.fusion_conductor, 1)));
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@ package com.hbm.blocks.generic;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.tileentity.deco.TileEntityBomber;
|
||||
import com.hbm.tileentity.deco.TileEntityDecoBlock;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
@ -28,17 +27,11 @@ public class DecoBlock extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
|
||||
if(this == ModBlocks.bomber)
|
||||
return new TileEntityBomber();
|
||||
|
||||
if(this == ModBlocks.steel_scaffold || this == ModBlocks.steel_beam)
|
||||
return null;
|
||||
|
||||
if(this == ModBlocks.steel_scaffold || this == ModBlocks.steel_beam) return null;
|
||||
return new TileEntityDecoBlock();
|
||||
}
|
||||
|
||||
public static int renderIDBeam = RenderingRegistry.getNextAvailableRenderId();
|
||||
public static int renderIDBeam = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
@ -59,158 +52,136 @@ public class DecoBlock extends BlockContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
if(this == ModBlocks.bomber)
|
||||
return null;
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0)
|
||||
{
|
||||
if(i == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
if(i == 1) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
if(i == 2)
|
||||
{
|
||||
if(i == 2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
}
|
||||
if(i == 3)
|
||||
{
|
||||
if(i == 3) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
|
||||
{
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) {
|
||||
int te = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_);
|
||||
float f = 0.0625F;
|
||||
|
||||
if(this == ModBlocks.steel_wall)
|
||||
{
|
||||
switch(te)
|
||||
{
|
||||
float f = 0.0625F;
|
||||
|
||||
if(this == ModBlocks.steel_wall) {
|
||||
switch(te) {
|
||||
case 4:
|
||||
this.setBlockBounds(14*f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
this.setBlockBounds(14 * f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(0.0F, 0.0F, 14*f, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
this.setBlockBounds(0.0F, 0.0F, 14 * f, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case 5:
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 2*f, 1.0F, 1.0F);
|
||||
break;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 2 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 2*f);
|
||||
break;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 2 * f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_corner)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_roof)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1*f, 1.0F);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_beam)
|
||||
{
|
||||
this.setBlockBounds(7*f, 0.0F, 7*f, 9*f, 1.0F, 9*f);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_scaffold)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 2*f, 1.0F, 1.0F, 14*f);
|
||||
switch(te)
|
||||
{
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_corner) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_roof) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1 * f, 1.0F);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_beam) {
|
||||
this.setBlockBounds(7 * f, 0.0F, 7 * f, 9 * f, 1.0F, 9 * f);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_scaffold) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
switch(te) {
|
||||
case 4:
|
||||
this.setBlockBounds(2*f, 0.0F, 0.0F, 14*f, 1.0F, 1.0F);
|
||||
break;
|
||||
this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(0.0F, 0.0F, 2*f, 1.0F, 1.0F, 14*f);
|
||||
break;
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
break;
|
||||
case 5:
|
||||
this.setBlockBounds(2*f, 0.0F, 0.0F, 14*f, 1.0F, 1.0F);
|
||||
break;
|
||||
this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(0.0F, 0.0F, 2*f, 1.0F, 1.0F, 14*f);
|
||||
break;
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
|
||||
int te = world.getBlockMetadata(x, y, z);
|
||||
float f = 0.0625F;
|
||||
|
||||
if(this == ModBlocks.steel_wall)
|
||||
{
|
||||
switch(te)
|
||||
{
|
||||
float f = 0.0625F;
|
||||
|
||||
if(this == ModBlocks.steel_wall) {
|
||||
switch(te) {
|
||||
case 4:
|
||||
this.setBlockBounds(14*f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
this.setBlockBounds(14 * f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(0.0F, 0.0F, 14*f, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
this.setBlockBounds(0.0F, 0.0F, 14 * f, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case 5:
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 2*f, 1.0F, 1.0F);
|
||||
break;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 2 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 2*f);
|
||||
break;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 2 * f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_corner)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_roof)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1*f, 1.0F);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_beam)
|
||||
{
|
||||
this.setBlockBounds(7*f, 0.0F, 7*f, 9*f, 1.0F, 9*f);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_scaffold)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 2*f, 1.0F, 1.0F, 14*f);
|
||||
switch(te)
|
||||
{
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_corner) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_roof) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1 * f, 1.0F);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_beam) {
|
||||
this.setBlockBounds(7 * f, 0.0F, 7 * f, 9 * f, 1.0F, 9 * f);
|
||||
}
|
||||
|
||||
if(this == ModBlocks.steel_scaffold) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
switch(te) {
|
||||
case 4:
|
||||
this.setBlockBounds(2*f, 0.0F, 0.0F, 14*f, 1.0F, 1.0F);
|
||||
break;
|
||||
this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(0.0F, 0.0F, 2*f, 1.0F, 1.0F, 14*f);
|
||||
break;
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
break;
|
||||
case 5:
|
||||
this.setBlockBounds(2*f, 0.0F, 0.0F, 14*f, 1.0F, 1.0F);
|
||||
break;
|
||||
this.setBlockBounds(2 * f, 0.0F, 0.0F, 14 * f, 1.0F, 1.0F);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(0.0F, 0.0F, 2*f, 1.0F, 1.0F, 14*f);
|
||||
break;
|
||||
this.setBlockBounds(0.0F, 0.0F, 2 * f, 1.0F, 1.0F, 14 * f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
}
|
||||
|
||||
46
src/main/java/com/hbm/blocks/machine/BlockCMAnchor.java
Normal file
46
src/main/java/com/hbm/blocks/machine/BlockCMAnchor.java
Normal file
@ -0,0 +1,46 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCMAnchor extends Block {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
|
||||
public BlockCMAnchor() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":cmt_terminal_front");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":cmt_terminal_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
}
|
||||
@ -7,12 +7,13 @@ import java.util.Random;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityBarrel;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
@ -28,6 +29,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@ -72,7 +76,19 @@ public class BlockFluidBarrel extends BlockContainer implements ITooltipProvider
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
return true;
|
||||
|
||||
} else {
|
||||
} else if(player.isSneaking()){
|
||||
TileEntityBarrel mileEntity = (TileEntityBarrel) world.getTileEntity(x, y, z);
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemFluidIdentifier) {
|
||||
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, x, y, z, player.getHeldItem());
|
||||
|
||||
mileEntity.tank.setTankType(type);
|
||||
mileEntity.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
|
||||
}
|
||||
return true;
|
||||
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -183,9 +199,9 @@ public class BlockFluidBarrel extends BlockContainer implements ITooltipProvider
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0, 0);
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "tank");
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.render.block.ct.CT;
|
||||
@ -53,6 +54,6 @@ public class BlockHadronCoil extends Block implements IBlockCT, ITooltipProvider
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
||||
list.add(I18nUtil.resolveKey("info.coil") + ": " + String.format("%,d", factor));
|
||||
list.add(I18nUtil.resolveKey("info.coil") + ": " + String.format(Locale.US, "%,d", factor));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.IBlockMulti;
|
||||
@ -265,7 +266,7 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
|
||||
if(full) {
|
||||
|
||||
title = storage.type.getDisplayName();
|
||||
text.add(String.format("%,d", storage.getStockpile()) + " / " + String.format("%,d", storage.getCapacity()));
|
||||
text.add(String.format(Locale.US, "%,d", storage.getStockpile()) + " / " + String.format(Locale.US, "%,d", storage.getCapacity()));
|
||||
|
||||
double percent = (double) storage.getStockpile() / (double) storage.getCapacity();
|
||||
int charge = (int) Math.floor(percent * 10_000D);
|
||||
@ -286,7 +287,7 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
|
||||
|
||||
if(type != null) {
|
||||
list.add(EnumChatFormatting.GOLD + type.getDisplayName());
|
||||
list.add(String.format("%,d", stack.stackTagCompound.getInteger("stack")) + " / " + String.format("%,d", getCapacity(stack.getItemDamage())));
|
||||
list.add(String.format(Locale.US, "%,d", stack.stackTagCompound.getInteger("stack")) + " / " + String.format(Locale.US, "%,d", getCapacity(stack.getItemDamage())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
@ -78,7 +77,7 @@ public class DeuteriumTower extends BlockDummyable implements ILookOverlay {
|
||||
text.add((tower.power < tower.getMaxPower() / 20 ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + "Power: " + BobMathUtil.getShortNumber(tower.power) + "HE");
|
||||
|
||||
for(int i = 0; i < tower.tanks.length; i++)
|
||||
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + tower.tanks[i].getTankType().getName().toLowerCase(Locale.US)) + ": " + tower.tanks[i].getFill() + "/" + tower.tanks[i].getMaxFill() + "mB");
|
||||
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + tower.tanks[i].getTankType().getLocalizedName() + ": " + tower.tanks[i].getFill() + "/" + tower.tanks[i].getMaxFill() + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityFWatzCore;
|
||||
|
||||
import api.hbm.energy.IEnergyConnectorBlock;
|
||||
import api.hbm.fluid.IFluidConnectorBlock;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -26,7 +27,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class FWatzHatch extends Block implements IFluidConnectorBlock {
|
||||
public class FWatzHatch extends Block implements IEnergyConnectorBlock, IFluidConnectorBlock {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
@ -158,4 +159,9 @@ public class FWatzHatch extends Block implements IFluidConnectorBlock {
|
||||
public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
return type == Fluids.AMAT || type == Fluids.ASCHRAB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
@ -75,7 +76,7 @@ public class HeaterElectric extends BlockDummyable implements ILookOverlay, IToo
|
||||
TileEntityHeaterElectric heater = (TileEntityHeaterElectric) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(String.format("%,d", heater.heatEnergy) + " TU");
|
||||
text.add(String.format(Locale.US, "%,d", heater.heatEnergy) + " TU");
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + heater.getConsumption() + " HE/t");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + heater.getHeatGen() + " TU/t");
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
@ -63,7 +64,7 @@ public class HeaterHeatex extends BlockDummyable implements ILookOverlay, IToolt
|
||||
TileEntityHeaterHeatex heater = (TileEntityHeaterHeatex) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(String.format("%,d", heater.heatEnergy) + " TU");
|
||||
text.add(String.format(Locale.US, "%,d", heater.heatEnergy) + " TU");
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
@ -97,7 +98,7 @@ public class HeaterOilburner extends BlockDummyable implements ILookOverlay, ITo
|
||||
FluidType type = heater.tank.getTankType();
|
||||
if(type.hasTrait(FT_Flammable.class)) {
|
||||
int heat = (int)(type.getTrait(FT_Flammable.class).getHeatEnergy() * heater.setting / 1000);
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + String.format("%,d", heat) + " TU/t");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + String.format(Locale.US, "%,d", heat) + " TU/t");
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
|
||||
38
src/main/java/com/hbm/blocks/machine/MachineArcWelder.java
Normal file
38
src/main/java/com/hbm/blocks/machine/MachineArcWelder.java
Normal file
@ -0,0 +1,38 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineArcWelder;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineArcWelder extends BlockDummyable {
|
||||
|
||||
public MachineArcWelder(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineArcWelder();
|
||||
return new TileEntityProxyCombo().inventory().power().fluid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {1, 0, 1, 0, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -24,10 +24,8 @@ import net.minecraft.world.World;
|
||||
|
||||
public class MachineAutocrafter extends BlockContainer {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconBottom;
|
||||
@SideOnly(Side.CLIENT) private IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) private IIcon iconBottom;
|
||||
|
||||
public MachineAutocrafter() {
|
||||
super(Material.iron);
|
||||
@ -67,48 +65,48 @@ public class MachineAutocrafter extends BlockContainer {
|
||||
}
|
||||
}
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private final Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
|
||||
ISidedInventory tileentityfurnace = (ISidedInventory) p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
ISidedInventory tile = (ISidedInventory) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tileentityfurnace != null) {
|
||||
if(tile != null) {
|
||||
|
||||
for(int i1 = 10; i1 < tileentityfurnace.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
for(int i1 = 10; i1 < tile.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tile.getStackInSlot(i1);
|
||||
|
||||
if(itemstack != null) {
|
||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while(itemstack.stackSize > 0) {
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
int j1 = this.rand.nextInt(21) + 10;
|
||||
|
||||
if(j1 > itemstack.stackSize) {
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
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) this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) this.field_149933_a.nextGaussian() * f3;
|
||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||
entityitem.motionX = (float) this.rand.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) this.rand.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) this.rand.nextGaussian() * f3;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||
world.func_147453_f(x, y, z, block);
|
||||
}
|
||||
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
@ -62,7 +61,7 @@ public class MachineAutosaw extends BlockContainer implements ILookOverlay, IToo
|
||||
if(saw.acceptedFuels.contains(type)) {
|
||||
saw.tank.setTankType(type);
|
||||
saw.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase(Locale.US))).appendSibling(new ChatComponentText("!")));
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -84,7 +83,7 @@ public class MachineAutosaw extends BlockContainer implements ILookOverlay, IToo
|
||||
TileEntityMachineAutosaw saw = (TileEntityMachineAutosaw) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(I18nUtil.resolveKey("hbmfluid." + saw.tank.getTankType().getName().toLowerCase(Locale.US)) + ": " + saw.tank.getFill() + "/" + saw.tank.getMaxFill() + "mB");
|
||||
text.add(saw.tank.getTankType().getLocalizedName() + ": " + saw.tank.getFill() + "/" + saw.tank.getMaxFill() + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -6,13 +6,14 @@ import java.util.List;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBAT9000;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -20,6 +21,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -88,7 +92,26 @@ public class MachineBigAssTank9000 extends BlockDummyable implements IPersistent
|
||||
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]); //we can do this because nobody is stopping me from doing this
|
||||
return true;
|
||||
} else {
|
||||
} else if(player.isSneaking()){
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
TileEntityMachineBAT9000 trialEntity = (TileEntityMachineBAT9000) world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(trialEntity != null) {
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemFluidIdentifier) {
|
||||
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, pos[0], pos[1], pos[2], player.getHeldItem());
|
||||
|
||||
trialEntity.tank.setTankType(type);
|
||||
trialEntity.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -117,8 +140,8 @@ public class MachineBigAssTank9000 extends BlockDummyable implements IPersistent
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0, 0);
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "tank");
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,30 +147,10 @@ public class MachineBoiler extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityMachineBoiler) {
|
||||
|
||||
TileEntityMachineBoiler entity = (TileEntityMachineBoiler) te;
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
if(te instanceof TileEntityMachineBoilerElectric) {
|
||||
|
||||
TileEntityMachineBoilerElectric entity = (TileEntityMachineBoilerElectric) te;
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
}
|
||||
}
|
||||
} else if(!player.isSneaking()) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
@ -71,7 +70,7 @@ public class MachineCatalyticCracker extends BlockDummyable implements ILookOver
|
||||
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, pos[0], pos[1], pos[2], player.getHeldItem());
|
||||
cracker.tanks[0].setTankType(type);
|
||||
cracker.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase(Locale.US))).appendSibling(new ChatComponentText("!")));
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -130,7 +129,7 @@ public class MachineCatalyticCracker extends BlockDummyable implements ILookOver
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
for(int i = 0; i < cracker.tanks.length; i++)
|
||||
text.add((i < 2 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + cracker.tanks[i].getTankType().getName().toLowerCase(Locale.US)) + ": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB");
|
||||
text.add((i < 2 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + cracker.tanks[i].getTankType().getLocalizedName() + ": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -1,15 +1,20 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityChimneyBrick;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineChimneyBrick extends BlockDummyable {
|
||||
public class MachineChimneyBrick extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineChimneyBrick(Material mat) {
|
||||
super(mat);
|
||||
@ -41,4 +46,9 @@ public class MachineChimneyBrick extends BlockDummyable {
|
||||
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o + 1);
|
||||
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,54 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityChimneyIndustrial;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineChimneyIndustrial extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineChimneyIndustrial(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12) return new TileEntityChimneyIndustrial();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {22, 0, 1, 1, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o);
|
||||
this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o);
|
||||
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o + 1);
|
||||
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
@ -1,257 +1,21 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
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.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCoal;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@Deprecated
|
||||
public class MachineCoal extends BlockContainer {
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private final boolean isActive;
|
||||
private static boolean keepInventory;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
|
||||
public MachineCoal(boolean blockState) {
|
||||
super(Material.iron);
|
||||
isActive = blockState;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_coal_front_on" : ":machine_coal_front_off"));
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_coal_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.machine_coal_off);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
this.setDefaultDirection(world, x, y, z);
|
||||
}
|
||||
|
||||
private void setDefaultDirection(World world, int x, int y, int z) {
|
||||
if(!world.isRemote)
|
||||
{
|
||||
Block block1 = world.getBlock(x, y, z - 1);
|
||||
Block block2 = world.getBlock(x, y, z + 1);
|
||||
Block block3 = world.getBlock(x - 1, y, z);
|
||||
Block block4 = world.getBlock(x + 1, y, z);
|
||||
|
||||
byte b0 = 3;
|
||||
|
||||
if(block1.func_149730_j() && !block2.func_149730_j())
|
||||
{
|
||||
b0 = 3;
|
||||
}
|
||||
if(block2.func_149730_j() && !block1.func_149730_j())
|
||||
{
|
||||
b0 = 2;
|
||||
}
|
||||
if(block3.func_149730_j() && !block4.func_149730_j())
|
||||
{
|
||||
b0 = 5;
|
||||
}
|
||||
if(block4.func_149730_j() && !block3.func_149730_j())
|
||||
{
|
||||
b0 = 4;
|
||||
}
|
||||
|
||||
world.setBlockMetadataWithNotify(x, y, z, b0, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
}
|
||||
if(i == 2)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
}
|
||||
if(i == 3)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
|
||||
if(itemStack.hasDisplayName())
|
||||
{
|
||||
((TileEntityMachineCoal)world.getTileEntity(x, y, z)).setCustomName(itemStack.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
TileEntityMachineCoal entity = (TileEntityMachineCoal) world.getTileEntity(x, y, z);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachineCoal();
|
||||
}
|
||||
|
||||
public static void updateBlockState(boolean isProcessing, World world, int x, int y, int z) {
|
||||
int i = world.getBlockMetadata(x, y, z);
|
||||
TileEntity entity = world.getTileEntity(x, y, z);
|
||||
keepInventory = true;
|
||||
|
||||
if(isProcessing)
|
||||
{
|
||||
world.setBlock(x, y, z, ModBlocks.machine_coal_on);
|
||||
}else{
|
||||
world.setBlock(x, y, z, ModBlocks.machine_coal_off);
|
||||
}
|
||||
|
||||
keepInventory = false;
|
||||
world.setBlockMetadataWithNotify(x, y, z, i, 2);
|
||||
|
||||
if(entity != null) {
|
||||
entity.validate();
|
||||
world.setTileEntity(x, y, z, entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
{
|
||||
if (!keepInventory)
|
||||
{
|
||||
TileEntityMachineCoal tileentityfurnace = (TileEntityMachineCoal)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if (tileentityfurnace != null)
|
||||
{
|
||||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + 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)this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
|
||||
{
|
||||
if (isActive)
|
||||
{
|
||||
int l = p_149734_1_.getBlockMetadata(x, y, z);
|
||||
float f = x + 0.5F;
|
||||
float f1 = y + 0.0F + rand.nextFloat() * 6.0F / 16.0F;
|
||||
float f2 = z + 0.5F;
|
||||
float f3 = 0.52F;
|
||||
float f4 = rand.nextFloat() * 0.6F - 0.3F;
|
||||
|
||||
if (l == 4)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 5)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 2)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 3)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.tileentity.machine.TileEntityCondenser;
|
||||
@ -39,7 +38,7 @@ public class MachineCondenser extends BlockContainer implements ILookOverlay {
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
for(int i = 0; i < condenser.tanks.length; i++)
|
||||
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + condenser.tanks[i].getTankType().getName().toLowerCase(Locale.US)) + ": " + condenser.tanks[i].getFill() + "/" + condenser.tanks[i].getMaxFill() + "mB");
|
||||
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET +condenser.tanks[i].getTankType().getLocalizedName() + ": " + condenser.tanks[i].getFill() + "/" + condenser.tanks[i].getMaxFill() + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -0,0 +1,81 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityCondenserPowered;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineCondenserPowered extends BlockDummyable implements ILookOverlay {
|
||||
|
||||
public MachineCondenserPowered(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int meta) {
|
||||
if(meta >= 12) return new TileEntityCondenserPowered();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().power().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {2, 0, 1, 1, 3, 3};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x = x + dir.offsetX * o;
|
||||
z = z + dir.offsetZ * o;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
this.makeExtra(world, x + rot.offsetX * 3, y + 1, z + rot.offsetZ * 3);
|
||||
this.makeExtra(world, x - rot.offsetX * 3, y + 1, z - rot.offsetZ * 3);
|
||||
this.makeExtra(world, x + dir.offsetX + rot.offsetX, y + 1, z + dir.offsetZ + rot.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX - rot.offsetX, y + 1, z + dir.offsetZ - rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX + rot.offsetX, y + 1, z - dir.offsetZ + rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX - rot.offsetX, y + 1, z - dir.offsetZ - rot.offsetZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityCondenserPowered)) return;
|
||||
|
||||
TileEntityCondenserPowered tower = (TileEntityCondenserPowered) te;
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
text.add(BobMathUtil.getShortNumber(tower.power) + "HE / " + BobMathUtil.getShortNumber(tower.maxPower) + "HE");
|
||||
|
||||
for(int i = 0; i < tower.tanks.length; i++)
|
||||
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + tower.tanks[i].getTankType().getLocalizedName() + ": " + tower.tanks[i].getFill() + "/" + tower.tanks[i].getMaxFill() + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
173
src/main/java/com/hbm/blocks/machine/MachineConveyorPress.java
Normal file
173
src/main/java/com/hbm/blocks/machine/MachineConveyorPress.java
Normal file
@ -0,0 +1,173 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.items.machine.ItemStamp;
|
||||
import com.hbm.tileentity.machine.TileEntityConveyorPress;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import api.hbm.conveyor.IConveyorBelt;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineConveyorPress extends BlockDummyable implements IConveyorBelt, ILookOverlay, IToolable, ITooltipProvider {
|
||||
|
||||
public MachineConveyorPress(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityConveyorPress();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {2, 0, 0, 0, 0, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityConveyorPress))
|
||||
return false;
|
||||
|
||||
TileEntityConveyorPress press = (TileEntityConveyorPress) te;
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemStamp && press.slots[0] == null) {
|
||||
press.slots[0] = player.getHeldItem().copy();
|
||||
press.slots[0].stackSize = 1;
|
||||
player.getHeldItem().stackSize--;
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:item.upgradePlug", 1.0F, 1.0F);
|
||||
press.markChanged();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
|
||||
if(tool != ToolType.SCREWDRIVER) return false;
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityConveyorPress))
|
||||
return false;
|
||||
|
||||
TileEntityConveyorPress press = (TileEntityConveyorPress) te;
|
||||
|
||||
if(press.slots[0] == null) return false;
|
||||
|
||||
if(!player.inventory.addItemStackToInventory(press.slots[0].copy())) {
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, press.slots[0].copy());
|
||||
world.spawnEntityInWorld(item);
|
||||
} else {
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
}
|
||||
|
||||
press.slots[0] = null;
|
||||
press.markChanged();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getTravelLocation(World world, int x, int y, int z, Vec3 itemPos, double speed) {
|
||||
ForgeDirection dir = this.getTravelDirection(world, x, y, z, itemPos);
|
||||
Vec3 snap = this.getClosestSnappingPosition(world, x, y, z, itemPos);
|
||||
Vec3 dest = Vec3.createVectorHelper(snap.xCoord - dir.offsetX * speed, snap.yCoord - dir.offsetY * speed, snap.zCoord - dir.offsetZ * speed);
|
||||
Vec3 motion = Vec3.createVectorHelper((dest.xCoord - itemPos.xCoord), (dest.yCoord - itemPos.yCoord), (dest.zCoord - itemPos.zCoord));
|
||||
double len = motion.lengthVector();
|
||||
Vec3 ret = Vec3.createVectorHelper(itemPos.xCoord + motion.xCoord / len * speed, itemPos.yCoord + motion.yCoord / len * speed, itemPos.zCoord + motion.zCoord / len * speed);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public ForgeDirection getTravelDirection(World world, int x, int y, int z, Vec3 itemPos) {
|
||||
int meta = world.getBlockMetadata(x, y - 1, z) - offset;
|
||||
return ForgeDirection.getOrientation(meta).getRotation(ForgeDirection.UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getClosestSnappingPosition(World world, int x, int y, int z, Vec3 itemPos) {
|
||||
|
||||
ForgeDirection dir = this.getTravelDirection(world, x, y, z, itemPos);
|
||||
itemPos.xCoord = MathHelper.clamp_double(itemPos.xCoord, x, x + 1);
|
||||
itemPos.zCoord = MathHelper.clamp_double(itemPos.zCoord, z, z + 1);
|
||||
double posX = x + 0.5;
|
||||
double posZ = z + 0.5;
|
||||
if(dir.offsetX != 0) posX = itemPos.xCoord;
|
||||
if(dir.offsetZ != 0) posZ = itemPos.zCoord;
|
||||
return Vec3.createVectorHelper(posX, y + 0.25, posZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canItemStay(World world, int x, int y, int z, Vec3 itemPos) {
|
||||
return world.getBlock(x, y - 1, z) == this && world.getBlockMetadata(x, y - 1, z) >= 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityConveyorPress))
|
||||
return;
|
||||
|
||||
TileEntityConveyorPress press = (TileEntityConveyorPress) te;
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
text.add(BobMathUtil.getShortNumber(press.power) + "HE / " + BobMathUtil.getShortNumber(press.maxPower) + "HE");
|
||||
text.add("Installed stamp: " + ((press.syncStack == null || press.syncStack.getItem() == null) ? (EnumChatFormatting.RED + "NONE") : press.syncStack.getDisplayName()));
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
@ -25,7 +25,7 @@ public class MachineCyclotron extends BlockDummyable {
|
||||
return new TileEntityMachineCyclotron();
|
||||
|
||||
if(meta >= 6)
|
||||
return new TileEntityProxyCombo(false, true, true);
|
||||
return new TileEntityProxyCombo().inventory().power().fluid();
|
||||
|
||||
return null;
|
||||
}
|
||||
@ -93,12 +93,16 @@ public class MachineCyclotron extends BlockDummyable {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
this.makeExtra(world, x + dir.offsetX * o + 2, y, z + dir.offsetZ * o + 1);
|
||||
this.makeExtra(world, x + dir.offsetX * o + 2, y, z + dir.offsetZ * o);
|
||||
this.makeExtra(world, x + dir.offsetX * o + 2, y, z + dir.offsetZ * o - 1);
|
||||
this.makeExtra(world, x + dir.offsetX * o - 2, y, z + dir.offsetZ * o + 1);
|
||||
this.makeExtra(world, x + dir.offsetX * o - 2, y, z + dir.offsetZ * o);
|
||||
this.makeExtra(world, x + dir.offsetX * o - 2, y, z + dir.offsetZ * o - 1);
|
||||
this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o + 2);
|
||||
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o + 2);
|
||||
this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o + 2);
|
||||
this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o - 2);
|
||||
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o - 2);
|
||||
this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o - 2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.lib.RefStrings;
|
||||
@ -67,7 +66,7 @@ public class MachineDeuteriumExtractor extends BlockContainer implements ILookOv
|
||||
text.add((extractor.power < extractor.getMaxPower() / 20 ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + "Power: " + BobMathUtil.getShortNumber(extractor.power) + "HE");
|
||||
|
||||
for(int i = 0; i < extractor.tanks.length; i++)
|
||||
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + extractor.tanks[i].getTankType().getName().toLowerCase(Locale.US)) + ": " + extractor.tanks[i].getFill() + "/" + extractor.tanks[i].getMaxFill() + "mB");
|
||||
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + extractor.tanks[i].getTankType().getLocalizedName() + ": " + extractor.tanks[i].getFill() + "/" + extractor.tanks[i].getMaxFill() + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -0,0 +1,81 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineExposureChamber;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineExposureChamber extends BlockDummyable {
|
||||
|
||||
public MachineExposureChamber(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineExposureChamber();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().power();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {4, 0, 2, 2, 2, 2};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP).getOpposite();
|
||||
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, 0, 0, 0, -3, 8}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y + 2, z, new int[] {0, 0, 1, -1, -3, 6}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y + 2, z, new int[] {0, 0, -1, 1, -3, 6}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + rot.offsetX * 7, y, z + rot.offsetZ * 7, new int[] {3, 0, 1, -1, 0, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + rot.offsetX * 7, y, z + rot.offsetZ * 7, new int[] {3, 0, -1, 1, 0, 1}, this, dir);
|
||||
|
||||
this.makeExtra(world, x + rot.offsetX * 7 + dir.offsetX, y, z + rot.offsetZ * 7 + dir.offsetZ);
|
||||
this.makeExtra(world, x + rot.offsetX * 7 - dir.offsetX, y, z + rot.offsetZ * 7 - dir.offsetZ);
|
||||
this.makeExtra(world, x + rot.offsetX * 8 + dir.offsetX, y, z + rot.offsetZ * 8 + dir.offsetZ);
|
||||
this.makeExtra(world, x + rot.offsetX * 8 - dir.offsetX, y, z + rot.offsetZ * 8 - dir.offsetZ);
|
||||
this.makeExtra(world, x + rot.offsetX * 8, y, z + rot.offsetZ * 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP).getOpposite();
|
||||
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, getDimensions(), x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, 0, 0, 0, -3, 8}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {0, 0, 1, -1, -3, 6}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {0, 0, -1, 1, -3, 6}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + rot.offsetX * 7, y, z + rot.offsetZ * 7, new int[] {3, 0, 1, -1, 0, 1}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + rot.offsetX * 7, y, z + rot.offsetZ * 7, new int[] {3, 0, -1, 1, 0, 1}, x, y, z, dir)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return super.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
}
|
||||
@ -7,15 +7,16 @@ import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.entity.projectile.EntityBombletZeta;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Flammable;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.IRepairable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFluidTank;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
@ -28,6 +29,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
@ -62,7 +66,8 @@ public class MachineFluidTank extends BlockDummyable implements IPersistentInfoP
|
||||
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
}
|
||||
else if(!player.isSneaking()) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
@ -75,9 +80,30 @@ public class MachineFluidTank extends BlockDummyable implements IPersistentInfoP
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
else if(player.isSneaking()){
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
TileEntityMachineFluidTank tank = (TileEntityMachineFluidTank) world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(tank != null) {
|
||||
if(tank.hasExploded) return false;
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemFluidIdentifier) {
|
||||
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, pos[0], pos[1], pos[2], player.getHeldItem());
|
||||
|
||||
tank.tank.setTankType(type);
|
||||
tank.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}else {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -99,7 +125,7 @@ public class MachineFluidTank extends BlockDummyable implements IPersistentInfoP
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "tank");
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -13,7 +13,6 @@ import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineFrackingTower;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -113,7 +112,7 @@ public class MachineFrackingTower extends BlockDummyable implements IPersistentI
|
||||
for(int i = 0; i < 2; i++) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "t" + i);
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
@ -74,7 +73,7 @@ public class MachineFractionTower extends BlockDummyable implements ILookOverlay
|
||||
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, pos[0], pos[1], pos[2], player.getHeldItem());
|
||||
frac.tanks[0].setTankType(type);
|
||||
frac.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase(Locale.US))).appendSibling(new ChatComponentText("!")));
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -116,7 +115,7 @@ public class MachineFractionTower extends BlockDummyable implements ILookOverlay
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
for(int i = 0; i < cracker.tanks.length; i++)
|
||||
text.add((i == 0 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + cracker.tanks[i].getTankType().getName().toLowerCase(Locale.US)) + ": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB");
|
||||
text.add((i == 0 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + cracker.tanks[i].getTankType().getLocalizedName() + ": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
138
src/main/java/com/hbm/blocks/machine/MachineFunnel.java
Normal file
138
src/main/java/com/hbm/blocks/machine/MachineFunnel.java
Normal file
@ -0,0 +1,138 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.blocks.rail.IRenderBlock;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.ObjUtil;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineFunnel;
|
||||
|
||||
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.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.obj.WavefrontObject;
|
||||
|
||||
public class MachineFunnel extends BlockContainer implements ITooltipProvider, IRenderBlock {
|
||||
|
||||
@SideOnly(Side.CLIENT) private IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) private IIcon iconBottom;
|
||||
|
||||
public MachineFunnel() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override public int getRenderType() { return renderID; }
|
||||
@Override public boolean isOpaqueCube() { return false; }
|
||||
@Override public boolean renderAsNormalBlock() { return false; }
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_funnel_top");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_funnel_side");
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":machine_funnel_bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityMachineFunnel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
TileEntity entity = world.getTileEntity(x, y, z);
|
||||
if(entity instanceof TileEntityMachineFunnel) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private final Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
ISidedInventory tile = (ISidedInventory) world.getTileEntity(x, y, z);
|
||||
if(tile != null) {
|
||||
for(int i1 = 0; i1 < tile.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tile.getStackInSlot(i1);
|
||||
if(itemstack != null) {
|
||||
float f = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
while(itemstack.stackSize > 0) {
|
||||
int j1 = this.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) this.rand.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) this.rand.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) this.rand.nextGaussian() * f3;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.func_147453_f(x, y, z, block);
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInventory(Tessellator tessellator, Block block, int metadata) {
|
||||
GL11.glTranslatef(0F, -0.5F, 0F);
|
||||
tessellator.startDrawingQuads();
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.funnel, "Top", block.getIcon(1, 0), tessellator, 0, false);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.funnel, "Bottom", block.getIcon(0, 0), tessellator, 0, false);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.funnel, "Side", block.getIcon(2, 0), tessellator, 0, false);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderWorld(Tessellator tessellator, Block block, int meta, IBlockAccess world, int x, int y, int z) {
|
||||
tessellator.addTranslation(x + 0.5F, y, z + 0.5F);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.funnel, "Top", block.getIcon(1, 0), tessellator, 0, true);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.funnel, "Bottom", block.getIcon(0, 0), tessellator, 0, true);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.funnel, "Side", block.getIcon(2, 0), tessellator, 0, true);
|
||||
tessellator.addTranslation(-x - 0.5F, -y, -z - 0.5F);
|
||||
}
|
||||
}
|
||||
@ -69,7 +69,7 @@ public class MachineHeatBoiler extends BlockDummyable implements ILookOverlay, I
|
||||
if(type.hasTrait(FT_Heatable.class) && type.getTrait(FT_Heatable.class).getEfficiency(HeatingType.BOILER) > 0) {
|
||||
boiler.tanks[0].setTankType(type);
|
||||
boiler.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase(Locale.US))).appendSibling(new ChatComponentText("!")));
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -175,9 +175,9 @@ public class MachineHeatBoiler extends BlockDummyable implements ILookOverlay, I
|
||||
if(boiler.hasExploded) return;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(String.format("%,d", boiler.heat) + "TU");
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[0].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", boiler.tanks[0].getFill()) + " / " + String.format("%,d", boiler.tanks[0].getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[1].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", boiler.tanks[1].getFill()) + " / " + String.format("%,d", boiler.tanks[1].getMaxFill()) + "mB");
|
||||
text.add(String.format(Locale.US, "%,d", boiler.heat) + "TU");
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + boiler.tanks[0].getTankType().getLocalizedName() + ": " + String.format(Locale.US, "%,d", boiler.tanks[0].getFill()) + " / " + String.format(Locale.US, "%,d", boiler.tanks[0].getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + boiler.tanks[1].getTankType().getLocalizedName() + ": " + String.format(Locale.US, "%,d", boiler.tanks[1].getFill()) + " / " + String.format(Locale.US, "%,d", boiler.tanks[1].getMaxFill()) + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ public class MachineHeatBoilerIndustrial extends BlockDummyable implements ILook
|
||||
if(type.hasTrait(FT_Heatable.class) && type.getTrait(FT_Heatable.class).getEfficiency(HeatingType.BOILER) > 0) {
|
||||
boiler.tanks[0].setTankType(type);
|
||||
boiler.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase(Locale.US))).appendSibling(new ChatComponentText("!")));
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -112,9 +112,9 @@ public class MachineHeatBoilerIndustrial extends BlockDummyable implements ILook
|
||||
TileEntityHeatBoilerIndustrial boiler = (TileEntityHeatBoilerIndustrial) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(String.format("%,d", boiler.heat) + "TU");
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[0].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", boiler.tanks[0].getFill()) + " / " + String.format("%,d", boiler.tanks[0].getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(boiler.tanks[1].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", boiler.tanks[1].getFill()) + " / " + String.format("%,d", boiler.tanks[1].getMaxFill()) + "mB");
|
||||
text.add(String.format(Locale.US, "%,d", boiler.heat) + "TU");
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + boiler.tanks[0].getTankType().getLocalizedName() + ": " + String.format(Locale.US, "%,d", boiler.tanks[0].getFill()) + " / " + String.format(Locale.US, "%,d", boiler.tanks[0].getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + boiler.tanks[1].getTankType().getLocalizedName() + ": " + String.format(Locale.US, "%,d", boiler.tanks[1].getFill()) + " / " + String.format(Locale.US, "%,d", boiler.tanks[1].getMaxFill()) + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -16,6 +16,9 @@ import com.hbm.util.I18nUtil;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
@ -82,6 +85,8 @@ public class MachineHephaestus extends BlockDummyable implements ILookOverlay {
|
||||
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, pos[0], pos[1], pos[2], player.getHeldItem());
|
||||
heatex.input.setTankType(type);
|
||||
heatex.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -107,11 +112,11 @@ public class MachineHephaestus extends BlockDummyable implements ILookOverlay {
|
||||
TileEntityMachineHephaestus heatex = (TileEntityMachineHephaestus) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(String.format("%,d", heatex.bufferedHeat) + " TU");
|
||||
text.add(String.format(Locale.US, "%,d", heatex.bufferedHeat) + " TU");
|
||||
|
||||
for(int i = 0; i < heatex.getAllTanks().length; i++) {
|
||||
FluidTank tank = heatex.getAllTanks()[i];
|
||||
text.add((i == 0 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + tank.getTankType().getName().toLowerCase(Locale.US)) + ": " + tank.getFill() + "/" + tank.getMaxFill() + "mB");
|
||||
text.add((i == 0 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + tank.getTankType().getLocalizedName() + ": " + tank.getFill() + "/" + tank.getMaxFill() + "mB");
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
|
||||
@ -72,6 +72,8 @@ public class MachineIGenerator extends BlockDummyable {
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
this.makeExtra(world, x + dir.offsetX * (o - 3), y, z + dir.offsetZ * (o - 3));
|
||||
this.makeExtra(world, x + dir.offsetX * (o - 2), y, z + dir.offsetZ * (o - 2));
|
||||
this.makeExtra(world, x + dir.offsetX * (o - 1), y, z + dir.offsetZ * (o - 1));
|
||||
this.makeExtra(world, x + dir.offsetX * (o + 2), y, z + dir.offsetZ * (o + 2));
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,6 @@ import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineOilWell;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -87,7 +86,7 @@ public class MachineOilWell extends BlockDummyable implements IPersistentInfoPro
|
||||
for(int i = 0; i < 2; i++) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "t" + i);
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,13 +5,14 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineOrbus;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -19,6 +20,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -61,7 +65,26 @@ public class MachineOrbus extends BlockDummyable implements IPersistentInfoProvi
|
||||
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]);
|
||||
return true;
|
||||
} else {
|
||||
} else if(player.isSneaking()){
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
TileEntityMachineOrbus kyleEntity = (TileEntityMachineOrbus) world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(kyleEntity != null) {
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemFluidIdentifier) {
|
||||
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, pos[0], pos[1], pos[2], player.getHeldItem());
|
||||
|
||||
kyleEntity.tank.setTankType(type);
|
||||
kyleEntity.markDirty();
|
||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -91,8 +114,8 @@ public class MachineOrbus extends BlockDummyable implements IPersistentInfoProvi
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0, 0);
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "tank");
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
|
||||
}
|
||||
}
|
||||
|
||||
108
src/main/java/com/hbm/blocks/machine/MachinePump.java
Normal file
108
src/main/java/com/hbm/blocks/machine/MachinePump.java
Normal file
@ -0,0 +1,108 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachinePumpBase;
|
||||
import com.hbm.tileentity.machine.TileEntityMachinePumpElectric;
|
||||
import com.hbm.tileentity.machine.TileEntityMachinePumpSteam;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachinePump extends BlockDummyable implements ITooltipProvider, ILookOverlay {
|
||||
|
||||
public MachinePump() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) {
|
||||
if(this == ModBlocks.pump_steam) return new TileEntityMachinePumpSteam();
|
||||
if(this == ModBlocks.pump_electric) return new TileEntityMachinePumpElectric();
|
||||
}
|
||||
if(meta >= 6) {
|
||||
if(this == ModBlocks.pump_steam) return new TileEntityProxyCombo().fluid();
|
||||
if(this == ModBlocks.pump_electric) return new TileEntityProxyCombo().fluid().power();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {3, 0, 1, 1, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
this.makeExtra(world, x - dir.offsetX + 1, y, z - dir.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX - 1, y, z - dir.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX, y, z - dir.offsetZ + 1);
|
||||
this.makeExtra(world, x - dir.offsetX, y, z - dir.offsetZ - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityMachinePumpBase)) return;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
if(te instanceof TileEntityMachinePumpSteam) {
|
||||
TileEntityMachinePumpSteam pump = (TileEntityMachinePumpSteam) te;
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + pump.steam.getTankType().getLocalizedName() + ": " + String.format(Locale.US, "%,d", pump.steam.getFill()) + " / " + String.format(Locale.US, "%,d", pump.steam.getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + pump.lps.getTankType().getLocalizedName() + ": " + String.format(Locale.US, "%,d", pump.lps.getFill()) + " / " + String.format(Locale.US, "%,d", pump.lps.getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + pump.water.getTankType().getLocalizedName() + ": " + String.format(Locale.US, "%,d", pump.water.getFill()) + " / " + String.format(Locale.US, "%,d", pump.water.getMaxFill()) + "mB");
|
||||
}
|
||||
|
||||
if(te instanceof TileEntityMachinePumpElectric) {
|
||||
TileEntityMachinePumpElectric pump = (TileEntityMachinePumpElectric) te;
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + String.format(Locale.US, "%,d", pump.power) + " / " + String.format(Locale.US, "%,d", pump.maxPower) + "HE");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + pump.water.getTankType().getLocalizedName() + ": " + String.format(Locale.US, "%,d", pump.water.getFill()) + " / " + String.format(Locale.US, "%,d", pump.water.getMaxFill()) + "mB");
|
||||
}
|
||||
|
||||
if(pos[1] > 70) {
|
||||
text.add("&[" + (BobMathUtil.getBlink() ? 0xff0000 : 0xffff00) + "&]! ! ! ALTITUDE ! ! !");
|
||||
}
|
||||
|
||||
if(!((TileEntityMachinePumpBase) te).onGround) {
|
||||
text.add("&[" + (BobMathUtil.getBlink() ? 0xff0000 : 0xffff00) + "&]! ! ! NO VALID GROUND ! ! !");
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
@ -13,7 +13,6 @@ import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -100,7 +99,7 @@ public class MachinePumpjack extends BlockDummyable implements IPersistentInfoPr
|
||||
for(int i = 0; i < 2; i++) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "t" + i);
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.config.WeaponConfig;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineRadar;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
@ -10,6 +9,8 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -21,7 +22,7 @@ public class MachineRadar extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachineRadar();
|
||||
return new TileEntityMachineRadarNT();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,41 +43,35 @@ public class MachineRadar extends BlockContainer {
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(y < WeaponConfig.radarAltitude) {
|
||||
if(y < TileEntityMachineRadarNT.radarAltitude) {
|
||||
if(world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText("[Radar] Error: Radar altitude not sufficient."));
|
||||
player.addChatMessage(new ChatComponentText("[Radar] Error: Radar altitude not sufficient.").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
return true;
|
||||
}
|
||||
|
||||
if(world.isRemote)
|
||||
{
|
||||
if(world.isRemote && !player.isSneaking()) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
TileEntityMachineRadar entity = (TileEntityMachineRadar) world.getTileEntity(x, y, z);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
}
|
||||
} else if(!player.isSneaking()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canProvidePower()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int m)
|
||||
{
|
||||
TileEntityMachineRadar entity = (TileEntityMachineRadar) world.getTileEntity(x, y, z);
|
||||
return entity.getRedPower();
|
||||
}
|
||||
@Override
|
||||
public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int m) {
|
||||
TileEntityMachineRadarNT entity = (TileEntityMachineRadarNT) world.getTileEntity(x, y, z);
|
||||
return entity.getRedPower();
|
||||
}
|
||||
|
||||
public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int m)
|
||||
{
|
||||
return isProvidingWeakPower(world, x, y, z, m);
|
||||
}
|
||||
@Override
|
||||
public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int m) {
|
||||
return isProvidingWeakPower(world, x, y, z, m);
|
||||
}
|
||||
}
|
||||
|
||||
56
src/main/java/com/hbm/blocks/machine/MachineRadarScreen.java
Normal file
56
src/main/java/com/hbm/blocks/machine/MachineRadarScreen.java
Normal file
@ -0,0 +1,56 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineRadarScreen;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineRadarScreen extends BlockDummyable {
|
||||
|
||||
public MachineRadarScreen(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return meta >= 12 ? new TileEntityMachineRadarScreen() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {1, 0, 0, 0, 1, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(world.isRemote && !player.isSneaking()) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null) return false;
|
||||
|
||||
TileEntityMachineRadarScreen screen = (TileEntityMachineRadarScreen) world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(screen.linked && world.getTileEntity(screen.refX, screen.refY, screen.refZ) instanceof TileEntityMachineRadarNT) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, screen.refX, screen.refY, screen.refZ);
|
||||
}
|
||||
|
||||
return false;
|
||||
} else if(!player.isSneaking()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,6 @@ import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.IRepairable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
@ -116,7 +115,7 @@ public class MachineRefinery extends BlockDummyable implements IPersistentInfoPr
|
||||
for(int i = 0; i < 5; i++) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "" + i);
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
@ -72,8 +73,8 @@ public class MachineSteamEngine extends BlockDummyable implements ILookOverlay,
|
||||
TileEntitySteamEngine engine = (TileEntitySteamEngine) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey(engine.tanks[0].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", engine.tanks[0].getFill()) + " / " + String.format("%,d", engine.tanks[0].getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(engine.tanks[1].getTankType().getUnlocalizedName()) + ": " + String.format("%,d", engine.tanks[1].getFill()) + " / " + String.format("%,d", engine.tanks[1].getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + engine.tanks[0].getTankType().getLocalizedName() + ": " + String.format(Locale.US, "%,d", engine.tanks[0].getFill()) + " / " + String.format(Locale.US, "%,d", engine.tanks[0].getMaxFill()) + "mB");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + engine.tanks[1].getTankType().getLocalizedName() + ": " + String.format(Locale.US, "%,d", engine.tanks[1].getFill()) + " / " + String.format(Locale.US, "%,d", engine.tanks[1].getMaxFill()) + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.lib.RefStrings;
|
||||
@ -61,7 +62,7 @@ public class MachineTeleporter extends BlockContainer implements ILookOverlay {
|
||||
if(tele.targetY == -1) {
|
||||
text.add(EnumChatFormatting.RED + "No destination set!");
|
||||
} else {
|
||||
text.add((tele.power >= tele.consumption ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + String.format("%,d", tele.power) + " / " + String.format("%,d", tele.maxPower));
|
||||
text.add((tele.power >= tele.consumption ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + String.format(Locale.US, "%,d", tele.power) + " / " + String.format(Locale.US, "%,d", tele.maxPower));
|
||||
text.add("Destination: " + tele.targetX + " / " + tele.targetY + " / " + tele.targetZ + " (D: " + tele.targetDim + ")");
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
@ -78,7 +77,7 @@ public class MachineTowerLarge extends BlockDummyable implements ILookOverlay {
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
for(int i = 0; i < tower.tanks.length; i++)
|
||||
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + tower.tanks[i].getTankType().getName().toLowerCase(Locale.US)) + ": " + tower.tanks[i].getFill() + "/" + tower.tanks[i].getMaxFill() + "mB");
|
||||
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + tower.tanks[i].getTankType().getLocalizedName() + ": " + tower.tanks[i].getFill() + "/" + tower.tanks[i].getMaxFill() + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
@ -75,7 +74,7 @@ public class MachineTowerSmall extends BlockDummyable implements ILookOverlay {
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
for(int i = 0; i < tower.tanks.length; i++)
|
||||
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + tower.tanks[i].getTankType().getName().toLowerCase(Locale.US)) + ": " + tower.tanks[i].getFill() + "/" + tower.tanks[i].getMaxFill() + "mB");
|
||||
text.add((i < 1 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + tower.tanks[i].getTankType().getLocalizedName() + ": " + tower.tanks[i].getFill() + "/" + tower.tanks[i].getMaxFill() + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -6,11 +6,9 @@ import com.hbm.util.I18nUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -87,17 +85,16 @@ public class MachineTurbineGas extends BlockDummyable implements ILookOverlay {
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
if(hitCheck(dir, pos[0], pos[1], pos[2], -1, -1, 0, x, y, z) || hitCheck(dir, pos[0], pos[1], pos[2], 1, -1, 0, x, y, z)) {
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + turbine.tanks[0].getTankType().getName().toLowerCase(Locale.US)));
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + turbine.tanks[1].getTankType().getName().toLowerCase(Locale.US)));
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey(Fluids.SMOKE.getUnlocalizedName()));
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + turbine.tanks[0].getTankType().getLocalizedName());
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + turbine.tanks[1].getTankType().getLocalizedName());
|
||||
}
|
||||
|
||||
if(hitCheck(dir, pos[0], pos[1], pos[2], -1, 4, 0, x, y, z) || hitCheck(dir, pos[0], pos[1], pos[2], 1, 4, 0, x, y, z)) {
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + turbine.tanks[2].getTankType().getName().toLowerCase(Locale.US)));
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + turbine.tanks[2].getTankType().getLocalizedName());
|
||||
}
|
||||
|
||||
if(hitCheck(dir, pos[0], pos[1], pos[2], 0, 5, 1, x, y, z)) {
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + turbine.tanks[3].getTankType().getName().toLowerCase(Locale.US)));
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + turbine.tanks[3].getTankType().getLocalizedName());
|
||||
}
|
||||
|
||||
if(hitCheck(dir, pos[0], pos[1], pos[2], 0, -4, 1, x, y, z)) {
|
||||
|
||||
58
src/main/java/com/hbm/blocks/machine/MachineWoodBurner.java
Normal file
58
src/main/java/com/hbm/blocks/machine/MachineWoodBurner.java
Normal file
@ -0,0 +1,58 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineWoodBurner;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineWoodBurner extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineWoodBurner(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineWoodBurner();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid();
|
||||
return new TileEntityProxyCombo().inventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {1, 0, 1, 0, 1, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
protected 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 - dir.offsetX, y, z - dir.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX + rot.offsetX, y, z - dir.offsetZ + rot.offsetZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
@ -4,12 +4,16 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockFallingNT;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.item.EntityFallingBlockNT;
|
||||
import com.hbm.inventory.container.ContainerAnvil;
|
||||
import com.hbm.inventory.gui.GUIAnvil;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.ObjUtil;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
@ -17,9 +21,10 @@ 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.BlockFalling;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -31,8 +36,9 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.obj.WavefrontObject;
|
||||
|
||||
public class NTMAnvil extends BlockFalling implements ITooltipProvider, IGUIProvider {
|
||||
public class NTMAnvil extends BlockFallingNT implements ITooltipProvider, IGUIProvider {
|
||||
|
||||
public final int tier;
|
||||
|
||||
@ -180,4 +186,29 @@ public class NTMAnvil extends BlockFalling implements ITooltipProvider, IGUIProv
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIAnvil(player.inventory, ((NTMAnvil)world.getBlock(x, y, z)).tier);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldOverrideRenderer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void overrideRenderer(EntityFallingBlockNT falling, RenderBlocks renderBlocks, Tessellator tessellator) {
|
||||
|
||||
float rotation = 0;
|
||||
if(falling.getMeta() == 2) rotation = 90F / 180F * (float) Math.PI;
|
||||
if(falling.getMeta() == 3) rotation = 270F / 180F * (float) Math.PI;
|
||||
if(falling.getMeta() == 4) rotation = 180F / 180F * (float)Math.PI;
|
||||
|
||||
tessellator.addTranslation(0F, -0.5F, 0F);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.anvil, "Top", getIcon(1, 0), tessellator, rotation, true);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.anvil, "Bottom", getIcon(0, 0), tessellator, rotation, true);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.anvil, "Front", getIcon(0, 0), tessellator, rotation, true);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.anvil, "Back", getIcon(0, 0), tessellator, rotation, true);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.anvil, "Left", getIcon(0, 0), tessellator, rotation, true);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.anvil, "Right", getIcon(0, 0), tessellator, rotation, true);
|
||||
tessellator.addTranslation(0F, 0.5F, 0F);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,13 +2,8 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -23,72 +18,6 @@ public class ReactorCore extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachineReactorLarge();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
{
|
||||
if (!keepInventory)
|
||||
{
|
||||
TileEntityMachineReactorLarge tileentityfurnace = (TileEntityMachineReactorLarge)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if (tileentityfurnace != null)
|
||||
{
|
||||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + 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)this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_)
|
||||
{
|
||||
if (!p_149723_1_.isRemote)
|
||||
{
|
||||
TileEntityMachineReactorLarge entity = (TileEntityMachineReactorLarge) p_149723_1_.getTileEntity(p_149723_2_, p_149723_3_, p_149723_4_);
|
||||
if(entity != null && entity.isLoaded)
|
||||
{
|
||||
entity.explode();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.Random;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityWatz;
|
||||
@ -93,7 +94,7 @@ public class Watz extends BlockDummyable {
|
||||
if(i >= 12 && drop) {
|
||||
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.watz_end, 48)));
|
||||
for(int j = 0; j < 3; j++) world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.bolt_dura_steel, 64)));
|
||||
for(int j = 0; j < 3; j++) world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, Mats.MAT_DURA.make(ModItems.bolt)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.watz_element, 36)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.watz_cooler, 26)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_watz_core, 1)));
|
||||
|
||||
143
src/main/java/com/hbm/blocks/network/BlockCableGauge.java
Normal file
143
src/main/java/com/hbm/blocks/network/BlockCableGauge.java
Normal file
@ -0,0 +1,143 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.network.TileEntityCableBaseNT;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class BlockCableGauge extends BlockContainer implements IBlockMultiPass, ILookOverlay, ITooltipProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT) protected IIcon overlayGauge;
|
||||
|
||||
public BlockCableGauge() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityCableGauge();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
this.blockIcon = reg.registerIcon(RefStrings.MODID + ":deco_red_copper");
|
||||
this.overlayGauge = reg.registerIcon(RefStrings.MODID + ":cable_gauge");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
|
||||
if(RenderBlockMultipass.currentPass == 0) {
|
||||
return blockIcon;
|
||||
}
|
||||
|
||||
return side == world.getBlockMetadata(x, y, z) ? this.overlayGauge : this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
int l = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
||||
world.setBlockMetadataWithNotify(x, y, z, l, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPasses() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityCableGauge))
|
||||
return;
|
||||
|
||||
TileEntityCableGauge duct = (TileEntityCableGauge) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(BobMathUtil.getShortNumber(duct.deltaTick) + "HE/t");
|
||||
text.add(BobMathUtil.getShortNumber(duct.deltaLastSecond) + "HE/s");
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return IBlockMultiPass.getRenderType();
|
||||
}
|
||||
|
||||
public static class TileEntityCableGauge extends TileEntityCableBaseNT implements INBTPacketReceiver {
|
||||
|
||||
private BigInteger lastMeasurement = BigInteger.valueOf(10);
|
||||
private long deltaTick = 0;
|
||||
private long deltaSecond = 0;
|
||||
private long deltaLastSecond = 0;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(network != null) {
|
||||
BigInteger total = network.getTotalTransfer();
|
||||
BigInteger delta = total.subtract(this.lastMeasurement);
|
||||
this.lastMeasurement = total;
|
||||
|
||||
try {
|
||||
this.deltaTick = delta.longValueExact();
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
this.deltaLastSecond = this.deltaSecond;
|
||||
this.deltaSecond = 0;
|
||||
}
|
||||
this.deltaSecond += deltaTick;
|
||||
|
||||
} catch(Exception ex) { }
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("deltaT", deltaTick);
|
||||
data.setLong("deltaS", deltaLastSecond);
|
||||
INBTPacketReceiver.networkPack(this, data, 25);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.deltaTick = Math.max(nbt.getLong("deltaT"), 0);
|
||||
this.deltaLastSecond = Math.max(nbt.getLong("deltaS"), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockConveyorExpress extends BlockConveyorBendable {
|
||||
|
||||
@Override
|
||||
public Vec3 getTravelLocation(World world, int x, int y, int z, Vec3 itemPos, double speed) {
|
||||
return super.getTravelLocation(world, x, y, z, itemPos, speed * 3);
|
||||
}
|
||||
}
|
||||
@ -97,7 +97,7 @@ public class BlockFluidDuct extends BlockContainer implements ILookOverlay {
|
||||
TileEntityFluidDuctSimple duct = (TileEntityFluidDuctSimple) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add("&[" + duct.getType().getColor() + "&]" +I18nUtil.resolveKey(duct.getType().getUnlocalizedName()));
|
||||
text.add("&[" + duct.getType().getColor() + "&]" + duct.getType().getLocalizedName());
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ public class BlockFluidDuctSolid extends BlockContainer implements IBlockMultiPa
|
||||
TileEntityFluidDuctSimple duct = (TileEntityFluidDuctSimple) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add("&[" + duct.getType().getColor() + "&]" +I18nUtil.resolveKey(duct.getType().getUnlocalizedName()));
|
||||
text.add("&[" + duct.getType().getColor() + "&]" + duct.getType().getLocalizedName());
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
133
src/main/java/com/hbm/blocks/network/DroneCrate.java
Normal file
133
src/main/java/com/hbm/blocks/network/DroneCrate.java
Normal file
@ -0,0 +1,133 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.network.TileEntityDroneCrate;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
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.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class DroneCrate extends BlockContainer implements ILookOverlay, ITooltipProvider {
|
||||
|
||||
private static Random rand = new Random();
|
||||
|
||||
@SideOnly(Side.CLIENT) private IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) private IIcon iconBottom;
|
||||
|
||||
public DroneCrate() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityDroneCrate();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
this.blockIcon = reg.registerIcon(RefStrings.MODID + ":drone_crate_side");
|
||||
this.iconTop = reg.registerIcon(RefStrings.MODID + ":drone_crate_top");
|
||||
this.iconBottom = reg.registerIcon(RefStrings.MODID + ":drone_crate_bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.drone_linker) return false;
|
||||
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
TileEntityDroneCrate tileentityfurnace = (TileEntityDroneCrate) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tileentityfurnace != null) {
|
||||
for(int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if(itemstack != null) {
|
||||
float f = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while(itemstack.stackSize > 0) {
|
||||
int j1 = this.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) this.rand.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) this.rand.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) this.rand.nextGaussian() * f3;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
world.func_147453_f(x, y, z, block);
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
TileEntityDroneCrate tile = (TileEntityDroneCrate) world.getTileEntity(x, y, z);
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
if(tile.nextY != -1) {
|
||||
text.add("Next waypoint: " + tile.nextX + " / " + tile.nextY + " / " + tile.nextZ);
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
}
|
||||
64
src/main/java/com/hbm/blocks/network/DroneDock.java
Normal file
64
src/main/java/com/hbm/blocks/network/DroneDock.java
Normal file
@ -0,0 +1,64 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.network.TileEntityDroneDock;
|
||||
import com.hbm.tileentity.network.TileEntityDroneProvider;
|
||||
import com.hbm.tileentity.network.TileEntityDroneRequester;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DroneDock extends BlockContainer {
|
||||
|
||||
@SideOnly(Side.CLIENT) private IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) private IIcon iconBottom;
|
||||
|
||||
public DroneDock() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(this == ModBlocks.drone_dock) return new TileEntityDroneDock();
|
||||
if(this == ModBlocks.drone_crate_provider) return new TileEntityDroneProvider();
|
||||
if(this == ModBlocks.drone_crate_requester) return new TileEntityDroneRequester();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
this.blockIcon = reg.registerIcon(this.textureName + "_side");
|
||||
this.iconTop = reg.registerIcon(this.textureName + "_top");
|
||||
this.iconBottom = reg.registerIcon(this.textureName + "_bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
141
src/main/java/com/hbm/blocks/network/DroneWaypoint.java
Normal file
141
src/main/java/com/hbm/blocks/network/DroneWaypoint.java
Normal file
@ -0,0 +1,141 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.network.TileEntityDroneWaypoint;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class DroneWaypoint extends BlockContainer implements ILookOverlay, ITooltipProvider {
|
||||
|
||||
public DroneWaypoint() {
|
||||
super(Material.circuits);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityDroneWaypoint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return RadioTorchBase.renderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 vec0, Vec3 vec1) {
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z) & 7;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(meta);
|
||||
|
||||
this.setBlockBounds(
|
||||
dir.offsetX == 1 ? 0F : 0.375F,
|
||||
dir.offsetY == 1 ? 0F : 0.375F,
|
||||
dir.offsetZ == 1 ? 0F : 0.375F,
|
||||
dir.offsetX == -1 ? 1F : 0.625F,
|
||||
dir.offsetY == -1 ? 1F : 0.625F,
|
||||
dir.offsetZ == -1 ? 1F : 0.625F
|
||||
);
|
||||
|
||||
return super.collisionRayTrace(world, x, y, z, vec0, vec1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float fX, float fY, float fZ, int meta) {
|
||||
return side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(meta);
|
||||
Block b = world.getBlock(x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ);
|
||||
|
||||
if(!b.isSideSolid(world, x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ, dir) && (!b.renderAsNormalBlock() || b.isAir(world, x, y, z))) {
|
||||
this.dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOnSide(World world, int x, int y, int z, int side) {
|
||||
if(!super.canPlaceBlockOnSide(world, x, y, z, side)) return false;
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(side);
|
||||
Block b = world.getBlock(x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ);
|
||||
|
||||
return b.isSideSolid(world, x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ, dir) || (b.renderAsNormalBlock() && !b.isAir(world, x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.drone_linker) return false;
|
||||
|
||||
if(world.isRemote) return true;
|
||||
|
||||
TileEntityDroneWaypoint tile = (TileEntityDroneWaypoint) world.getTileEntity(x, y, z);
|
||||
tile.addHeight(player.isSneaking() ? - 1 : 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
TileEntityDroneWaypoint tile = (TileEntityDroneWaypoint) world.getTileEntity(x, y, z);
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
text.add("Waypoint distance: " + tile.height);
|
||||
|
||||
if(tile.nextY != -1) {
|
||||
text.add("Next waypoint: " + tile.nextX + " / " + tile.nextY + " / " + tile.nextZ);
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
100
src/main/java/com/hbm/blocks/network/DroneWaypointRequest.java
Normal file
100
src/main/java/com/hbm/blocks/network/DroneWaypointRequest.java
Normal file
@ -0,0 +1,100 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.tileentity.network.TileEntityDroneWaypointRequest;
|
||||
|
||||
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.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class DroneWaypointRequest extends BlockContainer {
|
||||
|
||||
public DroneWaypointRequest() {
|
||||
super(Material.circuits);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityDroneWaypointRequest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return RadioTorchBase.renderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 vec0, Vec3 vec1) {
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z) & 7;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(meta);
|
||||
|
||||
this.setBlockBounds(
|
||||
dir.offsetX == 1 ? 0F : 0.375F,
|
||||
dir.offsetY == 1 ? 0F : 0.375F,
|
||||
dir.offsetZ == 1 ? 0F : 0.375F,
|
||||
dir.offsetX == -1 ? 1F : 0.625F,
|
||||
dir.offsetY == -1 ? 1F : 0.625F,
|
||||
dir.offsetZ == -1 ? 1F : 0.625F
|
||||
);
|
||||
|
||||
return super.collisionRayTrace(world, x, y, z, vec0, vec1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float fX, float fY, float fZ, int meta) {
|
||||
return side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(meta);
|
||||
Block b = world.getBlock(x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ);
|
||||
|
||||
if(!b.isSideSolid(world, x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ, dir) && (!b.renderAsNormalBlock() || b.isAir(world, x, y, z))) {
|
||||
this.dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOnSide(World world, int x, int y, int z, int side) {
|
||||
if(!super.canPlaceBlockOnSide(world, x, y, z, side)) return false;
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(side);
|
||||
Block b = world.getBlock(x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ);
|
||||
|
||||
return b.isSideSolid(world, x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ, dir) || (b.renderAsNormalBlock() && !b.isAir(world, x, y, z));
|
||||
}
|
||||
}
|
||||
@ -305,7 +305,7 @@ public class FluidDuctBox extends FluidDuctBase implements IBlockMulti, ILookOve
|
||||
TileEntityPipeBaseNT duct = (TileEntityPipeBaseNT) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add("&[" + duct.getType().getColor() + "&]" + I18nUtil.resolveKey(duct.getType().getUnlocalizedName()));
|
||||
text.add("&[" + duct.getType().getColor() + "&]" + duct.getType().getLocalizedName());
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
|
||||
@ -78,9 +78,9 @@ public class FluidDuctBoxExhaust extends FluidDuctBox {
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
List<String> text = new ArrayList();
|
||||
text.add(I18nUtil.resolveKey(Fluids.SMOKE.getUnlocalizedName()));
|
||||
text.add(I18nUtil.resolveKey(Fluids.SMOKE_LEADED.getUnlocalizedName()));
|
||||
text.add(I18nUtil.resolveKey(Fluids.SMOKE_POISON.getUnlocalizedName()));
|
||||
text.add(Fluids.SMOKE.getLocalizedName());
|
||||
text.add(Fluids.SMOKE_LEADED.getLocalizedName());
|
||||
text.add(Fluids.SMOKE_POISON.getLocalizedName());
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.blocks.network;
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
@ -95,9 +96,9 @@ public class FluidDuctGauge extends FluidDuctBase implements IBlockMultiPass, IL
|
||||
TileEntityPipeGauge duct = (TileEntityPipeGauge) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add("&[" + duct.getType().getColor() + "&]" +I18nUtil.resolveKey(duct.getType().getUnlocalizedName()));
|
||||
text.add(String.format("%,d", duct.deltaTick) + " mB/t");
|
||||
text.add(String.format("%,d", duct.deltaLastSecond) + " mB/s");
|
||||
text.add("&[" + duct.getType().getColor() + "&]" + duct.getType().getLocalizedName());
|
||||
text.add(String.format(Locale.US, "%,d", duct.deltaTick) + " mB/t");
|
||||
text.add(String.format(Locale.US, "%,d", duct.deltaLastSecond) + " mB/s");
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -155,19 +156,19 @@ public class FluidDuctGauge extends FluidDuctBase implements IBlockMultiPass, IL
|
||||
return "ntm_fluid_gauge";
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Callback(direct = true)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getTransfer(Context context, Arguments args) {
|
||||
return new Object[] {deltaTick, deltaSecond};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Callback(direct = true)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFluid(Context context, Arguments args) {
|
||||
return new Object[] {getType().getName()};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 8)
|
||||
@Callback(direct = true)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {deltaTick, deltaSecond, getType().getName(), xCoord, yCoord, zCoord};
|
||||
|
||||
@ -160,7 +160,7 @@ public class FluidDuctPaintable extends FluidDuctBase implements IToolable, IBlo
|
||||
TileEntityPipeBaseNT duct = (TileEntityPipeBaseNT) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add("&[" + duct.getType().getColor() + "&]" +I18nUtil.resolveKey(duct.getType().getUnlocalizedName()));
|
||||
text.add("&[" + duct.getType().getColor() + "&]" + duct.getType().getLocalizedName());
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.blocks.IBlockMulti;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.test.TestPipe;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.network.TileEntityPipeBaseNT;
|
||||
@ -18,11 +19,13 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
@ -70,7 +73,42 @@ public class FluidDuctStandard extends FluidDuctBase implements IBlockMulti, ILo
|
||||
public int damageDropped(int meta) {
|
||||
return rectify(meta);
|
||||
}
|
||||
/*
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z); // Get the block at the specified coordinates
|
||||
int blockMetadata = world.getBlockMetadata(x, y, z); // Get the metadata of the block at the specified coordinates
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z); // Get the tile entity at the specified coordinates
|
||||
|
||||
TileEntityPipeBaseNT pipe = (TileEntityPipeBaseNT) tileEntity;
|
||||
|
||||
// Get the metadata (FluidType) from the pipe
|
||||
FluidType fluidType = pipe.getType();
|
||||
int metadata = fluidType.getID();
|
||||
|
||||
// Create an ItemStack with the item and metadata
|
||||
ItemStack itemStack = new ItemStack(ModItems.fluid_duct, 1, metadata);
|
||||
System.out.println(metadata);
|
||||
System.out.println(itemStack);
|
||||
|
||||
return new ItemStack(ModItems.fluid_duct, 1, metadata).getItem();
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if (tileEntity instanceof TileEntityPipeBaseNT) {
|
||||
TileEntityPipeBaseNT pipe = (TileEntityPipeBaseNT) tileEntity;
|
||||
FluidType fluidType = pipe.getType();
|
||||
int retadata = fluidType.getID(); //florf
|
||||
|
||||
return new ItemStack(ModItems.fluid_duct, 1, retadata);
|
||||
}
|
||||
return super.getPickBlock(target, world, x, y, z, player);
|
||||
}
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return TestPipe.renderID;
|
||||
@ -201,7 +239,7 @@ public class FluidDuctStandard extends FluidDuctBase implements IBlockMulti, ILo
|
||||
TileEntityPipeBaseNT duct = (TileEntityPipeBaseNT) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add("&[" + duct.getType().getColor() + "&]" +I18nUtil.resolveKey(duct.getType().getUnlocalizedName()));
|
||||
text.add("&[" + duct.getType().getColor() + "&]" + duct.getType().getLocalizedName());
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ public class FluidSwitch extends FluidDuctBase implements ILookOverlay {
|
||||
TileEntityFluidValve duct = (TileEntityFluidValve) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add("&[" + duct.getType().getColor() + "&]" +I18nUtil.resolveKey(duct.getType().getUnlocalizedName()));
|
||||
text.add("&[" + duct.getType().getColor() + "&]" + duct.getType().getLocalizedName());
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ public class FluidValve extends FluidDuctBase implements ILookOverlay {
|
||||
TileEntityFluidValve duct = (TileEntityFluidValve) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add("&[" + duct.getType().getColor() + "&]" +I18nUtil.resolveKey(duct.getType().getUnlocalizedName()));
|
||||
text.add("&[" + duct.getType().getColor() + "&]" + duct.getType().getLocalizedName());
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
46
src/main/java/com/hbm/blocks/network/RadioTelex.java
Normal file
46
src/main/java/com/hbm/blocks/network/RadioTelex.java
Normal file
@ -0,0 +1,46 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.network.TileEntityRadioTelex;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class RadioTelex extends BlockDummyable {
|
||||
|
||||
public RadioTelex() {
|
||||
super(Material.wood);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityRadioTelex();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {0, 0, 0, 0, 1, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote && !player.isSneaking()) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return false;
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]);
|
||||
return true;
|
||||
} else {
|
||||
return !player.isSneaking();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user