mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge branch 'master' of https://github.com/BallOfEnergy1/Hbm-s-Nuclear-Tech-GIT-OC
This commit is contained in:
commit
fa1fd5a65c
6
.gitignore
vendored
6
.gitignore
vendored
@ -20,3 +20,9 @@ build
|
||||
|
||||
# other
|
||||
run
|
||||
|
||||
# CurseForge configuration
|
||||
/curseforge.properties
|
||||
|
||||
# Changelog backup
|
||||
/changelog.bak
|
||||
|
||||
15
README.md
15
README.md
@ -91,5 +91,20 @@ If you want to make some changes to the mod, follow this guide:
|
||||
* Click **Add Standard VM**; in the JRE home, navigate to the directory where the JDK is installed, then click finish and select it.
|
||||
10. Code!
|
||||
|
||||
## Compatibility notice
|
||||
NTM has certain behaviors intended to fix vanilla code or to increase compatibility in certain cases where it otherwise would not be possible. These behaviors have the potential of not playing well with other mods, and while no such cases are currently known, here's a list of them.
|
||||
|
||||
### Skybox chainloader
|
||||
NTM adds a few small things to the skybox using a custom skybox renderer. Minecraft can only have a single skybox renderer loaded, so setting the skybox to the NTM custom one would break compatibility with other mods' skyboxes. To mend this, NTM employs a **chainloader**. This chainloader will detect if a different skybox is loaded, save a reference to that skybox and then use NTM's skybox, which when used will also make sure to run the previous modded skybox renderer. In the event that NTM's skybox were to cause trouble, it can be disabled with the config option `1.31_enableSkyboxes`.
|
||||
|
||||
### Custom world provider
|
||||
A world provider is a piece of code that minecraft can load to determine certain aspects of how the world should be handled, like light levels, sky color, day/night cycle, etc. In order for the Tom impact effects to work, NTM employs such a world provider, although this is known to cause issues with Hardcore Darkness. The world provider can be disabled with the config option `1.32_enableImpactWorldProvider`.
|
||||
|
||||
### Stat re-registering
|
||||
An often overlooked aspect of Minecraft is its stats, the game keeps track of how many of an item were crafted, placed, broken, etc. By default, Minecraft can only handle vanilla items, modded items would not show up in the stats window. Forge does little to fix this, and since NTM has to keep track of certain things (such as the use of an acidizer for spawning Mask Man) it will run its own code which re-registers all stats for all modded items. In the event that re-registering causes issues, or another mod already does this better already, this behavior can be disabled with the config option `1.33_enableStatReRegistering`.
|
||||
|
||||
### Keybind overlap
|
||||
An often annoying aspect of modded Minecraft is its keybinds. Even though multiple binds can be assigned the same key, all but one will show up as "conflicting" and only the non-conflicting one will work. Which one this is is usually arbitrary, and there is no reason to have such limitation. Often times keybinds are only applicable in certain scenarios, and a commonly found degree of overlap is within reason. Therefore, NTM will run its own key handling code which allows conflicting keybinds to work. If there should be any issues with this behavior, it can be disabled with the config option `1.34_enableKeybindOverlap`.
|
||||
|
||||
# License
|
||||
This software is licensed under the GNU Lesser General Public License version 3. In short: This software is free, you may run the software freely, create modified versions, distribute this software and distribute modified versions, as long as the modified software too has a free software license (with an exception for linking to this software, as stated by the "Lesser" part of the LGPL, where this may not be required). You win this round, Stallman. The full license can be found in the `LICENSE` and `LICENSE.LESSER` files.
|
||||
|
||||
58
build.gradle
58
build.gradle
@ -1,3 +1,9 @@
|
||||
import org.gradle.plugins.ide.eclipse.model.internal.FileReferenceFactory
|
||||
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
import java.nio.file.StandardCopyOption
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url = 'https://maven.minecraftforge.net/' }
|
||||
@ -10,6 +16,14 @@ buildscript {
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
apply plugin: 'curseforge'
|
||||
|
||||
|
||||
if(Files.exists(Paths.get("curseforge.properties"))) {
|
||||
// Load CurseForge configuration
|
||||
ext.cfprops = parseConfig(file("curseforge.properties"))
|
||||
}
|
||||
|
||||
def version_name = version = mod_version
|
||||
if(!mod_build_number.isEmpty()) {
|
||||
version_name = mod_version + "_X" + mod_build_number
|
||||
@ -42,7 +56,7 @@ eclipse.classpath.file.whenMerged { cp ->
|
||||
}
|
||||
|
||||
// Create file reference factory
|
||||
def fileref = new org.gradle.plugins.ide.eclipse.model.internal.FileReferenceFactory()
|
||||
def fileref = new FileReferenceFactory()
|
||||
|
||||
// Find all codechicken development jars
|
||||
cp.entries.findAll { entry -> entry.path.contains("codechicken") && entry.path.endsWith("-dev.jar") }.forEach { entry ->
|
||||
@ -102,8 +116,50 @@ processResources {
|
||||
}
|
||||
}
|
||||
|
||||
// add AT to meta-inf
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'FMLAT': 'HBM_at.cfg'
|
||||
}
|
||||
}
|
||||
|
||||
task version {
|
||||
doFirst {
|
||||
println project.version
|
||||
}
|
||||
}
|
||||
|
||||
if(Files.exists(Paths.get("curseforge.properties"))) {
|
||||
curse {
|
||||
apiKey = cfprops.api_key
|
||||
projectId = cfprops.project_id
|
||||
releaseType = "release"
|
||||
|
||||
displayName = "Hbm's Nuclear Tech Mod " + version_name.replace("_", "") + " for Minecraft 1.7.10"
|
||||
|
||||
gameVersions.addAll([
|
||||
"Forge",
|
||||
"Java 8",
|
||||
"Client", "Server"
|
||||
])
|
||||
|
||||
if (Files.exists(Paths.get("changelog"))) {
|
||||
changelog = String.join("\r\n", Files.readAllLines(Paths.get("changelog")))
|
||||
|
||||
// Perform a backup of the changelog and create a new file for next changes
|
||||
doLast {
|
||||
Files.move(Paths.get("changelog"), Paths.get("changelog.bak"), StandardCopyOption.REPLACE_EXISTING)
|
||||
Files.createFile(Paths.get("changelog"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Properties file parsing helper
|
||||
static def parseConfig(File config) {
|
||||
config.withReader {
|
||||
def prop = new Properties()
|
||||
prop.load(it)
|
||||
return (new ConfigSlurper().parse(prop))
|
||||
}
|
||||
}
|
||||
|
||||
15
changelog
Normal file
15
changelog
Normal file
@ -0,0 +1,15 @@
|
||||
## Added
|
||||
|
||||
## Changed
|
||||
* Bedrock ores now spawn in the nether
|
||||
* Nether bedrock ores include red phosphorus and glowstone, both yielding powders instead of ores
|
||||
* All current nether bedrock ores are tier 1 and do not require any bore fluid
|
||||
* Custom machines now show their recipes in NEI
|
||||
* All it took was battling NEI's source code for 3 hours and my sanity
|
||||
* Changed energy OC compatibility
|
||||
* Make sure to update your programs, as the getEnergyStored and getMaxEnergy have been deprecated.
|
||||
|
||||
## Fixed
|
||||
* Fixed custom machines not sending fluid
|
||||
* Fixed custom machine item IO not working beyond the first slot
|
||||
* Fixed target designators not accepting coordinates when not designated first (OC compatibility)
|
||||
5
curseforge.properties.example
Normal file
5
curseforge.properties.example
Normal file
@ -0,0 +1,5 @@
|
||||
# CurseForge API token (obtainable from https://legacy.curseforge.com/account/api-tokens)
|
||||
api_key=
|
||||
|
||||
# CurseForge project ID
|
||||
project_id=
|
||||
@ -1,14 +1,18 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=4551
|
||||
mod_build_number=4671
|
||||
|
||||
credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\
|
||||
\ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models, porting),\
|
||||
\ UFFR (RTGs, guns, casings), Pu-238 (Tom impact effects), Bismarck (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), haru315 (spiral point algorithm),\
|
||||
\ Sten89 (models), Pixelguru26 (textures), TheBlueHat (textures), Alcater (GUI textures, porting), impbk2002 (project settings),\
|
||||
\ OvermindDL1 (project settings), TehTemmie (reacher radiation function), Toshayo (satellite loot system, project settings), 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), sdddddf80 (recipe configs), SuperCraftAlex (tooltips)
|
||||
\ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models,\
|
||||
\ porting), UFFR (RTGs, guns, casings, euphemium capacitor), Pu-238 (Tom impact effects), Bismarck\
|
||||
\ (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), haru315 (spiral point algorithm), Sten89 (models), Pixelguru26\
|
||||
\ (textures), TheBlueHat (textures), Alcater (GUI textures, porting), impbk2002 (project settings),\
|
||||
\ 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), Maksymisio (polish localization)
|
||||
|
||||
10
src/main/java/api/hbm/block/IBlowable.java
Normal file
10
src/main/java/api/hbm/block/IBlowable.java
Normal file
@ -0,0 +1,10 @@
|
||||
package api.hbm.block;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IBlowable { //sloppy toppy
|
||||
|
||||
/** Called server-side when a fan blows on an IBlowable in range every tick. */
|
||||
public void applyFan(World world, int x, int y, int z, ForgeDirection dir, int dist);
|
||||
}
|
||||
10
src/main/java/api/hbm/block/IInsertable.java
Normal file
10
src/main/java/api/hbm/block/IInsertable.java
Normal file
@ -0,0 +1,10 @@
|
||||
package api.hbm.block;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IInsertable { //uwu
|
||||
|
||||
public boolean insertItem(World world, int x, int y, int z, ForgeDirection dir, ItemStack stack);
|
||||
}
|
||||
@ -1,6 +1,13 @@
|
||||
package api.hbm.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IToolable {
|
||||
@ -12,6 +19,29 @@ public interface IToolable {
|
||||
HAND_DRILL,
|
||||
DEFUSER,
|
||||
WRENCH,
|
||||
TORCH
|
||||
TORCH,
|
||||
BOLT;
|
||||
|
||||
public List<ItemStack> stacksForDisplay = new ArrayList();
|
||||
private static HashMap<ComparableStack, ToolType> map = new HashMap();
|
||||
|
||||
public void register(ItemStack stack) {
|
||||
stacksForDisplay.add(stack);
|
||||
}
|
||||
|
||||
public static ToolType getType(ItemStack stack) {
|
||||
|
||||
if(!map.isEmpty()) {
|
||||
return map.get(new ComparableStack(stack));
|
||||
}
|
||||
|
||||
for(ToolType type : ToolType.values()) {
|
||||
for(ItemStack tool : type.stacksForDisplay) {
|
||||
map.put(new ComparableStack(tool), type);
|
||||
}
|
||||
}
|
||||
|
||||
return map.get(new ComparableStack(stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ public interface IEnergyConnector extends ILoadedTile {
|
||||
red = true;
|
||||
}
|
||||
|
||||
if(particleDebug) {//
|
||||
if(particleDebug) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "network");
|
||||
data.setString("mode", "power");
|
||||
|
||||
@ -10,4 +10,10 @@ public interface IEnergyGenerator extends IEnergyUser {
|
||||
public default long transferPower(long power) {
|
||||
return power;
|
||||
}
|
||||
|
||||
/* should stop making non-receivers from interfering by applying their weight which doesn't even matter */
|
||||
@Override
|
||||
public default long getTransferWeight() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package api.hbm.energy;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -32,4 +33,5 @@ public interface IPowerNet {
|
||||
public List<IEnergyConnector> getSubscribers();
|
||||
|
||||
public long transferPower(long power);
|
||||
public BigInteger getTotalTransfer();
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package api.hbm.energy;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -20,6 +21,9 @@ public class PowerNet implements IPowerNet {
|
||||
private HashMap<Integer, IEnergyConductor> links = new HashMap();
|
||||
private HashMap<Integer, Integer> proxies = new HashMap();
|
||||
private List<IEnergyConnector> subscribers = new ArrayList();
|
||||
|
||||
public static List<PowerNet> trackingInstances = null;
|
||||
protected BigInteger totalTransfer = BigInteger.ZERO;
|
||||
|
||||
@Override
|
||||
public void joinNetworks(IPowerNet network) {
|
||||
@ -119,6 +123,11 @@ public class PowerNet implements IPowerNet {
|
||||
public boolean isValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigInteger getTotalTransfer() {
|
||||
return this.totalTransfer;
|
||||
}
|
||||
|
||||
public long lastCleanup = System.currentTimeMillis();
|
||||
|
||||
@ -129,7 +138,9 @@ public class PowerNet implements IPowerNet {
|
||||
cleanup(this.subscribers);
|
||||
lastCleanup = System.currentTimeMillis();
|
||||
}*/
|
||||
|
||||
|
||||
trackingInstances = new ArrayList();
|
||||
trackingInstances.add(this);
|
||||
return fairTransfer(this.subscribers, power);
|
||||
}
|
||||
|
||||
@ -149,6 +160,8 @@ public class PowerNet implements IPowerNet {
|
||||
|
||||
ConnectionPriority[] priorities = new ConnectionPriority[] {ConnectionPriority.HIGH, ConnectionPriority.NORMAL, ConnectionPriority.LOW};
|
||||
|
||||
long totalTransfer = 0;
|
||||
|
||||
for(ConnectionPriority p : priorities) {
|
||||
|
||||
List<IEnergyConnector> subList = new ArrayList();
|
||||
@ -186,6 +199,15 @@ public class PowerNet implements IPowerNet {
|
||||
}
|
||||
|
||||
power -= totalGiven;
|
||||
totalTransfer += totalGiven;
|
||||
}
|
||||
|
||||
if(trackingInstances != null) {
|
||||
|
||||
for(int i = 0; i < trackingInstances.size(); i++) {
|
||||
PowerNet net = trackingInstances.get(i);
|
||||
net.totalTransfer = net.totalTransfer.add(BigInteger.valueOf(totalTransfer));
|
||||
}
|
||||
}
|
||||
|
||||
return power;
|
||||
|
||||
@ -9,11 +9,11 @@ public interface IFluidConductor extends IFluidConnector {
|
||||
public void setPipeNet(FluidType type, IPipeNet network);
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, long amount) {
|
||||
public default long transferFluid(FluidType type, int pressure, long amount) {
|
||||
|
||||
if(this.getPipeNet(type) == null)
|
||||
return amount;
|
||||
|
||||
return this.getPipeNet(type).transferFluid(amount);
|
||||
return this.getPipeNet(type).transferFluid(amount, pressure);
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ public interface IFluidConnector {
|
||||
* @param power
|
||||
* @return
|
||||
*/
|
||||
public long transferFluid(FluidType type, long fluid);
|
||||
public long transferFluid(FluidType type, int pressure, long fluid);
|
||||
|
||||
/**
|
||||
* Whether the given side can be connected to
|
||||
@ -33,7 +33,7 @@ public interface IFluidConnector {
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public long getDemand(FluidType type);
|
||||
public long getDemand(FluidType type, int pressure);
|
||||
|
||||
/**
|
||||
* Basic implementation of subscribing to a nearby power grid
|
||||
|
||||
@ -14,10 +14,10 @@ import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
public interface IFluidStandardReceiver extends IFluidUser {
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, long amount) {
|
||||
public default long transferFluid(FluidType type, int pressure, long amount) {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
tank.setFill(tank.getFill() + (int) amount);
|
||||
|
||||
if(tank.getFill() > tank.getMaxFill()) {
|
||||
@ -36,10 +36,10 @@ public interface IFluidStandardReceiver extends IFluidUser {
|
||||
public FluidTank[] getReceivingTanks();
|
||||
|
||||
@Override
|
||||
public default long getDemand(FluidType type) {
|
||||
public default long getDemand(FluidType type, int pressure) {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
return tank.getMaxFill() - tank.getFill();
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,10 +16,10 @@ public interface IFluidStandardSender extends IFluidUser {
|
||||
public FluidTank[] getSendingTanks();
|
||||
|
||||
@Override
|
||||
public default long getTotalFluidForSend(FluidType type) {
|
||||
public default long getTotalFluidForSend(FluidType type, int pressure) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
return tank.getFill();
|
||||
}
|
||||
}
|
||||
@ -28,10 +28,10 @@ public interface IFluidStandardSender extends IFluidUser {
|
||||
}
|
||||
|
||||
@Override
|
||||
public default void removeFluidForTransfer(FluidType type, long amount) {
|
||||
public default void removeFluidForTransfer(FluidType type, int pressure, long amount) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
tank.setFill(tank.getFill() - (int) amount);
|
||||
return;
|
||||
}
|
||||
@ -39,12 +39,12 @@ public interface IFluidStandardSender extends IFluidUser {
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, long fluid) {
|
||||
public default long transferFluid(FluidType type, int pressure, long fluid) {
|
||||
return fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long getDemand(FluidType type) {
|
||||
public default long getDemand(FluidType type, int pressure) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,10 +23,10 @@ public interface IFluidStandardTransceiver extends IFluidUser {
|
||||
public FluidTank[] getReceivingTanks();
|
||||
|
||||
@Override
|
||||
public default long getTotalFluidForSend(FluidType type) {
|
||||
public default long getTotalFluidForSend(FluidType type, int pressure) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
return tank.getFill();
|
||||
}
|
||||
}
|
||||
@ -35,10 +35,10 @@ public interface IFluidStandardTransceiver extends IFluidUser {
|
||||
}
|
||||
|
||||
@Override
|
||||
public default void removeFluidForTransfer(FluidType type, long amount) {
|
||||
public default void removeFluidForTransfer(FluidType type, int pressure, long amount) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
tank.setFill(tank.getFill() - (int) amount);
|
||||
return;
|
||||
}
|
||||
@ -46,10 +46,10 @@ public interface IFluidStandardTransceiver extends IFluidUser {
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long getDemand(FluidType type) {
|
||||
public default long getDemand(FluidType type, int pressure) {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
return tank.getMaxFill() - tank.getFill();
|
||||
}
|
||||
}
|
||||
@ -58,10 +58,10 @@ public interface IFluidStandardTransceiver extends IFluidUser {
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, long amount) {
|
||||
public default long transferFluid(FluidType type, int pressure, long amount) {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
if(tank.getTankType() == type && tank.getPressure() == pressure) {
|
||||
tank.setFill(tank.getFill() + (int) amount);
|
||||
|
||||
if(tank.getFill() > tank.getMaxFill()) {
|
||||
|
||||
@ -13,7 +13,11 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidUser extends IFluidConnector {
|
||||
|
||||
public default void sendFluid(FluidType type, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
public default void sendFluid(FluidTank tank, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
sendFluid(tank.getTankType(), tank.getPressure(), world, x, y, z, dir);
|
||||
}
|
||||
|
||||
public default void sendFluid(FluidType type, int pressure, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
boolean wasSubscribed = false;
|
||||
@ -32,9 +36,9 @@ public interface IFluidUser extends IFluidConnector {
|
||||
IFluidConnector con = (IFluidConnector) te;
|
||||
|
||||
if(con.canConnect(type, dir.getOpposite())) {
|
||||
long toSend = this.getTotalFluidForSend(type);
|
||||
long transfer = toSend - con.transferFluid(type, toSend);
|
||||
this.removeFluidForTransfer(type, transfer);
|
||||
long toSend = this.getTotalFluidForSend(type, pressure);
|
||||
long transfer = toSend - con.transferFluid(type, pressure, toSend);
|
||||
this.removeFluidForTransfer(type, pressure, transfer);
|
||||
red = true;
|
||||
}
|
||||
}
|
||||
@ -77,15 +81,21 @@ public interface IFluidUser extends IFluidConnector {
|
||||
return null;
|
||||
}
|
||||
|
||||
public default void sendFluidToAll(FluidType type, TileEntity te) {
|
||||
/** Use more common conPos method instead */
|
||||
@Deprecated public default void sendFluidToAll(FluidTank tank, TileEntity te) {
|
||||
sendFluidToAll(tank.getTankType(), tank.getPressure(), te);
|
||||
}
|
||||
|
||||
/** Use more common conPos method instead */
|
||||
@Deprecated public default void sendFluidToAll(FluidType type, int pressure, TileEntity te) {
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
sendFluid(type, te.getWorldObj(), te.xCoord + dir.offsetX, te.yCoord + dir.offsetY, te.zCoord + dir.offsetZ, dir);
|
||||
sendFluid(type, pressure, te.getWorldObj(), te.xCoord + dir.offsetX, te.yCoord + dir.offsetY, te.zCoord + dir.offsetZ, dir);
|
||||
}
|
||||
}
|
||||
|
||||
public default long getTotalFluidForSend(FluidType type) { return 0; }
|
||||
public default void removeFluidForTransfer(FluidType type, long amount) { }
|
||||
public default long getTotalFluidForSend(FluidType type, int pressure) { return 0; }
|
||||
public default void removeFluidForTransfer(FluidType type, int pressure, long amount) { }
|
||||
|
||||
public default void subscribeToAllAround(FluidType type, TileEntity te) {
|
||||
subscribeToAllAround(type, te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord);
|
||||
|
||||
@ -24,7 +24,7 @@ public interface IPipeNet {
|
||||
|
||||
public boolean isValid();
|
||||
|
||||
public long transferFluid(long fill);
|
||||
public long transferFluid(long fill, int pressure);
|
||||
public FluidType getType();
|
||||
public BigInteger getTotalTransfer();
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ public class PipeNet implements IPipeNet {
|
||||
}
|
||||
|
||||
@Override
|
||||
public long transferFluid(long fill) {
|
||||
public long transferFluid(long fill, int pressure) {
|
||||
|
||||
this.subscribers.removeIf(x ->
|
||||
x == null || !(x instanceof TileEntity) || ((TileEntity)x).isInvalid()
|
||||
@ -97,16 +97,16 @@ public class PipeNet implements IPipeNet {
|
||||
trackingInstances = new ArrayList();
|
||||
trackingInstances.add(this);
|
||||
List<IFluidConnector> subList = new ArrayList(subscribers);
|
||||
return fairTransfer(subList, type, fill);
|
||||
return fairTransfer(subList, type, pressure, fill);
|
||||
}
|
||||
|
||||
public static long fairTransfer(List<IFluidConnector> subList, FluidType type, long fill) {
|
||||
public static long fairTransfer(List<IFluidConnector> subList, FluidType type, int pressure, long fill) {
|
||||
|
||||
List<Long> weight = new ArrayList();
|
||||
long totalReq = 0;
|
||||
|
||||
for(IFluidConnector con : subList) {
|
||||
long req = con.getDemand(type);
|
||||
long req = con.getDemand(type, pressure);
|
||||
weight.add(req);
|
||||
totalReq += req;
|
||||
}
|
||||
@ -123,7 +123,7 @@ public class PipeNet implements IPipeNet {
|
||||
|
||||
long given = (long) Math.floor(fraction * fill);
|
||||
|
||||
totalGiven += (given - con.transferFluid(type, given));
|
||||
totalGiven += (given - con.transferFluid(type, pressure, given));
|
||||
}
|
||||
|
||||
if(trackingInstances != null) {
|
||||
|
||||
@ -490,12 +490,10 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return;
|
||||
TileEntity tile = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(tile == null) return;
|
||||
|
||||
x = tile.xCoord;
|
||||
y = tile.yCoord;
|
||||
z = tile.zCoord;
|
||||
x = pos[0];
|
||||
y = pos[1];
|
||||
z = pos[2];
|
||||
|
||||
EntityPlayer player = event.player;
|
||||
float interp = event.partialTicks;
|
||||
@ -503,9 +501,11 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
double dY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) interp;
|
||||
double dZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)interp;
|
||||
float exp = 0.002F;
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
ICustomBlockHighlight.setup();
|
||||
for(AxisAlignedBB aabb : this.bounding) event.context.drawOutlinedBoundingBox(getAABBRotationOffset(aabb.expand(exp, exp, exp), 0, 0, 0, ForgeDirection.getOrientation(tile.getBlockMetadata() - offset).getRotation(ForgeDirection.UP)).getOffsetBoundingBox(x - dX + 0.5, y - dY, z - dZ + 0.5), -1);
|
||||
for(AxisAlignedBB aabb : this.bounding) event.context.drawOutlinedBoundingBox(getAABBRotationOffset(aabb.expand(exp, exp, exp), 0, 0, 0, ForgeDirection.getOrientation(meta - offset).getRotation(ForgeDirection.UP)).getOffsetBoundingBox(x - dX + 0.5, y - dY, z - dZ + 0.5), -1);
|
||||
ICustomBlockHighlight.cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockEnumMulti extends BlockMulti {
|
||||
@ -31,13 +36,23 @@ public class BlockEnumMulti extends BlockMulti {
|
||||
|
||||
for(int i = 0; i < icons.length; i++) {
|
||||
Enum num = enums[i];
|
||||
this.icons[i] = reg.registerIcon(this.getTextureName() + "." + num.name().toLowerCase());
|
||||
this.icons[i] = reg.registerIcon(this.getTextureName() + "." + num.name().toLowerCase(Locale.US));
|
||||
}
|
||||
} else {
|
||||
this.blockIcon = reg.registerIcon(this.getTextureName());
|
||||
}
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
|
||||
if(this.multiName) {
|
||||
Enum num = EnumUtil.grabEnumSafely(this.theEnum, stack.getItemDamage());
|
||||
return super.getUnlocalizedName() + "." + num.name().toLowerCase(Locale.US);
|
||||
}
|
||||
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
|
||||
@ -7,13 +7,40 @@ public class BlockEnums {
|
||||
ASBESTOS,
|
||||
HEMATITE,
|
||||
MALACHITE,
|
||||
LIMESTONE
|
||||
LIMESTONE,
|
||||
BAUXITE
|
||||
}
|
||||
|
||||
public static enum EnumBiomeType {
|
||||
DESERT,
|
||||
WOODLAND
|
||||
}
|
||||
|
||||
public static enum EnumStalagmiteType {
|
||||
SULFUR,
|
||||
ASBESTOS
|
||||
}
|
||||
|
||||
public static enum EnumCMMaterials {
|
||||
STEEL,
|
||||
ALLOY,
|
||||
DESH,
|
||||
TCALLOY
|
||||
}
|
||||
|
||||
public static enum EnumCMEngines {
|
||||
STANDARD,
|
||||
DESH,
|
||||
BISMUTH
|
||||
}
|
||||
|
||||
public static enum EnumCMCircuit {
|
||||
ALUMINIUM,
|
||||
COPPER,
|
||||
RED_COPPER,
|
||||
GOLD,
|
||||
SCHRABIDIUM
|
||||
}
|
||||
|
||||
/** DECO / STRUCTURE ENUMS */
|
||||
//i apologize in advance
|
||||
|
||||
@ -31,4 +31,8 @@ public abstract class BlockMulti extends BlockBase implements IBlockMulti {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
}
|
||||
|
||||
41
src/main/java/com/hbm/blocks/BlockRemap.java
Normal file
41
src/main/java/com/hbm/blocks/BlockRemap.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class BlockRemap extends Block implements ILookOverlay {
|
||||
|
||||
public Block remapBlock;
|
||||
public int remapMeta;
|
||||
|
||||
protected BlockRemap(Block block, int meta) {
|
||||
super(Material.tnt);
|
||||
this.remapBlock = block;
|
||||
this.remapMeta = meta;
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setBlockName(String name) {
|
||||
super.setBlockName(name);
|
||||
this.setBlockTextureName(RefStrings.MODID + ":" + name);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
world.setBlock(x, y, z, this.remapBlock, this.remapMeta, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
ILookOverlay.printGeneric(event, "Compatibility block, will convert on update tick.", 0xffff00, 0x404000, new ArrayList());
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,12 @@ 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.test.*;
|
||||
import com.hbm.blocks.turret.*;
|
||||
@ -28,6 +34,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.*;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
@ -136,6 +143,7 @@ public class ModBlocks {
|
||||
public static Block stone_resource;
|
||||
public static Block stalagmite;
|
||||
public static Block stalactite;
|
||||
public static Block stone_biome;
|
||||
public static Block stone_deep_cobble;
|
||||
|
||||
public static Block depth_brick;
|
||||
@ -201,8 +209,11 @@ public class ModBlocks {
|
||||
public static Block block_aluminium;
|
||||
public static Block block_fluorite;
|
||||
public static Block block_steel;
|
||||
public static Block block_tcalloy;
|
||||
public static Block block_cdalloy;
|
||||
public static Block block_lead;
|
||||
public static Block block_bismuth;
|
||||
public static Block block_cadmium;
|
||||
public static Block block_coltan;
|
||||
public static Block block_tantalium;
|
||||
public static Block block_niobium;
|
||||
@ -293,6 +304,7 @@ public class ModBlocks {
|
||||
public static Block deco_rbmk_smooth;
|
||||
|
||||
public static Block deco_emitter;
|
||||
public static Block part_emitter;
|
||||
public static Block deco_loot;
|
||||
public static Block bobblehead;
|
||||
public static Block snowglobe;
|
||||
@ -307,10 +319,13 @@ public class ModBlocks {
|
||||
public static Block reinforced_brick;
|
||||
public static Block reinforced_ducrete;
|
||||
public static Block reinforced_glass;
|
||||
public static Block reinforced_glass_pane;
|
||||
public static Block reinforced_light;
|
||||
public static Block reinforced_sand;
|
||||
public static Block reinforced_lamp_off;
|
||||
public static Block reinforced_lamp_on;
|
||||
public static Block reinforced_laminate;
|
||||
public static Block reinforced_laminate_pane;
|
||||
|
||||
public static Block lamp_tritium_green_off;
|
||||
public static Block lamp_tritium_green_on;
|
||||
@ -324,6 +339,7 @@ public class ModBlocks {
|
||||
public static Block reinforced_stone;
|
||||
public static Block concrete_smooth;
|
||||
public static Block concrete_colored;
|
||||
public static Block concrete_colored_ext;
|
||||
public static Block concrete;
|
||||
public static Block concrete_asbestos;
|
||||
public static Block concrete_super;
|
||||
@ -479,11 +495,13 @@ public class ModBlocks {
|
||||
public static Block glass_ash;
|
||||
public static Block glass_quartz;
|
||||
|
||||
|
||||
public static Block mush;
|
||||
public static Block mush_block;
|
||||
public static Block mush_block_stem;
|
||||
|
||||
public static Block glyphid_base;
|
||||
public static Block glyphid_spawner;
|
||||
|
||||
public static Block plant_flower;
|
||||
public static Block plant_tall;
|
||||
public static Block plant_dead;
|
||||
@ -585,6 +603,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block vault_door;
|
||||
public static Block blast_door;
|
||||
public static Block sliding_blast_door;
|
||||
public static Block fire_door;
|
||||
public static Block transition_seal;
|
||||
|
||||
@ -618,11 +637,12 @@ public class ModBlocks {
|
||||
public static Block sat_dock;
|
||||
|
||||
public static Block soyuz_capsule;
|
||||
|
||||
|
||||
public static Block crate_iron;
|
||||
public static Block crate_steel;
|
||||
public static Block crate_desh;
|
||||
public static Block crate_tungsten;
|
||||
public static Block crate_template;
|
||||
public static Block safe;
|
||||
public static Block mass_storage;
|
||||
|
||||
@ -654,12 +674,15 @@ public class ModBlocks {
|
||||
public static Block machine_sawmill;
|
||||
public static Block machine_crucible;
|
||||
public static Block machine_boiler;
|
||||
public static Block machine_industrial_boiler;
|
||||
|
||||
public static Block foundry_mold;
|
||||
public static Block foundry_basin;
|
||||
public static Block foundry_channel;
|
||||
public static Block foundry_tank;
|
||||
public static Block foundry_outlet;
|
||||
public static Block foundry_slagtap;
|
||||
public static Block slag;
|
||||
|
||||
public static Block machine_difurnace_off;
|
||||
public static Block machine_difurnace_on;
|
||||
@ -720,6 +743,7 @@ public class ModBlocks {
|
||||
public static Block hadron_analysis_glass;
|
||||
public static Block hadron_access;
|
||||
public static Block hadron_core;
|
||||
public static Block hadron_cooler;
|
||||
|
||||
public static Block machine_electric_furnace_off;
|
||||
public static Block machine_electric_furnace_on;
|
||||
@ -738,6 +762,12 @@ public class ModBlocks {
|
||||
public static Block machine_dineutronium_battery;
|
||||
public static Block machine_fensu;
|
||||
public static final int guiID_machine_fensu = 99;
|
||||
|
||||
public static Block capacitor_bus;
|
||||
public static Block capacitor_copper;
|
||||
public static Block capacitor_gold;
|
||||
public static Block capacitor_niobium;
|
||||
public static Block capacitor_tantalium;
|
||||
|
||||
public static Block machine_coal_off;
|
||||
public static Block machine_coal_on;
|
||||
@ -754,18 +784,18 @@ public class ModBlocks {
|
||||
public static Block cable_detector;
|
||||
public static Block cable_diode;
|
||||
public static Block machine_detector;
|
||||
public static Block oil_duct_solid;
|
||||
public static Block oil_duct;
|
||||
public static Block gas_duct_solid;
|
||||
public static Block gas_duct;
|
||||
public static Block fluid_duct;
|
||||
public static Block fluid_duct_solid;
|
||||
public static Block fluid_duct_neo;
|
||||
public static Block fluid_duct_box;
|
||||
public static Block fluid_duct_paintable;
|
||||
public static Block fluid_duct_gauge;
|
||||
public static Block fluid_duct_exhaust;
|
||||
public static Block fluid_valve;
|
||||
public static Block fluid_switch;
|
||||
public static Block radio_torch_sender;
|
||||
public static Block radio_torch_receiver;
|
||||
public static Block radio_torch_counter;
|
||||
|
||||
public static Block conveyor;
|
||||
//public static Block conveyor_classic;
|
||||
@ -775,12 +805,15 @@ public class ModBlocks {
|
||||
public static Block conveyor_lift;
|
||||
public static Block crane_extractor;
|
||||
public static Block crane_inserter;
|
||||
public static Block crane_grabber;
|
||||
public static Block crane_router;
|
||||
public static Block crane_boxer;
|
||||
public static Block crane_unboxer;
|
||||
public static Block crane_splitter;
|
||||
|
||||
public static Block fan;
|
||||
|
||||
public static Block piston_inserter;
|
||||
|
||||
public static Block chain;
|
||||
|
||||
@ -821,6 +854,7 @@ public class ModBlocks {
|
||||
public static Block struct_soyuz_core;
|
||||
public static Block struct_iter_core;
|
||||
public static Block struct_plasma_core;
|
||||
public static Block struct_watz_core;
|
||||
|
||||
public static Block factory_titanium_hull;
|
||||
@Deprecated public static Block factory_titanium_furnace;
|
||||
@ -830,6 +864,14 @@ public class ModBlocks {
|
||||
@Deprecated public static Block factory_advanced_furnace;
|
||||
@Deprecated public static Block factory_advanced_conductor;
|
||||
|
||||
public static Block cm_block;
|
||||
public static Block cm_sheet;
|
||||
public static Block cm_engine;
|
||||
public static Block cm_tank;
|
||||
public static Block cm_circuit;
|
||||
public static Block cm_port;
|
||||
public static Block custom_machine;
|
||||
|
||||
public static Block reactor_element;
|
||||
public static Block reactor_control;
|
||||
public static Block reactor_hatch;
|
||||
@ -848,8 +890,9 @@ public class ModBlocks {
|
||||
|
||||
public static Block iter;
|
||||
public static Block plasma_heater;
|
||||
|
||||
|
||||
public static Block watz;
|
||||
public static Block watz_pump;
|
||||
|
||||
public static Block watz_element;
|
||||
public static Block watz_control;
|
||||
@ -903,7 +946,6 @@ public class ModBlocks {
|
||||
public static Block field_disturber;
|
||||
|
||||
public static Block machine_rtg_grey;
|
||||
public static Block machine_rtg_cyan;
|
||||
public static Block machine_amgen;
|
||||
public static Block machine_geo;
|
||||
public static Block machine_minirtg;
|
||||
@ -917,6 +959,7 @@ public class ModBlocks {
|
||||
public static Block machine_fracking_tower;
|
||||
|
||||
public static Block machine_flare;
|
||||
public static Block chimney_brick;
|
||||
|
||||
public static Block machine_refinery;
|
||||
public static Block machine_vacuum_distill;
|
||||
@ -924,6 +967,7 @@ public class ModBlocks {
|
||||
public static Block fraction_spacer;
|
||||
public static Block machine_catalytic_cracker;
|
||||
public static Block machine_catalytic_reformer;
|
||||
public static Block machine_coker;
|
||||
|
||||
public static Block machine_boiler_off;
|
||||
public static Block machine_boiler_on;
|
||||
@ -940,6 +984,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block machine_liquefactor;
|
||||
public static Block machine_solidifier;
|
||||
public static Block machine_compressor;
|
||||
|
||||
public static Block machine_chungus;
|
||||
public static Block machine_condenser;
|
||||
@ -1079,6 +1124,13 @@ public class ModBlocks {
|
||||
public static Block rail_narrow;
|
||||
public static Block rail_highspeed;
|
||||
public static Block rail_booster;
|
||||
|
||||
public static Block rail_narrow_straight;
|
||||
public static Block rail_narrow_curve;
|
||||
public static Block rail_large_straight;
|
||||
public static Block rail_large_curve;
|
||||
public static Block rail_large_ramp;
|
||||
public static Block rail_large_buffer;
|
||||
|
||||
public static Block statue_elb;
|
||||
public static Block statue_elb_g;
|
||||
@ -1162,8 +1214,6 @@ public class ModBlocks {
|
||||
|
||||
public static Block dummy_block_drill;
|
||||
public static Block dummy_port_drill;
|
||||
public static Block dummy_block_assembler;
|
||||
public static Block dummy_port_assembler;
|
||||
public static Block dummy_block_ams_limiter;
|
||||
public static Block dummy_port_ams_limiter;
|
||||
public static Block dummy_block_ams_emitter;
|
||||
@ -1308,6 +1358,7 @@ public class ModBlocks {
|
||||
stone_resource = new BlockResourceStone().setBlockName("stone_resource").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
|
||||
stalagmite = new BlockStalagmite().setBlockName("stalagmite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
stalactite = new BlockStalagmite().setBlockName("stalactite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
stone_biome = new BlockBiomeStone().setBlockName("stone_biome").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
|
||||
stone_deep_cobble = new BlockDeepCobble().setBlockName("stone_deep_cobble").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(30.0F);
|
||||
|
||||
basalt = new BlockGeneric(Material.rock).setBlockName("basalt").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt");
|
||||
@ -1371,8 +1422,11 @@ public class ModBlocks {
|
||||
block_aluminium = new BlockBeaconable(Material.iron).setBlockName("block_aluminium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_aluminium");
|
||||
block_fluorite = new BlockBeaconable(Material.iron).setBlockName("block_fluorite").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_fluorite");
|
||||
block_steel = new BlockBeaconable(Material.iron).setBlockName("block_steel").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
block_tcalloy = new BlockBeaconable(Material.iron).setBlockName("block_tcalloy").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_tcalloy");
|
||||
block_cdalloy = new BlockBeaconable(Material.iron).setBlockName("block_cdalloy").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_cdalloy");
|
||||
block_lead = new BlockBeaconable(Material.iron).setBlockName("block_lead").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(30.0F).setBlockTextureName(RefStrings.MODID + ":block_lead");
|
||||
block_bismuth = new BlockBeaconable(Material.iron).setBlockName("block_bismuth").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(30.0F).setBlockTextureName(RefStrings.MODID + ":block_bismuth");
|
||||
block_cadmium = new BlockBeaconable(Material.iron).setBlockName("block_cadmium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(30.0F).setBlockTextureName(RefStrings.MODID + ":block_cadmium");
|
||||
block_coltan = new BlockBeaconable(Material.iron).setBlockName("block_coltan").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(30.0F).setBlockTextureName(RefStrings.MODID + ":block_coltan");
|
||||
block_tantalium = new BlockBeaconable(Material.iron).setBlockName("block_tantalium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(30.0F).setBlockTextureName(RefStrings.MODID + ":block_tantalium");
|
||||
block_niobium = new BlockBeaconable(Material.iron).setBlockName("block_niobium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(30.0F);
|
||||
@ -1433,7 +1487,7 @@ public class ModBlocks {
|
||||
block_semtex = new BlockPlasticExplosive(Material.tnt).setBlockName("block_semtex").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(2.0F).setBlockTextureName(RefStrings.MODID + ":block_semtex");
|
||||
block_c4 = new BlockPlasticExplosive(Material.tnt).setBlockName("block_c4").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(2.0F).setBlockTextureName(RefStrings.MODID + ":block_c4");
|
||||
block_smore = new BlockPillar(Material.rock, RefStrings.MODID + ":block_smore_top").setBlockName("block_smore").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_smore_side");
|
||||
block_slag = new BlockBeaconable(Material.iron).setBlockName("block_slag").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_slag");
|
||||
block_slag = new BlockSlag(Material.rock).setBlockName("block_slag").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeStone).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_slag");
|
||||
|
||||
block_australium = new BlockBeaconable(Material.iron).setBlockName("block_australium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_australium");
|
||||
block_weidanium = new BlockBeaconable(Material.iron).setBlockName("block_weidanium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_weidanium");
|
||||
@ -1463,6 +1517,7 @@ public class ModBlocks {
|
||||
deco_rbmk_smooth = new BlockGeneric(Material.iron).setBlockName("deco_rbmk_smooth").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_top");
|
||||
|
||||
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");
|
||||
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");
|
||||
@ -1475,11 +1530,14 @@ public class ModBlocks {
|
||||
|
||||
reinforced_brick = new BlockGeneric(Material.rock).setBlockName("reinforced_brick").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(8000.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(200.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_light = new BlockGeneric(Material.rock).setBlockName("reinforced_light").setCreativeTab(MainRegistry.blockTab).setLightLevel(1.0F).setHardness(15.0F).setResistance(300.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_light");
|
||||
reinforced_sand = new BlockGeneric(Material.rock).setBlockName("reinforced_sand").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(400.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(300.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_lamp_off");
|
||||
reinforced_lamp_on = new ReinforcedLamp(Material.rock, true).setBlockName("reinforced_lamp_on").setHardness(15.0F).setResistance(300.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_lamp_on");
|
||||
|
||||
reinforced_laminate = new BlockNTMGlassCT(1, RefStrings.MODID + ":reinforced_laminate", Material.rock, true).setBlockName("reinforced_laminate").setCreativeTab(MainRegistry.blockTab).setLightOpacity(0).setHardness(15.0F).setResistance(1000.0F);
|
||||
reinforced_laminate_pane = new BlockNTMGlassPane(1, RefStrings.MODID + ":reinforced_laminate_pane", RefStrings.MODID + ":reinforced_laminate_pane_edge", Material.rock, true).setBlockName("reinforced_laminate_pane").setCreativeTab(MainRegistry.blockTab).setLightOpacity(1).setHardness(15.0F).setResistance(1000.0F);
|
||||
|
||||
lamp_tritium_green_off = new ReinforcedLamp(Material.redstoneLight, false).setBlockName("lamp_tritium_green_off").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lamp_tritium_green_off");
|
||||
lamp_tritium_green_on = new ReinforcedLamp(Material.redstoneLight, true).setBlockName("lamp_tritium_green_on").setStepSound(Block.soundTypeGlass).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lamp_tritium_green_on");
|
||||
lamp_tritium_blue_off = new ReinforcedLamp(Material.redstoneLight, false).setBlockName("lamp_tritium_blue_off").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(3.0F).setBlockTextureName(RefStrings.MODID + ":lamp_tritium_blue_off");
|
||||
@ -1492,13 +1550,14 @@ public class ModBlocks {
|
||||
reinforced_stone = new BlockGeneric(Material.rock).setBlockName("reinforced_stone").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(3000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_stone");
|
||||
concrete_smooth = new BlockRadResistant(Material.rock).setBlockName("concrete_smooth").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(4000.0F).setBlockTextureName(RefStrings.MODID + ":concrete");
|
||||
concrete_colored = new BlockConcreteColored(Material.rock).setBlockName("concrete_colored").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(4000.0F).setBlockTextureName(RefStrings.MODID + ":concrete");
|
||||
concrete_colored_ext = new BlockConcreteColoredExt(Material.rock).setBlockName("concrete_colored_ext").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(4000.0F).setBlockTextureName(RefStrings.MODID + ":concrete_colored_ext");
|
||||
concrete = new BlockGeneric(Material.rock).setBlockName("concrete").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(4000.0F).setBlockTextureName(RefStrings.MODID + ":concrete_tile");
|
||||
concrete_asbestos = new BlockGeneric(Material.rock).setBlockName("concrete_asbestos").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(4000.0F).setBlockTextureName(RefStrings.MODID + ":concrete_asbestos");
|
||||
concrete_super = new BlockUberConcrete().setBlockName("concrete_super").setCreativeTab(MainRegistry.blockTab).setHardness(150.0F).setResistance(10000.0F);
|
||||
concrete_super_broken = new BlockFalling(Material.rock).setBlockName("concrete_super_broken").setCreativeTab(MainRegistry.blockTab).setHardness(10.0F).setResistance(20.0F).setBlockTextureName(RefStrings.MODID + ":concrete_super_broken");
|
||||
concrete_pillar = new BlockRotatablePillar(Material.rock, RefStrings.MODID + ":concrete_pillar_top").setBlockName("concrete_pillar").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(4000.0F).setBlockTextureName(RefStrings.MODID + ":concrete_pillar_side");
|
||||
brick_concrete = new BlockGeneric(Material.rock).setBlockName("brick_concrete").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
brick_concrete_mossy = new BlockGeneric(Material.rock).setBlockName("brick_concrete_mossy").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete_mossy");
|
||||
concrete_pillar = new BlockRotatablePillar(Material.rock, RefStrings.MODID + ":concrete_pillar_top").setBlockName("concrete_pillar").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":concrete_pillar_side");
|
||||
brick_concrete = new BlockGeneric(Material.rock).setBlockName("brick_concrete").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(5000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
brick_concrete_mossy = new BlockGeneric(Material.rock).setBlockName("brick_concrete_mossy").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(5000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete_mossy");
|
||||
brick_concrete_cracked = new BlockGeneric(Material.rock).setBlockName("brick_concrete_cracked").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(2000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete_cracked");
|
||||
brick_concrete_broken = new BlockGeneric(Material.rock).setBlockName("brick_concrete_broken").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(1500.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete_broken");
|
||||
brick_concrete_marked = new BlockWriting(Material.rock, RefStrings.MODID + ":brick_concrete").setBlockName("brick_concrete_marked").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(1500.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete_marked");
|
||||
@ -1649,6 +1708,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");
|
||||
|
||||
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);
|
||||
@ -1759,12 +1820,15 @@ public class ModBlocks {
|
||||
machine_sawmill = new MachineSawmill().setBlockName("machine_sawmill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_crucible = new MachineCrucible().setBlockName("machine_crucible").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
machine_boiler = new MachineHeatBoiler().setBlockName("machine_boiler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
machine_industrial_boiler = new MachineHeatBoilerIndustrial().setBlockName("machine_industrial_boiler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
foundry_mold = new FoundryMold().setBlockName("foundry_mold").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
foundry_basin = new FoundryBasin().setBlockName("foundry_basin").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
foundry_channel = new FoundryChannel().setBlockName("foundry_channel").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
foundry_tank = new FoundryTank().setBlockName("foundry_tank").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
foundry_outlet = new FoundryOutlet().setBlockName("foundry_outlet").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
foundry_slagtap = new FoundrySlagtap().setBlockName("foundry_slagtap").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
slag = new BlockDynamicSlag().setBlockName("slag").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":slag");
|
||||
|
||||
machine_difurnace_off = new MachineDiFurnace(false).setBlockName("machine_difurnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_difurnace_on = new MachineDiFurnace(true).setBlockName("machine_difurnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
@ -1821,6 +1885,7 @@ public class ModBlocks {
|
||||
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_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);
|
||||
|
||||
machine_electric_furnace_off = new MachineElectricFurnace(false).setBlockName("machine_electric_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_electric_furnace_on = new MachineElectricFurnace(true).setBlockName("machine_electric_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
@ -1830,13 +1895,19 @@ public class ModBlocks {
|
||||
|
||||
//machine_deuterium = new MachineDeuterium(Material.iron).setBlockName("machine_deuterium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
machine_battery_potato = new MachineBattery(Material.iron, 10000).setBlockName("machine_battery_potato").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_battery = new MachineBattery(Material.iron, 1000000).setBlockName("machine_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_lithium_battery = new MachineBattery(Material.iron, 50000000).setBlockName("machine_lithium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_schrabidium_battery = new MachineBattery(Material.iron, 25000000000L).setBlockName("machine_schrabidium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_dineutronium_battery = new MachineBattery(Material.iron, 1000000000000L).setBlockName("machine_dineutronium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_battery_potato = new MachineBattery(Material.iron, 10_000).setBlockName("machine_battery_potato").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_battery = new MachineBattery(Material.iron, 1_000_000).setBlockName("machine_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_lithium_battery = new MachineBattery(Material.iron, 50_000_000).setBlockName("machine_lithium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_schrabidium_battery = new MachineBattery(Material.iron, 25_000_000_000L).setBlockName("machine_schrabidium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_dineutronium_battery = new MachineBattery(Material.iron, 1_000_000_000_000L).setBlockName("machine_dineutronium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_fensu = new MachineFENSU(Material.iron).setBlockName("machine_fensu").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_fensu");
|
||||
|
||||
capacitor_bus = new MachineCapacitorBus(Material.iron).setBlockName("capacitor_bus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
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");
|
||||
|
||||
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);
|
||||
|
||||
@ -1846,20 +1917,13 @@ public class ModBlocks {
|
||||
machine_shredder = new MachineShredder(Material.iron).setBlockName("machine_shredder").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_shredder_large = new MachineShredderLarge(Material.iron).setBlockName("machine_shredder_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
|
||||
machine_combine_factory = new MachineCMBFactory(Material.iron).setBlockName("machine_combine_factory").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_combine_factory = new MachineCMBFactory(Material.iron).setBlockName("machine_combine_factory").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null);
|
||||
|
||||
machine_teleporter = new MachineTeleporter(Material.iron).setBlockName("machine_teleporter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
teleanchor = new MachineTeleanchor().setBlockName("teleanchor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
field_disturber = new MachineFieldDisturber().setBlockName("field_disturber").setHardness(5.0F).setResistance(200.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":field_disturber");
|
||||
|
||||
machine_rtg_grey = new MachineRTG(Material.iron).setBlockName("machine_rtg_grey").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rtg");
|
||||
//machine_rtg_red = new MachineRTG(Material.iron).setBlockName("machine_rtg_red").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
//machine_rtg_orange = new MachineRTG(Material.iron).setBlockName("machine_rtg_orange").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
//machine_rtg_yellow = new MachineRTG(Material.iron).setBlockName("machine_rtg_yellow").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
//machine_rtg_green = new MachineRTG(Material.iron).setBlockName("machine_rtg_green").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_rtg_cyan = new MachineRTG(Material.iron).setBlockName("machine_rtg_cyan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
//machine_rtg_blue = new MachineRTG(Material.iron).setBlockName("machine_rtg_blue").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
//machine_rtg_purple = new MachineRTG(Material.iron).setBlockName("machine_rtg_purple").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_amgen = new MachineAmgen(Material.iron).setBlockName("machine_amgen").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_geo = new MachineAmgen(Material.iron).setBlockName("machine_geo").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_minirtg = new MachineMiniRTG(Material.iron).setBlockName("machine_minirtg").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rtg_cell");
|
||||
@ -1879,18 +1943,18 @@ public class ModBlocks {
|
||||
cable_detector = new CableDetector(Material.iron).setBlockName("cable_detector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
cable_diode = new CableDiode(Material.iron).setBlockName("cable_diode").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cable_diode");
|
||||
machine_detector = new PowerDetector(Material.iron).setBlockName("machine_detector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_detector_off");
|
||||
oil_duct_solid = new OilDuctSolid(Material.iron).setBlockName("oil_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":oil_duct_solid_alt");
|
||||
oil_duct = new BlockOilDuct(Material.iron).setBlockName("oil_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":oil_duct_icon_alt");
|
||||
gas_duct_solid = new GasDuctSolid(Material.iron).setBlockName("gas_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":gas_duct_solid");
|
||||
gas_duct = new BlockGasDuct(Material.iron).setBlockName("gas_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":gas_duct_icon");
|
||||
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_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);
|
||||
fluid_switch = new FluidSwitch(Material.iron).setBlockName("fluid_switch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
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");
|
||||
|
||||
conveyor = new BlockConveyor().setBlockName("conveyor").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor");
|
||||
//conveyor_classic = new BlockConveyorClassic().setBlockName("conveyor_classic").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor");
|
||||
@ -1900,12 +1964,15 @@ public class ModBlocks {
|
||||
conveyor_lift = new BlockConveyorLift().setBlockName("conveyor_lift").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor");
|
||||
crane_extractor = new CraneExtractor().setBlockName("crane_extractor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crane_inserter = new CraneInserter().setBlockName("crane_inserter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crane_grabber = new CraneGrabber().setBlockName("crane_grabber").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crane_router = new CraneRouter().setBlockName("crane_router").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crane_boxer = new CraneBoxer().setBlockName("crane_boxer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crane_unboxer = new CraneUnboxer().setBlockName("crane_unboxer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crane_splitter = new CraneSplitter().setBlockName("crane_splitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crane_splitter = new CraneSplitter().setBlockName("crane_splitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":crane_side");
|
||||
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");
|
||||
|
||||
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");
|
||||
@ -1945,6 +2012,7 @@ public class ModBlocks {
|
||||
struct_soyuz_core = new BlockSoyuzStruct(Material.iron).setBlockName("struct_soyuz_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":struct_soyuz_core");
|
||||
struct_iter_core = new BlockITERStruct(Material.iron).setBlockName("struct_iter_core").setLightLevel(1F).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":struct_iter_core");
|
||||
struct_plasma_core = new BlockPlasmaStruct(Material.iron).setBlockName("struct_plasma_core").setLightLevel(1F).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":struct_plasma_core");
|
||||
struct_watz_core = new BlockWatzStruct(Material.iron).setBlockName("struct_watz_core").setLightLevel(1F).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":struct_watz_core");
|
||||
|
||||
factory_titanium_hull = new BlockGeneric(Material.iron).setBlockName("factory_titanium_hull").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":factory_titanium_hull");
|
||||
factory_titanium_furnace = new FactoryHatch(Material.iron).setBlockName("factory_titanium_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":factory_titanium_furnace");
|
||||
@ -1953,6 +2021,14 @@ public class ModBlocks {
|
||||
factory_advanced_furnace = new FactoryHatch(Material.iron).setBlockName("factory_advanced_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":factory_advanced_furnace");
|
||||
factory_advanced_conductor = new BlockPillar(Material.iron, RefStrings.MODID + ":factory_advanced_conductor").setBlockName("factory_advanced_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":factory_advanced_hull");
|
||||
|
||||
cm_block = new BlockCM(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_block").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_block");
|
||||
cm_sheet = new BlockCM(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_sheet").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_sheet");
|
||||
cm_engine = new BlockCM(Material.iron, EnumCMEngines.class, true, true).setBlockName("cm_engine").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_engine");
|
||||
cm_tank = new BlockCMGlass(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_tank").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_tank");
|
||||
cm_circuit = new BlockCM(Material.iron, EnumCMCircuit.class, true, true).setBlockName("cm_circuit").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_circuit");
|
||||
cm_port = new BlockCMPort(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_port").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_port");
|
||||
custom_machine = new BlockCustomMachine().setBlockName("custom_machine").setCreativeTab(MainRegistry.machineTab).setLightLevel(1F).setHardness(5.0F).setResistance(10.0F);
|
||||
|
||||
reactor_element = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_element_top", RefStrings.MODID + ":reactor_element_base").setBlockName("reactor_element").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":reactor_element_side");
|
||||
reactor_control = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_control_top").setBlockName("reactor_control").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":reactor_control_side");
|
||||
reactor_hatch = new ReactorHatch(Material.iron).setBlockName("reactor_hatch").setHardness(5.0F).setResistance(1000.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
@ -1961,7 +2037,7 @@ public class ModBlocks {
|
||||
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");
|
||||
|
||||
fusion_conductor = new BlockPillar(Material.iron, RefStrings.MODID + ":fusion_conductor_top_alt").setBlockName("fusion_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fusion_conductor_side_alt");
|
||||
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");
|
||||
@ -1973,12 +2049,13 @@ public class ModBlocks {
|
||||
|
||||
watz_element = new BlockPillar(Material.iron, RefStrings.MODID + ":watz_element_top").setBlockName("watz_element").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_element_side");
|
||||
watz_control = new BlockPillar(Material.iron, RefStrings.MODID + ":watz_control_top").setBlockName("watz_control").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_control_side");
|
||||
watz_cooler = new BlockGeneric(Material.iron).setBlockName("watz_cooler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_cooler");
|
||||
watz_end = new BlockGeneric(Material.iron).setBlockName("watz_end").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_casing");
|
||||
watz_cooler = new BlockPillar(Material.iron, RefStrings.MODID + ":watz_cooler_top").setBlockName("watz_cooler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_cooler_side");
|
||||
watz_end = new BlockToolConversion(Material.iron).addVariant("_bolted").setBlockName("watz_end").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_casing");
|
||||
watz_hatch = new WatzHatch(Material.iron).setBlockName("watz_hatch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_hatch");
|
||||
watz_conductor = new BlockCableConnect(Material.iron).setBlockName("watz_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_conductor_top");
|
||||
watz_core = new WatzCore(Material.iron).setBlockName("watz_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_computer");
|
||||
watz = new Watz().setBlockName("watz").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
watz_pump = new WatzPump().setBlockName("watz_pump").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
fwatz_conductor = new BlockPillar(Material.iron, RefStrings.MODID + ":block_combine_steel").setBlockName("fwatz_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fwatz_conductor_side");
|
||||
fwatz_cooler = new BlockPillar(Material.iron, RefStrings.MODID + ":fwatz_cooler_top").setBlockName("fwatz_cooler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fwatz_cooler");
|
||||
@ -2012,6 +2089,9 @@ public class ModBlocks {
|
||||
|
||||
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");
|
||||
|
||||
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");
|
||||
|
||||
@ -2100,6 +2180,12 @@ public class ModBlocks {
|
||||
rail_narrow = new RailGeneric().setBlockName("rail_narrow").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_narrow");
|
||||
rail_highspeed = new RailGeneric().setMaxSpeed(1F).setFlexible(false).setBlockName("rail_highspeed").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_highspeed");
|
||||
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");
|
||||
|
||||
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");
|
||||
@ -2113,6 +2199,7 @@ public class ModBlocks {
|
||||
crate_steel = new BlockStorageCrate(Material.iron).setBlockName("crate_steel").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crate_desh = new BlockStorageCrate(Material.iron).setBlockName("crate_desh").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crate_tungsten = new BlockStorageCrate(Material.iron).setBlockName("crate_tungsten").setStepSound(Block.soundTypeMetal).setHardness(7.5F).setResistance(300.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crate_template = new BlockStorageCrate(Material.iron).setBlockName("crate_template").setStepSound(Block.soundTypeMetal).setHardness(7.5F).setResistance(300.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
safe = new BlockStorageCrate(Material.iron).setBlockName("safe").setStepSound(Block.soundTypeMetal).setHardness(7.5F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
mass_storage = new BlockMassStorage().setBlockName("mass_storage").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
@ -2125,12 +2212,14 @@ public class ModBlocks {
|
||||
machine_fracking_tower = new MachineFrackingTower().setBlockName("machine_fracking_tower").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
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");
|
||||
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");
|
||||
fraction_spacer = new FractionSpacer(Material.iron).setBlockName("fraction_spacer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_catalytic_cracker = new MachineCatalyticCracker(Material.iron).setBlockName("machine_catalytic_cracker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
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_excavator = new MachineExcavator().setBlockName("machine_excavator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -2172,8 +2261,9 @@ public class ModBlocks {
|
||||
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");
|
||||
|
||||
machine_liquefactor = new MachineLiquefactor().setBlockName("machine_liquefactor").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_liquefactor = new MachineLiquefactor().setBlockName("machine_liquefactor").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
machine_solidifier = new MachineSolidifier().setBlockName("machine_solidifier").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
machine_compressor = new MachineCompressor().setBlockName("machine_compressor").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
|
||||
machine_electrolyser = new MachineElectrolyser().setBlockName("machine_electrolyser").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
|
||||
@ -2280,8 +2370,6 @@ public class ModBlocks {
|
||||
|
||||
dummy_block_drill = new DummyBlockDrill(Material.iron, false).setBlockName("dummy_block_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
|
||||
dummy_port_drill = new DummyBlockDrill(Material.iron, true).setBlockName("dummy_port_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
|
||||
dummy_block_assembler = new DummyBlockAssembler(Material.iron, false).setBlockName("dummy_block_assembler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_assembler = new DummyBlockAssembler(Material.iron, true).setBlockName("dummy_port_assembler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_block_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
dummy_port_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_port_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
dummy_block_ams_emitter = new DummyBlockAMSEmitter(Material.iron).setBlockName("dummy_block_ams_emitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
@ -2444,9 +2532,10 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(crystal_trixite, crystal_trixite.getUnlocalizedName());
|
||||
|
||||
//Resource-bearing Stones
|
||||
GameRegistry.registerBlock(stone_resource, ItemBlockBase.class, stone_resource.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(stalagmite, ItemBlockBase.class, stalagmite.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(stalactite, ItemBlockBase.class, stalactite.getUnlocalizedName());
|
||||
register(stone_resource);
|
||||
register(stalagmite);
|
||||
register(stalactite);
|
||||
register(stone_biome);
|
||||
|
||||
//Stone Variants
|
||||
GameRegistry.registerBlock(stone_porous, stone_porous.getUnlocalizedName());
|
||||
@ -2498,8 +2587,11 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(block_beryllium, block_beryllium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_cobalt, block_cobalt.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_steel, block_steel.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_tcalloy, block_tcalloy.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_cdalloy, block_cdalloy.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_lead, block_lead.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_bismuth, block_bismuth.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_cadmium, block_cadmium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_coltan, block_coltan.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_tantalium, block_tantalium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_niobium, block_niobium.getUnlocalizedName());
|
||||
@ -2585,6 +2677,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(deco_beryllium, deco_beryllium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(deco_asbestos, deco_asbestos.getUnlocalizedName());
|
||||
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(bobblehead, ItemBlockMeta.class, bobblehead.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(snowglobe, ItemBlockMeta.class, snowglobe.getUnlocalizedName());
|
||||
@ -2610,16 +2703,20 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(asphalt_light, ItemBlockBlastInfo.class, asphalt_light.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reinforced_brick, ItemBlockBlastInfo.class, reinforced_brick.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reinforced_glass, ItemBlockBlastInfo.class, reinforced_glass.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reinforced_glass_pane, ItemBlockBlastInfo.class, reinforced_glass_pane.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reinforced_light, ItemBlockBlastInfo.class, reinforced_light.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reinforced_sand, ItemBlockBlastInfo.class, reinforced_sand.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reinforced_lamp_off, ItemBlockBlastInfo.class, reinforced_lamp_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reinforced_lamp_on, ItemBlockBlastInfo.class, reinforced_lamp_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reinforced_laminate, ItemBlockBlastInfo.class, reinforced_laminate.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reinforced_laminate_pane,ItemBlockBlastInfo.class, reinforced_laminate_pane.getUnlocalizedName());
|
||||
|
||||
//Bricks
|
||||
GameRegistry.registerBlock(reinforced_stone, ItemBlockBlastInfo.class, reinforced_stone.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reinforced_ducrete, ItemBlockBlastInfo.class, reinforced_ducrete.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(concrete_smooth, ItemBlockBlastInfo.class, concrete_smooth.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(concrete_colored, ItemBlockColoredConcrete.class, concrete_colored.getUnlocalizedName());
|
||||
register(concrete_colored_ext);
|
||||
GameRegistry.registerBlock(concrete, ItemBlockBlastInfo.class, concrete.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(concrete_asbestos, ItemBlockBlastInfo.class, concrete_asbestos.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(concrete_super, ItemBlockBlastInfo.class, concrete_super.getUnlocalizedName());
|
||||
@ -2767,6 +2864,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());
|
||||
GameRegistry.registerBlock(moon_turf, moon_turf.getUnlocalizedName());
|
||||
|
||||
//Waste
|
||||
@ -2916,7 +3015,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(blast_door, blast_door.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fire_door, fire_door.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(transition_seal, transition_seal.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(sliding_blast_door, sliding_blast_door.getUnlocalizedName());
|
||||
|
||||
//Doors
|
||||
GameRegistry.registerBlock(door_metal, door_metal.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(door_office, door_office.getUnlocalizedName());
|
||||
@ -2927,6 +3027,7 @@ public class ModBlocks {
|
||||
register(crate_steel);
|
||||
register(crate_desh);
|
||||
register(crate_tungsten);
|
||||
register(crate_template);
|
||||
register(safe);
|
||||
register(mass_storage);
|
||||
|
||||
@ -2969,11 +3070,14 @@ public class ModBlocks {
|
||||
register(machine_sawmill);
|
||||
register(machine_crucible);
|
||||
register(machine_boiler);
|
||||
register(machine_industrial_boiler);
|
||||
register(foundry_mold);
|
||||
register(foundry_basin);
|
||||
register(foundry_channel);
|
||||
register(foundry_tank);
|
||||
register(foundry_outlet);
|
||||
register(foundry_slagtap);
|
||||
register(slag);
|
||||
register(machine_difurnace_off);
|
||||
register(machine_difurnace_on);
|
||||
register(machine_difurnace_extension);
|
||||
@ -3040,6 +3144,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(hadron_analysis_glass, hadron_analysis_glass.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(hadron_access, hadron_access.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(hadron_core, hadron_core.getUnlocalizedName());
|
||||
register(hadron_cooler);
|
||||
|
||||
GameRegistry.registerBlock(rbmk_rod, rbmk_rod.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_rod_mod, rbmk_rod_mod.getUnlocalizedName());
|
||||
@ -3080,21 +3185,22 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(cable_detector, cable_detector.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(cable_diode, ItemBlockBase.class, cable_diode.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_detector, machine_detector.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(oil_duct, oil_duct.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(oil_duct_solid, oil_duct_solid.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(gas_duct, gas_duct.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(gas_duct_solid, gas_duct_solid.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fluid_duct, fluid_duct.getUnlocalizedName());
|
||||
register(fluid_duct_neo);
|
||||
register(fluid_duct_box);
|
||||
register(fluid_duct_exhaust);
|
||||
register(fluid_duct_paintable);
|
||||
register(fluid_duct_gauge);
|
||||
GameRegistry.registerBlock(fluid_duct_solid, fluid_duct_solid.getUnlocalizedName());
|
||||
register(fluid_valve);
|
||||
register(fluid_switch);
|
||||
register(radio_torch_sender);
|
||||
register(radio_torch_receiver);
|
||||
register(radio_torch_counter);
|
||||
|
||||
GameRegistry.registerBlock(crane_extractor, crane_extractor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crane_inserter, crane_inserter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crane_grabber, crane_grabber.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crane_router, crane_router.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crane_boxer, crane_boxer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crane_unboxer, crane_unboxer.getUnlocalizedName());
|
||||
@ -3106,6 +3212,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(crane_splitter, crane_splitter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fan, fan.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(piston_inserter, piston_inserter.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(chain, chain.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ladder_sturdy, ladder_sturdy.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ladder_iron, ladder_iron.getUnlocalizedName());
|
||||
@ -3130,6 +3238,11 @@ public class ModBlocks {
|
||||
register(machine_schrabidium_battery);
|
||||
register(machine_dineutronium_battery);
|
||||
register(machine_fensu);
|
||||
register(capacitor_bus);
|
||||
register(capacitor_copper);
|
||||
register(capacitor_gold);
|
||||
register(capacitor_niobium);
|
||||
register(capacitor_tantalium);
|
||||
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());
|
||||
@ -3164,6 +3277,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_deuterium_tower, machine_deuterium_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_liquefactor, ItemBlockBase.class, machine_liquefactor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_solidifier, ItemBlockBase.class, machine_solidifier.getUnlocalizedName());
|
||||
register(machine_compressor);
|
||||
GameRegistry.registerBlock(machine_electrolyser, machine_electrolyser.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_deaerator, machine_deaerator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_waste_drum, machine_waste_drum.getUnlocalizedName());
|
||||
@ -3174,14 +3288,16 @@ public class ModBlocks {
|
||||
register(machine_pumpjack);
|
||||
register(machine_fracking_tower);
|
||||
register(machine_flare);
|
||||
register(chimney_brick);
|
||||
register(machine_refinery);
|
||||
register(machine_vacuum_distill);
|
||||
GameRegistry.registerBlock(machine_fraction_tower, machine_fraction_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fraction_spacer, fraction_spacer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_catalytic_cracker, machine_catalytic_cracker.getUnlocalizedName());
|
||||
register(machine_fraction_tower);
|
||||
register(fraction_spacer);
|
||||
register(machine_catalytic_cracker);
|
||||
register(machine_catalytic_reformer);
|
||||
GameRegistry.registerBlock(machine_drill, machine_drill.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_autosaw, machine_autosaw.getUnlocalizedName());
|
||||
register(machine_coker);
|
||||
register(machine_drill);
|
||||
register(machine_autosaw);
|
||||
register(machine_excavator);
|
||||
register(machine_mining_laser);
|
||||
register(barricade);
|
||||
@ -3213,6 +3329,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(struct_soyuz_core, struct_soyuz_core.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(struct_iter_core, struct_iter_core.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(struct_plasma_core, struct_plasma_core.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(struct_watz_core, struct_watz_core.getUnlocalizedName());
|
||||
|
||||
//Absorbers
|
||||
GameRegistry.registerBlock(absorber, absorber.getUnlocalizedName());
|
||||
@ -3230,6 +3347,15 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(factory_titanium_hull, factory_titanium_hull.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(factory_advanced_hull, factory_advanced_hull.getUnlocalizedName());
|
||||
|
||||
//CM stuff
|
||||
register(custom_machine, ItemCustomMachine.class);
|
||||
register(cm_block);
|
||||
register(cm_sheet);
|
||||
register(cm_engine);
|
||||
register(cm_tank);
|
||||
register(cm_circuit);
|
||||
register(cm_port);
|
||||
|
||||
//Multiblock Generators
|
||||
GameRegistry.registerBlock(reactor_element, reactor_element.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reactor_control, reactor_control.getUnlocalizedName());
|
||||
@ -3239,7 +3365,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(reactor_conductor, reactor_conductor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reactor_computer, reactor_computer.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(fusion_conductor, fusion_conductor.getUnlocalizedName());
|
||||
register(fusion_conductor);
|
||||
GameRegistry.registerBlock(fusion_center, fusion_center.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fusion_motor, fusion_motor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fusion_heater, fusion_heater.getUnlocalizedName());
|
||||
@ -3252,11 +3378,12 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(watz_element, watz_element.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_control, watz_control.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_cooler, watz_cooler.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_end, watz_end.getUnlocalizedName());
|
||||
register(watz_end);
|
||||
GameRegistry.registerBlock(watz_hatch, watz_hatch.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_conductor, watz_conductor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_core, watz_core.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz, watz.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_pump, watz_pump.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(fwatz_conductor, fwatz_conductor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fwatz_scaffold, fwatz_scaffold.getUnlocalizedName());
|
||||
@ -3311,6 +3438,12 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(rail_narrow, ItemBlockBase.class, rail_narrow.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rail_highspeed, ItemBlockBase.class, rail_highspeed.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rail_booster, ItemBlockBase.class, rail_booster.getUnlocalizedName());
|
||||
register(rail_narrow_straight);
|
||||
register(rail_narrow_curve);
|
||||
register(rail_large_straight);
|
||||
register(rail_large_curve);
|
||||
register(rail_large_ramp);
|
||||
register(rail_large_buffer);
|
||||
|
||||
//Crate
|
||||
GameRegistry.registerBlock(crate, crate.getUnlocalizedName());
|
||||
@ -3341,8 +3474,6 @@ public class ModBlocks {
|
||||
//Multiblock Dummy Blocks
|
||||
GameRegistry.registerBlock(dummy_block_drill, dummy_block_drill.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_drill, dummy_port_drill.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_assembler, dummy_block_assembler.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_assembler, dummy_port_assembler.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_ams_limiter, dummy_block_ams_limiter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_ams_limiter, dummy_port_ams_limiter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_ams_emitter, dummy_block_ams_emitter.getUnlocalizedName());
|
||||
@ -3399,7 +3530,12 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(b, ItemBlockBase.class, b.getUnlocalizedName());
|
||||
}
|
||||
|
||||
/*private static void register(Block b, Class<? extends ItemBlock> clazz) {
|
||||
private static void register(Block b, Class<? extends ItemBlock> clazz) {
|
||||
GameRegistry.registerBlock(b, clazz, b.getUnlocalizedName());
|
||||
}*/
|
||||
}
|
||||
|
||||
public static void addRemap(String unloc, Block block, int meta) {
|
||||
Block remap = new BlockRemap(block, meta).setBlockName(unloc);
|
||||
register(remap, ItemBlockRemap.class);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,11 +16,13 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class BlockTNTBase extends BlockFlammable implements IToolable {
|
||||
|
||||
@ -44,6 +46,8 @@ public abstract class BlockTNTBase extends BlockFlammable implements IToolable {
|
||||
if(world.isBlockIndirectlyGettingPowered(x, y, z)) {
|
||||
this.onBlockDestroyedByPlayer(world, x, y, z, 1);
|
||||
world.setBlockToAir(x, y, z);
|
||||
} else {
|
||||
checkAndIgnite(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,6 +56,19 @@ public abstract class BlockTNTBase extends BlockFlammable implements IToolable {
|
||||
if(world.isBlockIndirectlyGettingPowered(x, y, z)) {
|
||||
this.onBlockDestroyedByPlayer(world, x, y, z, 1);
|
||||
world.setBlockToAir(x, y, z);
|
||||
} else {
|
||||
checkAndIgnite(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
public void checkAndIgnite(World world, int x, int y, int z) {
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if(world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) == Blocks.fire) {
|
||||
this.onBlockDestroyedByPlayer(world, x, y, z, 1);
|
||||
world.setBlockToAir(x, y, z);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.mob.EntityTaintCrab;
|
||||
import com.hbm.entity.mob.EntityTaintedCreeper;
|
||||
import com.hbm.entity.mob.EntityCreeperTainted;
|
||||
import com.hbm.entity.mob.EntityTeslaCrab;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
@ -185,8 +185,8 @@ public class BlockTaint extends Block/*Container*/ {
|
||||
}
|
||||
}
|
||||
|
||||
if(entity instanceof EntityCreeper) {
|
||||
EntityTaintedCreeper creep = new EntityTaintedCreeper(world);
|
||||
if(entity != null && entity.getClass().equals(EntityCreeper.class)) {
|
||||
EntityCreeperTainted creep = new EntityCreeperTainted(world);
|
||||
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
|
||||
|
||||
if(!world.isRemote) {
|
||||
|
||||
@ -25,7 +25,6 @@ import net.minecraft.world.World;
|
||||
public class Landmine extends BlockContainer implements IBomb {
|
||||
|
||||
public static boolean safeMode = false;
|
||||
static Random rand = new Random();;
|
||||
|
||||
public Landmine(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
@ -100,18 +99,23 @@ public class Landmine extends BlockContainer implements IBomb {
|
||||
}
|
||||
|
||||
if(flag) {
|
||||
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
if(!safeMode) {
|
||||
explode(world, x, y, z);
|
||||
} else {
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int i) {
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) {
|
||||
|
||||
if(!safeMode) {
|
||||
explode(world, x, y, z);
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, i);
|
||||
super.onBlockDestroyedByPlayer(world, x, y, z, meta);
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float fx, float fy, float fz) {
|
||||
|
||||
55
src/main/java/com/hbm/blocks/generic/BlockBiomeStone.java
Normal file
55
src/main/java/com/hbm/blocks/generic/BlockBiomeStone.java
Normal file
@ -0,0 +1,55 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.BlockEnums.EnumBiomeType;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockBiomeStone extends BlockEnumMulti {
|
||||
|
||||
public BlockBiomeStone() {
|
||||
super(Material.rock, EnumBiomeType.class, true, true);
|
||||
}
|
||||
|
||||
protected IIcon[] iconsTop;
|
||||
protected IIcon[] iconsLayer;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
|
||||
Enum[] enums = theEnum.getEnumConstants();
|
||||
this.icons = new IIcon[enums.length];
|
||||
this.iconsTop = new IIcon[enums.length];
|
||||
this.iconsLayer = new IIcon[enums.length];
|
||||
|
||||
for(int i = 0; i < icons.length; i++) {
|
||||
Enum num = enums[i];
|
||||
this.icons[i] = reg.registerIcon(this.getTextureName() + "." + num.name().toLowerCase(Locale.US));
|
||||
this.iconsTop[i] = reg.registerIcon(this.getTextureName() + "_top." + num.name().toLowerCase(Locale.US));
|
||||
this.iconsLayer[i] = reg.registerIcon(this.getTextureName() + "_layer." + num.name().toLowerCase(Locale.US));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if(side == 0) return this.iconsTop[meta % this.icons.length];
|
||||
if(side == 1) return this.iconsTop[meta % this.icons.length];
|
||||
|
||||
if(world.getBlock(x, y + 1, z) == this && world.getBlockMetadata(x, y + 1, z) == meta) {
|
||||
return this.getIcon(side, meta);
|
||||
} else {
|
||||
return this.iconsLayer[meta % this.icons.length];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,9 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.inventory.gui.GUIScreenBobble;
|
||||
import com.hbm.items.special.ItemPlasticScrap.ScrapType;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -33,6 +29,9 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
|
||||
public BlockBobble() {
|
||||
@ -171,27 +170,29 @@ public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
|
||||
public static enum BobbleType {
|
||||
|
||||
NONE( "null", "null", null, null, false, ScrapType.BOARD_BLANK),
|
||||
STRENGTH( "Strength", "Strength", null, "It's essential to give your arguments impact.", false, ScrapType.BRIDGE_BIOS),
|
||||
PERCEPTION( "Perception", "Perception", null, "Only through observation will you perceive weakness.", false, ScrapType.BRIDGE_NORTH),
|
||||
ENDURANCE( "Endurance", "Endurance", null, "Always be ready to take one for the team.", false, ScrapType.BRIDGE_SOUTH),
|
||||
CHARISMA( "Charisma", "Charisma", null, "Nothing says pizzaz like a winning smile.", false, ScrapType.BRIDGE_IO),
|
||||
INTELLIGENCE( "Intelligence", "Intelligence", null, "It takes the smartest individuals to realize$there's always more to learn.", false, ScrapType.BRIDGE_BUS),
|
||||
AGILITY( "Agility", "Agility", null, "Never be afraid to dodge the sensitive issues.", false, ScrapType.BRIDGE_CHIPSET),
|
||||
LUCK( "Luck", "Luck", null, "There's only one way to give 110%.", false, ScrapType.BRIDGE_CMOS),
|
||||
BOB( "Robert \"The Bobcat\" Katzinsky", "HbMinecraft", "Hbm's Nuclear Tech Mod", "I know where you live, " + System.getProperty("user.name"), false, ScrapType.CPU_SOCKET),
|
||||
FRIZZLE( "Frooz", "Frooz", "Weapon models", "BLOOD IS FUEL", true, ScrapType.CPU_CLOCK),
|
||||
PU238( "Pu-238", "Pu-238", "Improved Tom impact mechanics", null, false, ScrapType.CPU_REGISTER),
|
||||
VT( "VT-6/24", "VT-6/24", "Balefire warhead model and general texturework", "You cannot unfuck a horse.", true, ScrapType.CPU_EXT),
|
||||
DOC( "The Doctor", "Doctor17PH", "Russian localization, lunar miner", "Perhaps the moon rocks were too expensive", true, ScrapType.CPU_CACHE),
|
||||
BLUEHAT( "The Blue Hat", "The Blue Hat", "Textures", "payday 2's deagle freeaim champ of the year 2022", true, ScrapType.MEM_16K_A),
|
||||
PHEO( "Pheo", "Pheonix", "Deuterium machines, tantalium textures, Reliant Rocket", "RUN TO THE BEDROOM, ON THE SUITCASE ON THE LEFT,$YOU'LL FIND MY FAVORITE AXE", true, ScrapType.MEM_16K_B),
|
||||
ADAM29( "Adam29", "Adam29", "Ethanol, liquid petroleum gas", "You know, nukes are really quite beatiful.$It's like watching a star be born for a split second.", true, ScrapType.MEM_16K_C),
|
||||
UFFR( "UFFR", "UFFR", "All sorts of things from his PR", "fried shrimp", false, ScrapType.MEM_SOCKET),
|
||||
VAER( "vaer", "vaer", "ZIRNOX", "taken de family out to the weekend cigarette festival", true, ScrapType.MEM_16K_D),
|
||||
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);
|
||||
NONE( "null", "null", null, null, false, ScrapType.BOARD_BLANK),
|
||||
STRENGTH( "Strength", "Strength", null, "It's essential to give your arguments impact.", false, ScrapType.BRIDGE_BIOS),
|
||||
PERCEPTION( "Perception", "Perception", null, "Only through observation will you perceive weakness.", false, ScrapType.BRIDGE_NORTH),
|
||||
ENDURANCE( "Endurance", "Endurance", null, "Always be ready to take one for the team.", false, ScrapType.BRIDGE_SOUTH),
|
||||
CHARISMA( "Charisma", "Charisma", null, "Nothing says pizzaz like a winning smile.", false, ScrapType.BRIDGE_IO),
|
||||
INTELLIGENCE( "Intelligence", "Intelligence", null, "It takes the smartest individuals to realize$there's always more to learn.", false, ScrapType.BRIDGE_BUS),
|
||||
AGILITY( "Agility", "Agility", null, "Never be afraid to dodge the sensitive issues.", false, ScrapType.BRIDGE_CHIPSET),
|
||||
LUCK( "Luck", "Luck", null, "There's only one way to give 110%.", false, ScrapType.BRIDGE_CMOS),
|
||||
BOB( "Robert \"The Bobcat\" Katzinsky", "HbMinecraft", "Hbm's Nuclear Tech Mod", "I know where you live, " + System.getProperty("user.name"), false, ScrapType.CPU_SOCKET),
|
||||
FRIZZLE( "Frooz", "Frooz", "Weapon models", "BLOOD IS FUEL", true, ScrapType.CPU_CLOCK),
|
||||
PU238( "Pu-238", "Pu-238", "Improved Tom impact mechanics", null, false, ScrapType.CPU_REGISTER),
|
||||
VT( "VT-6/24", "VT-6/24", "Balefire warhead model and general texturework", "You cannot unfuck a horse.", true, ScrapType.CPU_EXT),
|
||||
DOC( "The Doctor", "Doctor17PH", "Russian localization, lunar miner", "Perhaps the moon rocks were too expensive", true, ScrapType.CPU_CACHE),
|
||||
BLUEHAT( "The Blue Hat", "The Blue Hat", "Textures", "payday 2's deagle freeaim champ of the year 2022", true, ScrapType.MEM_16K_A),
|
||||
PHEO( "Pheo", "Pheonix", "Deuterium machines, tantalium textures, Reliant Rocket", "RUN TO THE BEDROOM, ON THE SUITCASE ON THE LEFT,$YOU'LL FIND MY FAVORITE AXE", true, ScrapType.MEM_16K_B),
|
||||
ADAM29( "Adam29", "Adam29", "Ethanol, liquid petroleum gas", "You know, nukes are really quite beatiful.$It's like watching a star be born for a split second.", true, ScrapType.MEM_16K_C),
|
||||
UFFR( "UFFR", "UFFR", "All sorts of things from his PR", "fried shrimp", false, ScrapType.MEM_SOCKET),
|
||||
VAER( "vaer", "vaer", "ZIRNOX", "taken de family out to the weekend cigarette festival", true, ScrapType.MEM_16K_D),
|
||||
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),
|
||||
PEEP( "Peep", "LePeeperSauvage", "Coilgun model", "Fluffy ears can't hide in ash, nor snow.", true, ScrapType.CPU_CLOCK);
|
||||
|
||||
public String name; //the title of the tooltip
|
||||
public String label; //the name engraved in the socket
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockConcreteColoredExt extends BlockEnumMulti {
|
||||
|
||||
public BlockConcreteColoredExt(Material mat) {
|
||||
super(mat, EnumConcreteType.class, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
|
||||
if(meta == EnumConcreteType.MACHINE_STRIPE.ordinal() && (side == 0 || side == 1)) {
|
||||
return super.getIcon(side, EnumConcreteType.MACHINE.ordinal());
|
||||
}
|
||||
|
||||
return super.getIcon(side, meta);
|
||||
}
|
||||
|
||||
public enum EnumConcreteType {
|
||||
MACHINE,
|
||||
MACHINE_STRIPE,
|
||||
INDIGO,
|
||||
PURPLE,
|
||||
PINK,
|
||||
HAZARD
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.hbm.blocks.generic;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.items.special.ItemDoorSkin;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
import com.hbm.tileentity.TileEntityDoorGeneric;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
@ -54,12 +55,14 @@ public class BlockDoorGeneric extends BlockDummyable {
|
||||
TileEntityDoorGeneric door = (TileEntityDoorGeneric) world.getTileEntity(pos1[0], pos1[1], pos1[2]);
|
||||
|
||||
if(door != null) {
|
||||
return door.tryToggle(playerIn);
|
||||
if(playerIn.getHeldItem() != null && playerIn.getHeldItem().getItem() instanceof ItemDoorSkin) {
|
||||
return door.setSkinIndex((byte) playerIn.getHeldItem().getItemDamage());
|
||||
} else {
|
||||
return door.tryToggle(playerIn);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!playerIn.isSneaking())
|
||||
return true;
|
||||
return false;
|
||||
return !playerIn.isSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
278
src/main/java/com/hbm/blocks/generic/BlockDynamicSlag.java
Normal file
278
src/main/java/com/hbm/blocks/generic/BlockDynamicSlag.java
Normal file
@ -0,0 +1,278 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.material.MaterialShapes;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.inventory.material.NTMMaterial;
|
||||
import com.hbm.items.machine.ItemScraps;
|
||||
import com.hbm.render.icon.RGBMutatorInterpolatedComponentRemap;
|
||||
import com.hbm.render.icon.TextureAtlasSpriteMutatable;
|
||||
import com.hbm.util.Compat;
|
||||
|
||||
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.client.renderer.texture.TextureMap;
|
||||
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.stats.StatList;
|
||||
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.common.util.ForgeDirection;
|
||||
|
||||
public class BlockDynamicSlag extends BlockContainer {
|
||||
|
||||
private HashMap<NTMMaterial, IIcon> iconMap = new HashMap();
|
||||
|
||||
public BlockDynamicSlag() {
|
||||
super(Material.iron);
|
||||
this.useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntitySlag();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
super.registerBlockIcons(reg);
|
||||
|
||||
if(reg instanceof TextureMap) {
|
||||
TextureMap map = (TextureMap) reg;
|
||||
|
||||
for(NTMMaterial mat : Mats.orderedList) {
|
||||
if(mat.solidColorLight != mat.solidColorDark) {
|
||||
String placeholderName = this.getTextureName() + "-" + mat.names[0];
|
||||
TextureAtlasSpriteMutatable mutableIcon = new TextureAtlasSpriteMutatable(placeholderName, new RGBMutatorInterpolatedComponentRemap(0xFFFFFF, 0x505050, mat.solidColorLight, mat.solidColorDark)).setBlockAtlas();
|
||||
map.setTextureEntry(placeholderName, mutableIcon);
|
||||
iconMap.put(mat, mutableIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
|
||||
TileEntitySlag tile = (TileEntitySlag) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile != null && tile.mat != null) {
|
||||
IIcon override = iconMap.get(tile.mat);
|
||||
if(override != null) {
|
||||
return override;
|
||||
}
|
||||
}
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
TileEntitySlag tile = (TileEntitySlag) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile != null && tile.mat != null) {
|
||||
if(!iconMap.containsKey(tile.mat)) {
|
||||
return tile.mat.moltenColor;
|
||||
}
|
||||
}
|
||||
|
||||
return 0xffffff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
TileEntitySlag tile = (TileEntitySlag) world.getTileEntity(x, y, z);
|
||||
if(tile != null) {
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F, (float) tile.amount / (float) TileEntitySlag.maxAmount, 1F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
TileEntitySlag tile = (TileEntitySlag) world.getTileEntity(x, y, z);
|
||||
if(tile != null) {
|
||||
this.setBlockBounds(0F, 0F, 0F, 1F, (float) tile.amount / (float) TileEntitySlag.maxAmount, 1F);
|
||||
}
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
TileEntity s = Compat.getTileStandard(world, x, y, z);
|
||||
TileEntity b = Compat.getTileStandard(world, x, y - 1, z);
|
||||
|
||||
/* Error here, delete the block */
|
||||
if(s == null || !(s instanceof TileEntitySlag)) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
TileEntitySlag self = (TileEntitySlag) s;
|
||||
|
||||
/* Flow down */
|
||||
if(world.getBlock(x, y - 1, z).isReplaceable(world, x, y - 1, z)) {
|
||||
world.setBlock(x, y - 1, z, ModBlocks.slag);
|
||||
TileEntitySlag tile = (TileEntitySlag) Compat.getTileStandard(world, x, y - 1, z);
|
||||
tile.mat = self.mat;
|
||||
tile.amount = self.amount;
|
||||
world.markBlockForUpdate(x, y - 1, z);
|
||||
world.setBlockToAir(x, y, z);
|
||||
return;
|
||||
} else if(b instanceof TileEntitySlag) {
|
||||
|
||||
TileEntitySlag below = (TileEntitySlag) b;
|
||||
|
||||
if(below.mat == self.mat && below.amount < TileEntitySlag.maxAmount) {
|
||||
int transfer = Math.min(TileEntitySlag.maxAmount - below.amount, self.amount);
|
||||
below.amount += transfer;
|
||||
self.amount -= transfer;
|
||||
|
||||
if(self.amount <= 0){
|
||||
world.setBlockToAir(x, y, z);
|
||||
} else {
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y - 1, z);
|
||||
world.scheduleBlockUpdate(x, y - 1, z, ModBlocks.slag, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Flow sideways, no neighbors */
|
||||
ForgeDirection[] sides = new ForgeDirection[] { ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST };
|
||||
int count = 0;
|
||||
for(ForgeDirection dir : sides) {
|
||||
int iX = x + dir.offsetX;
|
||||
int iZ = z + dir.offsetZ;
|
||||
|
||||
if(world.getBlock(iX, y, iZ).isReplaceable(world, iX, y, iZ)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if(self.amount >= self.maxAmount / 5 && count > 0) {
|
||||
int toSpread = Math.max(self.amount / (count * 2), 1);
|
||||
|
||||
for(ForgeDirection dir : sides) {
|
||||
int iX = x + dir.offsetX;
|
||||
int iZ = z + dir.offsetZ;
|
||||
|
||||
if(world.getBlock(iX, y, iZ).isReplaceable(world, iX, y, iZ)) {
|
||||
world.setBlock(iX, y, iZ, ModBlocks.slag);
|
||||
TileEntitySlag tile = (TileEntitySlag) Compat.getTileStandard(world, iX, y, iZ);
|
||||
world.markBlockForUpdate(iX, y, iZ);
|
||||
world.scheduleBlockUpdate(iX, y, iZ, ModBlocks.slag, 1);
|
||||
tile.mat = self.mat;
|
||||
tile.amount = toSpread;
|
||||
self.amount -= toSpread;
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
|
||||
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
harvesters.set(player);
|
||||
this.dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
harvesters.set(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
||||
player.addExhaustion(0.025F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
|
||||
TileEntitySlag tile = (TileEntitySlag) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile != null && tile.mat != null && tile.amount > 0) {
|
||||
ret.add(ItemScraps.create(new MaterialStack(tile.mat, tile.amount)));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
|
||||
TileEntitySlag tile = (TileEntitySlag) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile != null) {
|
||||
return ItemScraps.create(new MaterialStack(tile.mat, tile.amount));
|
||||
}
|
||||
|
||||
return super.getPickBlock(target, world, x, y, z, player);
|
||||
}
|
||||
|
||||
public static class TileEntitySlag extends TileEntity {
|
||||
|
||||
public NTMMaterial mat;
|
||||
public int amount;
|
||||
public static int maxAmount = MaterialShapes.BLOCK.q(16);
|
||||
|
||||
@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.mat = Mats.matById.get(nbt.getInteger("mat"));
|
||||
this.amount = nbt.getInteger("amount");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
if(this.mat != null) nbt.setInteger("mat", this.mat.id);
|
||||
nbt.setInteger("amount", this.amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
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.handler.pollution.PollutionHandler;
|
||||
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.EnumDifficulty;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockGlyphidSpawner extends BlockContainer {
|
||||
|
||||
public BlockGlyphidSpawner(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return ModItems.egg_glyphid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(int meta, int fortune, Random rand) {
|
||||
return 1 + rand.nextInt(3) + fortune;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityGlpyhidSpawner();
|
||||
}
|
||||
|
||||
public static class TileEntityGlpyhidSpawner extends TileEntity {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
return rand.nextInt(3) == 0 ? new EntityGlyphidBlaster(worldObj) : new EntityGlyphidNuclear(worldObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -22,19 +22,23 @@ public class BlockNTMGlass extends BlockBreakable {
|
||||
this.doesDrop = doesDrop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random rand) {
|
||||
return doesDrop ? 1 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return renderLayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
|
||||
52
src/main/java/com/hbm/blocks/generic/BlockNTMGlassPane.java
Normal file
52
src/main/java/com/hbm/blocks/generic/BlockNTMGlassPane.java
Normal file
@ -0,0 +1,52 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPane;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockNTMGlassPane extends BlockPane
|
||||
{
|
||||
int renderLayer;
|
||||
boolean doesDrop = false;
|
||||
|
||||
//NOTE when you have eclipse make the constructor for you it *WILL BE 'protected'* so make sure to make this public like below.
|
||||
/*public BlockNTMGlassPane(String flatFaceTextureName, String rimTextureName,
|
||||
Material mat, boolean bool) {
|
||||
super(flatFaceTextureName, rimTextureName, mat, bool);
|
||||
// TODO Auto-generated constructor stub
|
||||
this.setLightOpacity(1);
|
||||
this.opaque = true;
|
||||
}*/
|
||||
|
||||
public BlockNTMGlassPane(int layer, String name, String rimTextureName, Material material, boolean doesDrop) {
|
||||
super(name, rimTextureName, material, false);
|
||||
this.renderLayer = layer;
|
||||
this.doesDrop = doesDrop;
|
||||
this.opaque = true;
|
||||
this.setLightOpacity(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
Block b = world.getBlock(x, y, z);
|
||||
return super.canPaneConnectTo(world, x, y, z, dir) || b instanceof BlockNTMGlass;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return renderLayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random rand) {
|
||||
return doesDrop ? 1 : 0;
|
||||
}
|
||||
|
||||
}
|
||||
32
src/main/java/com/hbm/blocks/generic/BlockSlag.java
Normal file
32
src/main/java/com/hbm/blocks/generic/BlockSlag.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockSlag extends BlockBeaconable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconAlt;
|
||||
|
||||
public BlockSlag(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconAlt = iconRegister.registerIcon(this.getTextureName() + "_broken");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
if(metadata == 1) return this.iconAlt;
|
||||
|
||||
return this.blockIcon;
|
||||
}
|
||||
}
|
||||
@ -45,6 +45,11 @@ public class BlockStalagmite extends BlockEnumMulti {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int getMetaFromResource(int meta) {
|
||||
return meta;
|
||||
|
||||
@ -1,21 +1,19 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.IBlockMulti;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemLock;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityLockableBase;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateBase;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateDesh;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateIron;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateSteel;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityCrateTungsten;
|
||||
import com.hbm.tileentity.machine.storage.TileEntitySafe;
|
||||
import com.hbm.tileentity.machine.storage.*;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -27,6 +25,8 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -39,7 +39,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockStorageCrate extends BlockContainer implements IBlockMulti {
|
||||
public class BlockStorageCrate extends BlockContainer implements IBlockMulti, ITooltipProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
@ -75,6 +75,9 @@ public class BlockStorageCrate extends BlockContainer implements IBlockMulti {
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_top");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_side");
|
||||
}
|
||||
if(this == ModBlocks.crate_template) {
|
||||
this.iconTop = this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":crate_template");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -93,6 +96,7 @@ public class BlockStorageCrate extends BlockContainer implements IBlockMulti {
|
||||
if(this == ModBlocks.crate_steel) return new TileEntityCrateSteel();
|
||||
if(this == ModBlocks.crate_desh) return new TileEntityCrateDesh();
|
||||
if(this == ModBlocks.crate_tungsten) return new TileEntityCrateTungsten();
|
||||
if(this == ModBlocks.crate_template) return new TileEntityCrateTemplate();
|
||||
if(this == ModBlocks.safe) return new TileEntitySafe();
|
||||
return null;
|
||||
}
|
||||
@ -140,6 +144,7 @@ public class BlockStorageCrate extends BlockContainer implements IBlockMulti {
|
||||
|
||||
if(abyte.length > 6000) {
|
||||
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "Warning: Container NBT exceeds 6kB, contents will be ejected!"));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(this)));
|
||||
return world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
@ -270,4 +275,45 @@ public class BlockStorageCrate extends BlockContainer implements IBlockMulti {
|
||||
public int getSubCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
|
||||
return Container.calcRedstoneFromInventory((IInventory) world.getTileEntity(x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
if(stack.hasTagCompound()) {
|
||||
|
||||
List<String> contents = new ArrayList();
|
||||
int amount = 0;
|
||||
|
||||
for(int i = 0; i < 100; i++) { //whatever the biggest container is, i can't be bothered to check
|
||||
ItemStack content = ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("slot" + i));
|
||||
|
||||
if(content != null) {
|
||||
amount++;
|
||||
|
||||
if(contents.size() < 10) {
|
||||
contents.add(EnumChatFormatting.AQUA + " - " + content.getDisplayName() + (content.stackSize > 1 ? (" x" + content.stackSize) : ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!contents.isEmpty()) {
|
||||
list.add(EnumChatFormatting.AQUA + "Contains:");
|
||||
list.addAll(contents);
|
||||
amount -= contents.size();
|
||||
|
||||
if(amount > 0) {
|
||||
list.add(EnumChatFormatting.AQUA + "...and " + amount + " more.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
@ -87,8 +88,8 @@ public class BlockTallPlant extends BlockEnumMulti implements IPlantable, IGrowa
|
||||
|
||||
for(int i = 0; i < icons.length; i++) {
|
||||
Enum num = enums[i];
|
||||
this.icons[i] = reg.registerIcon(this.getTextureName() + "." + num.name().toLowerCase() + ".upper");
|
||||
this.bottomIcons[i] = reg.registerIcon(this.getTextureName() + "." + num.name().toLowerCase() + ".lower");
|
||||
this.icons[i] = reg.registerIcon(this.getTextureName() + "." + num.name().toLowerCase(Locale.US) + ".upper");
|
||||
this.bottomIcons[i] = reg.registerIcon(this.getTextureName() + "." + num.name().toLowerCase(Locale.US) + ".lower");
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,12 +178,7 @@ public class BlockTallPlant extends BlockEnumMulti implements IPlantable, IGrowa
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
|
||||
|
||||
if(meta > 7) {
|
||||
|
||||
if(world.getBlock(x, y - 1, z) == this) {
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
this.dropBlockAsItem(world, x, y - 1, z, world.getBlockMetadata(x, y - 1, z), 0);
|
||||
}
|
||||
}
|
||||
// dead
|
||||
} else if(world.getBlock(x, y + 1, z) == this) {
|
||||
|
||||
if(player.capabilities.isCreativeMode) {
|
||||
@ -309,7 +305,7 @@ public class BlockTallPlant extends BlockEnumMulti implements IPlantable, IGrowa
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
|
||||
|
||||
if(rectify(world.getBlockMetadata(x, y, z)) == EnumTallFlower.CD4.ordinal()) {
|
||||
if(metadata == EnumTallFlower.CD4.ordinal() + 8) {
|
||||
ret.add(DictFrame.fromOne(ModItems.plant_item, com.hbm.items.ItemEnums.EnumPlantType.MUSTARDWILLOW, 3 + world.rand.nextInt(4)));
|
||||
}
|
||||
|
||||
|
||||
181
src/main/java/com/hbm/blocks/generic/BlockToolConversion.java
Normal file
181
src/main/java/com/hbm/blocks/generic/BlockToolConversion.java
Normal file
@ -0,0 +1,181 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.BlockMulti;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.OreDictManager;
|
||||
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;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class BlockToolConversion extends BlockMulti implements IToolable, ILookOverlay {
|
||||
|
||||
public IIcon[] icons;
|
||||
public String[] names;
|
||||
|
||||
public BlockToolConversion(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
public BlockToolConversion addVariant(String... name) {
|
||||
this.names = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
|
||||
if(names != null) {
|
||||
icons = new IIcon[names.length];
|
||||
for(int i = 0; i < names.length; i++) {
|
||||
icons[i] = iconRegister.registerIcon(getTextureName() + names[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
|
||||
int meta = stack.getItemDamage() - 1;
|
||||
|
||||
if(meta == -1 || names == null || meta >= names.length) {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
return this.getUnlocalizedName() + names[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
|
||||
metadata -= 1;
|
||||
|
||||
if(metadata == -1 || icons == null || metadata >= icons.length) {
|
||||
return super.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
return icons[metadata];
|
||||
}
|
||||
|
||||
@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(world.isRemote) return false;
|
||||
|
||||
Pair<AStack[], MetaBlock> result = conversions.get(new Pair(tool, new MetaBlock(this, world.getBlockMetadata(x, y, z))));
|
||||
|
||||
if(result == null) return false;
|
||||
|
||||
List<AStack> list = new ArrayList();
|
||||
for(AStack stack : result.key) list.add(stack);
|
||||
|
||||
if(list == null || list.isEmpty() || InventoryUtil.doesPlayerHaveAStacks(player, list, true)) {
|
||||
world.setBlock(x, y, z, result.value.block, result.value.meta, 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
ItemStack held = Minecraft.getMinecraft().thePlayer.getHeldItem();
|
||||
if(held == null) return;
|
||||
ToolType tool = this.quickLookup(held);
|
||||
if(tool == null) return;
|
||||
|
||||
Pair<AStack[], MetaBlock> result = conversions.get(new Pair(tool, new MetaBlock(this, world.getBlockMetadata(x, y, z))));
|
||||
|
||||
if(result == null) return;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(EnumChatFormatting.GOLD + "Requires:");
|
||||
List<AStack> materials = new ArrayList();
|
||||
for(AStack stack : result.key) materials.add(stack);
|
||||
|
||||
List<ItemStack> tools = tool.stacksForDisplay;
|
||||
ItemStack displayTool = tools.get((int) (Math.abs(System.currentTimeMillis() / 1000) % tools.size()));
|
||||
text.add(EnumChatFormatting.BLUE + "- " + displayTool.getDisplayName());
|
||||
|
||||
for(AStack stack : materials) {
|
||||
try {
|
||||
ItemStack display = stack.extractForCyclingDisplay(20);
|
||||
text.add("- " + display.getDisplayName() + " x" + display.stackSize);
|
||||
} catch(Exception ex) {
|
||||
text.add(EnumChatFormatting.RED + "- ERROR");
|
||||
}
|
||||
}
|
||||
|
||||
if(!materials.isEmpty()) {
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(this.getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSubCount() {
|
||||
return names != null ? names.length + 1 : 1;
|
||||
}
|
||||
|
||||
public static ToolType quickLookup(ItemStack stack) {
|
||||
return ToolType.getType(stack);
|
||||
}
|
||||
|
||||
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.TORCH, new MetaBlock(ModBlocks.fusion_conductor, 0)), new Pair(new AStack[] {new OreDictStack(OreDictManager.STEEL.plateCast())}, new MetaBlock(ModBlocks.fusion_conductor, 1)));
|
||||
}
|
||||
|
||||
public static HashMap<Object[], Object> bufferedRecipes = new HashMap();
|
||||
public static HashMap<Object[], Object> bufferedTools = new HashMap();
|
||||
|
||||
public static HashMap<Object[], Object> getRecipes(boolean recipes) {
|
||||
|
||||
if(!bufferedRecipes.isEmpty()) return recipes ? bufferedRecipes : bufferedTools;
|
||||
|
||||
for(Entry<Pair<ToolType, MetaBlock>, Pair<AStack[], MetaBlock>> entry : conversions.entrySet()) {
|
||||
|
||||
List<AStack> list = new ArrayList();
|
||||
|
||||
for(AStack stack : entry.getValue().getKey()) {
|
||||
list.add(stack);
|
||||
}
|
||||
list.add(new ComparableStack(entry.getKey().getValue().block, 1, entry.getKey().getValue().meta));
|
||||
|
||||
Object[] inputInstance = list.toArray(new AStack[0]); // the instance has to match for the machine lookup to succeed
|
||||
bufferedRecipes.put(inputInstance, new ItemStack(entry.getValue().getValue().block, 1, entry.getValue().getValue().meta));
|
||||
bufferedTools.put(inputInstance, entry.getKey().getKey().stacksForDisplay.toArray(new ItemStack[0]));
|
||||
}
|
||||
|
||||
return recipes ? bufferedRecipes : bufferedTools;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockToolConversionPillar extends BlockToolConversion {
|
||||
|
||||
public IIcon[] topIcons;
|
||||
public IIcon topIcon;
|
||||
|
||||
public BlockToolConversionPillar(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
|
||||
this.blockIcon = iconRegister.registerIcon(this.getTextureName() + "_side");
|
||||
this.topIcon = iconRegister.registerIcon(this.getTextureName() + "_top");
|
||||
|
||||
if(names != null) {
|
||||
icons = new IIcon[names.length];
|
||||
topIcons = new IIcon[names.length];
|
||||
|
||||
for(int i = 0; i < names.length; i++) {
|
||||
icons[i] = iconRegister.registerIcon(getTextureName() + "_side" + names[i]);
|
||||
topIcons[i] = iconRegister.registerIcon(getTextureName() + "_top" + names[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
|
||||
metadata -= 1;
|
||||
|
||||
if(metadata == -1 || icons == null || metadata >= icons.length) {
|
||||
return side == 0 || side == 1 ? topIcon : blockIcon;
|
||||
}
|
||||
|
||||
return side == 0 || side == 1 ? topIcons[metadata] : icons[metadata];
|
||||
}
|
||||
}
|
||||
@ -94,37 +94,6 @@ public class Guide extends Block implements ILookOverlay {
|
||||
return null;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
124
src/main/java/com/hbm/blocks/generic/PartEmitter.java
Normal file
124
src/main/java/com/hbm/blocks/generic/PartEmitter.java
Normal file
@ -0,0 +1,124 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.util.ParticleUtil;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
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.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.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class PartEmitter extends BlockContainer implements IToolable, ITooltipProvider {
|
||||
|
||||
public PartEmitter() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityPartEmitter();
|
||||
}
|
||||
|
||||
@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.HAND_DRILL) {
|
||||
TileEntityPartEmitter te = (TileEntityPartEmitter) world.getTileEntity(x, y, z);
|
||||
te.effect = (te.effect + 1) % te.effectCount;
|
||||
te.markDirty();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class TileEntityPartEmitter extends TileEntity {
|
||||
|
||||
public static final int range = 150;
|
||||
public int effect = 0;
|
||||
public static final int effectCount = 4;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
double x = xCoord + 0.5;
|
||||
double y = yCoord + 0.5;
|
||||
double z = zCoord + 0.5;
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
if(effect == 1) {
|
||||
ParticleUtil.spawnGasFlame(worldObj, xCoord + worldObj.rand.nextDouble(), yCoord + 4.5 + worldObj.rand.nextDouble(), zCoord + worldObj.rand.nextDouble(), worldObj.rand.nextGaussian() * 0.2, 0.1, worldObj.rand.nextGaussian() * 0.2);
|
||||
}
|
||||
|
||||
if(effect == 2) {
|
||||
data.setString("type", "tower");
|
||||
data.setFloat("lift", 5F);
|
||||
data.setFloat("base", 0.25F);
|
||||
data.setFloat("max", 5F);
|
||||
data.setInteger("life", 560 + worldObj.rand.nextInt(20));
|
||||
data.setInteger("color",0x404040);
|
||||
}
|
||||
if(effect == 3) {
|
||||
data.setString("type", "tower");
|
||||
data.setFloat("lift", 0.5F);
|
||||
data.setFloat("base", 1F);
|
||||
data.setFloat("max", 10F);
|
||||
data.setInteger("life", 750 + worldObj.rand.nextInt(250));
|
||||
|
||||
x = xCoord + 0.5 + worldObj.rand.nextDouble() * 3 - 1.5;
|
||||
y = yCoord + 1;
|
||||
z = zCoord + 0.5 + worldObj.rand.nextDouble() * 3 - 1.5;
|
||||
|
||||
}
|
||||
|
||||
if(data.hasKey("type")) {
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y, z), new TargetPoint(this.worldObj.provider.dimensionId, xCoord, yCoord, zCoord, range));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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.effect = nbt.getInteger("effect");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("effect", this.effect);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
list.add(EnumChatFormatting.GOLD + "Use hand drill to cycle special effects");
|
||||
}
|
||||
}
|
||||
30
src/main/java/com/hbm/blocks/machine/BlockCM.java
Normal file
30
src/main/java/com/hbm/blocks/machine/BlockCM.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockCM extends BlockEnumMulti {
|
||||
|
||||
public BlockCM(Material mat, Class<? extends Enum> theEnum, boolean multiName, boolean multiTexture) {
|
||||
super(mat, theEnum, multiName, multiTexture);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
Enum[] enums = theEnum.getEnumConstants();
|
||||
this.icons = new IIcon[enums.length];
|
||||
|
||||
for(int i = 0; i < icons.length; i++) {
|
||||
Enum num = enums[i];
|
||||
this.icons[i] = reg.registerIcon(this.getTextureName() + "_" + num.name().toLowerCase(Locale.US));
|
||||
}
|
||||
}
|
||||
}
|
||||
31
src/main/java/com/hbm/blocks/machine/BlockCMGlass.java
Normal file
31
src/main/java/com/hbm/blocks/machine/BlockCMGlass.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
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.world.IBlockAccess;
|
||||
|
||||
public class BlockCMGlass extends BlockCM {
|
||||
|
||||
public BlockCMGlass(Material mat, Class<? extends Enum> theEnum, boolean multiName, boolean multiTexture) {
|
||||
super(mat, theEnum, multiName, multiTexture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
return block == this ? false : super.shouldSideBeRendered(world, x, y, z, side);
|
||||
}
|
||||
}
|
||||
32
src/main/java/com/hbm/blocks/machine/BlockCMPort.java
Normal file
32
src/main/java/com/hbm/blocks/machine/BlockCMPort.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCMPort extends BlockCM implements ITileEntityProvider {
|
||||
|
||||
public BlockCMPort(Material mat, Class<? extends Enum> theEnum, boolean multiName, boolean multiTexture) {
|
||||
super(mat, theEnum, multiName, multiTexture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityProxyCombo().inventory().power().fluid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block b, int m) {
|
||||
super.breakBlock(world, x, y, z, b, m);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
}
|
||||
206
src/main/java/com/hbm/blocks/machine/BlockCustomMachine.java
Normal file
206
src/main/java/com/hbm/blocks/machine/BlockCustomMachine.java
Normal file
@ -0,0 +1,206 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.config.CustomMachineConfigJSON;
|
||||
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityCustomMachine;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCustomMachine extends BlockContainer {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
|
||||
public BlockCustomMachine() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityCustomMachine();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":cm_terminal_front");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":cm_terminal_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
if(metadata >= 100) return side == 3 ? this.iconFront : this.blockIcon;
|
||||
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
|
||||
}
|
||||
|
||||
@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()) {
|
||||
|
||||
TileEntityCustomMachine tile = (TileEntityCustomMachine) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile != null) {
|
||||
|
||||
if(tile.checkStructure()) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
} else if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.wand_s) {
|
||||
tile.buildStructure();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
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);
|
||||
|
||||
TileEntityCustomMachine tile = (TileEntityCustomMachine) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile != null) {
|
||||
int id = stack.getItemDamage() - 100;
|
||||
|
||||
if(id >= 0 && id < CustomMachineConfigJSON.customMachines.size()) {
|
||||
|
||||
MachineConfiguration config = CustomMachineConfigJSON.niceList.get(id);
|
||||
|
||||
if(config != null) {
|
||||
tile.machineType = config.unlocalizedName;
|
||||
tile.init();
|
||||
tile.markChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
|
||||
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
harvesters.set(player);
|
||||
this.dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
harvesters.set(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
||||
player.addExhaustion(0.025F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
Item item = getItemDropped(metadata, world.rand, fortune);
|
||||
if(item != null) {
|
||||
|
||||
TileEntityCustomMachine tile = (TileEntityCustomMachine) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile != null) {
|
||||
ItemStack stack = new ItemStack(item, 1, CustomMachineConfigJSON.niceList.indexOf(tile.config) + 100);
|
||||
ret.add(stack);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { //using the deprecated one to make NEI happy
|
||||
|
||||
TileEntityCustomMachine tile = (TileEntityCustomMachine) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile != null && tile.machineType != null && !tile.machineType.isEmpty()) {
|
||||
ItemStack stack = new ItemStack(this, 1, CustomMachineConfigJSON.niceList.indexOf(tile.config) + 100);
|
||||
return stack;
|
||||
}
|
||||
|
||||
return super.getPickBlock(target, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
|
||||
ISidedInventory sided = (ISidedInventory) world.getTileEntity(x, y, z);
|
||||
Random rand = world.rand;
|
||||
|
||||
if(sided != null) {
|
||||
for(int i1 = 0; i1 < sided.getSizeInventory(); ++i1) {
|
||||
|
||||
if(i1 >= 10 && i1 <= 15)
|
||||
continue; // do NOT drop the filters
|
||||
|
||||
ItemStack itemstack = sided.getStackInSlot(i1);
|
||||
|
||||
if(itemstack != null) {
|
||||
float f = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while(itemstack.stackSize > 0) {
|
||||
int j1 = rand.nextInt(21) + 10;
|
||||
|
||||
if(j1 > itemstack.stackSize) {
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if(itemstack.hasTagCompound()) {
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) rand.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) rand.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) rand.nextGaussian() * f3;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
world.func_147453_f(x, y, z, block);
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,7 @@ import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityBarrel;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFluidTank;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
@ -164,6 +165,23 @@ public class BlockFluidBarrel extends BlockContainer implements ITooltipProvider
|
||||
player.addExhaustion(0.025F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityBarrel))
|
||||
return 0;
|
||||
|
||||
TileEntityBarrel barrel = (TileEntityBarrel) te;
|
||||
return barrel.getComparatorPower();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0, 0);
|
||||
|
||||
67
src/main/java/com/hbm/blocks/machine/BlockHadronCooler.java
Normal file
67
src/main/java/com/hbm/blocks/machine/BlockHadronCooler.java
Normal file
@ -0,0 +1,67 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.hbm.blocks.BlockMulti;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockHadronCooler extends BlockMulti implements ITooltipProvider {
|
||||
|
||||
private IIcon[] icons = new IIcon[getSubCount()];
|
||||
|
||||
public BlockHadronCooler(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
icons[0] = reg.registerIcon(RefStrings.MODID + ":hadron_cooler");
|
||||
icons[1] = reg.registerIcon(RefStrings.MODID + ":hadron_cooler_mk2");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return icons[this.rectify(metadata)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSubCount() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
int meta = this.rectify(stack.getItemDamage());
|
||||
|
||||
if(meta == 1) return this.getUnlocalizedName() + "_mk2";
|
||||
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
for(String s : I18nUtil.resolveKeyArray(this.getUnlocalizedName(stack) + ".desc")) list.add(EnumChatFormatting.YELLOW + s);
|
||||
} else {
|
||||
list.add(EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC +"Hold <" +
|
||||
EnumChatFormatting.YELLOW + "" + EnumChatFormatting.ITALIC + "LSHIFT" +
|
||||
EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC + "> to display more info");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -17,9 +17,9 @@ public class BlockITERStruct extends BlockContainer {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityITERStruct();
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube() {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,8 +47,8 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconTop = new IIcon[3];
|
||||
this.iconSide = new IIcon[3];
|
||||
this.iconTop = new IIcon[4];
|
||||
this.iconSide = new IIcon[4];
|
||||
|
||||
this.iconTop[0] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_top_iron");
|
||||
this.iconSide[0] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_side_iron");
|
||||
@ -56,14 +56,17 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
|
||||
this.iconSide[1] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_side_desh");
|
||||
this.iconTop[2] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_top");
|
||||
this.iconSide[2] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_side");
|
||||
this.iconTop[3] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_top_wood");
|
||||
this.iconSide[3] = iconRegister.registerIcon(RefStrings.MODID + ":mass_storage_side_wood");
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
list.add(new ItemStack(item, 1, 3));
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
list.add(new ItemStack(item, 1, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -84,7 +87,7 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
|
||||
}
|
||||
|
||||
public int getCapacity(int meta) {
|
||||
return meta == 0 ? 10_000 : meta == 1 ? 100_000 : meta == 2 ? 1_000_000 : 0;
|
||||
return meta == 3 ? 100 : meta == 0 ? 10_000 : meta == 1 ? 100_000 : meta == 2 ? 1_000_000 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -242,7 +245,7 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
|
||||
|
||||
@Override
|
||||
public int getSubCount() {
|
||||
return 3;
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -286,4 +289,14 @@ public class BlockMassStorage extends BlockContainer implements IBlockMulti, ILo
|
||||
list.add(String.format("%,d", stack.stackTagCompound.getInteger("stack")) + " / " + String.format("%,d", getCapacity(stack.getItemDamage())));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
|
||||
return ((TileEntityMassStorage) world.getTileEntity(x, y, z)).redstone;
|
||||
}
|
||||
}
|
||||
|
||||
25
src/main/java/com/hbm/blocks/machine/BlockWatzStruct.java
Normal file
25
src/main/java/com/hbm/blocks/machine/BlockWatzStruct.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityWatzStruct;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockWatzStruct extends BlockContainer {
|
||||
|
||||
public BlockWatzStruct(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityWatzStruct();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
@ -77,7 +78,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()) + ": " + tower.tanks[i].getFill() + "/" + tower.tanks[i].getMaxFill() + "mB");
|
||||
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");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ public class FoundryChannel extends BlockContainer implements ICrucibleAcceptor
|
||||
if(b == ModBlocks.foundry_outlet && meta == dir.ordinal())
|
||||
return true;
|
||||
|
||||
return b == ModBlocks.foundry_channel || b == ModBlocks.foundry_mold;
|
||||
return b == ModBlocks.foundry_channel || b == ModBlocks.foundry_mold || b == ModBlocks.foundry_slagtap;
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@ -167,12 +167,12 @@ public class FoundryOutlet extends BlockContainer implements ICrucibleAcceptor,
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialFlow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
return ((TileEntityFoundryOutlet) world.getTileEntity(x, y, z)).canAcceptPartialFlow(world, x, y, z, side, stack);
|
||||
return ((ICrucibleAcceptor) world.getTileEntity(x, y, z)).canAcceptPartialFlow(world, x, y, z, side, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialStack flow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
return ((TileEntityFoundryOutlet) world.getTileEntity(x, y, z)).flow(world, x, y, z, side, stack);
|
||||
return ((ICrucibleAcceptor) world.getTileEntity(x, y, z)).flow(world, x, y, z, side, stack);
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
35
src/main/java/com/hbm/blocks/machine/FoundrySlagtap.java
Normal file
35
src/main/java/com/hbm/blocks/machine/FoundrySlagtap.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityFoundrySlagtap;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class FoundrySlagtap extends FoundryOutlet {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":foundry_slagtap_top");
|
||||
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":foundry_slagtap_side");
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":foundry_slagtap_bottom");
|
||||
this.iconInner = iconRegister.registerIcon(RefStrings.MODID + ":foundry_slagtap_inner");
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":foundry_slagtap_front");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityFoundrySlagtap();
|
||||
}
|
||||
|
||||
@Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { 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) { return false; }
|
||||
@Override public void printHook(Pre event, World world, int x, int y, int z) { }
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.tileentity.conductor.TileEntityGasDuctSolid;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GasDuctSolid extends BlockContainer {
|
||||
|
||||
public GasDuctSolid(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityGasDuctSolid();
|
||||
}
|
||||
}
|
||||
@ -29,7 +29,7 @@ public class HeaterFirebox extends BlockDummyable implements ITooltipProvider {
|
||||
/*if(lastCore.getX() == lastBlockSet.getX() && lastCore.getY() + 1 == lastBlockSet.getY() && lastCore.getZ() == lastBlockSet.getZ())
|
||||
return new TileEntityProxyCombo().inventory().heatSource();*/
|
||||
|
||||
return new TileEntityProxyCombo(true, false, false);
|
||||
return new TileEntityProxyCombo().inventory().fluid();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,296 +1,55 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandler;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineAssembler extends BlockContainer implements IMultiblock {
|
||||
public class MachineAssembler extends BlockDummyable {
|
||||
|
||||
public MachineAssembler(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachineAssembler();
|
||||
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineAssembler();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().power();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_assembler);
|
||||
public int[] getDimensions() {
|
||||
return new int[] {1, 0, 2, 1, 2, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
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(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.assemblerDimensionEast)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.assemblerDimensionEast, ModBlocks.dummy_block_assembler);
|
||||
|
||||
//
|
||||
DummyBlockAssembler.safeBreak = true;
|
||||
world.setBlock(x - 1, y, z, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te = world.getTileEntity(x - 1, y, z);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z + 1, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y, z + 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 2, y, z, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te3 = world.getTileEntity(x + 2, y, z);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 2, y, z + 1, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te4 = world.getTileEntity(x + 2, y, z + 1);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockAssembler.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 1) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.assemblerDimensionSouth)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.assemblerDimensionSouth, ModBlocks.dummy_block_assembler);
|
||||
|
||||
//
|
||||
DummyBlockAssembler.safeBreak = true;
|
||||
world.setBlock(x, y, z - 1, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te = world.getTileEntity(x, y, z - 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z - 1, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y, z - 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x, y, z + 2, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te3 = world.getTileEntity(x, y, z + 2);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z + 2, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te4 = world.getTileEntity(x - 1, y, z + 2);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockAssembler.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.assemblerDimensionWest)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.assemblerDimensionWest, ModBlocks.dummy_block_assembler);
|
||||
|
||||
//
|
||||
DummyBlockAssembler.safeBreak = true;
|
||||
world.setBlock(x + 1, y, z, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te = world.getTileEntity(x + 1, y, z);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y, z - 1, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te2 = world.getTileEntity(x + 1, y, z - 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 2, y, z, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te3 = world.getTileEntity(x - 2, y, z);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 2, y, z - 1, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te4 = world.getTileEntity(x - 2, y, z - 1);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockAssembler.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 3) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.assemblerDimensionNorth)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.assemblerDimensionNorth, ModBlocks.dummy_block_assembler);
|
||||
|
||||
//
|
||||
DummyBlockAssembler.safeBreak = true;
|
||||
world.setBlock(x, y, z + 1, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te = world.getTileEntity(x, y, z + 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y, z + 1, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te2 = world.getTileEntity(x + 1, y, z + 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x, y, z - 2, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te3 = world.getTileEntity(x, y, z - 2);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y, z - 2, ModBlocks.dummy_port_assembler);
|
||||
TileEntity te4 = world.getTileEntity(x + 1, y, z - 2);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockAssembler.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private static boolean keepInventory;
|
||||
|
||||
@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_);
|
||||
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);
|
||||
}
|
||||
|
||||
if (tileentityfurnace != null)
|
||||
{
|
||||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
@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;
|
||||
z -= dir.offsetZ;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
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_);
|
||||
}
|
||||
this.makeExtra(world, x + rot.offsetX * 2, y, z + rot.offsetZ * 2);
|
||||
this.makeExtra(world, x - rot.offsetX * 1, y, z - rot.offsetZ * 1);
|
||||
this.makeExtra(world, x + rot.offsetX * 2 - dir.offsetX, y, z + rot.offsetZ * 2 - dir.offsetZ);
|
||||
this.makeExtra(world, x - rot.offsetX * 1 - dir.offsetX, y, z - rot.offsetZ * 1 - dir.offsetZ);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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.tileentity.machine.TileEntityMachineAutosaw;
|
||||
@ -50,7 +51,7 @@ public class MachineAutosaw extends BlockContainer implements ILookOverlay {
|
||||
TileEntityMachineAutosaw saw = (TileEntityMachineAutosaw) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(I18nUtil.resolveKey("hbmfluid." + saw.tank.getTankType().getName().toLowerCase()) + ": " + saw.tank.getFill() + "/" + saw.tank.getMaxFill() + "mB");
|
||||
text.add(I18nUtil.resolveKey("hbmfluid." + saw.tank.getTankType().getName().toLowerCase(Locale.US)) + ": " + saw.tank.getFill() + "/" + saw.tank.getMaxFill() + "mB");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ 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.tileentity.machine.storage.TileEntityMachineFluidTank;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
@ -98,6 +99,23 @@ public class MachineBigAssTank9000 extends BlockDummyable implements IPersistent
|
||||
return IPersistentNBT.getDrops(world, x, y, z, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityMachineBAT9000))
|
||||
return 0;
|
||||
|
||||
TileEntityMachineBAT9000 tank = (TileEntityMachineBAT9000) te;
|
||||
return tank.getComparatorPower();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0, 0);
|
||||
|
||||
272
src/main/java/com/hbm/blocks/machine/MachineCapacitor.java
Normal file
272
src/main/java/com/hbm/blocks/machine/MachineCapacitor.java
Normal file
@ -0,0 +1,272 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
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.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineCapacitor extends BlockContainer implements ILookOverlay, IPersistentInfoProvider, ITooltipProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT) public IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconSide;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconBottom;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconInnerTop;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconInnerSide;
|
||||
|
||||
protected long power;
|
||||
String name;
|
||||
|
||||
public MachineCapacitor(Material mat, long power, String name) {
|
||||
super(mat);
|
||||
this.power = power;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":capacitor_" + name + "_top");
|
||||
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":capacitor_" + name + "_side");
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":capacitor_" + name + "_bottom");
|
||||
this.iconInnerTop = iconRegister.registerIcon(RefStrings.MODID + ":capacitor_" + name + "_inner_top");
|
||||
this.iconInnerSide = iconRegister.registerIcon(RefStrings.MODID + ":capacitor_" + name + "_inner_side");
|
||||
}
|
||||
|
||||
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
|
||||
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 TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityCapacitor(this.power);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityCapacitor))
|
||||
return;
|
||||
|
||||
TileEntityCapacitor battery = (TileEntityCapacitor) te;
|
||||
List<String> text = new ArrayList();
|
||||
text.add(BobMathUtil.getShortNumber(battery.getPower()) + " / " + BobMathUtil.getShortNumber(battery.getMaxPower()) + "HE");
|
||||
|
||||
double percent = (double) battery.getPower() / (double) battery.getMaxPower();
|
||||
int charge = (int) Math.floor(percent * 10_000D);
|
||||
int color = ((int) (0xFF - 0xFF * percent)) << 16 | ((int)(0xFF * percent) << 8);
|
||||
text.add("&[" + color + "&]" + (charge / 100D) + "%");
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + "+" + BobMathUtil.getShortNumber(battery.powerReceived) + "HE/t");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + "-" + BobMathUtil.getShortNumber(battery.powerSent) + "HE/t");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
list.add(EnumChatFormatting.YELLOW + "" + BobMathUtil.getShortNumber(persistentTag.getLong("power")) + "/" + BobMathUtil.getShortNumber(persistentTag.getLong("maxPower")) + "HE");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
for(String s : I18nUtil.resolveKeyArray("tile.capacitor.desc")) list.add(EnumChatFormatting.YELLOW + s);
|
||||
} else {
|
||||
list.add(EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC +"Hold <" +
|
||||
EnumChatFormatting.YELLOW + "" + EnumChatFormatting.ITALIC + "LSHIFT" +
|
||||
EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC + "> to display more info");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return IPersistentNBT.getDrops(world, x, y, z, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
IPersistentNBT.restoreData(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
|
||||
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
harvesters.set(player);
|
||||
this.dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
harvesters.set(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
||||
player.addExhaustion(0.025F);
|
||||
}
|
||||
|
||||
public static class TileEntityCapacitor extends TileEntityLoadedBase implements IEnergyUser, INBTPacketReceiver, IPersistentNBT {
|
||||
|
||||
public long power;
|
||||
protected long maxPower;
|
||||
public long prevPower;
|
||||
public long powerReceived;
|
||||
public long powerSent;
|
||||
|
||||
public TileEntityCapacitor() { }
|
||||
|
||||
public TileEntityCapacitor(long maxPower) {
|
||||
this.maxPower = maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
long gain = power - prevPower;
|
||||
|
||||
ForgeDirection opp = ForgeDirection.getOrientation(this.getBlockMetadata());
|
||||
ForgeDirection dir = opp.getOpposite();
|
||||
|
||||
BlockPos pos = new BlockPos(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
|
||||
|
||||
boolean didStep = false;
|
||||
ForgeDirection last = null;
|
||||
|
||||
while(worldObj.getBlock(pos.getX(), pos.getY(), pos.getZ()) == ModBlocks.capacitor_bus) {
|
||||
ForgeDirection current = ForgeDirection.getOrientation(worldObj.getBlockMetadata(pos.getX(), pos.getY(), pos.getZ()));
|
||||
if(!didStep) last = current;
|
||||
didStep = true;
|
||||
|
||||
if(last != current) {
|
||||
pos = null;
|
||||
break;
|
||||
}
|
||||
|
||||
pos = pos.offset(current);
|
||||
}
|
||||
|
||||
long preSend = power;
|
||||
if(pos != null && last != null) {
|
||||
this.tryUnsubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ());
|
||||
this.sendPower(worldObj, pos.getX(), pos.getY(), pos.getZ(), last);
|
||||
}
|
||||
long sent = preSend - power;
|
||||
|
||||
this.trySubscribe(worldObj, xCoord + opp.offsetX, yCoord+ opp.offsetY, zCoord + opp.offsetZ, opp);
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setLong("maxPower", maxPower);
|
||||
data.setLong("rec", gain);
|
||||
data.setLong("sent", sent);
|
||||
INBTPacketReceiver.networkPack(this, data, 15);
|
||||
|
||||
this.prevPower = power;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("power");
|
||||
this.maxPower = nbt.getLong("maxPower");
|
||||
this.powerReceived = nbt.getLong("rec");
|
||||
this.powerSent = nbt.getLong("sent");
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionPriority getPriority() {
|
||||
return ConnectionPriority.LOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return dir == ForgeDirection.getOrientation(this.getBlockMetadata());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeNBT(NBTTagCompound nbt) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setLong("maxPower", maxPower);
|
||||
nbt.setTag(NBT_PERSISTENT_KEY, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readNBT(NBTTagCompound nbt) {
|
||||
NBTTagCompound data = nbt.getCompoundTag(NBT_PERSISTENT_KEY);
|
||||
this.power = data.getLong("power");
|
||||
this.maxPower = data.getLong("maxPower");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.power = nbt.getLong("power");
|
||||
this.maxPower = nbt.getLong("maxPower");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("power", power);
|
||||
nbt.setLong("maxPower", maxPower);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import api.hbm.energy.IEnergyConnectorBlock;
|
||||
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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineCapacitorBus extends Block implements IEnergyConnectorBlock, ITooltipProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT) private IIcon topIcon;
|
||||
|
||||
public MachineCapacitorBus(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister p_149651_1_) {
|
||||
this.blockIcon = p_149651_1_.registerIcon(RefStrings.MODID + ":capacitor_bus_side");
|
||||
this.topIcon = p_149651_1_.registerIcon(RefStrings.MODID + ":capacitor_bus_out");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == meta ? topIcon : 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 boolean canConnect(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
ForgeDirection busDir = ForgeDirection.getOrientation(meta);
|
||||
return dir == busDir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
@ -70,7 +71,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())).appendSibling(new ChatComponentText("!")));
|
||||
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("!")));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -129,7 +130,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()) + ": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB");
|
||||
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");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityChimneyBrick;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineChimneyBrick extends BlockDummyable {
|
||||
|
||||
public MachineChimneyBrick(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12) return new TileEntityChimneyBrick();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {12, 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);
|
||||
}
|
||||
}
|
||||
87
src/main/java/com/hbm/blocks/machine/MachineCoker.java
Normal file
87
src/main/java/com/hbm/blocks/machine/MachineCoker.java
Normal file
@ -0,0 +1,87 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineCoker;
|
||||
|
||||
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 MachineCoker extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineCoker(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12) return new TileEntityMachineCoker();
|
||||
if(meta >= extra) return new TileEntityProxyCombo().inventory().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return standardOpenBehavior(world, x, y, z, player, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {22, 0, 1, 1, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
if(super.checkRequirement(world, x, y, z, dir, o)) {
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
return MultiblockHandlerXR.checkSpace(world, x, y + 1, z, new int[] {5, 0, 2, 2, 2, 2}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x - 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x - 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected 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;
|
||||
|
||||
MultiblockHandlerXR.fillSpace(world, x, y + 1, z, new int[] {5, 0, 2, 2, 2, 2}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x + 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x + 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x - 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x - 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
|
||||
this.makeExtra(world, x + 1, y, z + 1);
|
||||
this.makeExtra(world, x + 1, y, z - 1);
|
||||
this.makeExtra(world, x - 1, y, z + 1);
|
||||
this.makeExtra(world, x - 1, y, z - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
this.addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
66
src/main/java/com/hbm/blocks/machine/MachineCompressor.java
Normal file
66
src/main/java/com/hbm/blocks/machine/MachineCompressor.java
Normal file
@ -0,0 +1,66 @@
|
||||
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.TileEntityMachineCompressor;
|
||||
|
||||
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 MachineCompressor extends BlockDummyable {
|
||||
|
||||
public MachineCompressor() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineCompressor();
|
||||
if(meta >= extra) return new TileEntityProxyCombo().fluid().power();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {2, 0, 1, 2, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@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
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
return super.checkRequirement(world, x, y, z, dir, o) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -3, 1, 1, 1, 1}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {8, -4, 0, 0, 1, 1}, x, y, z, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -3, 1, 1, 1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {8, -4, 0, 0, 1, 1}, this, dir);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
this.makeExtra(world, x - dir.offsetX, y, z - dir.offsetZ);
|
||||
this.makeExtra(world, x + rot.offsetX, y, z + rot.offsetZ);
|
||||
this.makeExtra(world, x - rot.offsetX, y, z - rot.offsetZ);
|
||||
}
|
||||
}
|
||||
@ -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.tileentity.machine.TileEntityCondenser;
|
||||
@ -38,7 +39,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()) + ": " + condenser.tanks[i].getFill() + "/" + condenser.tanks[i].getMaxFill() + "mB");
|
||||
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");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityCrucible;
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -24,8 +25,9 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineCrucible extends BlockDummyable {
|
||||
public class MachineCrucible extends BlockDummyable implements ICrucibleAcceptor {
|
||||
|
||||
public MachineCrucible() {
|
||||
super(Material.rock);
|
||||
@ -151,4 +153,31 @@ public class MachineCrucible extends BlockDummyable {
|
||||
for(AxisAlignedBB aabb : this.bounding) event.context.drawOutlinedBoundingBox(aabb.expand(exp, exp, exp).getOffsetBoundingBox(x - dX + 0.5, y - dY, z - dZ + 0.5), -1);
|
||||
ICustomBlockHighlight.cleanup();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialPour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return false;
|
||||
TileEntity tile = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(!(tile instanceof TileEntityCrucible)) return false;
|
||||
TileEntityCrucible crucible = (TileEntityCrucible) tile;
|
||||
|
||||
return crucible.canAcceptPartialPour(world, x, y, z, dX, dY, dZ, side, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialStack pour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return stack;
|
||||
TileEntity tile = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(!(tile instanceof TileEntityCrucible)) return stack;
|
||||
TileEntityCrucible crucible = (TileEntityCrucible) tile;
|
||||
|
||||
return crucible.pour(world, x, y, z, dX, dY, dZ, side, stack);
|
||||
}
|
||||
|
||||
@Override public boolean canAcceptPartialFlow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) { return false; }
|
||||
@Override public MaterialStack flow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) { return null; }
|
||||
}
|
||||
|
||||
@ -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;
|
||||
@ -66,7 +67,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()) + ": " + extractor.tanks[i].getFill() + "/" + extractor.tanks[i].getMaxFill() + "mB");
|
||||
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");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ public class MachineDiFurnaceExtension extends BlockContainer implements IProxyC
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityProxyCombo().inventory();
|
||||
return new TileEntityProxyCombo().inventory().fluid();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -20,18 +20,18 @@ public class MachineElectrolyser extends BlockDummyable {
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityElectrolyser();
|
||||
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {0, 0, 4, 4, 2, 2};
|
||||
return new int[] {0, 0, 5, 5, 1, 3};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 4;
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,33 +42,54 @@ public class MachineElectrolyser extends BlockDummyable {
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {1, 0, 4, 4, 1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -1, 4, 4, 0, 0}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, 1, -1, -2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, 1, -1, -1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, 3, -3, -2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, 3, -3, -1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, -1, 1, -2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, -1, 1, -1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, -3, 3, -2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, -3, 3, -1, 1}, this, dir);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {2, -1, 5, 5, 1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -3, 5, 5, 0, 0}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -1, 4, -4, -3, 3}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -1, 2, -2, -3, 3}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -1, 0, 0, -3, 3}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -1, -2, 2, -3, 3}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -1, -4, 4, -3, 3}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world,x + dir.offsetX * 4, y + 3, z + dir.offsetZ * 4, new int[] {0, 0, 0, 0, -1, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world,x + dir.offsetX * 2, y + 3, z + dir.offsetZ * 2, new int[] {0, 0, 0, 0, -1, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y + 3, z, new int[] {0, 0, 0, 0, -1, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x - dir.offsetX * 2, y + 3, z - dir.offsetZ * 2, new int[] {0, 0, 0, 0, -1, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x - dir.offsetX * 4, y + 3, z - dir.offsetZ * 4, new int[] {0, 0, 0, 0, -1, 2}, this, dir);
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
this.makeExtra(world, x - dir.offsetX * 5, y, z - dir.offsetZ * 5);
|
||||
this.makeExtra(world, x - dir.offsetX * 5 + rot.offsetX, y, z - dir.offsetZ * 5 + rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX * 5 - rot.offsetX, y, z - dir.offsetZ * 5 - rot.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX * 5, y, z + dir.offsetZ * 5);
|
||||
this.makeExtra(world, x + dir.offsetX * 5 + rot.offsetX, y, z + dir.offsetZ * 5 + rot.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX * 5 - rot.offsetX, y, z + dir.offsetZ * 5 - rot.offsetZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, getDimensions(), x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {1, 0, 4, 4, 1, 1}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -1, 4, 4, 0, 0}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, 1, -1, -2, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, 1, -1, -1, 1}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, 3, -3, -2, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, 3, -3, -1, 1}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, -1, 1, -2, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, -1, 1, -1, 1}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, -3, 3, -2, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, -3, 3, -1, 1}, x, y, z, dir)) return false;
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y , z, getDimensions(), x, y, z, dir)) return false;
|
||||
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {2, -1, 5, 5, 1, 1}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -3, 5, 5, 0, 0}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -1, 4, -4, -3, 3}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -1, 2, -2, -3, 3}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -1, 0, 0, -3, 3}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -1, -2, 2, -3, 3}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -1, -4, 4, -3, 3}, x, y, z, dir)) return false;
|
||||
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * 4, y + 3, z + dir.offsetZ * 4, new int[] {0, 0, 0, 0, -1, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * 2, y + 3, z + dir.offsetZ * 2, new int[] {0, 0, 0, 0, -1, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x, y + 3, z, new int[] {0, 0, 0, 0, -1, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x - dir.offsetX * 2, y + 3, z - dir.offsetZ * 2, new int[] {0, 0, 0, 0, -1, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x - dir.offsetX * 4, y + 3, z - dir.offsetZ * 4, new int[] {0, 0, 0, 0, -1, 2}, x, y, z, dir)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -51,7 +51,10 @@ public class MachineExcavator extends BlockDummyable {
|
||||
y += dir.offsetY * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
return MultiblockHandlerXR.checkSpace(world, x, y, z, getDimensions(), x, y, z, dir);
|
||||
return MultiblockHandlerXR.checkSpace(world, x, y, z, getDimensions(), x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {-1, 3, 3, -2, 3, -2}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {-1, 3, 3, -2, -2, 3}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {-1, 3, -2, 3, 3, 3}, x, y, z, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -2,10 +2,11 @@ package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.block.IBlowable;
|
||||
import api.hbm.block.IToolable;
|
||||
import api.hbm.block.IToolable.ToolType;
|
||||
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.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -80,7 +81,13 @@ public class MachineFan extends BlockContainer implements IToolable {
|
||||
double push = 0.1;
|
||||
|
||||
for(int i = 1; i <= range; i++) {
|
||||
if(worldObj.getBlock(xCoord + dir.offsetX * i, yCoord + dir.offsetY * i, zCoord + dir.offsetZ * i).isNormalCube()) {
|
||||
Block block = worldObj.getBlock(xCoord + dir.offsetX * i, yCoord + dir.offsetY * i, zCoord + dir.offsetZ * i);
|
||||
boolean blowable = block instanceof IBlowable;
|
||||
|
||||
if(block.isNormalCube() || blowable) {
|
||||
if(!worldObj.isRemote && blowable)
|
||||
((IBlowable) block).applyFan(worldObj, xCoord + dir.offsetX * i, yCoord + dir.offsetY * i, zCoord + dir.offsetZ * i, dir, i);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -133,9 +140,6 @@ public class MachineFan extends BlockContainer implements IToolable {
|
||||
if(meta == 4) world.setBlockMetadataWithNotify(x, y, z, 5, 3);
|
||||
if(meta == 5) world.setBlockMetadataWithNotify(x, y, z, 4, 3);
|
||||
|
||||
//TileEntityFan fan = (TileEntityFan) world.getTileEntity(x, y, z);
|
||||
//fan.blockMetadata = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ 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.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFluidTank;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
@ -135,6 +136,23 @@ public class MachineFluidTank extends BlockDummyable implements IPersistentInfoP
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityMachineFluidTank))
|
||||
return 0;
|
||||
|
||||
TileEntityMachineFluidTank tank = (TileEntityMachineFluidTank) te;
|
||||
return tank.getComparatorPower();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
|
||||
|
||||
@ -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;
|
||||
@ -73,7 +74,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())).appendSibling(new ChatComponentText("!")));
|
||||
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("!")));
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -115,7 +116,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()) + ": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB");
|
||||
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");
|
||||
|
||||
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.IBlockMulti;
|
||||
@ -68,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())).appendSibling(new ChatComponentText("!")));
|
||||
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("!")));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -0,0 +1,126 @@
|
||||
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.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.trait.FT_Heatable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityHeatBoilerIndustrial;
|
||||
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.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;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineHeatBoilerIndustrial extends BlockDummyable implements ILookOverlay, ITooltipProvider {
|
||||
|
||||
public MachineHeatBoilerIndustrial() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12) return new TileEntityHeatBoilerIndustrial();
|
||||
if(meta >= extra) return new TileEntityProxyCombo().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@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()) {
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemFluidIdentifier) {
|
||||
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 TileEntityHeatBoilerIndustrial))
|
||||
return false;
|
||||
|
||||
TileEntityHeatBoilerIndustrial boiler = (TileEntityHeatBoilerIndustrial) te;
|
||||
|
||||
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, pos[0], pos[1], pos[2], player.getHeldItem());
|
||||
|
||||
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("!")));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {4, 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);
|
||||
this.makeExtra(world, x - dir.offsetX, y + 4, z - dir.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 TileEntityHeatBoilerIndustrial))
|
||||
return;
|
||||
|
||||
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");
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
@ -110,7 +111,7 @@ public class MachineHephaestus extends BlockDummyable implements ILookOverlay {
|
||||
|
||||
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()) + ": " + tank.getFill() + "/" + tank.getMaxFill() + "mB");
|
||||
text.add((i == 0 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + tank.getTankType().getName().toLowerCase(Locale.US)) + ": " + tank.getFill() + "/" + tank.getMaxFill() + "mB");
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
|
||||
@ -4,6 +4,8 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityITER;
|
||||
@ -241,20 +243,23 @@ public class MachineITER extends BlockDummyable {
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int i) {
|
||||
|
||||
if(i >= 12 && drop) {
|
||||
|
||||
for(int l = 0; l < 4; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.fusion_conductor, 64)));
|
||||
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.fusion_conductor, 36)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.fusion_center, 64)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.fusion_motor, 4)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.reinforced_glass, 8)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_iter_core, 1)));
|
||||
}
|
||||
|
||||
if(i >= 12 && drop) {
|
||||
|
||||
for(int l = 0; l < 4; l++) {
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.fusion_conductor, 64)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.plate_cast, 64, Mats.MAT_STEEL.id)));
|
||||
}
|
||||
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.fusion_conductor, 36)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.plate_cast, 36, Mats.MAT_STEEL.id)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.fusion_center, 64)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.fusion_motor, 4)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.reinforced_glass, 8)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_iter_core, 1)));
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, i);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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;
|
||||
@ -77,7 +78,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()) + ": " + tower.tanks[i].getFill() + "/" + tower.tanks[i].getMaxFill() + "mB");
|
||||
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");
|
||||
|
||||
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;
|
||||
@ -74,7 +75,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()) + ": " + tower.tanks[i].getFill() + "/" + tower.tanks[i].getMaxFill() + "mB");
|
||||
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");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@ -6,9 +6,11 @@ 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;
|
||||
@ -85,16 +87,17 @@ 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()));
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + turbine.tanks[1].getTankType().getName().toLowerCase()));
|
||||
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()));
|
||||
}
|
||||
|
||||
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()));
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + turbine.tanks[2].getTankType().getName().toLowerCase(Locale.US)));
|
||||
}
|
||||
|
||||
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()));
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + turbine.tanks[3].getTankType().getName().toLowerCase(Locale.US)));
|
||||
}
|
||||
|
||||
if(hitCheck(dir, pos[0], pos[1], pos[2], 0, -4, 1, x, y, z)) {
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.tileentity.conductor.TileEntityOilDuctSolid;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class OilDuctSolid extends BlockContainer {
|
||||
|
||||
public OilDuctSolid(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityOilDuctSolid();
|
||||
}
|
||||
}
|
||||
386
src/main/java/com/hbm/blocks/machine/PistonInserter.java
Normal file
386
src/main/java/com/hbm/blocks/machine/PistonInserter.java
Normal file
@ -0,0 +1,386 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockContainerBase;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
|
||||
import api.hbm.block.IInsertable;
|
||||
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.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class PistonInserter extends BlockContainerBase {
|
||||
|
||||
public PistonInserter() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityPistonInserter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) {
|
||||
this.updateState(world, x, y, z);
|
||||
}
|
||||
|
||||
protected void updateState(World world, int x, int y, int z) {
|
||||
if(!world.isRemote) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));
|
||||
|
||||
if(world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).isNormalCube())
|
||||
return; //no obstructions allowed!
|
||||
|
||||
boolean flag = checkRedstone(world, x, y, z);
|
||||
TileEntityPistonInserter piston = (TileEntityPistonInserter)world.getTileEntity(x, y, z);
|
||||
|
||||
if(flag && !piston.lastState && piston.extend <= 0)
|
||||
piston.isRetracting = false;
|
||||
|
||||
piston.lastState = flag;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean checkRedstone(World world, int x, int y, int z) {
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if(world.getIndirectPowerOutput(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.ordinal()))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(side != world.getBlockMetadata(x, y, z)) return false;
|
||||
|
||||
if(player.isSneaking()) {
|
||||
if(!world.isRemote) {
|
||||
TileEntityPistonInserter piston = (TileEntityPistonInserter)world.getTileEntity(x, y, z);
|
||||
|
||||
if(piston.slot != null && piston.isRetracting) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(piston.getBlockMetadata());
|
||||
|
||||
EntityItem dust = new EntityItem(world, x + 0.5D + dir.offsetX * 0.75D, y + 0.5D + dir.offsetY * 0.75D, z + 0.5D + dir.offsetZ * 0.75D, piston.slot);
|
||||
piston.slot = null;
|
||||
|
||||
dust.motionX = dir.offsetX * 0.25;
|
||||
dust.motionY = dir.offsetY * 0.25;
|
||||
dust.motionZ = dir.offsetZ * 0.25;
|
||||
world.spawnEntityInWorld(dust);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if(player.getHeldItem() != null) {
|
||||
if(!world.isRemote) {
|
||||
TileEntityPistonInserter piston = (TileEntityPistonInserter)world.getTileEntity(x, y, z);
|
||||
|
||||
if(piston.slot == null) {
|
||||
piston.slot = player.inventory.decrStackSize(player.inventory.currentItem, 1);
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@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 boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
return meta != side.ordinal() && meta != side.getOpposite().ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
IInventory tileentityfurnace = (IInventory) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tileentityfurnace != null) {
|
||||
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(0);
|
||||
|
||||
if(itemstack != null) {
|
||||
float f = world.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = world.rand.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = world.rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while(itemstack.stackSize > 0) {
|
||||
int j1 = world.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) world.rand.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) world.rand.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) world.rand.nextGaussian() * f3;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
|
||||
world.func_147453_f(x, y, z, block);
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// $%&#$&
|
||||
// %$&&@$%%#%
|
||||
//______ $%@--$@@%&$%$
|
||||
// | %/ *--$#@&&$$
|
||||
// | / --__ %$%@$&
|
||||
// | (----^`--- $@##%
|
||||
// | /___\ `-----*#@$
|
||||
// | /(()_) / /___\ /__
|
||||
// | / \___// (()_) //-,|
|
||||
// | /____|_ / \___// )_/
|
||||
// | \____/ `^-___|___/ |
|
||||
// | \/ \____/ /_-^-.
|
||||
// | / _-' |___. \_
|
||||
// | / _-' / `\ \\___
|
||||
// | `'\____~~+~^/ _)/ \____
|
||||
// | \`----' | __/ _)
|
||||
// | /( /~-' ,-' |
|
||||
// | / `| | / |
|
||||
// | / ( ) / `)
|
||||
// | / `-==-' | |
|
||||
// | / /| | |
|
||||
// | / / \ | |
|
||||
// | / / | | |
|
||||
// | / / \ _____,.____| |
|
||||
// | / _ / |<`____, ____,| |
|
||||
// | / / \_ / _ | <_____/ | )
|
||||
// | / / ^/,^=-~---~' `z---..._______/ |
|
||||
// |--' / /| |/ .^ ,^\ \ )
|
||||
// | |_|| || |(_( ) | |
|
||||
// | \_/`-``-`----'___/_____ |
|
||||
// |___..---' _|____`-----..-----'\
|
||||
// |_____________________| @ | )
|
||||
// average coding session involving tile entities
|
||||
public static class TileEntityPistonInserter extends TileEntity implements IInventory, INBTPacketReceiver {
|
||||
|
||||
public ItemStack slot;
|
||||
|
||||
public int extend; //why don't we just make all these ones serverside? we're never using them on the client anyway
|
||||
public static final int maxExtend = 25;
|
||||
public boolean isRetracting = true;
|
||||
public int delay;
|
||||
|
||||
//prevents funkies from happening with block updates or loading into a server
|
||||
private boolean lastState;
|
||||
|
||||
//when a fake animatorcel gives you something so 20fps you gotta hit him with the true interpolation stare
|
||||
@SideOnly(Side.CLIENT) public double renderExtend;
|
||||
@SideOnly(Side.CLIENT) public double lastExtend;
|
||||
@SideOnly(Side.CLIENT) private int syncExtend; //what are these for?
|
||||
@SideOnly(Side.CLIENT) private int turnProgress;
|
||||
|
||||
public TileEntityPistonInserter() { }
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(delay <= 0) {
|
||||
|
||||
if(this.isRetracting && this.extend > 0) {
|
||||
this.extend--;
|
||||
} else if(!this.isRetracting) {
|
||||
this.extend++;
|
||||
|
||||
if(this.extend >= this.maxExtend) {
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:block.pressOperate", 1.0F, 1.5F);
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
|
||||
Block b = worldObj.getBlock(xCoord + dir.offsetX * 2, yCoord + dir.offsetY * 2, zCoord + dir.offsetZ * 2);
|
||||
|
||||
if(b instanceof IInsertable && ((IInsertable) b).insertItem(worldObj, xCoord + dir.offsetX * 2, yCoord + dir.offsetY * 2, zCoord + dir.offsetZ * 2, dir, slot)) {
|
||||
this.decrStackSize(0, 1);
|
||||
}
|
||||
|
||||
this.isRetracting = true;
|
||||
this.delay = 5;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
delay--;
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("extend", extend);
|
||||
if(this.slot != null) {
|
||||
NBTTagCompound stack = new NBTTagCompound();
|
||||
slot.writeToNBT(stack);
|
||||
data.setTag("stack", stack);
|
||||
}
|
||||
|
||||
INBTPacketReceiver.networkPack(this, data, 25);
|
||||
|
||||
} else {
|
||||
this.lastExtend = this.renderExtend;
|
||||
|
||||
if(this.turnProgress > 0) {
|
||||
this.renderExtend += (this.syncExtend - this.renderExtend) / (double) this.turnProgress;
|
||||
this.turnProgress--;
|
||||
} else {
|
||||
this.renderExtend = this.syncExtend;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.syncExtend = nbt.getInteger("extend");
|
||||
|
||||
if(nbt.hasKey("stack")) {
|
||||
NBTTagCompound stack = nbt.getCompoundTag("stack");
|
||||
this.slot = ItemStack.loadItemStackFromNBT(stack);
|
||||
} else
|
||||
this.slot = null;
|
||||
|
||||
this.turnProgress = 2;
|
||||
}
|
||||
|
||||
/* :3 NBT stuff */
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("extend", extend);
|
||||
nbt.setBoolean("retract", isRetracting);
|
||||
nbt.setBoolean("state", lastState); //saved so loading into a world doesn't cause issues
|
||||
if(this.slot != null) {
|
||||
NBTTagCompound stack = new NBTTagCompound();
|
||||
slot.writeToNBT(stack);
|
||||
nbt.setTag("stack", stack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.extend = nbt.getInteger("extend");
|
||||
this.isRetracting = nbt.getBoolean("retract");
|
||||
this.lastState = nbt.getBoolean("state");
|
||||
if(nbt.hasKey("stack")) {
|
||||
NBTTagCompound stack = nbt.getCompoundTag("stack");
|
||||
this.slot = ItemStack.loadItemStackFromNBT(stack);
|
||||
} else {
|
||||
this.slot = null;
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private AxisAlignedBB aabb;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(aabb != null)
|
||||
return aabb;
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
|
||||
aabb = AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1).addCoord(dir.offsetX, dir.offsetY, dir.offsetZ);
|
||||
return aabb;
|
||||
}
|
||||
|
||||
/* BS inventory stuff */
|
||||
|
||||
@Override public int getSizeInventory() { return 1; }
|
||||
|
||||
@Override public ItemStack getStackInSlot(int slot) { return this.slot; }
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
if(this.slot != null) {
|
||||
if(this.slot.stackSize <= amount) {
|
||||
ItemStack stack = this.slot;
|
||||
this.slot = null;
|
||||
return stack;
|
||||
}
|
||||
|
||||
ItemStack stack = this.slot.splitStack(amount);
|
||||
if(this.slot.stackSize == 0)
|
||||
this.slot = null;
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slot) { return null; }
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack stack) {
|
||||
this.slot = stack;
|
||||
if(stack != null && stack.stackSize > this.getInventoryStackLimit())
|
||||
stack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
|
||||
@Override public String getInventoryName() { return null; }
|
||||
|
||||
@Override public boolean hasCustomInventoryName() { return false; }
|
||||
|
||||
@Override public int getInventoryStackLimit() { return 1; }
|
||||
|
||||
@Override public boolean isUseableByPlayer(EntityPlayer player) { return false; }
|
||||
|
||||
@Override public void openInventory() {}
|
||||
|
||||
@Override public void closeInventory() {}
|
||||
|
||||
@Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return true; }
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,23 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityWatz;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
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.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class Watz extends BlockDummyable {
|
||||
|
||||
@ -17,25 +28,77 @@ public class Watz extends BlockDummyable {
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12)
|
||||
return new TileEntityWatz();
|
||||
|
||||
if(meta >= 12) return new TileEntityWatz();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@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);
|
||||
return false;
|
||||
return super.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {2, 0, 3, 3, 3, 3};
|
||||
return new int[] {2, 0, 3, 3, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
return super.checkRequirement(world, x, y, z, dir, o) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 2, 2, 2, -2}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 2, 2, -2, 2}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 1, 1, 3, -3}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 1, 1, -3, 3}, x, y, z, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 2, 2, 2, -2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 2, 2, -2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 1, 1, 3, -3}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[]{2, 0, 1, 1, -3, 3}, this, dir);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
this.makeExtra(world, x + 2, y, z);
|
||||
this.makeExtra(world, x - 2, y, z);
|
||||
this.makeExtra(world, x, y, z + 2);
|
||||
this.makeExtra(world, x, y, z - 2);
|
||||
this.makeExtra(world, x + 2, y + 2, z);
|
||||
this.makeExtra(world, x - 2, y + 2, z);
|
||||
this.makeExtra(world, x, y + 2, z + 2);
|
||||
this.makeExtra(world, x, y + 2, z - 2);
|
||||
this.makeExtra(world, x, y + 2, z);
|
||||
}
|
||||
|
||||
public static boolean drop = true;
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int i) {
|
||||
|
||||
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)));
|
||||
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)));
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, i);
|
||||
}
|
||||
}
|
||||
|
||||
52
src/main/java/com/hbm/blocks/machine/WatzPump.java
Normal file
52
src/main/java/com/hbm/blocks/machine/WatzPump.java
Normal file
@ -0,0 +1,52 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class WatzPump extends BlockDummyable {
|
||||
|
||||
public WatzPump() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityWatzPump();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {1, 0, 0, 0, 0, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
return side == ForgeDirection.UP && meta == 1;
|
||||
}
|
||||
|
||||
public static class TileEntityWatzPump extends TileEntity {
|
||||
@Override public boolean canUpdate() { return false; }
|
||||
@Override @SideOnly(Side.CLIENT) public double getMaxRenderDistanceSquared() { return 65536.0D; }
|
||||
AxisAlignedBB bb = null;
|
||||
@Override public AxisAlignedBB getRenderBoundingBox() {
|
||||
if(bb == null) bb = AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 2, zCoord + 2);
|
||||
return bb;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -32,7 +32,7 @@ public class BlockGraphite extends BlockFlammable implements IToolable {
|
||||
PacketDispatcher.wrapper.sendToAllAround(new ParticleBurstPacket(x, y, z, Block.getIdFromBlock(this), 0), new TargetPoint(world.provider.dimensionId, x, y, z, 50));
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, this.stepSound.func_150496_b(), (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F);
|
||||
|
||||
BlockGraphiteRod.ejectItem(world, x, y, z, ForgeDirection.getOrientation(side), new ItemStack(ModItems.powder_coal));
|
||||
BlockGraphiteRod.ejectItem(world, x, y, z, ForgeDirection.getOrientation(side), new ItemStack(ModItems.ingot_graphite));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@ -64,4 +64,5 @@ public class BlockGraphiteBreedingFuel extends BlockGraphiteDrilledTE implements
|
||||
protected Item getInsertedItem() {
|
||||
return ModItems.pile_rod_lithium;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,9 +5,11 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockFlammable;
|
||||
import com.hbm.inventory.RecipesCommon.MetaBlock;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import api.hbm.block.IInsertable;
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -17,11 +19,13 @@ 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.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class BlockGraphiteDrilledBase extends BlockFlammable implements IToolable {
|
||||
public abstract class BlockGraphiteDrilledBase extends BlockFlammable implements IToolable, IInsertable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon sideIcon;
|
||||
@ -89,7 +93,7 @@ public abstract class BlockGraphiteDrilledBase extends BlockFlammable implements
|
||||
|
||||
if(side == cfg * 2 || side == cfg * 2 + 1) {
|
||||
world.setBlock(x, y, z, ModBlocks.block_graphite_drilled, meta & 7, 3);
|
||||
this.ejectItem(world, x, y, z, ForgeDirection.getOrientation(side), new ItemStack(getInsertedItem()));
|
||||
this.ejectItem(world, x, y, z, ForgeDirection.getOrientation(side), new ItemStack(getInsertedItem(meta)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,4 +119,115 @@ public abstract class BlockGraphiteDrilledBase extends BlockFlammable implements
|
||||
drops.add(new ItemStack(getInsertedItem(meta), 1));
|
||||
return drops;
|
||||
}
|
||||
|
||||
//Checks the relationship between specific items and placement.
|
||||
//kinda cringe but anything other than hardcoding would be overengineering this for no reason so
|
||||
//all of this is destined to be changed most likely anyway
|
||||
protected MetaBlock checkInteractions(ItemStack stack) {
|
||||
Item item = stack.getItem(); //temp
|
||||
if(item == ModItems.pile_rod_uranium) return new MetaBlock(ModBlocks.block_graphite_fuel);
|
||||
if(item == ModItems.pile_rod_pu239) return new MetaBlock(ModBlocks.block_graphite_fuel, 0b1000);
|
||||
if(item == ModItems.pile_rod_plutonium) return new MetaBlock(ModBlocks.block_graphite_plutonium);
|
||||
if(item == ModItems.pile_rod_source) return new MetaBlock(ModBlocks.block_graphite_source);
|
||||
if(item == ModItems.pile_rod_boron) return new MetaBlock(ModBlocks.block_graphite_rod);
|
||||
if(item == ModItems.pile_rod_lithium) return new MetaBlock(ModBlocks.block_graphite_lithium);
|
||||
if(item == ModItems.cell_tritium) return new MetaBlock(ModBlocks.block_graphite_tritium);
|
||||
if(item == ModItems.pile_rod_detector) return new MetaBlock(ModBlocks.block_graphite_detector);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertItem(World world, int x, int y, int z, ForgeDirection dir, ItemStack stack) {
|
||||
|
||||
if(stack == null) return false;
|
||||
|
||||
MetaBlock baseBlock = checkInteractions(stack);
|
||||
if(baseBlock == null) return false;
|
||||
|
||||
final int side = dir.ordinal();
|
||||
final int pureMeta = world.getBlockMetadata(x, y, z) & 3; //in case it's shrouded in aluminum
|
||||
|
||||
if(side == pureMeta * 2 || side == pureMeta * 2 + 1) {
|
||||
//first, make sure we can even push rods out
|
||||
for(int i = 0; i <= 3; i++) { //limited to 3 boyos
|
||||
int ix = x + dir.offsetX * i;
|
||||
int iy = y + dir.offsetY * i;
|
||||
int iz = z + dir.offsetZ * i;
|
||||
|
||||
Block b = world.getBlock(ix, iy, iz);
|
||||
|
||||
if(b instanceof BlockGraphiteDrilledBase) {
|
||||
int baseMeta = world.getBlockMetadata(ix, iy, iz);
|
||||
if((baseMeta & 3) != pureMeta) //wrong orientation
|
||||
return false;
|
||||
|
||||
if(((BlockGraphiteDrilledBase)b).getInsertedItem(baseMeta) == null) //if there's nothing to push
|
||||
break;
|
||||
else if(i >= 3) //if there is stuff to push and we reach our limit
|
||||
return false;
|
||||
} else {
|
||||
if(b.isNormalCube()) //obstructions
|
||||
return false;
|
||||
else //empty space? no need to search
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO convert old methods to use itemstack for flexibility
|
||||
int oldMeta = pureMeta | baseBlock.meta; //metablocks are kinda inconvenient to work with so
|
||||
Block oldBlock = baseBlock.block;
|
||||
NBTTagCompound oldTag = new NBTTagCompound(); //In case of TEs
|
||||
oldTag.setInteger("x", x); //giving tags prevents issues and resets any lingering tes.
|
||||
oldTag.setInteger("y", y);
|
||||
oldTag.setInteger("z", z);
|
||||
|
||||
//now actually make the change
|
||||
for(int i = 0; i <= 3; i++) { //yeah yeah we know it's safe but let's be *extra cautious* of infinite loops
|
||||
int ix = x + dir.offsetX * i;
|
||||
int iy = y + dir.offsetY * i;
|
||||
int iz = z + dir.offsetZ * i;
|
||||
|
||||
Block newBlock = world.getBlock(ix, iy, iz);
|
||||
|
||||
if(newBlock instanceof BlockGraphiteDrilledBase) {
|
||||
int newMeta = world.getBlockMetadata(ix, iy, iz);
|
||||
NBTTagCompound newTag = new NBTTagCompound();
|
||||
|
||||
if(newBlock instanceof BlockGraphiteDrilledTE) {
|
||||
TileEntity te = world.getTileEntity(ix, iy, iz);
|
||||
te.writeToNBT(newTag);
|
||||
newTag.setInteger("x", te.xCoord + dir.offsetX); //malformed positions is very very bad and prevents the pile TEs from ticking
|
||||
newTag.setInteger("y", te.yCoord + dir.offsetY);
|
||||
newTag.setInteger("z", te.zCoord + dir.offsetZ);
|
||||
}
|
||||
|
||||
world.setBlock(ix, iy, iz, oldBlock, (oldMeta & ~0b100) | (newMeta & 0b100), 0);
|
||||
|
||||
if(oldBlock instanceof BlockGraphiteDrilledTE && !oldTag.hasNoTags()) { //safety first
|
||||
TileEntity te = world.getTileEntity(ix, iy, iz);
|
||||
te.readFromNBT(oldTag);
|
||||
}
|
||||
|
||||
world.markAndNotifyBlock(ix, iy, iz, world.getChunkFromBlockCoords(ix, iz), newBlock, oldBlock, 3); //in case setBlock returns false due to = meta / block
|
||||
|
||||
oldMeta = newMeta;
|
||||
oldBlock = newBlock;
|
||||
oldTag = newTag;
|
||||
|
||||
if(oldBlock instanceof BlockGraphiteDrilled) //if there's no need to eject an item
|
||||
break;
|
||||
} else {
|
||||
Item eject = ((BlockGraphiteDrilledBase) oldBlock).getInsertedItem(oldMeta); //TODO old methods to itemstack
|
||||
this.ejectItem(world, ix - dir.offsetX, iy - dir.offsetY, iz - dir.offsetZ, dir, new ItemStack(eject));
|
||||
world.playSoundEffect(ix + 0.5, iy + 0.5, iz + 0.5, "hbm:item.upgradePlug", 1.25F, 1.0F);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.pile.TileEntityPileFuel;
|
||||
|
||||
import api.hbm.block.IBlowable;
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -16,14 +17,19 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockGraphiteFuel extends BlockGraphiteDrilledTE implements IToolable {
|
||||
public class BlockGraphiteFuel extends BlockGraphiteDrilledTE implements IToolable, IBlowable {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int mets) {
|
||||
return new TileEntityPileFuel();
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
TileEntityPileFuel pile = new TileEntityPileFuel();
|
||||
if((meta & 8) != 0)
|
||||
pile.progress = pile.maxProgress - 1000; // pu239 rods cringe :(
|
||||
|
||||
return pile;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -33,6 +39,17 @@ public class BlockGraphiteFuel extends BlockGraphiteDrilledTE implements IToolab
|
||||
this.blockIconAluminum = iconRegister.registerIcon(RefStrings.MODID + ":block_graphite_fuel_aluminum");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
|
||||
TileEntityPileFuel pile = (TileEntityPileFuel)world.getTileEntity(x, y, z);
|
||||
return MathHelper.clamp_int((pile.progress * 16) / pile.maxProgress, 0, 15); //potentially wip
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
|
||||
@ -68,4 +85,10 @@ public class BlockGraphiteFuel extends BlockGraphiteDrilledTE implements IToolab
|
||||
protected Item getInsertedItem(int meta) {
|
||||
return (meta & 8) == 8 ? ModItems.pile_rod_pu239 : ModItems.pile_rod_uranium;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyFan(World world, int x, int y, int z, ForgeDirection dir, int dist) {
|
||||
TileEntityPileFuel pile = (TileEntityPileFuel) world.getTileEntity(x, y, z);
|
||||
pile.heat -= pile.heat * 0.025;
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,12 +48,12 @@ public class BlockCable extends BlockContainer {
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
|
||||
boolean posX = Library.canConnect(world, x + 1, y, z, Library.NEG_X);
|
||||
boolean negX = Library.canConnect(world, x - 1, y, z, Library.POS_X);
|
||||
boolean posY = Library.canConnect(world, x, y + 1, z, Library.NEG_Y);
|
||||
boolean negY = Library.canConnect(world, x, y - 1, z, Library.POS_Y);
|
||||
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.NEG_Z);
|
||||
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.POS_Z);
|
||||
boolean posX = Library.canConnect(world, x + 1, y, z, Library.POS_X);
|
||||
boolean negX = Library.canConnect(world, x - 1, y, z, Library.NEG_X);
|
||||
boolean posY = Library.canConnect(world, x, y + 1, z, Library.POS_Y);
|
||||
boolean negY = Library.canConnect(world, x, y - 1, z, Library.NEG_Y);
|
||||
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.POS_Z);
|
||||
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.NEG_Z);
|
||||
|
||||
setBlockBounds(posX, negX, posY, negY, posZ, negZ);
|
||||
|
||||
@ -63,12 +63,12 @@ public class BlockCable extends BlockContainer {
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
boolean posX = Library.canConnect(world, x + 1, y, z, Library.NEG_X);
|
||||
boolean negX = Library.canConnect(world, x - 1, y, z, Library.POS_X);
|
||||
boolean posY = Library.canConnect(world, x, y + 1, z, Library.NEG_Y);
|
||||
boolean negY = Library.canConnect(world, x, y - 1, z, Library.POS_Y);
|
||||
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.NEG_Z);
|
||||
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.POS_Z);
|
||||
boolean posX = Library.canConnect(world, x + 1, y, z, Library.POS_X);
|
||||
boolean negX = Library.canConnect(world, x - 1, y, z, Library.NEG_X);
|
||||
boolean posY = Library.canConnect(world, x, y + 1, z, Library.POS_Y);
|
||||
boolean negY = Library.canConnect(world, x, y - 1, z, Library.NEG_Y);
|
||||
boolean posZ = Library.canConnect(world, x, y, z + 1, Library.POS_Z);
|
||||
boolean negZ = Library.canConnect(world, x, y, z - 1, Library.NEG_Z);
|
||||
|
||||
setBlockBounds(posX, negX, posY, negY, posZ, negZ);
|
||||
}
|
||||
|
||||
@ -1,81 +0,0 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.tileentity.conductor.TileEntityGasDuct;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockGasDuct extends BlockContainer {
|
||||
|
||||
public BlockGasDuct(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
float p = 1F/16F;
|
||||
this.setBlockBounds(11 * p / 2, 11 * p / 2, 11 * p / 2, 1 - 11 * p / 2, 1 - 11 * p / 2, 1 - 11 * p / 2);
|
||||
this.useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
if(world.getTileEntity(x, y, z) instanceof TileEntityGasDuct) {
|
||||
TileEntityGasDuct cable = (TileEntityGasDuct)world.getTileEntity(x, y, z);
|
||||
|
||||
if(cable != null)
|
||||
{
|
||||
float p = 1F/16F;
|
||||
float minX = 11 * p / 2 - (cable.connections[5] != null ? (11 * p / 2) : 0);
|
||||
float minY = 11 * p / 2 - (cable.connections[1] != null ? (11 * p / 2) : 0);
|
||||
float minZ = 11 * p / 2 - (cable.connections[2] != null ? (11 * p / 2) : 0);
|
||||
float maxX = 1 - 11 * p / 2 + (cable.connections[3] != null ? (11 * p / 2) : 0);
|
||||
float maxY = 1 - 11 * p / 2 + (cable.connections[0] != null ? (11 * p / 2) : 0);
|
||||
float maxZ = 1 - 11 * p / 2 + (cable.connections[4] != null ? (11 * p / 2) : 0);
|
||||
|
||||
this.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
}
|
||||
}
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
if(world.getTileEntity(x, y, z) instanceof TileEntityGasDuct) {
|
||||
TileEntityGasDuct cable = (TileEntityGasDuct)world.getTileEntity(x, y, z);
|
||||
|
||||
if(cable != null)
|
||||
{
|
||||
float p = 1F/16F;
|
||||
float minX = 11 * p / 2 - (cable.connections[5] != null ? (11 * p / 2) : 0);
|
||||
float minY = 11 * p / 2 - (cable.connections[1] != null ? (11 * p / 2) : 0);
|
||||
float minZ = 11 * p / 2 - (cable.connections[2] != null ? (11 * p / 2) : 0);
|
||||
float maxX = 1 - 11 * p / 2 + (cable.connections[3] != null ? (11 * p / 2) : 0);
|
||||
float maxY = 1 - 11 * p / 2 + (cable.connections[0] != null ? (11 * p / 2) : 0);
|
||||
float maxZ = 1 - 11 * p / 2 + (cable.connections[4] != null ? (11 * p / 2) : 0);
|
||||
|
||||
this.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityGasDuct();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1,81 +0,0 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.tileentity.conductor.TileEntityOilDuct;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockOilDuct extends BlockContainer {
|
||||
|
||||
public BlockOilDuct(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
float p = 1F/16F;
|
||||
this.setBlockBounds(11 * p / 2, 11 * p / 2, 11 * p / 2, 1 - 11 * p / 2, 1 - 11 * p / 2, 1 - 11 * p / 2);
|
||||
this.useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
if(world.getTileEntity(x, y, z) instanceof TileEntityOilDuct) {
|
||||
TileEntityOilDuct cable = (TileEntityOilDuct)world.getTileEntity(x, y, z);
|
||||
|
||||
if(cable != null)
|
||||
{
|
||||
float p = 1F/16F;
|
||||
float minX = 11 * p / 2 - (cable.connections[5] != null ? (11 * p / 2) : 0);
|
||||
float minY = 11 * p / 2 - (cable.connections[1] != null ? (11 * p / 2) : 0);
|
||||
float minZ = 11 * p / 2 - (cable.connections[2] != null ? (11 * p / 2) : 0);
|
||||
float maxX = 1 - 11 * p / 2 + (cable.connections[3] != null ? (11 * p / 2) : 0);
|
||||
float maxY = 1 - 11 * p / 2 + (cable.connections[0] != null ? (11 * p / 2) : 0);
|
||||
float maxZ = 1 - 11 * p / 2 + (cable.connections[4] != null ? (11 * p / 2) : 0);
|
||||
|
||||
this.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
}
|
||||
}
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
if(world.getTileEntity(x, y, z) instanceof TileEntityOilDuct) {
|
||||
TileEntityOilDuct cable = (TileEntityOilDuct)world.getTileEntity(x, y, z);
|
||||
|
||||
if(cable != null)
|
||||
{
|
||||
float p = 1F/16F;
|
||||
float minX = 11 * p / 2 - (cable.connections[5] != null ? (11 * p / 2) : 0);
|
||||
float minY = 11 * p / 2 - (cable.connections[1] != null ? (11 * p / 2) : 0);
|
||||
float minZ = 11 * p / 2 - (cable.connections[2] != null ? (11 * p / 2) : 0);
|
||||
float maxX = 1 - 11 * p / 2 + (cable.connections[3] != null ? (11 * p / 2) : 0);
|
||||
float maxY = 1 - 11 * p / 2 + (cable.connections[0] != null ? (11 * p / 2) : 0);
|
||||
float maxZ = 1 - 11 * p / 2 + (cable.connections[4] != null ? (11 * p / 2) : 0);
|
||||
|
||||
this.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityOilDuct();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,7 @@ import com.hbm.util.I18nUtil;
|
||||
import api.hbm.block.IToolable;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.energy.IEnergyConnector.ConnectionPriority;
|
||||
import api.hbm.energy.IEnergyConnectorBlock;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -32,7 +33,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class CableDiode extends BlockContainer implements ILookOverlay, IToolable, ITooltipProvider {
|
||||
public class CableDiode extends BlockContainer implements IEnergyConnectorBlock, ILookOverlay, IToolable, ITooltipProvider {
|
||||
|
||||
public CableDiode(Material mat) {
|
||||
super(mat);
|
||||
@ -66,6 +67,11 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
|
||||
world.setBlockMetadataWithNotify(x, y, z, l, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
|
||||
@ -179,6 +185,11 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return dir != getDir();
|
||||
}
|
||||
|
||||
private boolean recursionBrake = false;
|
||||
private long subBuffer;
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.network.TileEntityCraneBoxer;
|
||||
import com.hbm.tileentity.network.TileEntityCraneInserter;
|
||||
|
||||
import api.hbm.conveyor.IConveyorItem;
|
||||
import api.hbm.conveyor.IConveyorPackage;
|
||||
@ -81,7 +80,7 @@ public class CraneBoxer extends BlockCraneBase implements IEnterableBlock {
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
|
||||
return Container.calcRedstoneFromInventory((TileEntityCraneInserter)world.getTileEntity(x, y, z));
|
||||
return Container.calcRedstoneFromInventory((TileEntityCraneBoxer)world.getTileEntity(x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
56
src/main/java/com/hbm/blocks/network/CraneGrabber.java
Normal file
56
src/main/java/com/hbm/blocks/network/CraneGrabber.java
Normal file
@ -0,0 +1,56 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.network.TileEntityCraneGrabber;
|
||||
|
||||
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.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CraneGrabber extends BlockCraneBase {
|
||||
|
||||
public CraneGrabber() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityCraneGrabber();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconDirectional = iconRegister.registerIcon(RefStrings.MODID + ":crane_grabber_top");
|
||||
this.iconDirectionalUp = iconRegister.registerIcon(RefStrings.MODID + ":crane_grabber_side_up");
|
||||
this.iconDirectionalDown = iconRegister.registerIcon(RefStrings.MODID + ":crane_grabber_side_down");
|
||||
this.iconOut = iconRegister.registerIcon(RefStrings.MODID + ":crane_pull");
|
||||
this.iconSideOut = iconRegister.registerIcon(RefStrings.MODID + ":crane_side_pull");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRotationFromSide(IBlockAccess world, int x, int y, int z, int side) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(meta > 1 && side == 1) {
|
||||
if(meta == 2) return 3;
|
||||
if(meta == 3) return 0;
|
||||
if(meta == 4) return 1;
|
||||
if(meta == 5) return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
this.dropContents(world, x, y, z, block, meta, 9, 11);
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
}
|
||||
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