mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Added Redstone Flux power converter
This commit is contained in:
parent
b43a1eb5aa
commit
89ea3472c1
BIN
assets/hbm/textures/blocks/machine_converter_he_rf.png
Normal file
BIN
assets/hbm/textures/blocks/machine_converter_he_rf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 506 B |
BIN
assets/hbm/textures/blocks/machine_converter_rf_he.png
Normal file
BIN
assets/hbm/textures/blocks/machine_converter_rf_he.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 542 B |
BIN
assets/hbm/textures/gui/gui_he_rf_converter.png
Normal file
BIN
assets/hbm/textures/gui/gui_he_rf_converter.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
assets/hbm/textures/gui/gui_rf_he_converter.png
Normal file
BIN
assets/hbm/textures/gui/gui_rf_he_converter.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/hbm/textures/models/CapeDafnik.png
Normal file
BIN
assets/hbm/textures/models/CapeDafnik.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 308 B |
11
cofh/api/CoFHAPIProps.java
Normal file
11
cofh/api/CoFHAPIProps.java
Normal file
@ -0,0 +1,11 @@
|
||||
package cofh.api;
|
||||
|
||||
public class CoFHAPIProps {
|
||||
|
||||
private CoFHAPIProps() {
|
||||
|
||||
}
|
||||
|
||||
public static final String VERSION = "1.7.10R1.0.2";
|
||||
|
||||
}
|
||||
158
cofh/api/energy/EnergyStorage.java
Normal file
158
cofh/api/energy/EnergyStorage.java
Normal file
@ -0,0 +1,158 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* Reference implementation of {@link IEnergyStorage}. Use/extend this or implement your own.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public class EnergyStorage implements IEnergyStorage {
|
||||
|
||||
protected int energy;
|
||||
protected int capacity;
|
||||
protected int maxReceive;
|
||||
protected int maxExtract;
|
||||
|
||||
public EnergyStorage(int capacity) {
|
||||
|
||||
this(capacity, capacity, capacity);
|
||||
}
|
||||
|
||||
public EnergyStorage(int capacity, int maxTransfer) {
|
||||
|
||||
this(capacity, maxTransfer, maxTransfer);
|
||||
}
|
||||
|
||||
public EnergyStorage(int capacity, int maxReceive, int maxExtract) {
|
||||
|
||||
this.capacity = capacity;
|
||||
this.maxReceive = maxReceive;
|
||||
this.maxExtract = maxExtract;
|
||||
}
|
||||
|
||||
public EnergyStorage readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
this.energy = nbt.getInteger("Energy");
|
||||
|
||||
if (energy > capacity) {
|
||||
energy = capacity;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
|
||||
if (energy < 0) {
|
||||
energy = 0;
|
||||
}
|
||||
nbt.setInteger("Energy", energy);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public void setCapacity(int capacity) {
|
||||
|
||||
this.capacity = capacity;
|
||||
|
||||
if (energy > capacity) {
|
||||
energy = capacity;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMaxTransfer(int maxTransfer) {
|
||||
|
||||
setMaxReceive(maxTransfer);
|
||||
setMaxExtract(maxTransfer);
|
||||
}
|
||||
|
||||
public void setMaxReceive(int maxReceive) {
|
||||
|
||||
this.maxReceive = maxReceive;
|
||||
}
|
||||
|
||||
public void setMaxExtract(int maxExtract) {
|
||||
|
||||
this.maxExtract = maxExtract;
|
||||
}
|
||||
|
||||
public int getMaxReceive() {
|
||||
|
||||
return maxReceive;
|
||||
}
|
||||
|
||||
public int getMaxExtract() {
|
||||
|
||||
return maxExtract;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is included to allow for server -> client sync. Do not call this externally to the containing Tile Entity, as not all IEnergyHandlers
|
||||
* are guaranteed to have it.
|
||||
*
|
||||
* @param energy
|
||||
*/
|
||||
public void setEnergyStored(int energy) {
|
||||
|
||||
this.energy = energy;
|
||||
|
||||
if (this.energy > capacity) {
|
||||
this.energy = capacity;
|
||||
} else if (this.energy < 0) {
|
||||
this.energy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is included to allow the containing tile to directly and efficiently modify the energy contained in the EnergyStorage. Do not rely on this
|
||||
* externally, as not all IEnergyHandlers are guaranteed to have it.
|
||||
*
|
||||
* @param energy
|
||||
*/
|
||||
public void modifyEnergyStored(int energy) {
|
||||
|
||||
this.energy += energy;
|
||||
|
||||
if (this.energy > capacity) {
|
||||
this.energy = capacity;
|
||||
} else if (this.energy < 0) {
|
||||
this.energy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* IEnergyStorage */
|
||||
@Override
|
||||
public int receiveEnergy(int maxReceive, boolean simulate) {
|
||||
|
||||
int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));
|
||||
|
||||
if (!simulate) {
|
||||
energy += energyReceived;
|
||||
}
|
||||
return energyReceived;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(int maxExtract, boolean simulate) {
|
||||
|
||||
int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
|
||||
|
||||
if (!simulate) {
|
||||
energy -= energyExtracted;
|
||||
}
|
||||
return energyExtracted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored() {
|
||||
|
||||
return energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
}
|
||||
21
cofh/api/energy/IEnergyConnection.java
Normal file
21
cofh/api/energy/IEnergyConnection.java
Normal file
@ -0,0 +1,21 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this interface on TileEntities which should connect to energy transportation blocks. This is intended for blocks which generate energy but do not
|
||||
* accept it; otherwise just use IEnergyHandler.
|
||||
* <p>
|
||||
* Note that {@link IEnergyHandler} is an extension of this.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyConnection {
|
||||
|
||||
/**
|
||||
* Returns TRUE if the TileEntity can connect on a given side.
|
||||
*/
|
||||
boolean canConnectEnergy(ForgeDirection from);
|
||||
|
||||
}
|
||||
52
cofh/api/energy/IEnergyContainerItem.java
Normal file
52
cofh/api/energy/IEnergyContainerItem.java
Normal file
@ -0,0 +1,52 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Implement this interface on Item classes that support external manipulation of their internal energy storages.
|
||||
* <p>
|
||||
* A reference implementation is provided {@link ItemEnergyContainer}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyContainerItem {
|
||||
|
||||
/**
|
||||
* Adds energy to a container item. Returns the quantity of energy that was accepted. This should always return 0 if the item cannot be externally charged.
|
||||
*
|
||||
* @param container
|
||||
* ItemStack to be charged.
|
||||
* @param maxReceive
|
||||
* Maximum amount of energy to be sent into the item.
|
||||
* @param simulate
|
||||
* If TRUE, the charge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) received by the item.
|
||||
*/
|
||||
int receiveEnergy(ItemStack container, int maxReceive, boolean simulate);
|
||||
|
||||
/**
|
||||
* Removes energy from a container item. Returns the quantity of energy that was removed. This should always return 0 if the item cannot be externally
|
||||
* discharged.
|
||||
*
|
||||
* @param container
|
||||
* ItemStack to be discharged.
|
||||
* @param maxExtract
|
||||
* Maximum amount of energy to be extracted from the item.
|
||||
* @param simulate
|
||||
* If TRUE, the discharge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) extracted from the item.
|
||||
*/
|
||||
int extractEnergy(ItemStack container, int maxExtract, boolean simulate);
|
||||
|
||||
/**
|
||||
* Get the amount of energy currently stored in the container item.
|
||||
*/
|
||||
int getEnergyStored(ItemStack container);
|
||||
|
||||
/**
|
||||
* Get the max amount of energy that can be stored in the container item.
|
||||
*/
|
||||
int getMaxEnergyStored(ItemStack container);
|
||||
|
||||
}
|
||||
58
cofh/api/energy/IEnergyHandler.java
Normal file
58
cofh/api/energy/IEnergyHandler.java
Normal file
@ -0,0 +1,58 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which should handle energy, generally storing it in one or more internal {@link IEnergyStorage} objects.
|
||||
* <p>
|
||||
* A reference implementation is provided {@link TileEnergyHandler}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyHandler extends IEnergyProvider, IEnergyReceiver {
|
||||
|
||||
// merely a convenience interface (remove these methods in 1.8; provided here for back-compat via compiler doing things)
|
||||
|
||||
/**
|
||||
* Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver.
|
||||
*
|
||||
* @param from
|
||||
* Orientation the energy is received from.
|
||||
* @param maxReceive
|
||||
* Maximum amount of energy to receive.
|
||||
* @param simulate
|
||||
* If TRUE, the charge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) received.
|
||||
*/
|
||||
@Override
|
||||
int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate);
|
||||
|
||||
/**
|
||||
* Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider.
|
||||
*
|
||||
* @param from
|
||||
* Orientation the energy is extracted from.
|
||||
* @param maxExtract
|
||||
* Maximum amount of energy to extract.
|
||||
* @param simulate
|
||||
* If TRUE, the extraction will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) extracted.
|
||||
*/
|
||||
@Override
|
||||
int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the amount of energy currently stored.
|
||||
*/
|
||||
@Override
|
||||
int getEnergyStored(ForgeDirection from);
|
||||
|
||||
/**
|
||||
* Returns the maximum amount of energy that can be stored.
|
||||
*/
|
||||
@Override
|
||||
int getMaxEnergyStored(ForgeDirection from);
|
||||
|
||||
}
|
||||
38
cofh/api/energy/IEnergyProvider.java
Normal file
38
cofh/api/energy/IEnergyProvider.java
Normal file
@ -0,0 +1,38 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which should provide energy, generally storing it in one or more internal {@link IEnergyStorage} objects.
|
||||
* <p>
|
||||
* A reference implementation is provided {@link TileEnergyHandler}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyProvider extends IEnergyConnection {
|
||||
|
||||
/**
|
||||
* Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider.
|
||||
*
|
||||
* @param from
|
||||
* Orientation the energy is extracted from.
|
||||
* @param maxExtract
|
||||
* Maximum amount of energy to extract.
|
||||
* @param simulate
|
||||
* If TRUE, the extraction will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) extracted.
|
||||
*/
|
||||
int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate);
|
||||
|
||||
/**
|
||||
* Returns the amount of energy currently stored.
|
||||
*/
|
||||
int getEnergyStored(ForgeDirection from);
|
||||
|
||||
/**
|
||||
* Returns the maximum amount of energy that can be stored.
|
||||
*/
|
||||
int getMaxEnergyStored(ForgeDirection from);
|
||||
|
||||
}
|
||||
38
cofh/api/energy/IEnergyReceiver.java
Normal file
38
cofh/api/energy/IEnergyReceiver.java
Normal file
@ -0,0 +1,38 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal {@link IEnergyStorage} objects.
|
||||
* <p>
|
||||
* A reference implementation is provided {@link TileEnergyHandler}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyReceiver extends IEnergyConnection {
|
||||
|
||||
/**
|
||||
* Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver.
|
||||
*
|
||||
* @param from
|
||||
* Orientation the energy is received from.
|
||||
* @param maxReceive
|
||||
* Maximum amount of energy to receive.
|
||||
* @param simulate
|
||||
* If TRUE, the charge will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) received.
|
||||
*/
|
||||
int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate);
|
||||
|
||||
/**
|
||||
* Returns the amount of energy currently stored.
|
||||
*/
|
||||
int getEnergyStored(ForgeDirection from);
|
||||
|
||||
/**
|
||||
* Returns the maximum amount of energy that can be stored.
|
||||
*/
|
||||
int getMaxEnergyStored(ForgeDirection from);
|
||||
|
||||
}
|
||||
46
cofh/api/energy/IEnergyStorage.java
Normal file
46
cofh/api/energy/IEnergyStorage.java
Normal file
@ -0,0 +1,46 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
/**
|
||||
* An energy storage is the unit of interaction with Energy inventories.<br>
|
||||
* This is not to be implemented on TileEntities. This is for internal use only.
|
||||
* <p>
|
||||
* A reference implementation can be found at {@link EnergyStorage}.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IEnergyStorage {
|
||||
|
||||
/**
|
||||
* Adds energy to the storage. Returns quantity of energy that was accepted.
|
||||
*
|
||||
* @param maxReceive
|
||||
* Maximum amount of energy to be inserted.
|
||||
* @param simulate
|
||||
* If TRUE, the insertion will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) accepted by the storage.
|
||||
*/
|
||||
int receiveEnergy(int maxReceive, boolean simulate);
|
||||
|
||||
/**
|
||||
* Removes energy from the storage. Returns quantity of energy that was removed.
|
||||
*
|
||||
* @param maxExtract
|
||||
* Maximum amount of energy to be extracted.
|
||||
* @param simulate
|
||||
* If TRUE, the extraction will only be simulated.
|
||||
* @return Amount of energy that was (or would have been, if simulated) extracted from the storage.
|
||||
*/
|
||||
int extractEnergy(int maxExtract, boolean simulate);
|
||||
|
||||
/**
|
||||
* Returns the amount of energy currently stored.
|
||||
*/
|
||||
int getEnergyStored();
|
||||
|
||||
/**
|
||||
* Returns the maximum amount of energy that can be stored.
|
||||
*/
|
||||
int getMaxEnergyStored();
|
||||
|
||||
}
|
||||
110
cofh/api/energy/ItemEnergyContainer.java
Normal file
110
cofh/api/energy/ItemEnergyContainer.java
Normal file
@ -0,0 +1,110 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* Reference implementation of {@link IEnergyContainerItem}. Use/extend this or implement your own.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public class ItemEnergyContainer extends Item implements IEnergyContainerItem {
|
||||
|
||||
protected int capacity;
|
||||
protected int maxReceive;
|
||||
protected int maxExtract;
|
||||
|
||||
public ItemEnergyContainer() {
|
||||
|
||||
}
|
||||
|
||||
public ItemEnergyContainer(int capacity) {
|
||||
|
||||
this(capacity, capacity, capacity);
|
||||
}
|
||||
|
||||
public ItemEnergyContainer(int capacity, int maxTransfer) {
|
||||
|
||||
this(capacity, maxTransfer, maxTransfer);
|
||||
}
|
||||
|
||||
public ItemEnergyContainer(int capacity, int maxReceive, int maxExtract) {
|
||||
|
||||
this.capacity = capacity;
|
||||
this.maxReceive = maxReceive;
|
||||
this.maxExtract = maxExtract;
|
||||
}
|
||||
|
||||
public ItemEnergyContainer setCapacity(int capacity) {
|
||||
|
||||
this.capacity = capacity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setMaxTransfer(int maxTransfer) {
|
||||
|
||||
setMaxReceive(maxTransfer);
|
||||
setMaxExtract(maxTransfer);
|
||||
}
|
||||
|
||||
public void setMaxReceive(int maxReceive) {
|
||||
|
||||
this.maxReceive = maxReceive;
|
||||
}
|
||||
|
||||
public void setMaxExtract(int maxExtract) {
|
||||
|
||||
this.maxExtract = maxExtract;
|
||||
}
|
||||
|
||||
/* IEnergyContainerItem */
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
|
||||
if (container.stackTagCompound == null) {
|
||||
container.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
int energy = container.stackTagCompound.getInteger("Energy");
|
||||
int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));
|
||||
|
||||
if (!simulate) {
|
||||
energy += energyReceived;
|
||||
container.stackTagCompound.setInteger("Energy", energy);
|
||||
}
|
||||
return energyReceived;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
|
||||
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
int energy = container.stackTagCompound.getInteger("Energy");
|
||||
int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
|
||||
|
||||
if (!simulate) {
|
||||
energy -= energyExtracted;
|
||||
container.stackTagCompound.setInteger("Energy", energy);
|
||||
}
|
||||
return energyExtracted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ItemStack container) {
|
||||
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
|
||||
return 0;
|
||||
}
|
||||
return container.stackTagCompound.getInteger("Energy");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ItemStack container) {
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
}
|
||||
65
cofh/api/energy/TileEnergyHandler.java
Normal file
65
cofh/api/energy/TileEnergyHandler.java
Normal file
@ -0,0 +1,65 @@
|
||||
package cofh.api.energy;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Reference implementation of {@link IEnergyHandler}. Use/extend this or implement your own.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public class TileEnergyHandler extends TileEntity implements IEnergyHandler {
|
||||
|
||||
protected EnergyStorage storage = new EnergyStorage(32000);
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
super.readFromNBT(nbt);
|
||||
storage.readFromNBT(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
|
||||
super.writeToNBT(nbt);
|
||||
storage.writeToNBT(nbt);
|
||||
}
|
||||
|
||||
/* IEnergyConnection */
|
||||
@Override
|
||||
public boolean canConnectEnergy(ForgeDirection from) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* IEnergyReceiver */
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
|
||||
return storage.receiveEnergy(maxReceive, simulate);
|
||||
}
|
||||
|
||||
/* IEnergyProvider */
|
||||
@Override
|
||||
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) {
|
||||
|
||||
return storage.extractEnergy(maxExtract, simulate);
|
||||
}
|
||||
|
||||
/* IEnergyReceiver and IEnergyProvider */
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
|
||||
return storage.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
|
||||
return storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
}
|
||||
9
cofh/api/energy/package-info.java
Normal file
9
cofh/api/energy/package-info.java
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* (C) 2014 Team CoFH / CoFH / Cult of the Full Hub
|
||||
* http://www.teamcofh.com
|
||||
*/
|
||||
@API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|energy")
|
||||
package cofh.api.energy;
|
||||
|
||||
import cofh.api.CoFHAPIProps;
|
||||
import cpw.mods.fml.common.API;
|
||||
8
cofh/api/package-info.java
Normal file
8
cofh/api/package-info.java
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* (C) 2014 Team CoFH / CoFH / Cult of the Full Hub
|
||||
* http://www.teamcofh.com
|
||||
*/
|
||||
@API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHLib", provides = "CoFHAPI")
|
||||
package cofh.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
41
com/hbm/blocks/BlockConverterHeRf.java
Normal file
41
com/hbm/blocks/BlockConverterHeRf.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockConverterHeRf extends BlockContainer {
|
||||
|
||||
protected BlockConverterHeRf(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityConverterHeRf();
|
||||
}
|
||||
|
||||
@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())
|
||||
{
|
||||
TileEntityConverterHeRf entity = (TileEntityConverterHeRf) world.getTileEntity(x, y, z);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_converter_he_rf, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
41
com/hbm/blocks/BlockConverterRfHe.java
Normal file
41
com/hbm/blocks/BlockConverterRfHe.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockConverterRfHe extends BlockContainer {
|
||||
|
||||
protected BlockConverterRfHe(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityConverterRfHe();
|
||||
}
|
||||
|
||||
@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())
|
||||
{
|
||||
TileEntityConverterRfHe entity = (TileEntityConverterRfHe) world.getTileEntity(x, y, z);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_converter_rf_he, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -206,6 +206,12 @@ public class ModBlocks {
|
||||
public static Block plasma;
|
||||
public static final int guiID_fusion_multiblock = 27;
|
||||
|
||||
public static Block machine_converter_he_rf;
|
||||
public static final int guiID_converter_he_rf = 28;
|
||||
|
||||
public static Block machine_converter_rf_he;
|
||||
public static final int guiID_converter_rf_he = 29;
|
||||
|
||||
public static Block launch_pad;
|
||||
public static Block launch_pad_generic;
|
||||
public static Block launch_pad_incendiary;
|
||||
@ -391,6 +397,9 @@ public class ModBlocks {
|
||||
fusion_hatch = new FusionHatch(Material.iron).setBlockName("fusion_hatch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":fusion_hatch");
|
||||
fusion_core = new FusionCore(Material.iron).setBlockName("fusion_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":fusion_core_side");
|
||||
plasma = new BlockPlasma(Material.iron).setBlockName("plasma").setHardness(5.0F).setResistance(6000.0F).setLightLevel(1.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":plasma");
|
||||
|
||||
machine_converter_he_rf = new BlockConverterHeRf(Material.iron).setBlockName("machine_converter_he_rf").setHardness(5.0F).setResistance(6000.0F).setLightLevel(1.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":machine_converter_he_rf");
|
||||
machine_converter_rf_he = new BlockConverterRfHe(Material.iron).setBlockName("machine_converter_rf_he").setHardness(5.0F).setResistance(6000.0F).setLightLevel(1.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":machine_converter_rf_he");
|
||||
|
||||
launch_pad = new LaunchPad(Material.iron).setBlockName("launch_pad").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabNuke).setBlockTextureName(RefStrings.MODID + ":launch_pad");
|
||||
launch_pad_generic = new LaunchPad(Material.iron).setBlockName("launch_pad_generic").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":launch_pad");
|
||||
@ -544,6 +553,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(red_cable, red_cable.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_battery, machine_battery.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_converter_he_rf, machine_converter_he_rf.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_converter_rf_he, machine_converter_rf_he.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_electric_furnace_off, machine_electric_furnace_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_electric_furnace_on, machine_electric_furnace_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_deuterium, machine_deuterium.getUnlocalizedName());
|
||||
|
||||
108
com/hbm/blocks/TileEntityConverterHeRf.java
Normal file
108
com/hbm/blocks/TileEntityConverterHeRf.java
Normal file
@ -0,0 +1,108 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import com.hbm.calc.Location;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
|
||||
import cofh.api.energy.EnergyStorage;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
import cofh.api.energy.IEnergyProvider;
|
||||
import cofh.api.energy.IEnergyReceiver;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityConverterHeRf extends TileEntity implements IConsumer, IEnergyProvider {
|
||||
|
||||
public int power;
|
||||
public final int maxPower = 10000;
|
||||
public EnergyStorage storage = new EnergyStorage(40000, 25000, 25000);
|
||||
|
||||
//Thanks to the great people of Fusion Warfare for helping me with this part.
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!worldObj.isRemote) {
|
||||
|
||||
if(power >= 1000 && storage.getEnergyStored() + 4000 <= storage.getMaxEnergyStored())
|
||||
{
|
||||
power -= 1000;
|
||||
storage.setEnergyStored(storage.getEnergyStored() + 4000);
|
||||
}
|
||||
if(power >= 100 && storage.getEnergyStored() + 400 <= storage.getMaxEnergyStored())
|
||||
{
|
||||
power -= 100;
|
||||
storage.setEnergyStored(storage.getEnergyStored() + 400);
|
||||
}
|
||||
if(power >= 10 && storage.getEnergyStored() + 40 <= storage.getMaxEnergyStored())
|
||||
{
|
||||
power -= 10;
|
||||
storage.setEnergyStored(storage.getEnergyStored() + 4);
|
||||
}
|
||||
if(power >= 1 && storage.getEnergyStored() + 4 <= storage.getMaxEnergyStored())
|
||||
{
|
||||
power -= 1;
|
||||
storage.setEnergyStored(storage.getEnergyStored() + 40);
|
||||
}
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
|
||||
Location loc = new Location(worldObj, xCoord, yCoord, zCoord).add(dir);
|
||||
TileEntity entity = loc.getTileEntity();
|
||||
|
||||
if (entity != null && entity instanceof IEnergyReceiver) {
|
||||
|
||||
IEnergyReceiver receiver = (IEnergyReceiver) entity;
|
||||
|
||||
int maxExtract = storage.getMaxExtract();
|
||||
int maxAvailable = storage.extractEnergy(maxExtract, true);
|
||||
int energyTransferred = receiver.receiveEnergy(dir.getOpposite(), maxAvailable, false);
|
||||
|
||||
storage.extractEnergy(energyTransferred, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectEnergy(ForgeDirection from) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) {
|
||||
return storage.extractEnergy(maxExtract, simulate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
return storage.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
return storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(int i) {
|
||||
power = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
public int getPowerScaled(int i) {
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
public int getFluxScaled(int i) {
|
||||
return (storage.getEnergyStored() * i) / storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
}
|
||||
214
com/hbm/blocks/TileEntityConverterRfHe.java
Normal file
214
com/hbm/blocks/TileEntityConverterRfHe.java
Normal file
@ -0,0 +1,214 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.calc.UnionOfTileEntitiesAndBooleans;
|
||||
import com.hbm.interfaces.IConductor;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import cofh.api.energy.EnergyStorage;
|
||||
import cofh.api.energy.IEnergyProvider;
|
||||
import cofh.api.energy.IEnergyReceiver;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityConverterRfHe extends TileEntity implements ISource, IEnergyReceiver {
|
||||
|
||||
public int power;
|
||||
public final int maxPower = 10000;
|
||||
public List<IConsumer> list = new ArrayList();
|
||||
public int age = 0;
|
||||
public EnergyStorage storage = new EnergyStorage(40000, 25000, 25000);
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!worldObj.isRemote) {
|
||||
|
||||
if(storage.getEnergyStored() >= 4000 && power + 1000 <= maxPower)
|
||||
{
|
||||
storage.setEnergyStored(storage.getEnergyStored() - 4000);
|
||||
power += 1000;
|
||||
}
|
||||
if(storage.getEnergyStored() >= 400 && power + 100 <= maxPower)
|
||||
{
|
||||
storage.setEnergyStored(storage.getEnergyStored() - 400);
|
||||
power += 100;
|
||||
}
|
||||
if(storage.getEnergyStored() >= 40 && power + 10 <= maxPower)
|
||||
{
|
||||
storage.setEnergyStored(storage.getEnergyStored() - 40);
|
||||
power += 10;
|
||||
}
|
||||
if(storage.getEnergyStored() >= 4 && power + 1 <= maxPower)
|
||||
{
|
||||
storage.setEnergyStored(storage.getEnergyStored() - 4);
|
||||
power += 1;
|
||||
}
|
||||
}
|
||||
|
||||
age++;
|
||||
if(age >= 20)
|
||||
{
|
||||
age = 0;
|
||||
}
|
||||
|
||||
if(age == 9 || age == 19)
|
||||
ffgeuaInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectEnergy(ForgeDirection from) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
return storage.receiveEnergy(maxReceive, simulate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
return storage.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
return storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ffgeua(int x, int y, int z, boolean newTact) {
|
||||
Block block = this.worldObj.getBlock(x, y, z);
|
||||
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
|
||||
|
||||
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
|
||||
{
|
||||
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
|
||||
}
|
||||
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core)
|
||||
{
|
||||
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
|
||||
}
|
||||
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core)
|
||||
{
|
||||
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
|
||||
}
|
||||
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core)
|
||||
{
|
||||
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
|
||||
}
|
||||
|
||||
if(tileentity instanceof IConductor)
|
||||
{
|
||||
if(tileentity instanceof TileEntityCable)
|
||||
{
|
||||
if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this))
|
||||
{
|
||||
for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++)
|
||||
{
|
||||
if(((TileEntityCable)tileentity).uoteab.get(i).source == this)
|
||||
{
|
||||
if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact)
|
||||
{
|
||||
((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact;
|
||||
ffgeua(x, y + 1, z, getTact());
|
||||
ffgeua(x, y - 1, z, getTact());
|
||||
ffgeua(x - 1, y, z, getTact());
|
||||
ffgeua(x + 1, y, z, getTact());
|
||||
ffgeua(x, y, z - 1, getTact());
|
||||
ffgeua(x, y, z + 1, getTact());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
|
||||
}
|
||||
}
|
||||
if(tileentity instanceof TileEntityWireCoated)
|
||||
{
|
||||
if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this))
|
||||
{
|
||||
for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++)
|
||||
{
|
||||
if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this)
|
||||
{
|
||||
if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact)
|
||||
{
|
||||
((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact;
|
||||
ffgeua(x, y + 1, z, getTact());
|
||||
ffgeua(x, y - 1, z, getTact());
|
||||
ffgeua(x - 1, y, z, getTact());
|
||||
ffgeua(x + 1, y, z, getTact());
|
||||
ffgeua(x, y, z - 1, getTact());
|
||||
ffgeua(x, y, z + 1, getTact());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
|
||||
{
|
||||
list.add((IConsumer)tileentity);
|
||||
}
|
||||
|
||||
if(!newTact)
|
||||
{
|
||||
int size = list.size();
|
||||
if(size > 0)
|
||||
{
|
||||
int part = this.power / size;
|
||||
for(IConsumer consume : list)
|
||||
{
|
||||
if(consume.getPower() < consume.getMaxPower())
|
||||
{
|
||||
if(consume.getMaxPower() - consume.getPower() >= part)
|
||||
{
|
||||
this.power -= part;
|
||||
consume.setPower(consume.getPower() + part);
|
||||
} else {
|
||||
this.power -= consume.getMaxPower() - consume.getPower();
|
||||
consume.setPower(consume.getMaxPower());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
list.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ffgeuaInit() {
|
||||
ffgeua(this.xCoord, this.yCoord + 1, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord, this.yCoord - 1, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord - 1, this.yCoord, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord + 1, this.yCoord, this.zCoord, getTact());
|
||||
ffgeua(this.xCoord, this.yCoord, this.zCoord - 1, getTact());
|
||||
ffgeua(this.xCoord, this.yCoord, this.zCoord + 1, getTact());
|
||||
}
|
||||
|
||||
public boolean getTact() {
|
||||
if(age >= 0 && age < 10)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getPowerScaled(int i) {
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
public int getFluxScaled(int i) {
|
||||
return (storage.getEnergyStored() * i) / storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
}
|
||||
@ -331,9 +331,11 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
|
||||
{
|
||||
water -= 1;
|
||||
|
||||
if(power + 1 <= maxPower)
|
||||
if(power + 10 <= maxPower)
|
||||
{
|
||||
power += 10;
|
||||
} else {
|
||||
power = maxPower;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -427,7 +429,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
|
||||
}
|
||||
}
|
||||
|
||||
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && !((TileEntityMachineBattery)tileentity).conducts))
|
||||
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
|
||||
{
|
||||
list.add((IConsumer)tileentity);
|
||||
}
|
||||
|
||||
@ -248,10 +248,6 @@ public class TileEntityMachineElectricFurnace extends TileEntity implements ISid
|
||||
slots[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
power--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -854,7 +854,7 @@ public class TileEntityReactorMultiblock extends TileEntity implements ISidedInv
|
||||
}
|
||||
}
|
||||
|
||||
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && !((TileEntityMachineBattery)tileentity).conducts))
|
||||
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
|
||||
{
|
||||
list.add((IConsumer)tileentity);
|
||||
}
|
||||
|
||||
33
com/hbm/calc/Location.java
Normal file
33
com/hbm/calc/Location.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.hbm.calc;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class Location {
|
||||
|
||||
public int x;
|
||||
public int y;
|
||||
public int z;
|
||||
public World world;
|
||||
|
||||
public Location(World world, int x, int y, int z) {
|
||||
this.world = world;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public Location add(int xa, int ya, int za) {
|
||||
return new Location(world, x + xa, y + ya, z + za);
|
||||
}
|
||||
|
||||
public Location add(ForgeDirection dir) {
|
||||
return add(dir.offsetX, dir.offsetY, dir.offsetZ);
|
||||
}
|
||||
|
||||
public TileEntity getTileEntity() {
|
||||
return world.getTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
}
|
||||
76
com/hbm/gui/ContainerConverterHeRf.java
Normal file
76
com/hbm/gui/ContainerConverterHeRf.java
Normal file
@ -0,0 +1,76 @@
|
||||
package com.hbm.gui;
|
||||
|
||||
import com.hbm.blocks.TileEntityConverterHeRf;
|
||||
import com.hbm.blocks.TileEntityConverterRfHe;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerConverterHeRf extends Container {
|
||||
|
||||
private TileEntityConverterHeRf diFurnace;
|
||||
|
||||
private int water;
|
||||
private int flux;
|
||||
|
||||
public ContainerConverterHeRf(InventoryPlayer invPlayer, TileEntityConverterHeRf tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power);
|
||||
crafting.sendProgressBarUpdate(this, 1, this.diFurnace.storage.getEnergyStored());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting par1 = (ICrafting)this.crafters.get(i);
|
||||
|
||||
if(this.water != this.diFurnace.power)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 0, this.diFurnace.power);
|
||||
}
|
||||
|
||||
if(this.flux != this.diFurnace.storage.getEnergyStored())
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 1, this.diFurnace.storage.getEnergyStored());
|
||||
}
|
||||
}
|
||||
|
||||
this.water = this.diFurnace.power;
|
||||
this.flux = this.diFurnace.storage.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 0)
|
||||
{
|
||||
diFurnace.power = j;
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
diFurnace.storage.setEnergyStored(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
78
com/hbm/gui/ContainerConverterRfHe.java
Normal file
78
com/hbm/gui/ContainerConverterRfHe.java
Normal file
@ -0,0 +1,78 @@
|
||||
package com.hbm.gui;
|
||||
|
||||
import com.hbm.blocks.TileEntityConverterRfHe;
|
||||
import com.hbm.blocks.TileEntityReactorMultiblock;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerConverterRfHe extends Container {
|
||||
|
||||
private TileEntityConverterRfHe diFurnace;
|
||||
|
||||
private int water;
|
||||
private int flux;
|
||||
|
||||
public ContainerConverterRfHe(InventoryPlayer invPlayer, TileEntityConverterRfHe tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, this.diFurnace.power);
|
||||
crafting.sendProgressBarUpdate(this, 1, this.diFurnace.storage.getEnergyStored());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting par1 = (ICrafting)this.crafters.get(i);
|
||||
|
||||
if(this.water != this.diFurnace.power)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 0, this.diFurnace.power);
|
||||
}
|
||||
|
||||
if(this.flux != this.diFurnace.storage.getEnergyStored())
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 1, this.diFurnace.storage.getEnergyStored());
|
||||
}
|
||||
}
|
||||
|
||||
this.water = this.diFurnace.power;
|
||||
this.flux = this.diFurnace.storage.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 0)
|
||||
{
|
||||
diFurnace.power = j;
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
diFurnace.storage.setEnergyStored(j);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
47
com/hbm/gui/GUIConverterHeRf.java
Normal file
47
com/hbm/gui/GUIConverterHeRf.java
Normal file
@ -0,0 +1,47 @@
|
||||
package com.hbm.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.TileEntityConverterHeRf;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIConverterHeRf extends GuiContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_he_rf_converter.png");
|
||||
private TileEntityConverterHeRf diFurnace;
|
||||
|
||||
public GUIConverterHeRf(InventoryPlayer invPlayer, TileEntityConverterHeRf tedf) {
|
||||
super(new ContainerConverterHeRf(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 86;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(diFurnace.power > 0) {
|
||||
int i = diFurnace.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 28, guiTop + 69 - i, 176, 52 - i, 12, i);
|
||||
}
|
||||
|
||||
if(diFurnace.storage.getEnergyStored() > 0) {
|
||||
int i = diFurnace.getFluxScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 136, guiTop + 69 - i, 188, 52 - i, 12, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
47
com/hbm/gui/GUIConverterRfHe.java
Normal file
47
com/hbm/gui/GUIConverterRfHe.java
Normal file
@ -0,0 +1,47 @@
|
||||
package com.hbm.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.TileEntityConverterRfHe;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIConverterRfHe extends GuiContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_rf_he_converter.png");
|
||||
private TileEntityConverterRfHe diFurnace;
|
||||
|
||||
public GUIConverterRfHe(InventoryPlayer invPlayer, TileEntityConverterRfHe tedf) {
|
||||
super(new ContainerConverterRfHe(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 86;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(diFurnace.power > 0) {
|
||||
int i = diFurnace.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 136, guiTop + 69 - i, 188, 52 - i, 12, i);
|
||||
}
|
||||
|
||||
if(diFurnace.storage.getEnergyStored() > 0) {
|
||||
int i = diFurnace.getFluxScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 28, guiTop + 69 - i, 176, 52 - i, 12, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class GUIReactorMultiblock extends GuiContainer {
|
||||
int k = diFurnace.getPowerScaled(70);
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 88 - k, 208, 70 - k, 16, k);
|
||||
|
||||
int l = diFurnace.getHeatScaled(124);
|
||||
int l = diFurnace.getHeatScaled(142);
|
||||
drawTexturedModalRect(guiLeft + 26, guiTop + 108, 0, 222, l, 16);
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,6 +49,9 @@ public class ArmorModel extends ItemArmor {
|
||||
if (this == ModItems.cape_hbm) {
|
||||
return armorType == 1;
|
||||
}
|
||||
if (this == ModItems.cape_dafnik) {
|
||||
return armorType == 1;
|
||||
}
|
||||
return armorType == 0;
|
||||
}
|
||||
|
||||
@ -79,7 +82,7 @@ public class ArmorModel extends ItemArmor {
|
||||
return this.modelCloak;
|
||||
}
|
||||
}
|
||||
if (this == ModItems.cape_hbm) {
|
||||
if (this == ModItems.cape_hbm || this == ModItems.cape_dafnik) {
|
||||
if (armorSlot == 1) {
|
||||
if (this.modelCloak == null) {
|
||||
this.modelCloak = new ModelCloak();
|
||||
@ -110,6 +113,9 @@ public class ArmorModel extends ItemArmor {
|
||||
if (stack.getItem() == ModItems.cape_hbm && entity instanceof EntityPlayer && ((EntityPlayer)entity).getUniqueID().toString().equals(Library.HbMinecraft)) {
|
||||
return "hbm:textures/models/CapeHbm.png";
|
||||
}
|
||||
if (stack.getItem() == ModItems.cape_dafnik && entity instanceof EntityPlayer && ((EntityPlayer)entity).getUniqueID().toString().equals(Library.Dafnik)) {
|
||||
return "hbm:textures/models/CapeDafnik.png";
|
||||
}
|
||||
return "hbm:textures/models/CapeUnknown.png";
|
||||
}
|
||||
|
||||
@ -128,5 +134,8 @@ public class ArmorModel extends ItemArmor {
|
||||
if (itemstack.getItem() == ModItems.cape_hbm) {
|
||||
list.add("Only works for HbMinecraft");
|
||||
}
|
||||
if (itemstack.getItem() == ModItems.cape_dafnik) {
|
||||
list.add("Only works for Dafnik");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -452,6 +452,7 @@ public class ModItems {
|
||||
public static Item cape_gasmask;
|
||||
public static Item cape_schrabidium;
|
||||
public static Item cape_hbm;
|
||||
public static Item cape_dafnik;
|
||||
|
||||
public static Item nuke_starter_kit;
|
||||
public static Item nuke_advanced_kit;
|
||||
@ -944,6 +945,7 @@ public class ModItems {
|
||||
cape_gasmask = new ArmorModel(ArmorMaterial.CHAIN, 9, 1).setUnlocalizedName("cape_gasmask").setCreativeTab(MainRegistry.tabNuke).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_gasmask");
|
||||
cape_schrabidium = new ArmorModel(MainRegistry.enumArmorMaterialSchrabidium, 9, 1).setUnlocalizedName("cape_schrabidium").setCreativeTab(MainRegistry.tabNuke).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_schrabidium");
|
||||
cape_hbm = new ArmorModel(MainRegistry.enumArmorMaterialEuphemium, 9, 1).setUnlocalizedName("cape_hbm").setCreativeTab(MainRegistry.tabNuke).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_unknown");
|
||||
cape_dafnik = new ArmorModel(MainRegistry.enumArmorMaterialEmerald, 9, 1).setUnlocalizedName("cape_dafnik").setCreativeTab(MainRegistry.tabNuke).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_dafnik");
|
||||
|
||||
smoke1 = new Item().setUnlocalizedName("smoke1").setTextureName(RefStrings.MODID + ":smoke1");
|
||||
smoke2 = new Item().setUnlocalizedName("smoke2").setTextureName(RefStrings.MODID + ":smoke2");
|
||||
@ -1324,6 +1326,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(cape_gasmask, cape_gasmask.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cape_schrabidium, cape_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cape_hbm, cape_hbm.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cape_dafnik, cape_dafnik.getUnlocalizedName());
|
||||
|
||||
//Tools
|
||||
GameRegistry.registerItem(schrabidium_sword, schrabidium_sword.getUnlocalizedName());
|
||||
|
||||
@ -56,7 +56,7 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
int randPosY = rand.nextInt(35);
|
||||
int randPosZ = j + rand.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(ModBlocks.ore_titanium, 4)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
(new WorldGenMinable(ModBlocks.ore_titanium, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
|
||||
for (int k = 0; k < 5; k++)
|
||||
@ -77,16 +77,16 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
(new WorldGenMinable(ModBlocks.ore_aluminium, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
|
||||
for (int k = 0; k < 10; k++)
|
||||
for (int k = 0; k < 12; k++)
|
||||
{
|
||||
int randPosX = i + rand.nextInt(16);
|
||||
int randPosY = rand.nextInt(50);
|
||||
int randPosZ = j + rand.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(ModBlocks.ore_copper, 4)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
(new WorldGenMinable(ModBlocks.ore_copper, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
|
||||
for (int k = 0; k < 8; k++)
|
||||
for (int k = 0; k < 6; k++)
|
||||
{
|
||||
int randPosX = i + rand.nextInt(16);
|
||||
int randPosY = rand.nextInt(40);
|
||||
@ -104,7 +104,7 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
(new WorldGenMinable(ModBlocks.ore_niter, 4)).generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
|
||||
for (int k = 0; k < 8; k++)
|
||||
for (int k = 0; k < 10; k++)
|
||||
{
|
||||
int randPosX = i + rand.nextInt(16);
|
||||
int randPosY = rand.nextInt(35);
|
||||
|
||||
@ -98,8 +98,9 @@ public class Library {
|
||||
|
||||
public static String book61;
|
||||
|
||||
public static /*UUID*/String HbMinecraft = /*UUID.fromString(*/"192af5d7-ed0f-48d8-bd89-9d41af8524f8"/*)*/;
|
||||
public static UUID LPkukin = UUID.fromString("937c9804-e11f-4ad2-a5b1-42e62ac73077");
|
||||
public static String HbMinecraft = "192af5d7-ed0f-48d8-bd89-9d41af8524f8";
|
||||
public static String LPkukin = "937c9804-e11f-4ad2-a5b1-42e62ac73077";
|
||||
public static String Dafnik = "???";
|
||||
|
||||
public static boolean checkArmor(EntityPlayer player, Item helmet, Item plate, Item legs, Item boots) {
|
||||
|
||||
|
||||
@ -367,7 +367,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.reactor_element), 1), new Object[] { "SCS", "CSC", "SCS", 'S', ModItems.ingot_steel, 'C', ModItems.rod_quad_empty });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.reactor_control), 1), new Object[] { "SLS", "SLS", "SLS", 'S', ModItems.ingot_steel, 'L', ModItems.ingot_lead });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.reactor_conductor), 1), new Object[] { "SWS", "FFF", "SWS", 'S', ModItems.ingot_steel, 'W', Item.getItemFromBlock(ModBlocks.red_wire_coated), 'F', ModItems.fuse });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.reactor_computer), 1), new Object[] { "CWC", "CRC", "CWC", 'C', ModItems.circuit_gold, 'W', Item.getItemFromBlock(ModBlocks.red_wire_coated), 'R', Item.getItemFromBlock(ModBlocks.reactor_conductor) });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.reactor_computer), 1), new Object[] { "CWC", "CRC", "CWC", 'C', ModItems.circuit_red_copper, 'W', Item.getItemFromBlock(ModBlocks.red_wire_coated), 'R', Item.getItemFromBlock(ModBlocks.reactor_conductor) });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.reactor_hatch), 1), new Object[] { "BBB", "BFB", "BBB", 'B', Item.getItemFromBlock(ModBlocks.brick_concrete), 'F', Item.getItemFromBlock(Blocks.furnace) });
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fusion_conductor), 1), new Object[] { "SSS", "CCC", "SSS", 'S', ModItems.plate_steel, 'C', ModItems.coil_advanced_alloy });
|
||||
@ -375,7 +375,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fusion_motor), 1), new Object[] { "MTM", "TTT", "MTM", 'T', ModItems.ingot_titanium, 'M', ModItems.motor });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fusion_heater), 1), new Object[] { "TTT", "CCC", "TTT", 'T', ModItems.ingot_tungsten, 'C', ModItems.coil_tungsten });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fusion_hatch), 1), new Object[] { "TTT", "TFT", "TTT", 'T', Item.getItemFromBlock(ModBlocks.fusion_heater), 'F', Item.getItemFromBlock(Blocks.furnace) });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fusion_core), 1), new Object[] { "CWC", "CRC", "CWC", 'C', ModItems.circuit_gold, 'W', Item.getItemFromBlock(ModBlocks.red_wire_coated), 'E', Item.getItemFromBlock(ModBlocks.fusion_center) });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.fusion_core), 1), new Object[] { "CWC", "CRC", "CWC", 'C', ModItems.circuit_gold, 'W', Item.getItemFromBlock(ModBlocks.red_wire_coated), 'R', Item.getItemFromBlock(ModBlocks.fusion_center) });
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.brick_light), 8), new Object[] { "FBF", "BFB", "FBF", 'F', Blocks.fence, 'B', Blocks.brick_block });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.brick_concrete), 8), new Object[] { "FBF", "BFB", "FBF", 'F', Blocks.iron_bars, 'B', Blocks.stone });
|
||||
|
||||
@ -2,6 +2,8 @@ package com.hbm.main;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.TileEntityBombMulti;
|
||||
import com.hbm.blocks.TileEntityConverterHeRf;
|
||||
import com.hbm.blocks.TileEntityConverterRfHe;
|
||||
import com.hbm.blocks.TileEntityCoreAdvanced;
|
||||
import com.hbm.blocks.TileEntityCoreTitanium;
|
||||
import com.hbm.blocks.TileEntityDiFurnace;
|
||||
@ -30,6 +32,8 @@ import com.hbm.blocks.TileEntityTestNuke;
|
||||
import com.hbm.gui.ContainerBombMulti;
|
||||
import com.hbm.gui.ContainerDiFurnace;
|
||||
import com.hbm.gui.ContainerCentrifuge;
|
||||
import com.hbm.gui.ContainerConverterHeRf;
|
||||
import com.hbm.gui.ContainerConverterRfHe;
|
||||
import com.hbm.gui.ContainerCoreAdvanced;
|
||||
import com.hbm.gui.ContainerCoreTitanium;
|
||||
import com.hbm.gui.ContainerElectricFurnace;
|
||||
@ -54,6 +58,8 @@ import com.hbm.gui.ContainerRtgFurnace;
|
||||
import com.hbm.gui.ContainerTestNuke;
|
||||
import com.hbm.gui.ContainerUF6Tank;
|
||||
import com.hbm.gui.GUIBombMulti;
|
||||
import com.hbm.gui.GUIConverterHeRf;
|
||||
import com.hbm.gui.GUIConverterRfHe;
|
||||
import com.hbm.gui.GUICoreAdvanced;
|
||||
import com.hbm.gui.GUICoreTitanium;
|
||||
import com.hbm.gui.GUIFusionMultiblock;
|
||||
@ -301,6 +307,22 @@ public class GUIHandler implements IGuiHandler {
|
||||
return new ContainerFusionMultiblock(player.inventory, (TileEntityFusionMultiblock) entity);
|
||||
}
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_converter_he_rf:
|
||||
{
|
||||
if(entity instanceof TileEntityConverterHeRf)
|
||||
{
|
||||
return new ContainerConverterHeRf(player.inventory, (TileEntityConverterHeRf) entity);
|
||||
}
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_converter_rf_he:
|
||||
{
|
||||
if(entity instanceof TileEntityConverterRfHe)
|
||||
{
|
||||
return new ContainerConverterRfHe(player.inventory, (TileEntityConverterRfHe) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -521,6 +543,22 @@ public class GUIHandler implements IGuiHandler {
|
||||
return new GUIFusionMultiblock(player.inventory, (TileEntityFusionMultiblock) entity);
|
||||
}
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_converter_he_rf:
|
||||
{
|
||||
if(entity instanceof TileEntityConverterHeRf)
|
||||
{
|
||||
return new GUIConverterHeRf(player.inventory, (TileEntityConverterHeRf) entity);
|
||||
}
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_converter_rf_he:
|
||||
{
|
||||
if(entity instanceof TileEntityConverterRfHe)
|
||||
{
|
||||
return new GUIConverterRfHe(player.inventory, (TileEntityConverterRfHe) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@ -20,6 +20,8 @@ import cpw.mods.fml.common.ModMetadata;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.TileEntityBombMulti;
|
||||
import com.hbm.blocks.TileEntityCable;
|
||||
import com.hbm.blocks.TileEntityConverterHeRf;
|
||||
import com.hbm.blocks.TileEntityConverterRfHe;
|
||||
import com.hbm.blocks.TileEntityCoreAdvanced;
|
||||
import com.hbm.blocks.TileEntityCoreTitanium;
|
||||
import com.hbm.blocks.TileEntityCrashedBomb;
|
||||
@ -226,6 +228,8 @@ public class MainRegistry
|
||||
GameRegistry.registerTileEntity(TileEntityFusionMultiblock.class, "tileentity_fusion_multiblock");
|
||||
GameRegistry.registerTileEntity(TileEntityCrashedBomb.class, "tileentity_crashed_balefire");
|
||||
GameRegistry.registerTileEntity(TileEntityCable.class, "tileentity_cable");
|
||||
GameRegistry.registerTileEntity(TileEntityConverterHeRf.class, "tileentity_converter_herf");
|
||||
GameRegistry.registerTileEntity(TileEntityConverterRfHe.class, "tileentity_converter_rfhe");
|
||||
|
||||
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user