mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-29 18:28:34 +01:00
commit
2ebe98821a
317 changed files with 12653 additions and 1801 deletions
31
InterModCommsInfo.md
Normal file
31
InterModCommsInfo.md
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
Adding Custom Recipes (For Modders only!):
|
||||||
|
=====
|
||||||
|
|
||||||
|
Actually Additions adds an InterModCommunications Feature that allows you to add custom Crafting Recipes using Items from your Mods.
|
||||||
|
|
||||||
|
To use these Features, just send an InterModComms Message in your preInit or init like this:
|
||||||
|
FMLInterModComms.sendMessage("ActuallyAdditions", [X], [Y]);
|
||||||
|
The two Brackets will have to get replaced with one of the parts of Information below.
|
||||||
|
|
||||||
|
##### Crusher Recipes
|
||||||
|
- Create an NBTTagCompound
|
||||||
|
- To the Compound, add an NBTTagCompound with the name "input" that contains the Input ItemStack saved to NBT (To do this, just use ItemStack.saveToNBT)
|
||||||
|
- To the Compound, add an NBTTagCompound with the name "outputOne" that contains the first Output saved to NBT
|
||||||
|
- To the Compound, add an NBTTagCompound with the name "outputTwo" that contains the second Output saved to NBT
|
||||||
|
- To the Compound, add an int with the name "secondChance" that contains the Chance for the second Output to appear
|
||||||
|
- Send the Message with "registerCrusherRecipe" as the [X] Argument, the Compound as the [Y] Argument.
|
||||||
|
|
||||||
|
##### Coffee Machine Recipes
|
||||||
|
- Create an NBTTagCompound
|
||||||
|
- To the Compound, add an NBTTagCompound with the name "input" that contains the Input ItemStack saved to NBT (To do this, just use ItemStack.saveToNBT)
|
||||||
|
- To the Compound, add an int with the name "id" that contains the ID of the Effect the Coffee should have (Look up the Effects in Minecraft's Potion Class!)
|
||||||
|
- To the Compound, add an int with the name "duration" that contains the Duration the Effect should have
|
||||||
|
- To the Compound, add an int with the name "amplifier" that contains the Amplifier the Effect should have (Remember: 0 = Level 1!)
|
||||||
|
- To the Compound, add an int with the name "maxAmp" that contains the maximal Amplifier the Effect can have
|
||||||
|
- Send the Message with "registerCoffeeMachineRecipe" as the [X] Argument, the Compound as the [Y] Argument.
|
||||||
|
|
||||||
|
##### Ball of Hair Recipes
|
||||||
|
- Create an NBTTagCompound
|
||||||
|
- To the Compound, add an NBTTagCompound with the name "output" that contains the Input ItemStack saved to NBT (To do this, just use ItemStack.saveToNBT)
|
||||||
|
- To the Compound, add an int with the name "chance" that contains the Chance of the Item appearing
|
||||||
|
- Send the Message with "registerBallOfHairRecipe" as the [X] Argument, the Compound as the [Y] Argument.
|
20
README.md
20
README.md
|
@ -1,28 +1,36 @@
|
||||||
It's a Minecraft Mod!
|
##It's a Minecraft Mod!
|
||||||
|
|
||||||
For more information, visit the main Minecraft Forum Thread at http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/2374910-actually-additions-a-bunch-of-awesome-gadgets
|
For more information, visit the main Minecraft Forum Thread at http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/2374910-actually-additions-a-bunch-of-awesome-gadgets
|
||||||
|
|
||||||
|
If you want to see Information on how you can use my Mod and its InterModComms Feature in your own Mod, see the InterModCommsInfo.md File!
|
||||||
|
|
||||||
|
|
||||||
### LICENSE:
|
LICENSE:
|
||||||
All Rights Reserved
|
========
|
||||||
|
|
||||||
What that means? I can decide what I want to do with the License myself.
|
##### All Rights Reserved
|
||||||
|
|
||||||
|
What that means? The License can be customized by me:
|
||||||
|
|
||||||
### YOU MAY
|
### YOU MAY
|
||||||
- Fork and modify the Code
|
- Fork and modify the Code
|
||||||
- Submit Pull Requests
|
- Submit Pull Requests
|
||||||
- Copy Parts of the Code for other Projects
|
- Copy (SMALL!) Parts of the Code for other Projects
|
||||||
- Make a Review/Spotlight of the Mod or use it in a Modpack
|
- Make a Review/Spotlight of the Mod or use it in a Modpack
|
||||||
|
- Make Let's Play (and similar) Videos containing my Mod
|
||||||
|
|
||||||
|
|
||||||
### YOU CAN NOT
|
### YOU CAN NOT
|
||||||
- Copy the entire Code or claim it is yours.
|
- Copy the entire Code or claim it is yours.
|
||||||
- Reupload the Code or Mod to another website or claim you made it.
|
- Reupload the Code or Mod to another website or claim you made it.
|
||||||
|
- Copy entire Classes, Methods or other big Parts of Code.
|
||||||
|
|
||||||
### YOU HAVE TO
|
### YOU HAVE TO
|
||||||
- Always credit me. Don't be a jerk and copy entire portions of the code and claim they're yours.
|
- Always credit me. Don't be a jerk and copy entire portions of the code and claim they're yours.
|
||||||
- When it comes to the code, always link back to this Repository.
|
- When it comes to the code, always link back to this Repository.
|
||||||
- When it comes to the Mod, always link back to the the Forum Thread linked above.
|
- When it comes to the Mod, always link back to the the Forum Thread linked above.
|
||||||
|
|
||||||
|
### NOTES
|
||||||
|
- The above License only applies for Code I wrote myself, any APIs used (such as the CoFH API and the InventoryTweaks API) have their own License that is being respected.
|
||||||
|
- Almost all of the Assets used in this Mod are made by Glenthor and are owned by me. You are not allowed to copy them for any other Project without my Permission.
|
||||||
|
|
||||||
|
|
25
build.gradle
25
build.gradle
|
@ -18,12 +18,12 @@ buildscript {
|
||||||
apply plugin: 'forge'
|
apply plugin: 'forge'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
|
|
||||||
version = "1.7.10-0.0.4.3"
|
version = "1.7.10-0.0.6.2"
|
||||||
group = "ellpeck.actuallyadditions"
|
group = "ellpeck.actuallyadditions"
|
||||||
archivesBaseName = "ActuallyAdditions"
|
archivesBaseName = "ActuallyAdditions"
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.7.10-10.13.3.1395-1710ls"
|
version = "1.7.10-10.13.4.1448-1.7.10"
|
||||||
runDir = "idea"
|
runDir = "idea"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,21 +39,10 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "mcp.mobius.waila:Waila:1.5.6_1.7.10"
|
compile "mcp.mobius.waila:Waila:1.5.10_1.7.10"
|
||||||
|
compile "codechicken:CodeChickenLib:1.7.10-1.1.1.99:dev"
|
||||||
/*When Compiling from Github, you will need to have this file present
|
compile "codechicken:CodeChickenCore:1.7.10-1.0.4.29:dev"
|
||||||
because InventoryTweaks doesn't have a Maven Repo.
|
compile "codechicken:NotEnoughItems:1.7.10-1.0.3.74:dev"
|
||||||
But no one is going to download and compile this anyway, so it doesn't really matter. */
|
|
||||||
compile files("lib/InventoryTweaks-api-1.58-147.jar")
|
|
||||||
}
|
|
||||||
|
|
||||||
task copyChickenBones(type: Copy, dependsOn: "extractUserDev") {
|
|
||||||
from { configurations.compile }
|
|
||||||
include "**/*Chicken*.jar", "**/*NotEnoughItems*.jar"
|
|
||||||
exclude "**/CodeChickenLib*"
|
|
||||||
into file("./run/mods")
|
|
||||||
mustRunAfter "deobfBinJar"
|
|
||||||
mustRunAfter "repackMinecraft"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources{
|
processResources{
|
||||||
|
@ -64,7 +53,7 @@ processResources{
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
include 'mcmod.info'
|
include 'mcmod.info'
|
||||||
|
|
||||||
expand 'update':project.version, 'mcversion':project.minecraft.version
|
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||||
}
|
}
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
1.7.10-0.0.4.3
|
|
11
src/main/java/cofh/api/CoFHAPIProps.java
Normal file
11
src/main/java/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
src/main/java/cofh/api/energy/EnergyStorage.java
Normal file
158
src/main/java/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
src/main/java/cofh/api/energy/IEnergyConnection.java
Normal file
21
src/main/java/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
src/main/java/cofh/api/energy/IEnergyContainerItem.java
Normal file
52
src/main/java/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
src/main/java/cofh/api/energy/IEnergyHandler.java
Normal file
58
src/main/java/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
src/main/java/cofh/api/energy/IEnergyProvider.java
Normal file
38
src/main/java/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
src/main/java/cofh/api/energy/IEnergyReceiver.java
Normal file
38
src/main/java/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
src/main/java/cofh/api/energy/IEnergyStorage.java
Normal file
46
src/main/java/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
src/main/java/cofh/api/energy/ItemEnergyContainer.java
Normal file
110
src/main/java/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
src/main/java/cofh/api/energy/TileEnergyHandler.java
Normal file
65
src/main/java/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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
10
src/main/java/cofh/api/energy/package-info.java
Normal file
10
src/main/java/cofh/api/energy/package-info.java
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
/**
|
||||||
|
* (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;
|
||||||
|
|
9
src/main/java/cofh/api/package-info.java
Normal file
9
src/main/java/cofh/api/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 = "CoFHLib", provides = "CoFHAPI")
|
||||||
|
package cofh.api;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.API;
|
||||||
|
|
|
@ -10,17 +10,22 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
import ellpeck.actuallyadditions.achievement.InitAchievements;
|
import ellpeck.actuallyadditions.achievement.InitAchievements;
|
||||||
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||||
|
import ellpeck.actuallyadditions.communication.InterModCommunications;
|
||||||
import ellpeck.actuallyadditions.config.ConfigurationHandler;
|
import ellpeck.actuallyadditions.config.ConfigurationHandler;
|
||||||
import ellpeck.actuallyadditions.crafting.GrinderCrafting;
|
import ellpeck.actuallyadditions.crafting.GrinderCrafting;
|
||||||
import ellpeck.actuallyadditions.crafting.InitCrafting;
|
import ellpeck.actuallyadditions.crafting.InitCrafting;
|
||||||
|
import ellpeck.actuallyadditions.crafting.ItemCrafting;
|
||||||
import ellpeck.actuallyadditions.event.InitEvents;
|
import ellpeck.actuallyadditions.event.InitEvents;
|
||||||
import ellpeck.actuallyadditions.gen.InitVillager;
|
import ellpeck.actuallyadditions.gen.InitVillager;
|
||||||
import ellpeck.actuallyadditions.gen.OreGen;
|
import ellpeck.actuallyadditions.gen.OreGen;
|
||||||
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
import ellpeck.actuallyadditions.items.InitItems;
|
import ellpeck.actuallyadditions.items.InitItems;
|
||||||
|
import ellpeck.actuallyadditions.items.ItemCoffee;
|
||||||
import ellpeck.actuallyadditions.material.InitItemMaterials;
|
import ellpeck.actuallyadditions.material.InitItemMaterials;
|
||||||
import ellpeck.actuallyadditions.network.PacketHandler;
|
import ellpeck.actuallyadditions.network.PacketHandler;
|
||||||
import ellpeck.actuallyadditions.proxy.IProxy;
|
import ellpeck.actuallyadditions.proxy.IProxy;
|
||||||
|
import ellpeck.actuallyadditions.recipe.FuelHandler;
|
||||||
|
import ellpeck.actuallyadditions.recipe.HairyBallHandler;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
import ellpeck.actuallyadditions.util.ModUtil;
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import ellpeck.actuallyadditions.util.Util;
|
import ellpeck.actuallyadditions.util.Util;
|
||||||
|
@ -34,23 +39,23 @@ public class ActuallyAdditions{
|
||||||
@SidedProxy(clientSide = "ellpeck.actuallyadditions.proxy.ClientProxy", serverSide = "ellpeck.actuallyadditions.proxy.ServerProxy")
|
@SidedProxy(clientSide = "ellpeck.actuallyadditions.proxy.ClientProxy", serverSide = "ellpeck.actuallyadditions.proxy.ServerProxy")
|
||||||
public static IProxy proxy;
|
public static IProxy proxy;
|
||||||
|
|
||||||
@EventHandler()
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent event){
|
public void preInit(FMLPreInitializationEvent event){
|
||||||
Util.logInfo("Starting PreInitialization Phase...");
|
Util.logInfo("Starting PreInitialization Phase...");
|
||||||
|
|
||||||
PacketHandler.init();
|
|
||||||
ConfigurationHandler.init(event.getSuggestedConfigurationFile());
|
ConfigurationHandler.init(event.getSuggestedConfigurationFile());
|
||||||
|
PacketHandler.init();
|
||||||
InitItemMaterials.init();
|
InitItemMaterials.init();
|
||||||
InitBlocks.init();
|
InitBlocks.init();
|
||||||
InitItems.init();
|
InitItems.init();
|
||||||
InitVillager.init();
|
InitVillager.init();
|
||||||
|
FuelHandler.init();
|
||||||
proxy.preInit();
|
proxy.preInit();
|
||||||
|
|
||||||
Util.logInfo("PreInitialization Finished.");
|
Util.logInfo("PreInitialization Finished.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@EventHandler
|
||||||
@EventHandler()
|
|
||||||
public void init(FMLInitializationEvent event){
|
public void init(FMLInitializationEvent event){
|
||||||
Util.logInfo("Starting Initialization Phase...");
|
Util.logInfo("Starting Initialization Phase...");
|
||||||
|
|
||||||
|
@ -66,14 +71,21 @@ public class ActuallyAdditions{
|
||||||
Util.logInfo("Initialization Finished.");
|
Util.logInfo("Initialization Finished.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@EventHandler
|
||||||
@EventHandler()
|
|
||||||
public void postInit(FMLPostInitializationEvent event){
|
public void postInit(FMLPostInitializationEvent event){
|
||||||
Util.logInfo("Starting PostInitialization Phase...");
|
Util.logInfo("Starting PostInitialization Phase...");
|
||||||
|
|
||||||
|
ItemCoffee.initIngredients();
|
||||||
GrinderCrafting.init();
|
GrinderCrafting.init();
|
||||||
|
ItemCrafting.initMashedFoodRecipes();
|
||||||
|
HairyBallHandler.init();
|
||||||
proxy.postInit();
|
proxy.postInit();
|
||||||
|
|
||||||
Util.logInfo("PostInitialization Finished.");
|
Util.logInfo("PostInitialization Finished.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onIMCReceived(FMLInterModComms.IMCEvent event){
|
||||||
|
InterModCommunications.processIMC(event.getMessages());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,17 @@
|
||||||
-Doesn't use Levels
|
-Doesn't use Levels
|
||||||
-Needs Quartz and Diamond Blocks instead of Bookcases around
|
-Needs Quartz and Diamond Blocks instead of Bookcases around
|
||||||
|
|
||||||
|
-Chestie
|
||||||
|
-Follows you around
|
||||||
|
-Has an Inventory, a Crafting Table and a Furnace
|
||||||
|
|
||||||
-Instant Teleport Device
|
-Instant Teleport Device
|
||||||
-Teleports Players to where they look (Much like the Bukkit Compass)
|
-Teleports Players to where they look (Much like the Bukkit Compass)
|
||||||
|
|
||||||
-Magnet
|
-Ender Attractor / Repulsor
|
||||||
-Pulls Mobs and Items towards it
|
-Attracts/Repulses Mobs
|
||||||
-Has a certain Redstone Output depending on Mob Amount
|
-Has an aggressive and a friendly version
|
||||||
-Can be toggled On and Off
|
-Maybe for Items
|
||||||
|
|
||||||
-Void Bag
|
-Void Bag
|
||||||
-Sucks up picked up Items
|
-Sucks up picked up Items
|
||||||
|
@ -17,10 +21,6 @@
|
||||||
-Destroys excess Items (also determined by a Filter)
|
-Destroys excess Items (also determined by a Filter)
|
||||||
-Gets emptied into Chest on Right-Click
|
-Gets emptied into Chest on Right-Click
|
||||||
|
|
||||||
-Rice
|
|
||||||
-Gets planted in the Water
|
|
||||||
-Used to make Rice Flour and Rice Bread
|
|
||||||
|
|
||||||
-Auto-Crafting Item
|
-Auto-Crafting Item
|
||||||
-Has a Recipe saved
|
-Has a Recipe saved
|
||||||
-Crafts Recipe on Shift-Right-Click if all Items are in Inventory
|
-Crafts Recipe on Shift-Right-Click if all Items are in Inventory
|
||||||
|
@ -57,7 +57,65 @@
|
||||||
-File Jukebox
|
-File Jukebox
|
||||||
-Plays Sound Files put into your Minecraft Folder
|
-Plays Sound Files put into your Minecraft Folder
|
||||||
|
|
||||||
-RF Implementation
|
-Pharmacy Plants
|
||||||
-Power Acceptor Block that powers Machines
|
-Give you different effects
|
||||||
-Machines still don't accept RF themselves!
|
|
||||||
-Solar Panel & Heat Collector produce RF
|
-Multi-Block Ore Factory
|
||||||
|
-Fluids and things higher Multiplying Chance (x2, x3..)
|
||||||
|
-Speed Upgrades etc.
|
||||||
|
|
||||||
|
-Advanced Redstone Transmitter
|
||||||
|
-You can mark an area
|
||||||
|
-On Activation, all blocks in the area get a Signal
|
||||||
|
|
||||||
|
-Thermopile
|
||||||
|
-Needs a hot and a cold fluid
|
||||||
|
-Depending on the fluids, it generates more power
|
||||||
|
|
||||||
|
-More Effect Rings
|
||||||
|
-Ring of Growth: Lets Plants grow, more Reach with Tier 2
|
||||||
|
-Ring of Thorns: Hurts Attackers when they hit you with a Projectile
|
||||||
|
-Ring of Water Walking
|
||||||
|
-Ring of Flight
|
||||||
|
-Ring of Aquadive: Fast underwater movement
|
||||||
|
-Ring of Suction: Sucks up Items in the area
|
||||||
|
-Ring of Water Absorption: Removes Water around
|
||||||
|
-Ring of Striptease (Or something like that): Attacker lose parts of their Armor
|
||||||
|
|
||||||
|
-Food Cannon
|
||||||
|
-Shoots Food Items
|
||||||
|
-Damage varies with Food
|
||||||
|
|
||||||
|
-Furniture
|
||||||
|
-Can be put into a Crafting Table with a Banner to give it a pattern (1.8!)
|
||||||
|
-Parts of the furniture can have different types (eg. Wood, Stone etc.) -> Via Crafting or Tool?
|
||||||
|
|
||||||
|
-Tinker's Concrete
|
||||||
|
-Customizable with Items in Concrete Mixer
|
||||||
|
-(eg. Redstone->Speed Glowstone->Light etc.)
|
||||||
|
|
||||||
|
-XP Solidifier
|
||||||
|
-Block that creates Solidified Experience from Player's Levels
|
||||||
|
-Has a GUI with Buttons
|
||||||
|
|
||||||
|
-Alarm
|
||||||
|
-Gets triggered when Mobs are in the Area
|
||||||
|
-Configurable Range
|
||||||
|
-Configurable Mobs
|
||||||
|
|
||||||
|
-Industrial Fertilizer
|
||||||
|
-Grows the whole Plant with one Click
|
||||||
|
|
||||||
|
-Dog Bones
|
||||||
|
-Breed Dogs faster
|
||||||
|
-Makes them have Babies too
|
||||||
|
|
||||||
|
-Testificate Bucks
|
||||||
|
-Village House that has a Coffee Machine
|
||||||
|
-Villager who sells Coffee and Cookies
|
||||||
|
|
||||||
|
-Inventory Emitter
|
||||||
|
-Emits a Redstone Signal dependant on the Amount of a specified Item in it
|
||||||
|
-Items are configurable in the GUI
|
||||||
|
|
||||||
|
-Enderman Teleport Stopper
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityCanolaPress;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockCanolaPress extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
|
private IIcon topIcon;
|
||||||
|
|
||||||
|
public BlockCanolaPress(){
|
||||||
|
super(Material.rock);
|
||||||
|
this.setHarvestLevel("pickaxe", 0);
|
||||||
|
this.setHardness(1.0F);
|
||||||
|
this.setStepSound(soundTypeStone);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
|
return new TileEntityCanolaPress();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
return side == 1 || side == 0 ? this.topIcon : this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
|
if(!world.isRemote){
|
||||||
|
TileEntityCanolaPress press = (TileEntityCanolaPress)world.getTileEntity(x, y, z);
|
||||||
|
if (press != null) player.openGui(ActuallyAdditions.instance, GuiHandler.CANOLA_PRESS_ID, world, x, y, z);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return "blockCanolaPress";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
BlockUtil.addPowerUsageInfo(list, TileEntityCanolaPress.energyUsedPerTick);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,126 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityCoalGenerator;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class BlockCoalGenerator extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
|
private IIcon topIcon;
|
||||||
|
|
||||||
|
public BlockCoalGenerator(){
|
||||||
|
super(Material.rock);
|
||||||
|
this.setHarvestLevel("pickaxe", 0);
|
||||||
|
this.setHardness(1.0F);
|
||||||
|
this.setStepSound(soundTypeStone);
|
||||||
|
this.setTickRandomly(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
|
||||||
|
if (meta == 1){
|
||||||
|
for(int i = 0; i < 5; i++){
|
||||||
|
world.spawnParticle("smoke", (double)x+0.5F, (double)y + 1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
|
return new TileEntityCoalGenerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
return side <= 1 ? this.topIcon : this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
|
if(!world.isRemote){
|
||||||
|
TileEntityCoalGenerator press = (TileEntityCoalGenerator)world.getTileEntity(x, y, z);
|
||||||
|
if (press != null) player.openGui(ActuallyAdditions.instance, GuiHandler.COAL_GENERATOR_ID, world, x, y, z);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return "blockCoalGenerator";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
BlockUtil.addPowerProductionInfo(list, TileEntityCoalGenerator.energyProducedPerTick);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,11 +3,15 @@ package ellpeck.actuallyadditions.blocks;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityCoffeeMachine;
|
||||||
import ellpeck.actuallyadditions.util.BlockUtil;
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
import ellpeck.actuallyadditions.util.INameableItem;
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.EnumRarity;
|
import net.minecraft.item.EnumRarity;
|
||||||
|
@ -15,6 +19,7 @@ import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -22,16 +27,31 @@ import java.util.List;
|
||||||
public class BlockCoffeeMachine extends BlockContainerBase implements INameableItem{
|
public class BlockCoffeeMachine extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
public BlockCoffeeMachine(){
|
public BlockCoffeeMachine(){
|
||||||
super(Material.wood);
|
super(Material.rock);
|
||||||
this.setHarvestLevel("axe", 0);
|
this.setHarvestLevel("pickaxe", 0);
|
||||||
this.setHardness(1.0F);
|
this.setHardness(1.0F);
|
||||||
this.setStepSound(soundTypeWood);
|
this.setStepSound(soundTypeStone);
|
||||||
|
|
||||||
|
float f = 1/16F;
|
||||||
|
this.setBlockBounds(f, 0F, f, 1F-f, 1F-2*f, 1F-f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
||||||
|
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
||||||
|
|
||||||
|
if(rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 0);
|
||||||
|
if(rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 1, 3);
|
||||||
|
if(rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 0, 2);
|
||||||
|
if(rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 3, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int f6, float f7, float f8, float f9){
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int f6, float f7, float f8, float f9){
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
|
TileEntityCoffeeMachine machine = (TileEntityCoffeeMachine)world.getTileEntity(x, y, z);
|
||||||
|
if (machine != null) player.openGui(ActuallyAdditions.instance, GuiHandler.COFFEE_MACHINE_ID, world, x, y, z);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +64,7 @@ public class BlockCoffeeMachine extends BlockContainerBase implements INameableI
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
this.blockIcon = Blocks.hopper.getIcon(0, 0);
|
this.blockIcon = Blocks.coal_block.getIcon(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -64,7 +84,7 @@ public class BlockCoffeeMachine extends BlockContainerBase implements INameableI
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int meta){
|
public TileEntity createNewTileEntity(World world, int meta){
|
||||||
return null;
|
return new TileEntityCoffeeMachine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -96,7 +116,7 @@ public class BlockCoffeeMachine extends BlockContainerBase implements INameableI
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
return EnumRarity.uncommon;
|
return EnumRarity.rare;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -108,7 +128,8 @@ public class BlockCoffeeMachine extends BlockContainerBase implements INameableI
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
BlockUtil.addInformation(theBlock, list, 1, "");
|
BlockUtil.addInformation(theBlock, list, 5, "");
|
||||||
|
BlockUtil.addPowerUsageInfo(list, TileEntityCoffeeMachine.energyUsePerTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -33,6 +33,8 @@ public class BlockCompost extends BlockContainerBase implements INameableItem{
|
||||||
this.setHarvestLevel("axe", 0);
|
this.setHarvestLevel("axe", 0);
|
||||||
this.setHardness(1.0F);
|
this.setHardness(1.0F);
|
||||||
this.setStepSound(soundTypeWood);
|
this.setStepSound(soundTypeWood);
|
||||||
|
|
||||||
|
this.setBlockBoundsForItemRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -46,12 +48,11 @@ public class BlockCompost extends BlockContainerBase implements INameableItem{
|
||||||
else tile.slots[0].stackSize++;
|
else tile.slots[0].stackSize++;
|
||||||
if(!player.capabilities.isCreativeMode) player.inventory.getCurrentItem().stackSize--;
|
if(!player.capabilities.isCreativeMode) player.inventory.getCurrentItem().stackSize--;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Add Fertilizer to player's inventory
|
//Add Fertilizer to player's inventory
|
||||||
else if(tile.slots[0] != null && (stackPlayer == null || (stackPlayer.getItem() instanceof ItemFertilizer && stackPlayer.stackSize <= stackPlayer.getMaxStackSize() - tile.slots[0].stackSize)) && tile.slots[0].getItem() instanceof ItemFertilizer){
|
else if(tile.slots[0] != null && (stackPlayer == null || (stackPlayer.getItem() instanceof ItemFertilizer && stackPlayer.stackSize <= stackPlayer.getMaxStackSize() - tile.slots[0].stackSize)) && tile.slots[0].getItem() instanceof ItemFertilizer){
|
||||||
if(stackPlayer == null) player.inventory.setInventorySlotContents(player.inventory.currentItem, tile.slots[0].copy());
|
if(stackPlayer == null) player.inventory.setInventorySlotContents(player.inventory.currentItem, tile.slots[0].copy());
|
||||||
else player.getCurrentEquippedItem().stackSize+=tile.slots[0].stackSize;
|
else player.getCurrentEquippedItem().stackSize+=tile.slots[0].stackSize;
|
||||||
//TODO Add again when readding Achievements
|
|
||||||
//player.addStat(InitAchievements.achievementCraftFertilizer, 1);
|
|
||||||
tile.slots[0] = null;
|
tile.slots[0] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,11 @@ import ellpeck.actuallyadditions.tile.TileEntityInventoryBase;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
@ -16,26 +19,43 @@ public abstract class BlockContainerBase extends BlockContainer{
|
||||||
super(mat);
|
super(mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TileEntityInventoryBase dropInventory(World world, int x, int y, int z){
|
public void dropInventory(World world, int x, int y, int z){
|
||||||
TileEntityInventoryBase tileEntity = (TileEntityInventoryBase)world.getTileEntity(x, y, z);
|
if(!world.isRemote){
|
||||||
for (int i = 0; i < tileEntity.getSizeInventory(); i++){
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
ItemStack itemStack = tileEntity.getStackInSlot(i);
|
if(tile instanceof TileEntityInventoryBase){
|
||||||
if (itemStack != null && itemStack.stackSize > 0) {
|
TileEntityInventoryBase tileEntity = (TileEntityInventoryBase)tile;
|
||||||
Random rand = new Random();
|
if(tileEntity.getSizeInventory() > 0){
|
||||||
float dX = rand.nextFloat() * 0.8F + 0.1F;
|
for(int i = 0; i < tileEntity.getSizeInventory(); i++){
|
||||||
float dY = rand.nextFloat() * 0.8F + 0.1F;
|
ItemStack itemStack = tileEntity.getStackInSlot(i);
|
||||||
float dZ = rand.nextFloat() * 0.8F + 0.1F;
|
if(itemStack != null && itemStack.stackSize > 0){
|
||||||
EntityItem entityItem = new EntityItem(world, x + dX, y + dY, z + dZ, itemStack.copy());
|
Random rand = new Random();
|
||||||
if (itemStack.hasTagCompound())
|
float dX = rand.nextFloat()*0.8F+0.1F;
|
||||||
entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy());
|
float dY = rand.nextFloat()*0.8F+0.1F;
|
||||||
float factor = 0.05F;
|
float dZ = rand.nextFloat()*0.8F+0.1F;
|
||||||
entityItem.motionX = rand.nextGaussian() * factor;
|
EntityItem entityItem = new EntityItem(world, x+dX, y+dY, z+dZ, itemStack.copy());
|
||||||
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
if(itemStack.hasTagCompound()) entityItem.getEntityItem().setTagCompound((NBTTagCompound)itemStack.getTagCompound().copy());
|
||||||
entityItem.motionZ = rand.nextGaussian() * factor;
|
float factor = 0.05F;
|
||||||
world.spawnEntityInWorld(entityItem);
|
entityItem.motionX = rand.nextGaussian()*factor;
|
||||||
itemStack.stackSize = 0;
|
entityItem.motionY = rand.nextGaussian()*factor+0.2F;
|
||||||
|
entityItem.motionZ = rand.nextGaussian()*factor;
|
||||||
|
world.spawnEntityInWorld(entityItem);
|
||||||
|
itemStack.stackSize = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tileEntity;
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasComparatorInputOverride(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getComparatorInputOverride(World world, int x, int y, int z, int meta){
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if(tile instanceof IInventory) return Container.calcRedstoneFromInventory((IInventory)tile);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,122 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityEnergizer;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityEnervator;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockEnergizer extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
|
private IIcon topIcon;
|
||||||
|
private IIcon sideIcon;
|
||||||
|
private boolean isEnergizer;
|
||||||
|
|
||||||
|
public BlockEnergizer(boolean isEnergizer){
|
||||||
|
super(Material.rock);
|
||||||
|
this.isEnergizer = isEnergizer;
|
||||||
|
this.setHarvestLevel("pickaxe", 0);
|
||||||
|
this.setHardness(2.0F);
|
||||||
|
this.setStepSound(soundTypeStone);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
|
return this.isEnergizer ? new TileEntityEnergizer() : new TileEntityEnervator();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
return side == 1 ? this.topIcon : (side == 0 ? this.blockIcon : this.sideIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||||
|
this.sideIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Side");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
|
if(!world.isRemote){
|
||||||
|
if(this.isEnergizer){
|
||||||
|
TileEntityEnergizer energizer = (TileEntityEnergizer)world.getTileEntity(x, y, z);
|
||||||
|
if(energizer != null) player.openGui(ActuallyAdditions.instance, GuiHandler.ENERGIZER_ID, world, x, y, z);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
TileEntityEnervator energizer = (TileEntityEnervator)world.getTileEntity(x, y, z);
|
||||||
|
if(energizer != null) player.openGui(ActuallyAdditions.instance, GuiHandler.ENERVATOR_ID, world, x, y, z);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return this.isEnergizer ? "blockEnergizer" : "blockEnervator";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 2, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,111 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityFermentingBarrel;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockFermentingBarrel extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
|
private IIcon iconTop;
|
||||||
|
|
||||||
|
public BlockFermentingBarrel(){
|
||||||
|
super(Material.wood);
|
||||||
|
this.setHarvestLevel("axe", 0);
|
||||||
|
this.setHardness(1.0F);
|
||||||
|
this.setStepSound(soundTypeWood);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
|
return new TileEntityFermentingBarrel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
|
if(!world.isRemote){
|
||||||
|
TileEntityFermentingBarrel press = (TileEntityFermentingBarrel)world.getTileEntity(x, y, z);
|
||||||
|
if (press != null) player.openGui(ActuallyAdditions.instance, GuiHandler.FERMENTING_BARREL_ID, world, x, y, z);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return side <= 1 ? this.iconTop : this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||||
|
this.iconTop = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return "blockFermentingBarrel";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int meta){
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,135 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityFluidCollector;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
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.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockFluidCollector extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
|
private IIcon frontIcon;
|
||||||
|
private IIcon topIcon;
|
||||||
|
|
||||||
|
private boolean isPlacer;
|
||||||
|
|
||||||
|
public BlockFluidCollector(boolean isPlacer){
|
||||||
|
super(Material.rock);
|
||||||
|
this.isPlacer = isPlacer;
|
||||||
|
this.setHarvestLevel("pickaxe", 0);
|
||||||
|
this.setHardness(1.0F);
|
||||||
|
this.setStepSound(soundTypeStone);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){
|
||||||
|
int rotation = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, rotation, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
|
return this.isPlacer ? new TileEntityFluidCollector.TileEntityFluidPlacer() : new TileEntityFluidCollector();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
if(side == 0 || side == 1) return this.topIcon;
|
||||||
|
if(side == 3) return this.frontIcon;
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
if(side != meta && (side == 0 || side == 1)) return this.topIcon;
|
||||||
|
if(side == meta) return this.frontIcon;
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||||
|
this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front");
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
|
if(!world.isRemote){
|
||||||
|
TileEntityFluidCollector collector = (TileEntityFluidCollector)world.getTileEntity(x, y, z);
|
||||||
|
if (collector != null) player.openGui(ActuallyAdditions.instance, GuiHandler.FLUID_COLLECTOR_ID, world, x, y, z);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return this.isPlacer ? "blockFluidPlacer" : "blockFluidCollector";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.rare;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,103 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||||
|
import net.minecraftforge.fluids.Fluid;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockFluidFlowing extends BlockFluidClassic implements INameableItem{
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public IIcon stillIcon;
|
||||||
|
public IIcon flowingIcon;
|
||||||
|
|
||||||
|
public BlockFluidFlowing(Fluid fluid, Material material, String unlocalizedName){
|
||||||
|
super(fluid, material);
|
||||||
|
this.name = unlocalizedName;
|
||||||
|
this.setRenderPass(1);
|
||||||
|
displacements.put(this, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canDisplace(IBlockAccess world, int x, int y, int z){
|
||||||
|
return !world.getBlock(x, y, z).getMaterial().isLiquid() && super.canDisplace(world, x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean displaceIfPossible(World world, int x, int y, int z){
|
||||||
|
return !world.getBlock(x, y, z).getMaterial().isLiquid() && super.displaceIfPossible(world, x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
return side <= 1 ? this.stillIcon : this.flowingIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.stillIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Still");
|
||||||
|
this.flowingIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Flowing");
|
||||||
|
this.definedFluid.setIcons(this.stillIcon, this.flowingIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,6 +3,7 @@ package ellpeck.actuallyadditions.blocks;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import ellpeck.actuallyadditions.ActuallyAdditions;
|
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
|
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||||
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityFurnaceDouble;
|
import ellpeck.actuallyadditions.tile.TileEntityFurnaceDouble;
|
||||||
import ellpeck.actuallyadditions.util.BlockUtil;
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
@ -171,6 +172,7 @@ public class BlockFurnaceDouble extends BlockContainerBase implements INameableI
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
BlockUtil.addInformation(theBlock, list, 1, "");
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
BlockUtil.addPowerUsageInfo(list, ConfigIntValues.FURNACE_ENERGY_USED.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -23,10 +23,10 @@ import java.util.List;
|
||||||
public class BlockFurnaceSolar extends BlockContainerBase implements INameableItem{
|
public class BlockFurnaceSolar extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
public BlockFurnaceSolar(){
|
public BlockFurnaceSolar(){
|
||||||
super(Material.wood);
|
super(Material.rock);
|
||||||
this.setHarvestLevel("axe", 0);
|
this.setHarvestLevel("pickaxe", 0);
|
||||||
this.setHardness(1.0F);
|
this.setHardness(1.0F);
|
||||||
this.setStepSound(soundTypeWood);
|
this.setStepSound(soundTypeStone);
|
||||||
this.setBlockBounds(0F, 0F, 0F, 1F, 3F/16F, 1F);
|
this.setBlockBounds(0F, 0F, 0F, 1F, 3F/16F, 1F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +97,7 @@ public class BlockFurnaceSolar extends BlockContainerBase implements INameableIt
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
BlockUtil.addInformation(theBlock, list, 1, "");
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
BlockUtil.addPowerProductionInfo(list, TileEntityFurnaceSolar.energyProducedPerTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,85 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockGeneric extends Block implements INameableItem{
|
||||||
|
|
||||||
|
public String name;
|
||||||
|
|
||||||
|
public BlockGeneric(String name){
|
||||||
|
super(Material.rock);
|
||||||
|
this.name = name;
|
||||||
|
this.setHarvestLevel("pickaxe", 0);
|
||||||
|
this.setHardness(1.0F);
|
||||||
|
this.setStepSound(soundTypeStone);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int meta){
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,6 +3,7 @@ package ellpeck.actuallyadditions.blocks;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import ellpeck.actuallyadditions.ActuallyAdditions;
|
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
|
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||||
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityGrinder;
|
import ellpeck.actuallyadditions.tile.TileEntityGrinder;
|
||||||
import ellpeck.actuallyadditions.util.BlockUtil;
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
@ -29,7 +30,7 @@ public class BlockGrinder extends BlockContainerBase implements INameableItem{
|
||||||
private IIcon onIcon;
|
private IIcon onIcon;
|
||||||
private IIcon bottomIcon;
|
private IIcon bottomIcon;
|
||||||
|
|
||||||
private boolean isDouble;
|
private final boolean isDouble;
|
||||||
|
|
||||||
public BlockGrinder(boolean isDouble){
|
public BlockGrinder(boolean isDouble){
|
||||||
super(Material.rock);
|
super(Material.rock);
|
||||||
|
@ -134,6 +135,7 @@ public class BlockGrinder extends BlockContainerBase implements INameableItem{
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
BlockUtil.addInformation(theBlock, list, ((BlockGrinder)theBlock).isDouble ? 3 : 4, "");
|
BlockUtil.addInformation(theBlock, list, ((BlockGrinder)theBlock).isDouble ? 3 : 4, "");
|
||||||
|
BlockUtil.addPowerUsageInfo(list, ((BlockGrinder)theBlock).isDouble ? ConfigIntValues.GRINDER_DOUBLE_ENERGY_USED.getValue() : ConfigIntValues.GRINDER_ENERGY_USED.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -85,6 +85,7 @@ public class BlockHeatCollector extends BlockContainerBase implements INameableI
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
BlockUtil.addInformation(theBlock, list, 3, "");
|
BlockUtil.addInformation(theBlock, list, 3, "");
|
||||||
|
BlockUtil.addPowerProductionInfo(list, TileEntityHeatCollector.energyProducedPerTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class BlockInputter extends BlockContainerBase implements INameableItem{
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
if(KeyUtil.isShiftPressed()){
|
if(KeyUtil.isShiftPressed()){
|
||||||
list.add(StatCollector.translateToLocalFormatted("tooltip." + ModUtil.MOD_ID_LOWER + ".blockInputter.desc." + 1, StringUtil.OBFUSCATED, StringUtil.LIGHT_GRAY));
|
list.add(StatCollector.translateToLocalFormatted("tooltip." + ModUtil.MOD_ID_LOWER + ".blockInputter.desc." + 1, StringUtil.OBFUSCATED, StringUtil.LIGHT_GRAY));
|
||||||
for(int i = 1; i < 6; i++){
|
for(int i = 1; i < 7; i++){
|
||||||
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".blockInputter.desc." + (i + 1)));
|
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".blockInputter.desc." + (i + 1)));
|
||||||
}
|
}
|
||||||
if((((BlockInputter)theBlock).isAdvanced)) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc"));
|
if((((BlockInputter)theBlock).isAdvanced)) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc"));
|
||||||
|
|
|
@ -21,12 +21,10 @@ import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class BlockItemRepairer extends BlockContainerBase implements INameableItem{
|
public class BlockItemRepairer extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
private IIcon topIcon;
|
private IIcon topIcon;
|
||||||
private IIcon onIcon;
|
|
||||||
private IIcon bottomIcon;
|
private IIcon bottomIcon;
|
||||||
|
|
||||||
public BlockItemRepairer(){
|
public BlockItemRepairer(){
|
||||||
|
@ -54,24 +52,16 @@ public class BlockItemRepairer extends BlockContainerBase implements INameableIt
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(int side, int meta){
|
public IIcon getIcon(int side, int meta){
|
||||||
if(side == 1 && meta != 1) return this.topIcon;
|
if(side == 1) return this.topIcon;
|
||||||
if(side == 1) return this.onIcon;
|
|
||||||
if(side == 0) return this.bottomIcon;
|
if(side == 0) return this.bottomIcon;
|
||||||
return this.blockIcon;
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister iconReg){
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||||
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||||
this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "On");
|
|
||||||
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom");
|
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,6 +112,7 @@ public class BlockItemRepairer extends BlockContainerBase implements INameableIt
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
BlockUtil.addInformation(theBlock, list, 1, "");
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
BlockUtil.addPowerUsageInfo(list, TileEntityItemRepairer.energyUsePerTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,118 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityLavaFactoryController;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.KeyUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockLavaFactoryController extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
|
private IIcon topIcon;
|
||||||
|
|
||||||
|
public BlockLavaFactoryController(){
|
||||||
|
super(Material.rock);
|
||||||
|
this.setHarvestLevel("pickaxe", 0);
|
||||||
|
this.setHardness(1.0F);
|
||||||
|
this.setStepSound(soundTypeStone);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
|
return new TileEntityLavaFactoryController();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
return side == 1 ? this.topIcon : this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
|
if(!world.isRemote){
|
||||||
|
TileEntityLavaFactoryController factory = (TileEntityLavaFactoryController)world.getTileEntity(x, y, z);
|
||||||
|
if(factory != null){
|
||||||
|
int state = factory.isMultiblock();
|
||||||
|
if(state == TileEntityLavaFactoryController.NOT_MULTI){
|
||||||
|
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".factory.notPart.desc")));
|
||||||
|
}
|
||||||
|
if(state == TileEntityLavaFactoryController.HAS_AIR || state == TileEntityLavaFactoryController.HAS_LAVA){
|
||||||
|
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".factory.works.desc")));
|
||||||
|
}
|
||||||
|
player.addChatComponentMessage(new ChatComponentText(factory.storage.getEnergyStored() + "/" + factory.storage.getMaxEnergyStored() + " RF"));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return "blockLavaFactoryController";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 3, "");
|
||||||
|
if(KeyUtil.isShiftPressed()){
|
||||||
|
list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".uses.desc") + " " + TileEntityLavaFactoryController.energyNeededToProduceLava + " RF/B");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -45,7 +45,7 @@ public class BlockMisc extends Block implements INameableItem{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(int side, int metadata){
|
public IIcon getIcon(int side, int metadata){
|
||||||
return textures[metadata];
|
return metadata >= textures.length ? null : textures[metadata];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -79,19 +79,19 @@ public class BlockMisc extends Block implements INameableItem{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumRarity getRarity(ItemStack stack){
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
return allMiscBlocks[stack.getItemDamage()].rarity;
|
return stack.getItemDamage() >= allMiscBlocks.length ? EnumRarity.common : allMiscBlocks[stack.getItemDamage()].rarity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName(ItemStack stack){
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
return this.getUnlocalizedName() + allMiscBlocks[stack.getItemDamage()].getName();
|
return this.getUnlocalizedName() + (stack.getItemDamage() >= allMiscBlocks.length ? " ERROR!" : allMiscBlocks[stack.getItemDamage()].getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
BlockUtil.addInformation(theBlock, list, 1, allMiscBlocks[stack.getItemDamage()].getName());
|
if(stack.getItemDamage() < allMiscBlocks.length) BlockUtil.addInformation(theBlock, list, 1, allMiscBlocks[stack.getItemDamage()].getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,126 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityOilGenerator;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class BlockOilGenerator extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
|
private IIcon topIcon;
|
||||||
|
|
||||||
|
public BlockOilGenerator(){
|
||||||
|
super(Material.rock);
|
||||||
|
this.setHarvestLevel("pickaxe", 0);
|
||||||
|
this.setHardness(1.0F);
|
||||||
|
this.setStepSound(soundTypeStone);
|
||||||
|
this.setTickRandomly(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void randomDisplayTick(World world, int x, int y, int z, Random rand){
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
|
||||||
|
if (meta == 1){
|
||||||
|
for(int i = 0; i < 5; i++){
|
||||||
|
world.spawnParticle("smoke", (double)x+0.5F, (double)y + 1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
|
return new TileEntityOilGenerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
return side <= 1 ? this.topIcon : this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||||
|
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||||
|
if(!world.isRemote){
|
||||||
|
TileEntityOilGenerator generator = (TileEntityOilGenerator)world.getTileEntity(x, y, z);
|
||||||
|
if (generator != null) player.openGui(ActuallyAdditions.instance, GuiHandler.OIL_GENERATOR_ID, world, x, y, z);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return "blockOilGenerator";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
BlockUtil.addPowerProductionInfo(list, TileEntityOilGenerator.energyProducedPerTick);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,109 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityPhantomBooster;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockPhantomBooster extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
|
public BlockPhantomBooster(){
|
||||||
|
super(Material.rock);
|
||||||
|
this.setHarvestLevel("pickaxe", 0);
|
||||||
|
this.setHardness(1.0F);
|
||||||
|
this.setStepSound(soundTypeStone);
|
||||||
|
|
||||||
|
float f = 1F/16F;
|
||||||
|
this.setBlockBounds(3*f, 0F, 3*f, 1-3*f, 1F, 1-3*f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType(){
|
||||||
|
return RenderingRegistry.getNextAvailableRenderId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = Blocks.lapis_block.getIcon(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return "blockPhantomBooster";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int i){
|
||||||
|
return new TileEntityPhantomBooster();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.epic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 2, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,174 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
|
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||||
|
import ellpeck.actuallyadditions.inventory.GuiHandler;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityPhantomPlacer;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityPhantomface;
|
||||||
|
import ellpeck.actuallyadditions.util.*;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockPhantomface extends BlockContainerBase implements INameableItem{
|
||||||
|
|
||||||
|
public static final int FACE = 0;
|
||||||
|
public static final int PLACER = 1;
|
||||||
|
public static final int BREAKER = 2;
|
||||||
|
public static final int LIQUIFACE = 3;
|
||||||
|
public static final int ENERGYFACE = 4;
|
||||||
|
|
||||||
|
public int type;
|
||||||
|
public int range;
|
||||||
|
|
||||||
|
public BlockPhantomface(int type){
|
||||||
|
super(Material.rock);
|
||||||
|
this.type = type;
|
||||||
|
this.setHarvestLevel("pickaxe", 0);
|
||||||
|
this.setHardness(1.0F);
|
||||||
|
this.setStepSound(soundTypeStone);
|
||||||
|
|
||||||
|
if(type == FACE || type == LIQUIFACE || type == ENERGYFACE) this.range = ConfigIntValues.PHANTOMFACE_RANGE.getValue();
|
||||||
|
else if(type == BREAKER || type == PLACER) this.range = ConfigIntValues.PHANTOM_PLACER_RANGE.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||||
|
if(this.type == PLACER || this.type == BREAKER) this.dropInventory(world, x, y, z);
|
||||||
|
super.breakBlock(world, x, y, z, block, par6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int hitSide, float hitX, float hitY, float hitZ){
|
||||||
|
if(!world.isRemote){
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
if(tile != null){
|
||||||
|
if(tile instanceof TileEntityPhantomface){
|
||||||
|
TileEntityPhantomface phantom = (TileEntityPhantomface)tile;
|
||||||
|
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + phantom.range));
|
||||||
|
if(phantom.hasBoundTile()){
|
||||||
|
if(phantom.isBoundTileInRage()) player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedBlock.desc", phantom.boundPosition.posX, phantom.boundPosition.posY, phantom.boundPosition.posZ)));
|
||||||
|
else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc", phantom.boundPosition.posX, phantom.boundPosition.posY, phantom.boundPosition.posZ)));
|
||||||
|
}
|
||||||
|
else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc")));
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(tile instanceof TileEntityPhantomPlacer){
|
||||||
|
if(player.isSneaking()){
|
||||||
|
TileEntityPhantomPlacer phantom = (TileEntityPhantomPlacer)tile;
|
||||||
|
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + phantom.range));
|
||||||
|
if(phantom.hasBoundPosition()){
|
||||||
|
if(phantom.isBoundPositionInRange()) player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedBlock.desc", phantom.boundPosition.posX, phantom.boundPosition.posY, phantom.boundPosition.posZ)));
|
||||||
|
else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc", phantom.boundPosition.posX, phantom.boundPosition.posY, phantom.boundPosition.posZ)));
|
||||||
|
}
|
||||||
|
else player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc")));
|
||||||
|
}
|
||||||
|
else player.openGui(ActuallyAdditions.instance, GuiHandler.PHANTOM_PLACER_ID, world, x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int par2){
|
||||||
|
switch(this.type){
|
||||||
|
case PLACER:
|
||||||
|
return new TileEntityPhantomPlacer();
|
||||||
|
case BREAKER:
|
||||||
|
return new TileEntityPhantomPlacer.TileEntityPhantomBreaker();
|
||||||
|
case LIQUIFACE:
|
||||||
|
return new TileEntityPhantomface.TileEntityPhantomLiquiface();
|
||||||
|
case ENERGYFACE:
|
||||||
|
return new TileEntityPhantomface.TileEntityPhantomEnergyface();
|
||||||
|
default:
|
||||||
|
return new TileEntityPhantomface.TileEntityPhantomItemface();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
switch(this.type){
|
||||||
|
case PLACER:
|
||||||
|
return "blockPhantomPlacer";
|
||||||
|
case BREAKER:
|
||||||
|
return "blockPhantomBreaker";
|
||||||
|
case LIQUIFACE:
|
||||||
|
return "blockPhantomLiquiface";
|
||||||
|
case ENERGYFACE:
|
||||||
|
return "blockPhantomEnergyface";
|
||||||
|
default:
|
||||||
|
return "blockPhantomface";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.epic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 2, "");
|
||||||
|
if(KeyUtil.isShiftPressed()){
|
||||||
|
if(((BlockPhantomface)this.theBlock).type == LIQUIFACE){
|
||||||
|
list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.3"));
|
||||||
|
list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.4"));
|
||||||
|
}
|
||||||
|
list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + ((BlockPhantomface)theBlock).range);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
130
src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java
Normal file
130
src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java
Normal file
|
@ -0,0 +1,130 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockCrops;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class BlockPlant extends BlockCrops implements INameableItem{
|
||||||
|
|
||||||
|
private IIcon[] textures;
|
||||||
|
private String name;
|
||||||
|
public Item seedItem;
|
||||||
|
public Item returnItem;
|
||||||
|
public int returnMeta;
|
||||||
|
private int minDropAmount;
|
||||||
|
private int addDropAmount;
|
||||||
|
|
||||||
|
public BlockPlant(String name, int stages, int minDropAmount, int addDropAmount){
|
||||||
|
this.name = name;
|
||||||
|
this.textures = new IIcon[stages];
|
||||||
|
this.minDropAmount = minDropAmount;
|
||||||
|
this.addDropAmount = addDropAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int quantityDropped(int meta, int fortune, Random random){
|
||||||
|
return meta >= 7 ? random.nextInt(addDropAmount)+minDropAmount : super.quantityDropped(meta, fortune, random);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
if(meta < 7){
|
||||||
|
if (meta == 6) meta = 5;
|
||||||
|
return this.textures[meta >> 1];
|
||||||
|
}
|
||||||
|
else return this.textures[this.textures.length-1];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item func_149866_i(){
|
||||||
|
return this.seedItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item getItemDropped(int meta, Random rand, int par3){
|
||||||
|
return meta >= 7 ? this.func_149865_P() : this.func_149866_i();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Item func_149865_P(){
|
||||||
|
return this.returnItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(int meta){
|
||||||
|
return this.returnMeta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getDamageValue(World world, int x, int y, int z){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconReg){
|
||||||
|
for (int i = 0; i < this.textures.length; i++){
|
||||||
|
textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Stage" + (i+1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
129
src/main/java/ellpeck/actuallyadditions/blocks/BlockSlabs.java
Normal file
129
src/main/java/ellpeck/actuallyadditions/blocks/BlockSlabs.java
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockSlabs extends Block implements INameableItem{
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private Block fullBlock;
|
||||||
|
|
||||||
|
public BlockSlabs(String name, Block fullBlock){
|
||||||
|
super(Material.rock);
|
||||||
|
this.fullBlock = fullBlock;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axis, List list, Entity entity){
|
||||||
|
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||||
|
super.addCollisionBoxesToList(world, x, y, z, axis, list, entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBlockBoundsForItemRender(){
|
||||||
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
float minY = meta == 1 ? 0.5F : 0.0F;
|
||||||
|
float maxY = meta == 1 ? 1.0F : 0.5F;
|
||||||
|
this.setBlockBounds(0.0F, minY, 0F, 1.0F, maxY, 1.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int onBlockPlaced(World par1World, int blockX, int blockY, int blockZ, int side, float hitX, float hitY, float hitZ, int meta){
|
||||||
|
if (side == 1) return meta;
|
||||||
|
if (side == 0 || hitY >= 0.5F) return meta+1;
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(int side, int meta){
|
||||||
|
return this.fullBlock.getIcon(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int meta){
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ){
|
||||||
|
if(world.getBlock(x, y, z) == this.theBlock && ((side == 1 && world.getBlockMetadata(x, y, z) == 0) || (side == 0 && world.getBlockMetadata(x, y, z) == 1))){
|
||||||
|
if(world.setBlock(x, y, z, ((BlockSlabs)this.theBlock).fullBlock, 0, 3)){
|
||||||
|
world.playSoundEffect(x+0.5F, y+0.5F, z+0.5F, this.theBlock.stepSound.getBreakSound(), (this.theBlock.stepSound.getVolume()+1.0F)/2.0F, this.theBlock.stepSound.getPitch()*0.8F);
|
||||||
|
stack.stackSize--;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockStairs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockStair extends BlockStairs implements INameableItem{
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public BlockStair(Block block, String name){
|
||||||
|
super(block, 0);
|
||||||
|
this.name = name;
|
||||||
|
this.setLightOpacity(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(false);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return EnumRarity.uncommon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int meta){
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,118 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.blocks.metalists.TheWildPlants;
|
||||||
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockBush;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BlockWildPlant extends BlockBush implements INameableItem{
|
||||||
|
|
||||||
|
public static final TheWildPlants[] allWildPlants = TheWildPlants.values();
|
||||||
|
public IIcon[] textures = new IIcon[allWildPlants.length];
|
||||||
|
|
||||||
|
public BlockWildPlant(){
|
||||||
|
this.setStepSound(soundTypeGrass);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBlockStay(World world, int x, int y, int z){
|
||||||
|
return world.getBlockMetadata(x, y, z) == TheWildPlants.RICE.ordinal() ? world.getBlock(x, y-1, z).getMaterial() == Material.water : world.getBlock(x, y - 1, z).canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canSilkHarvest(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubBlocks(Item item, CreativeTabs tab, List list){
|
||||||
|
for (int j = 0; j < allWildPlants.length; j++){
|
||||||
|
list.add(new ItemStack(item, 1, j));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune){
|
||||||
|
return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getDrops(world, x, y, z, 7, fortune);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(int side, int metadata){
|
||||||
|
return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getIcon(0, 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return "blockWild";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public Item getItem(World world, int x, int y, int z){
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
return meta >= allWildPlants.length ? null : ((BlockPlant)allWildPlants[meta].wildVersionOf).seedItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TheItemBlock extends ItemBlock{
|
||||||
|
|
||||||
|
private Block theBlock;
|
||||||
|
|
||||||
|
public TheItemBlock(Block block){
|
||||||
|
super(block);
|
||||||
|
this.theBlock = block;
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumRarity getRarity(ItemStack stack){
|
||||||
|
return stack.getItemDamage() >= allWildPlants.length ? EnumRarity.common : allWildPlants[stack.getItemDamage()].rarity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack){
|
||||||
|
return this.getUnlocalizedName() + (stack.getItemDamage() >= allWildPlants.length ? " ERROR!" : allWildPlants[stack.getItemDamage()].getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||||
|
if(stack.getItemDamage() < allWildPlants.length) BlockUtil.addInformation(theBlock, list, 1, allWildPlants[stack.getItemDamage()].getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage){
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public IIcon getIconFromDamage(int meta){
|
||||||
|
return this.theBlock.getIcon(0, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
10
src/main/java/ellpeck/actuallyadditions/blocks/FluidAA.java
Normal file
10
src/main/java/ellpeck/actuallyadditions/blocks/FluidAA.java
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import net.minecraftforge.fluids.Fluid;
|
||||||
|
|
||||||
|
public class FluidAA extends Fluid{
|
||||||
|
|
||||||
|
public FluidAA(String fluidName){
|
||||||
|
super(fluidName);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,13 +1,22 @@
|
||||||
package ellpeck.actuallyadditions.blocks;
|
package ellpeck.actuallyadditions.blocks;
|
||||||
|
|
||||||
|
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
|
||||||
import ellpeck.actuallyadditions.util.BlockUtil;
|
import ellpeck.actuallyadditions.util.BlockUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.CompatUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import ellpeck.actuallyadditions.util.Util;
|
import ellpeck.actuallyadditions.util.Util;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
import net.minecraftforge.fluids.Fluid;
|
||||||
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
|
import org.apache.logging.log4j.Level;
|
||||||
|
|
||||||
public class InitBlocks{
|
public class InitBlocks{
|
||||||
|
|
||||||
public static Block blockCompost;
|
public static Block blockCompost;
|
||||||
public static Block blockMisc;
|
public static Block blockMisc;
|
||||||
|
public static Block blockWildPlant;
|
||||||
public static Block blockFeeder;
|
public static Block blockFeeder;
|
||||||
public static Block blockGiantChest;
|
public static Block blockGiantChest;
|
||||||
|
|
||||||
|
@ -26,9 +35,114 @@ public class InitBlocks{
|
||||||
public static Block blockPlacer;
|
public static Block blockPlacer;
|
||||||
public static Block blockDropper;
|
public static Block blockDropper;
|
||||||
|
|
||||||
|
public static Block blockRice;
|
||||||
|
public static Block blockCanola;
|
||||||
|
public static Block blockFlax;
|
||||||
|
public static Block blockCoffee;
|
||||||
|
|
||||||
|
public static Fluid fluidCanolaOil;
|
||||||
|
public static Block blockCanolaOil;
|
||||||
|
public static Fluid fluidOil;
|
||||||
|
public static Block blockOil;
|
||||||
|
|
||||||
|
public static Block blockCanolaPress;
|
||||||
|
public static Block blockFermentingBarrel;
|
||||||
|
|
||||||
|
public static Block blockCoalGenerator;
|
||||||
|
public static Block blockOilGenerator;
|
||||||
|
|
||||||
|
public static Block blockPhantomface;
|
||||||
|
public static Block blockPhantomPlacer;
|
||||||
|
public static Block blockPhantomBreaker;
|
||||||
|
public static Block blockPhantomLiquiface;
|
||||||
|
public static Block blockPhantomEnergyface;
|
||||||
|
|
||||||
|
public static Block blockFluidPlacer;
|
||||||
|
public static Block blockFluidCollector;
|
||||||
|
|
||||||
|
public static Block blockLavaFactoryController;
|
||||||
|
public static Block blockCoffeeMachine;
|
||||||
|
|
||||||
|
public static Block blockPhantomBooster;
|
||||||
|
|
||||||
|
public static Block blockEnergizer;
|
||||||
|
public static Block blockEnervator;
|
||||||
|
|
||||||
|
public static Block blockTestifiBucksGreenWall;
|
||||||
|
public static Block blockTestifiBucksWhiteWall;
|
||||||
|
public static Block blockTestifiBucksGreenStairs;
|
||||||
|
public static Block blockTestifiBucksWhiteStairs;
|
||||||
|
public static Block blockTestifiBucksGreenSlab;
|
||||||
|
public static Block blockTestifibucksWhiteSlab;
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
Util.logInfo("Initializing Blocks...");
|
Util.logInfo("Initializing Blocks...");
|
||||||
|
|
||||||
|
blockTestifiBucksGreenWall = new BlockGeneric("blockTestifiBucksGreenWall");
|
||||||
|
BlockUtil.register(blockTestifiBucksGreenWall, BlockGeneric.TheItemBlock.class);
|
||||||
|
blockTestifiBucksWhiteWall = new BlockGeneric("blockTestifiBucksWhiteWall");
|
||||||
|
BlockUtil.register(blockTestifiBucksWhiteWall, BlockGeneric.TheItemBlock.class);
|
||||||
|
blockTestifiBucksGreenStairs = new BlockStair(blockTestifiBucksGreenWall, "blockTestifiBucksGreenStairs");
|
||||||
|
BlockUtil.register(blockTestifiBucksGreenStairs, BlockStair.TheItemBlock.class);
|
||||||
|
blockTestifiBucksWhiteStairs = new BlockStair(blockTestifiBucksWhiteWall, "blockTestifiBucksWhiteStairs");
|
||||||
|
BlockUtil.register(blockTestifiBucksWhiteStairs, BlockStair.TheItemBlock.class);
|
||||||
|
blockTestifiBucksGreenSlab = new BlockSlabs("blockTestifiBucksGreenSlab", blockTestifiBucksGreenWall);
|
||||||
|
BlockUtil.register(blockTestifiBucksGreenSlab, BlockSlabs.TheItemBlock.class);
|
||||||
|
blockTestifibucksWhiteSlab = new BlockSlabs("blockTestifibucksWhiteSlab", blockTestifiBucksWhiteWall);
|
||||||
|
BlockUtil.register(blockTestifibucksWhiteSlab, BlockSlabs.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockEnergizer = new BlockEnergizer(true);
|
||||||
|
BlockUtil.register(blockEnergizer, BlockEnergizer.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockEnervator = new BlockEnergizer(false);
|
||||||
|
BlockUtil.register(blockEnervator, BlockEnergizer.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockLavaFactoryController = new BlockLavaFactoryController();
|
||||||
|
BlockUtil.register(blockLavaFactoryController, BlockLavaFactoryController.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockCanolaPress = new BlockCanolaPress();
|
||||||
|
BlockUtil.register(blockCanolaPress, BlockCanolaPress.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockPhantomface = new BlockPhantomface(BlockPhantomface.FACE);
|
||||||
|
BlockUtil.register(blockPhantomface, BlockPhantomface.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockPhantomPlacer = new BlockPhantomface(BlockPhantomface.PLACER);
|
||||||
|
BlockUtil.register(blockPhantomPlacer, BlockPhantomface.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockPhantomLiquiface = new BlockPhantomface(BlockPhantomface.LIQUIFACE);
|
||||||
|
BlockUtil.register(blockPhantomLiquiface, BlockPhantomface.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockPhantomEnergyface = new BlockPhantomface(BlockPhantomface.ENERGYFACE);
|
||||||
|
BlockUtil.register(blockPhantomEnergyface, BlockPhantomface.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockPhantomBreaker = new BlockPhantomface(BlockPhantomface.BREAKER);
|
||||||
|
BlockUtil.register(blockPhantomBreaker, BlockPhantomface.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockCoalGenerator = new BlockCoalGenerator();
|
||||||
|
BlockUtil.register(blockCoalGenerator, BlockCoalGenerator.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockOilGenerator = new BlockOilGenerator();
|
||||||
|
BlockUtil.register(blockOilGenerator, BlockOilGenerator.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockFermentingBarrel = new BlockFermentingBarrel();
|
||||||
|
BlockUtil.register(blockFermentingBarrel, BlockFermentingBarrel.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockRice = new BlockPlant("blockRice", 6, 1, 2);
|
||||||
|
BlockUtil.register(blockRice, BlockPlant.TheItemBlock.class, false);
|
||||||
|
CompatUtil.registerMFRPlant(blockRice);
|
||||||
|
|
||||||
|
blockCanola = new BlockPlant("blockCanola", 4, 3, 3);
|
||||||
|
BlockUtil.register(blockCanola, BlockPlant.TheItemBlock.class, false);
|
||||||
|
CompatUtil.registerMFRPlant(blockCanola);
|
||||||
|
|
||||||
|
blockFlax = new BlockPlant("blockFlax", 6, 2, 4);
|
||||||
|
BlockUtil.register(blockFlax, BlockPlant.TheItemBlock.class, false);
|
||||||
|
CompatUtil.registerMFRPlant(blockFlax);
|
||||||
|
|
||||||
|
blockCoffee = new BlockPlant("blockCoffee", 6, 2, 2);
|
||||||
|
BlockUtil.register(blockCoffee, BlockPlant.TheItemBlock.class, false);
|
||||||
|
CompatUtil.registerMFRPlant(blockCoffee);
|
||||||
|
|
||||||
blockCompost = new BlockCompost();
|
blockCompost = new BlockCompost();
|
||||||
BlockUtil.register(blockCompost, BlockCompost.TheItemBlock.class);
|
BlockUtil.register(blockCompost, BlockCompost.TheItemBlock.class);
|
||||||
|
|
||||||
|
@ -79,5 +193,70 @@ public class InitBlocks{
|
||||||
|
|
||||||
blockDropper = new BlockDropper();
|
blockDropper = new BlockDropper();
|
||||||
BlockUtil.register(blockDropper, BlockDropper.TheItemBlock.class);
|
BlockUtil.register(blockDropper, BlockDropper.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockFluidPlacer = new BlockFluidCollector(true);
|
||||||
|
BlockUtil.register(blockFluidPlacer, BlockFluidCollector.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockFluidCollector = new BlockFluidCollector(false);
|
||||||
|
BlockUtil.register(blockFluidCollector, BlockFluidCollector.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockCoffeeMachine = new BlockCoffeeMachine();
|
||||||
|
BlockUtil.register(blockCoffeeMachine, BlockCoffeeMachine.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockPhantomBooster = new BlockPhantomBooster();
|
||||||
|
BlockUtil.register(blockPhantomBooster, BlockPhantomBooster.TheItemBlock.class);
|
||||||
|
|
||||||
|
blockWildPlant = new BlockWildPlant();
|
||||||
|
BlockUtil.register(blockWildPlant, BlockWildPlant.TheItemBlock.class, false, BlockWildPlant.allWildPlants);
|
||||||
|
|
||||||
|
registerFluids();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerFluids(){
|
||||||
|
//Canola Fluid
|
||||||
|
String canolaOil = "canolaoil";
|
||||||
|
if(!FluidRegistry.isFluidRegistered(canolaOil) || ConfigBoolValues.PREVENT_CANOLA_OVERRIDE.isEnabled()){
|
||||||
|
fluidCanolaOil = new FluidAA(canolaOil).setDensity(1200).setViscosity(1500).setTemperature(300).setRarity(EnumRarity.uncommon);
|
||||||
|
FluidRegistry.registerFluid(fluidCanolaOil);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
errorAlreadyRegistered("Canola Oil Fluid");
|
||||||
|
}
|
||||||
|
fluidCanolaOil = FluidRegistry.getFluid(canolaOil);
|
||||||
|
|
||||||
|
//Canola Block
|
||||||
|
if(fluidCanolaOil.getBlock() == null || ConfigBoolValues.PREVENT_CANOLA_BLOCK_OVERRIDE.isEnabled()){
|
||||||
|
blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil");
|
||||||
|
BlockUtil.register(blockCanolaOil, BlockFluidFlowing.TheItemBlock.class, false);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
errorAlreadyRegistered("Canola Oil Block");
|
||||||
|
}
|
||||||
|
blockCanolaOil = fluidCanolaOil.getBlock();
|
||||||
|
|
||||||
|
//Oil Fluid
|
||||||
|
String oil = "oil";
|
||||||
|
if(!FluidRegistry.isFluidRegistered(oil) || ConfigBoolValues.PREVENT_OIL_OVERRIDE.isEnabled()){
|
||||||
|
fluidOil = new FluidAA(oil).setDensity(1200).setViscosity(1500).setTemperature(300).setRarity(EnumRarity.uncommon);
|
||||||
|
FluidRegistry.registerFluid(fluidOil);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
errorAlreadyRegistered("Oil Fluid");
|
||||||
|
}
|
||||||
|
fluidOil = FluidRegistry.getFluid(oil);
|
||||||
|
|
||||||
|
//Oil Block
|
||||||
|
if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){
|
||||||
|
blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil");
|
||||||
|
BlockUtil.register(blockOil, BlockFluidFlowing.TheItemBlock.class, false);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
errorAlreadyRegistered("Oil Block");
|
||||||
|
}
|
||||||
|
blockOil = fluidOil.getBlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void errorAlreadyRegistered(String str){
|
||||||
|
ModUtil.LOGGER.log(Level.WARN, str + " from Actually Additions is not getting used as it has already been registered by another Mod! If this causes Issues (which it shouldn't!), you can turn this off in the Config File!");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -10,7 +10,11 @@ public enum TheMiscBlocks implements INameableItem{
|
||||||
QUARTZ("BlackQuartz", EnumRarity.rare, "blockQuartzBlack"),
|
QUARTZ("BlackQuartz", EnumRarity.rare, "blockQuartzBlack"),
|
||||||
ORE_QUARTZ("OreBlackQuartz", EnumRarity.epic, "oreQuartzBlack"),
|
ORE_QUARTZ("OreBlackQuartz", EnumRarity.epic, "oreQuartzBlack"),
|
||||||
WOOD_CASING("WoodCasing", EnumRarity.common, "blockCasingWood"),
|
WOOD_CASING("WoodCasing", EnumRarity.common, "blockCasingWood"),
|
||||||
STONE_CASING("StoneCasing", EnumRarity.uncommon, "blockCasingStone");
|
STONE_CASING("StoneCasing", EnumRarity.uncommon, "blockCasingStone"),
|
||||||
|
CHARCOAL_BLOCK("Charcoal", EnumRarity.common, "blockCharcoal"),
|
||||||
|
ENDERPEARL_BLOCK("Enderpearl", EnumRarity.rare, "blockEnderpearl"),
|
||||||
|
LAVA_FACTORY_CASE("LavaFactoryCase", EnumRarity.uncommon, "blockLavaFactoryCase"),
|
||||||
|
ENDER_CASING("EnderCasing", EnumRarity.epic, "blockEnderCasing");
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
public final String oredictName;
|
public final String oredictName;
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks.metalists;
|
||||||
|
|
||||||
|
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||||
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.EnumRarity;
|
||||||
|
|
||||||
|
public enum TheWildPlants implements INameableItem{
|
||||||
|
|
||||||
|
CANOLA("Canola", EnumRarity.rare, "blockCanolaWild", InitBlocks.blockCanola),
|
||||||
|
FLAX("Flax", EnumRarity.rare, "blockFlaxWild", InitBlocks.blockFlax),
|
||||||
|
RICE("Rice", EnumRarity.rare, "blockRiceWild", InitBlocks.blockRice),
|
||||||
|
COFFEE("Coffee", EnumRarity.rare, "blockCoffeeWild", InitBlocks.blockCoffee);
|
||||||
|
|
||||||
|
public final String name;
|
||||||
|
public final String oredictName;
|
||||||
|
public final EnumRarity rarity;
|
||||||
|
public final Block wildVersionOf;
|
||||||
|
|
||||||
|
TheWildPlants(String name, EnumRarity rarity, String oredictName, Block wildVersionOf){
|
||||||
|
this.name = name;
|
||||||
|
this.rarity = rarity;
|
||||||
|
this.oredictName = oredictName;
|
||||||
|
this.wildVersionOf = wildVersionOf;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOredictName(){
|
||||||
|
return this.oredictName;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package ellpeck.actuallyadditions.blocks.render;
|
package ellpeck.actuallyadditions.blocks.render;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelBase;
|
import net.minecraft.client.model.ModelBase;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
public class ModelBaseAA extends ModelBase{
|
public class ModelBaseAA extends ModelBase{
|
||||||
|
|
||||||
|
@ -11,4 +12,12 @@ public class ModelBaseAA extends ModelBase{
|
||||||
public String getName(){
|
public String getName(){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void renderExtra(float f, TileEntity tile){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean doesRotate(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,137 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
|
|
||||||
|
public class ModelCoffeeMachine extends ModelBaseAA{
|
||||||
|
|
||||||
|
ModelRenderer p1;
|
||||||
|
ModelRenderer p2;
|
||||||
|
ModelRenderer p3;
|
||||||
|
ModelRenderer p4;
|
||||||
|
ModelRenderer p5;
|
||||||
|
ModelRenderer p6;
|
||||||
|
ModelRenderer p7;
|
||||||
|
ModelRenderer p8;
|
||||||
|
ModelRenderer p9;
|
||||||
|
ModelRenderer p10;
|
||||||
|
ModelRenderer p11;
|
||||||
|
ModelRenderer p12;
|
||||||
|
ModelRenderer p13;
|
||||||
|
|
||||||
|
public ModelCoffeeMachine(){
|
||||||
|
textureWidth = 128;
|
||||||
|
textureHeight = 128;
|
||||||
|
|
||||||
|
p1 = new ModelRenderer(this, 0, 0);
|
||||||
|
p1.addBox(0F, 0F, 0F, 10, 1, 14);
|
||||||
|
p1.setRotationPoint(-5F, 23F, -7F);
|
||||||
|
p1.setTextureSize(128, 128);
|
||||||
|
p1.mirror = true;
|
||||||
|
setRotation(p1, 0F, 0F, 0F);
|
||||||
|
p2 = new ModelRenderer(this, 49, 0);
|
||||||
|
p2.addBox(0F, 0F, 0F, 10, 8, 6);
|
||||||
|
p2.setRotationPoint(-5F, 15F, 1F);
|
||||||
|
p2.setTextureSize(128, 128);
|
||||||
|
p2.mirror = true;
|
||||||
|
setRotation(p2, 0F, 0F, 0F);
|
||||||
|
p3 = new ModelRenderer(this, 0, 16);
|
||||||
|
p3.addBox(0F, 0F, 0F, 10, 2, 11);
|
||||||
|
p3.setRotationPoint(-5F, 13F, -4F);
|
||||||
|
p3.setTextureSize(128, 128);
|
||||||
|
p3.mirror = true;
|
||||||
|
setRotation(p3, 0F, 0F, 0F);
|
||||||
|
p4 = new ModelRenderer(this, 43, 16);
|
||||||
|
p4.addBox(0F, 0F, 0F, 8, 3, 8);
|
||||||
|
p4.setRotationPoint(-4F, 10F, -1F);
|
||||||
|
p4.setTextureSize(128, 128);
|
||||||
|
p4.mirror = true;
|
||||||
|
setRotation(p4, 0F, 0F, 0F);
|
||||||
|
p5 = new ModelRenderer(this, 0, 30);
|
||||||
|
p5.addBox(0F, 0F, 0F, 2, 1, 2);
|
||||||
|
p5.setRotationPoint(-1F, 15F, -3.5F);
|
||||||
|
p5.setTextureSize(128, 128);
|
||||||
|
p5.mirror = true;
|
||||||
|
setRotation(p5, 0F, 0F, 0F);
|
||||||
|
p6 = new ModelRenderer(this, 82, 0);
|
||||||
|
p6.addBox(0F, 0F, 0F, 4, 5, 1);
|
||||||
|
p6.setRotationPoint(-2F, 17F, -1F);
|
||||||
|
p6.setTextureSize(128, 128);
|
||||||
|
p6.mirror = true;
|
||||||
|
setRotation(p6, 0F, 0F, 0F);
|
||||||
|
p7 = new ModelRenderer(this, 82, 0);
|
||||||
|
p7.addBox(0F, 0F, 0F, 4, 5, 1);
|
||||||
|
p7.setRotationPoint(-2F, 17F, -6F);
|
||||||
|
p7.setTextureSize(128, 128);
|
||||||
|
p7.mirror = true;
|
||||||
|
setRotation(p7, 0F, 0F, 0F);
|
||||||
|
p8 = new ModelRenderer(this, 82, 0);
|
||||||
|
p8.addBox(0F, 0F, 0F, 4, 5, 1);
|
||||||
|
p8.setRotationPoint(2F, 17F, -1F);
|
||||||
|
p8.setTextureSize(128, 128);
|
||||||
|
p8.mirror = true;
|
||||||
|
setRotation(p8, 0F, 1.570796F, 0F);
|
||||||
|
p9 = new ModelRenderer(this, 82, 0);
|
||||||
|
p9.addBox(0F, 0F, 0F, 4, 5, 1);
|
||||||
|
p9.setRotationPoint(-3F, 17F, -1F);
|
||||||
|
p9.setTextureSize(128, 128);
|
||||||
|
p9.mirror = true;
|
||||||
|
setRotation(p9, 0F, 1.570796F, 0F);
|
||||||
|
p10 = new ModelRenderer(this, 93, 0);
|
||||||
|
p10.addBox(0F, 0F, 0F, 4, 1, 4);
|
||||||
|
p10.setRotationPoint(-2F, 22F, -5F);
|
||||||
|
p10.setTextureSize(128, 128);
|
||||||
|
p10.mirror = true;
|
||||||
|
setRotation(p10, 0F, 0F, 0F);
|
||||||
|
p11 = new ModelRenderer(this, 82, 7);
|
||||||
|
p11.addBox(0F, 0F, 0F, 1, 1, 2);
|
||||||
|
p11.setRotationPoint(-4F, 18F, -4F);
|
||||||
|
p11.setTextureSize(128, 128);
|
||||||
|
p11.mirror = true;
|
||||||
|
setRotation(p11, 0F, 0F, 0F);
|
||||||
|
p12 = new ModelRenderer(this, 82, 7);
|
||||||
|
p12.addBox(0F, 0F, 0F, 1, 1, 2);
|
||||||
|
p12.setRotationPoint(-4F, 21F, -4F);
|
||||||
|
p12.setTextureSize(128, 128);
|
||||||
|
p12.mirror = true;
|
||||||
|
setRotation(p12, 0F, 0F, 0F);
|
||||||
|
p13 = new ModelRenderer(this, 89, 7);
|
||||||
|
p13.addBox(0F, 0F, 0F, 1, 2, 2);
|
||||||
|
p13.setRotationPoint(-5F, 19F, -4F);
|
||||||
|
p13.setTextureSize(128, 128);
|
||||||
|
p13.mirror = true;
|
||||||
|
setRotation(p13, 0F, 0F, 0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render(float f){
|
||||||
|
p1.render(f);
|
||||||
|
p2.render(f);
|
||||||
|
p3.render(f);
|
||||||
|
p4.render(f);
|
||||||
|
p5.render(f);
|
||||||
|
p6.render(f);
|
||||||
|
p7.render(f);
|
||||||
|
p8.render(f);
|
||||||
|
p9.render(f);
|
||||||
|
p10.render(f);
|
||||||
|
p11.render(f);
|
||||||
|
p12.render(f);
|
||||||
|
p13.render(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setRotation(ModelRenderer model, float x, float y, float z){
|
||||||
|
model.rotateAngleX = x;
|
||||||
|
model.rotateAngleY = y;
|
||||||
|
model.rotateAngleZ = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return "modelCoffeeMachine";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doesRotate(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package ellpeck.actuallyadditions.blocks.render;
|
||||||
|
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityCompost;
|
import ellpeck.actuallyadditions.tile.TileEntityCompost;
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
public class ModelCompost extends ModelBaseAA{
|
public class ModelCompost extends ModelBaseAA{
|
||||||
|
|
||||||
|
@ -43,15 +44,17 @@ public class ModelCompost extends ModelBaseAA{
|
||||||
this.innerDone.addBox(0.0F, 0.0F, 0.0F, 12, 13, 12, 0.0F);
|
this.innerDone.addBox(0.0F, 0.0F, 0.0F, 12, 13, 12, 0.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderExtra(float f, TileEntityCompost tile){
|
@Override
|
||||||
|
public void renderExtra(float f, TileEntity tile){
|
||||||
|
TileEntityCompost tileCompost = (TileEntityCompost)tile;
|
||||||
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||||
if(meta > 0 && meta <= tile.amountNeededToConvert){
|
if(meta > 0 && meta <= tileCompost.amountNeededToConvert){
|
||||||
int heightToDisplay = meta*13/tile.amountNeededToConvert;
|
int heightToDisplay = meta*13/tileCompost.amountNeededToConvert;
|
||||||
if(heightToDisplay > 13) heightToDisplay = 13;
|
if(heightToDisplay > 13) heightToDisplay = 13;
|
||||||
|
|
||||||
this.innerRawList[heightToDisplay-1].render(f);
|
this.innerRawList[heightToDisplay-1].render(f);
|
||||||
}
|
}
|
||||||
if(meta == tile.amountNeededToConvert+1){
|
if(meta == tileCompost.amountNeededToConvert+1){
|
||||||
this.innerDone.render(f);
|
this.innerDone.render(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,148 @@
|
||||||
|
package ellpeck.actuallyadditions.blocks.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
|
|
||||||
|
public class ModelPhantomBooster extends ModelBaseAA{
|
||||||
|
|
||||||
|
ModelRenderer s1;
|
||||||
|
ModelRenderer s2;
|
||||||
|
ModelRenderer s3;
|
||||||
|
ModelRenderer s4;
|
||||||
|
ModelRenderer s5;
|
||||||
|
ModelRenderer s6;
|
||||||
|
ModelRenderer s7;
|
||||||
|
ModelRenderer s8;
|
||||||
|
ModelRenderer s9;
|
||||||
|
ModelRenderer s10;
|
||||||
|
ModelRenderer s11;
|
||||||
|
ModelRenderer s12;
|
||||||
|
ModelRenderer s13;
|
||||||
|
ModelRenderer s14;
|
||||||
|
ModelRenderer s15;
|
||||||
|
|
||||||
|
public ModelPhantomBooster(){
|
||||||
|
textureWidth = 128;
|
||||||
|
textureHeight = 128;
|
||||||
|
|
||||||
|
s1 = new ModelRenderer(this, 0, 0);
|
||||||
|
s1.addBox(0F, 0F, 0F, 4, 16, 4);
|
||||||
|
s1.setRotationPoint(-2F, 8F, -2F);
|
||||||
|
s1.setTextureSize(128, 128);
|
||||||
|
s1.mirror = true;
|
||||||
|
setRotation(s1, 0F, 0F, 0F);
|
||||||
|
s2 = new ModelRenderer(this, 17, 0);
|
||||||
|
s2.addBox(0F, 0F, 0F, 6, 1, 6);
|
||||||
|
s2.setRotationPoint(-3F, 9F, -3F);
|
||||||
|
s2.setTextureSize(128, 128);
|
||||||
|
s2.mirror = true;
|
||||||
|
setRotation(s2, 0F, 0F, 0F);
|
||||||
|
s3 = new ModelRenderer(this, 17, 0);
|
||||||
|
s3.addBox(0F, 0F, 0F, 6, 1, 6);
|
||||||
|
s3.setRotationPoint(-3F, 22F, -3F);
|
||||||
|
s3.setTextureSize(128, 128);
|
||||||
|
s3.mirror = true;
|
||||||
|
setRotation(s3, 0F, 0F, 0F);
|
||||||
|
s4 = new ModelRenderer(this, 17, 8);
|
||||||
|
s4.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||||
|
s4.setRotationPoint(-3F, 10F, -4F);
|
||||||
|
s4.setTextureSize(128, 128);
|
||||||
|
s4.mirror = true;
|
||||||
|
setRotation(s4, 0F, 0F, 0F);
|
||||||
|
s5 = new ModelRenderer(this, 17, 8);
|
||||||
|
s5.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||||
|
s5.setRotationPoint(-3F, 10F, 3F);
|
||||||
|
s5.setTextureSize(128, 128);
|
||||||
|
s5.mirror = true;
|
||||||
|
setRotation(s5, 0F, 0F, 0F);
|
||||||
|
s6 = new ModelRenderer(this, 17, 8);
|
||||||
|
s6.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||||
|
s6.setRotationPoint(-4F, 10F, 3F);
|
||||||
|
s6.setTextureSize(128, 128);
|
||||||
|
s6.mirror = true;
|
||||||
|
setRotation(s6, 0F, 1.579523F, 0F);
|
||||||
|
s7 = new ModelRenderer(this, 17, 8);
|
||||||
|
s7.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||||
|
s7.setRotationPoint(3F, 10F, 3F);
|
||||||
|
s7.setTextureSize(128, 128);
|
||||||
|
s7.mirror = true;
|
||||||
|
setRotation(s7, 0F, 1.579523F, 0F);
|
||||||
|
s8 = new ModelRenderer(this, 17, 12);
|
||||||
|
s8.addBox(0F, 0F, 0F, 6, 8, 1);
|
||||||
|
s8.setRotationPoint(-3F, 12F, -5F);
|
||||||
|
s8.setTextureSize(128, 128);
|
||||||
|
s8.mirror = true;
|
||||||
|
setRotation(s8, 0F, 0F, 0F);
|
||||||
|
s9 = new ModelRenderer(this, 17, 12);
|
||||||
|
s9.addBox(0F, 0F, 0F, 6, 8, 1);
|
||||||
|
s9.setRotationPoint(-3F, 12F, 4F);
|
||||||
|
s9.setTextureSize(128, 128);
|
||||||
|
s9.mirror = true;
|
||||||
|
setRotation(s9, 0F, 0F, 0F);
|
||||||
|
s10 = new ModelRenderer(this, 17, 12);
|
||||||
|
s10.addBox(0F, 0F, 0F, 6, 8, 1);
|
||||||
|
s10.setRotationPoint(-5F, 12F, 3F);
|
||||||
|
s10.setTextureSize(128, 128);
|
||||||
|
s10.mirror = true;
|
||||||
|
setRotation(s10, 0F, 1.579523F, 0F);
|
||||||
|
s11 = new ModelRenderer(this, 17, 12);
|
||||||
|
s11.addBox(0F, 0F, 0F, 6, 8, 1);
|
||||||
|
s11.setRotationPoint(4F, 12F, 3F);
|
||||||
|
s11.setTextureSize(128, 128);
|
||||||
|
s11.mirror = true;
|
||||||
|
setRotation(s11, 0F, 1.579523F, 0F);
|
||||||
|
s12 = new ModelRenderer(this, 17, 8);
|
||||||
|
s12.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||||
|
s12.setRotationPoint(-4F, 20F, 3F);
|
||||||
|
s12.setTextureSize(128, 128);
|
||||||
|
s12.mirror = true;
|
||||||
|
setRotation(s12, 0F, 1.579523F, 0F);
|
||||||
|
s13 = new ModelRenderer(this, 17, 8);
|
||||||
|
s13.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||||
|
s13.setRotationPoint(-3F, 20F, 3F);
|
||||||
|
s13.setTextureSize(128, 128);
|
||||||
|
s13.mirror = true;
|
||||||
|
setRotation(s13, 0F, 0F, 0F);
|
||||||
|
s14 = new ModelRenderer(this, 17, 8);
|
||||||
|
s14.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||||
|
s14.setRotationPoint(3F, 20F, 3F);
|
||||||
|
s14.setTextureSize(128, 128);
|
||||||
|
s14.mirror = true;
|
||||||
|
setRotation(s14, 0F, 1.579523F, 0F);
|
||||||
|
s15 = new ModelRenderer(this, 17, 8);
|
||||||
|
s15.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||||
|
s15.setRotationPoint(-3F, 20F, -4F);
|
||||||
|
s15.setTextureSize(128, 128);
|
||||||
|
s15.mirror = true;
|
||||||
|
setRotation(s15, 0F, 0F, 0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render(float f){
|
||||||
|
s1.render(f);
|
||||||
|
s2.render(f);
|
||||||
|
s3.render(f);
|
||||||
|
s4.render(f);
|
||||||
|
s5.render(f);
|
||||||
|
s6.render(f);
|
||||||
|
s7.render(f);
|
||||||
|
s8.render(f);
|
||||||
|
s9.render(f);
|
||||||
|
s10.render(f);
|
||||||
|
s11.render(f);
|
||||||
|
s12.render(f);
|
||||||
|
s13.render(f);
|
||||||
|
s14.render(f);
|
||||||
|
s15.render(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName(){
|
||||||
|
return "modelPhantomBooster";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setRotation(ModelRenderer model, float x, float y, float z){
|
||||||
|
model.rotateAngleX = x;
|
||||||
|
model.rotateAngleY = y;
|
||||||
|
model.rotateAngleZ = z;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package ellpeck.actuallyadditions.blocks.render;
|
package ellpeck.actuallyadditions.blocks.render;
|
||||||
|
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityCompost;
|
|
||||||
import ellpeck.actuallyadditions.util.ModUtil;
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
@ -9,7 +8,7 @@ import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public class RenderTileEntity extends TileEntitySpecialRenderer{
|
public class RenderTileEntity extends TileEntitySpecialRenderer{
|
||||||
|
|
||||||
ModelBaseAA theModel;
|
public ModelBaseAA theModel;
|
||||||
|
|
||||||
public RenderTileEntity(ModelBaseAA model){
|
public RenderTileEntity(ModelBaseAA model){
|
||||||
this.theModel = model;
|
this.theModel = model;
|
||||||
|
@ -22,9 +21,16 @@ public class RenderTileEntity extends TileEntitySpecialRenderer{
|
||||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||||
GL11.glTranslatef(0.0F, -2.0F, 0.0F);
|
GL11.glTranslatef(0.0F, -2.0F, 0.0F);
|
||||||
this.bindTexture(new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/" + this.theModel.getName() + ".png"));
|
this.bindTexture(new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/" + this.theModel.getName() + ".png"));
|
||||||
theModel.render(0.0625F);
|
|
||||||
|
|
||||||
if(tile instanceof TileEntityCompost && theModel instanceof ModelCompost) ((ModelCompost)theModel).renderExtra(0.0625F, (TileEntityCompost)tile);
|
if(theModel.doesRotate()){
|
||||||
|
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||||
|
if(meta == 0) GL11.glRotatef(180F, 0F, 1F, 0F);
|
||||||
|
if(meta == 1) GL11.glRotatef(90F, 0F, 1F, 0F);
|
||||||
|
if(meta == 3) GL11.glRotatef(270F, 0F, 1F, 0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
theModel.render(0.0625F);
|
||||||
|
theModel.renderExtra(0.0625F, tile);
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
package ellpeck.actuallyadditions.communication;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||||
|
import ellpeck.actuallyadditions.items.ItemCoffee;
|
||||||
|
import ellpeck.actuallyadditions.recipe.GrinderRecipeManualRegistry;
|
||||||
|
import ellpeck.actuallyadditions.recipe.HairyBallHandler;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.Util;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import org.apache.logging.log4j.Level;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class InterModCommunications{
|
||||||
|
|
||||||
|
public static void processIMC(List<FMLInterModComms.IMCMessage> messages){
|
||||||
|
for(FMLInterModComms.IMCMessage message : messages){
|
||||||
|
if(message.key.equalsIgnoreCase("registerCrusherRecipe")){
|
||||||
|
NBTTagCompound compound = message.getNBTValue();
|
||||||
|
if(compound != null){
|
||||||
|
ItemStack input = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("input"));
|
||||||
|
ItemStack outputOne = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("outputOne"));
|
||||||
|
ItemStack outputTwo = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("outputTwo"));
|
||||||
|
int secondChance = compound.getInteger("secondChance");
|
||||||
|
|
||||||
|
if(input != null && outputOne != null){
|
||||||
|
GrinderRecipeManualRegistry.registerRecipe(input, outputOne, outputTwo, secondChance);
|
||||||
|
Util.logInfo("Crusher Recipe that was sent from Mod " + message.getSender() + " has been registered successfully: " + input.toString() + " -> " + outputOne.toString() + (outputTwo != null ? " + " + outputTwo.toString() + ", Second Chance: " + secondChance : ""));
|
||||||
|
}
|
||||||
|
else ModUtil.LOGGER.log(Level.ERROR, "Crusher Recipe that was sent from Mod " + message.getSender() + " could not be registered: It's missing an Input or an Output!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(message.key.equalsIgnoreCase("registerCoffeeMachineRecipe")){
|
||||||
|
NBTTagCompound compound = message.getNBTValue();
|
||||||
|
if(compound != null){
|
||||||
|
ItemStack input = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("input"));
|
||||||
|
int potionID = compound.getInteger("id");
|
||||||
|
int duration = compound.getInteger("duration");
|
||||||
|
int amplifier = compound.getInteger("amplifier");
|
||||||
|
int maxAmp = compound.getInteger("maxAmp");
|
||||||
|
|
||||||
|
if(input != null && potionID > 0 && duration > 0 && maxAmp > 0){
|
||||||
|
PotionEffect effect = new PotionEffect(potionID, duration, amplifier);
|
||||||
|
ItemCoffee.registerIngredient(new ItemCoffee.Ingredient(input, new PotionEffect[]{effect}, maxAmp));
|
||||||
|
Util.logInfo("Coffee Machine Recipe that was sent from Mod " + message.getSender() + " has been registered successfully: " + input.toString() + " -> " + effect.toString());
|
||||||
|
}
|
||||||
|
else ModUtil.LOGGER.log(Level.ERROR, "Coffee Machine Recipe that was sent from Mod " + message.getSender() + " could not be registered: It's missing an Input, a Potion ID, a Duration or a max Amplifier!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(message.key.equalsIgnoreCase("registerBallOfHairRecipe")){
|
||||||
|
NBTTagCompound compound = message.getNBTValue();
|
||||||
|
if(compound != null){
|
||||||
|
ItemStack output = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("output"));
|
||||||
|
int chance = compound.getInteger("chance");
|
||||||
|
|
||||||
|
if(output != null && chance > 0){
|
||||||
|
HairyBallHandler.addReturn(output, chance);
|
||||||
|
Util.logInfo("Ball Of Hair Recipe that was sent from Mod " + message.getSender() + " has been registered successfully: " + output.toString() + ", Chance: " + chance);
|
||||||
|
}
|
||||||
|
else ModUtil.LOGGER.log(Level.ERROR, "Ball Of Hair Recipe that was sent from Mod " + message.getSender() + " could not be registered: It's missing an Output or a Chance!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -11,7 +11,9 @@ public enum ConfigCategories{
|
||||||
MOB_DROPS("mob drops"),
|
MOB_DROPS("mob drops"),
|
||||||
WORLD_GEN("world gen"),
|
WORLD_GEN("world gen"),
|
||||||
POTION_RING_CRAFTING("ring crafting"),
|
POTION_RING_CRAFTING("ring crafting"),
|
||||||
OTHER("other");
|
OTHER("other"),
|
||||||
|
FLUIDS("fluids"),
|
||||||
|
DRILL_VALUES("drill values");
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ import java.io.File;
|
||||||
|
|
||||||
public class ConfigurationHandler{
|
public class ConfigurationHandler{
|
||||||
|
|
||||||
|
public static final String ISSUES_WARNING = " [THIS COULD CAUSE ISSUES, CHANGE AT YOUR OWN RISK!]";
|
||||||
|
|
||||||
public static void init(File configFile){
|
public static void init(File configFile){
|
||||||
Util.logInfo("Grabbing Configurations...");
|
Util.logInfo("Grabbing Configurations...");
|
||||||
Configuration config = new Configuration(configFile);
|
Configuration config = new Configuration(configFile);
|
||||||
|
|
|
@ -2,6 +2,7 @@ package ellpeck.actuallyadditions.config.values;
|
||||||
|
|
||||||
import ellpeck.actuallyadditions.config.ConfigCategories;
|
import ellpeck.actuallyadditions.config.ConfigCategories;
|
||||||
import ellpeck.actuallyadditions.config.ConfigValues;
|
import ellpeck.actuallyadditions.config.ConfigValues;
|
||||||
|
import ellpeck.actuallyadditions.config.ConfigurationHandler;
|
||||||
|
|
||||||
public enum ConfigBoolValues{
|
public enum ConfigBoolValues{
|
||||||
|
|
||||||
|
@ -20,9 +21,21 @@ public enum ConfigBoolValues{
|
||||||
PEARL_SHARD_DROP("Ender Pearl Shard", ConfigCategories.MOB_DROPS, true, "If the Ender Pearl Shard drops from Mobs"),
|
PEARL_SHARD_DROP("Ender Pearl Shard", ConfigCategories.MOB_DROPS, true, "If the Ender Pearl Shard drops from Mobs"),
|
||||||
EMERALD_SHARD_CROP("Emerald Shard", ConfigCategories.MOB_DROPS, true, "If the Emerald Shard drops from Mobs"),
|
EMERALD_SHARD_CROP("Emerald Shard", ConfigCategories.MOB_DROPS, true, "If the Emerald Shard drops from Mobs"),
|
||||||
|
|
||||||
DO_UPDATE_CHECK("Do Update Check", ConfigCategories.OTHER, true, "If Actually Additions should check for an Update on joining a World"),
|
DO_WAILA_INFO("Waila Display Info", ConfigCategories.OTHER, true, "If the Shift Description should display in Waila too"),
|
||||||
|
|
||||||
DO_CRUSHER_SPAM("Crusher Debug", ConfigCategories.OTHER, false, "Print out Crusher Recipe Initializing Debug");
|
DO_UPDATE_CHECK("Do Update Check", ConfigCategories.OTHER, true, "If Actually Additions should check for an Update on joining a World"),
|
||||||
|
DO_CRUSHER_SPAM("Crusher Debug", ConfigCategories.OTHER, false, "Print out Crusher Recipe Initializing Debug"),
|
||||||
|
DO_CAT_DROPS("Do Cat Drops", ConfigCategories.OTHER, true, "If Cats drop Hairy Balls on Occasion"),
|
||||||
|
|
||||||
|
DO_RICE_GEN("Rice Gen", ConfigCategories.WORLD_GEN, true, "If Rice should generate in the World"),
|
||||||
|
DO_CANOLA_GEN("Canola Gen", ConfigCategories.WORLD_GEN, true, "If Canola should generate in the World"),
|
||||||
|
DO_FLAX_GEN("Flax Gen", ConfigCategories.WORLD_GEN, true, "If Flax should generate in the World"),
|
||||||
|
DO_COFFEE_GEN("Coffee Gen", ConfigCategories.WORLD_GEN, true, "If Coffee should generate in the World"),
|
||||||
|
|
||||||
|
PREVENT_OIL_OVERRIDE("Oil Fluid Override", ConfigCategories.FLUIDS, false, "If not registering Oil Fluids from Actually Additions if other Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING),
|
||||||
|
PREVENT_CANOLA_OVERRIDE("Canola Oil Fluid Override", ConfigCategories.FLUIDS, false, "If not registering Canola Oil Fluids from Actually Additions if other Canola Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING),
|
||||||
|
PREVENT_OIL_BLOCK_OVERRIDE("Oil Block Override", ConfigCategories.FLUIDS, false, "If not registering Oil Blocks from Actually Additions if other Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING),
|
||||||
|
PREVENT_CANOLA_BLOCK_OVERRIDE("Canola Oil Block Override", ConfigCategories.FLUIDS, false, "If not registering Canola Oil Blocks from Actually Additions if other Canola Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING);
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
public final String category;
|
public final String category;
|
||||||
|
|
|
@ -60,7 +60,6 @@ public enum ConfigCrafting{
|
||||||
RING_WATER_BREATHING("Water Breathing Ring", ConfigCategories.POTION_RING_CRAFTING),
|
RING_WATER_BREATHING("Water Breathing Ring", ConfigCategories.POTION_RING_CRAFTING),
|
||||||
RING_INVISIBILITY("Invisibility Ring", ConfigCategories.POTION_RING_CRAFTING),
|
RING_INVISIBILITY("Invisibility Ring", ConfigCategories.POTION_RING_CRAFTING),
|
||||||
RING_NIGHT_VISION("Night Vision Ring", ConfigCategories.POTION_RING_CRAFTING),
|
RING_NIGHT_VISION("Night Vision Ring", ConfigCategories.POTION_RING_CRAFTING),
|
||||||
RING_SATURATION("Saturation Ring", ConfigCategories.POTION_RING_CRAFTING, false),
|
|
||||||
|
|
||||||
DOUGH("Dough", ConfigCategories.ITEMS_CRAFTING),
|
DOUGH("Dough", ConfigCategories.ITEMS_CRAFTING),
|
||||||
PAPER_CONE("Paper Cone", ConfigCategories.ITEMS_CRAFTING),
|
PAPER_CONE("Paper Cone", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
@ -68,7 +67,45 @@ public enum ConfigCrafting{
|
||||||
KNIFE_BLADE("Knife Blade", ConfigCategories.ITEMS_CRAFTING),
|
KNIFE_BLADE("Knife Blade", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
|
||||||
TOOL_EMERALD("Emerald Tools", ConfigCategories.ITEMS_CRAFTING),
|
TOOL_EMERALD("Emerald Tools", ConfigCategories.ITEMS_CRAFTING),
|
||||||
TOOL_OBSIDIAN("Obsidian Tools", ConfigCategories.ITEMS_CRAFTING);
|
TOOL_OBSIDIAN("Obsidian Tools", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
RICE_BREAD("Rice Bread", ConfigCategories.FOOD_CRAFTING),
|
||||||
|
RICE_DOUGH("Rice Dough", ConfigCategories.FOOD_CRAFTING),
|
||||||
|
|
||||||
|
RICE_GADGETS("Rice Gadgets", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
RESONANT_RICE("Resonant Rice", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
|
||||||
|
CANOLA_PRESS("Canola Press", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
FERMENTING_BARREL("Fermenting Barrel", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
COAL_GENERATOR("Coal Generator", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
OIL_GENERATOR("Oil Generator", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
PHANTOMFACE("Phantomface", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
PHANTOM_CONNECTOR("Phantom Connector", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
|
||||||
|
PHANTOM_ENERGYFACE("Phantom Energyface", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
PHANTOM_LIQUIFACE("Phantom Liquiface", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
PHANTOM_PLACER("Phantom Placer", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
PHANTOM_BREAKER("Phantom Breaker", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
LIQUID_PLACER("Liquid Placer", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
LIQUID_BREAKER("Liquid Collector", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
|
||||||
|
CUP("Cup", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
PAXELS("Paxels", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
|
||||||
|
ENDER_CASING("Ender Casing", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
PHANTOM_BOOSTER("Phantom Booster", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
COFFEE_MACHINE("Coffee Machine", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
LAVA_FACTORY("Lava Factory", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
|
||||||
|
DRILL("Drill", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
DRILL_SPEED("Drill Speed Upgrades", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
DRILL_FORTUNE("Drill Fortune Upgrades", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
DRILL_SIZE("Drill Size Upgrades", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
DRILL_PLACING("Drill Placing Upgrade", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
DRILL_SILK_TOUCH("Drill Silk Touch Upgrade", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
BATTERY("Battery", ConfigCategories.ITEMS_CRAFTING),
|
||||||
|
|
||||||
|
ENERGIZER("Energizer", ConfigCategories.BLOCKS_CRAFTING),
|
||||||
|
ENERVATOR("Enervator", ConfigCategories.BLOCKS_CRAFTING);
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
public final String category;
|
public final String category;
|
||||||
|
@ -87,5 +124,4 @@ public enum ConfigCrafting{
|
||||||
public boolean isEnabled(){
|
public boolean isEnabled(){
|
||||||
return ConfigValues.craftingValues[this.ordinal()];
|
return ConfigValues.craftingValues[this.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,9 @@ public enum ConfigFloatValues{
|
||||||
EMERALD_MAX_DAMAGE("Emerald: Damage", ConfigCategories.TOOL_VALUES, 5.0F, 0.1F, 50.0F, "How much damage an Emerald Tool deals"),
|
EMERALD_MAX_DAMAGE("Emerald: Damage", ConfigCategories.TOOL_VALUES, 5.0F, 0.1F, 50.0F, "How much damage an Emerald Tool deals"),
|
||||||
|
|
||||||
OBSIDIAN_SPEED("Obsidian: Efficiency", ConfigCategories.TOOL_VALUES, 4.0F, 1.0F, 20.0F, "How fast Obsidian Tools are"),
|
OBSIDIAN_SPEED("Obsidian: Efficiency", ConfigCategories.TOOL_VALUES, 4.0F, 1.0F, 20.0F, "How fast Obsidian Tools are"),
|
||||||
OBSIDIAN_MAX_DAMAGE("Obsidian: Damage", ConfigCategories.TOOL_VALUES, 2.0F, 0.1F, 50.0F, "How much damage an Obsidian Tool deals");
|
OBSIDIAN_MAX_DAMAGE("Obsidian: Damage", ConfigCategories.TOOL_VALUES, 2.0F, 0.1F, 50.0F, "How much damage an Obsidian Tool deals"),
|
||||||
|
|
||||||
|
DRILL_DAMAGE("Drill: Default Damage", ConfigCategories.DRILL_VALUES, 8.0F, 1.0F, 30.0F, "How much Damage the Drill does to an Entity");
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
public final String category;
|
public final String category;
|
||||||
|
|
|
@ -2,6 +2,7 @@ package ellpeck.actuallyadditions.config.values;
|
||||||
|
|
||||||
import ellpeck.actuallyadditions.config.ConfigCategories;
|
import ellpeck.actuallyadditions.config.ConfigCategories;
|
||||||
import ellpeck.actuallyadditions.config.ConfigValues;
|
import ellpeck.actuallyadditions.config.ConfigValues;
|
||||||
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
|
|
||||||
public enum ConfigIntValues{
|
public enum ConfigIntValues{
|
||||||
|
|
||||||
|
@ -12,14 +13,14 @@ public enum ConfigIntValues{
|
||||||
|
|
||||||
BLACK_QUARTZ_BASE_AMOUNT("Black Quartz Amount", ConfigCategories.WORLD_GEN, 3, 1, 50, "How big a Black Quartz Vein is at least"),
|
BLACK_QUARTZ_BASE_AMOUNT("Black Quartz Amount", ConfigCategories.WORLD_GEN, 3, 1, 50, "How big a Black Quartz Vein is at least"),
|
||||||
BLACK_QUARTZ_ADD_CHANCE("Black Quartz Additional Chance", ConfigCategories.WORLD_GEN, 3, 0, 50, "How much bigger than the Base Amount a Black Quartz Vein can get"),
|
BLACK_QUARTZ_ADD_CHANCE("Black Quartz Additional Chance", ConfigCategories.WORLD_GEN, 3, 0, 50, "How much bigger than the Base Amount a Black Quartz Vein can get"),
|
||||||
BLACK_QUARTZ_CHANCE("Black Quartz Chance", ConfigCategories.WORLD_GEN, 25, 1, 150, "How often the Black Quartz tries to generate"),
|
BLACK_QUARTZ_CHANCE("Black Quartz Chance", ConfigCategories.WORLD_GEN, 5, 1, 150, "How often the Black Quartz tries to generate"),
|
||||||
BLACK_QUARTZ_MIN_HEIGHT("Black Quartz Min Height", ConfigCategories.WORLD_GEN, 0, 0, 256, "How high the Black Quartz starts to generate"),
|
BLACK_QUARTZ_MIN_HEIGHT("Black Quartz Min Height", ConfigCategories.WORLD_GEN, 0, 0, 256, "How high the Black Quartz starts to generate"),
|
||||||
BLACK_QUARTZ_MAX_HEIGHT("Black Quartz Max Height", ConfigCategories.WORLD_GEN, 25, 0, 256, "How high the Black Quartz stops to generate at"),
|
BLACK_QUARTZ_MAX_HEIGHT("Black Quartz Max Height", ConfigCategories.WORLD_GEN, 25, 0, 256, "How high the Black Quartz stops to generate at"),
|
||||||
|
|
||||||
COMPOST_AMOUNT("Compost: Amount Needed To Convert", ConfigCategories.MACHINE_VALUES, 10, 1, 64, "How many items are needed in the Compost to convert to Fertilizer"),
|
COMPOST_AMOUNT("Compost: Amount Needed To Convert", ConfigCategories.MACHINE_VALUES, 10, 1, 64, "How many items are needed in the Compost to convert to Fertilizer"),
|
||||||
COMPOST_TIME("Compost: Conversion Time Needed", ConfigCategories.MACHINE_VALUES, 1000, 30, 10000, "How long the Compost needs to convert to Fertilizer"),
|
COMPOST_TIME("Compost: Conversion Time Needed", ConfigCategories.MACHINE_VALUES, 1000, 30, 10000, "How long the Compost needs to convert to Fertilizer"),
|
||||||
|
|
||||||
FISHER_TIME("Fishing Net: Time Needed", ConfigCategories.MACHINE_VALUES, 2000, 50, 50000, "How long it takes on Average until the Fishing Net catches a Fish"),
|
FISHER_TIME("Fishing Net: Time Needed", ConfigCategories.MACHINE_VALUES, 15000, 50, 500000, "How long it takes on Average until the Fishing Net catches a Fish"),
|
||||||
|
|
||||||
FEEDER_REACH("Feeder: Reach", ConfigCategories.MACHINE_VALUES, 5, 1, 20, "The Radius of Action of the Feeder"),
|
FEEDER_REACH("Feeder: Reach", ConfigCategories.MACHINE_VALUES, 5, 1, 20, "The Radius of Action of the Feeder"),
|
||||||
FEEDER_TIME("Feeder: Time Needed", ConfigCategories.MACHINE_VALUES, 100, 50, 5000, "The time spent between feeding animals with the Feeder"),
|
FEEDER_TIME("Feeder: Time Needed", ConfigCategories.MACHINE_VALUES, 100, 50, 5000, "The time spent between feeding animals with the Feeder"),
|
||||||
|
@ -35,18 +36,70 @@ public enum ConfigIntValues{
|
||||||
OBSIDIAN_USES("Obsidian: Max Uses", ConfigCategories.TOOL_VALUES, 8000, 50, 20000, "How often Obsidian Tools can be used"),
|
OBSIDIAN_USES("Obsidian: Max Uses", ConfigCategories.TOOL_VALUES, 8000, 50, 20000, "How often Obsidian Tools can be used"),
|
||||||
OBSIDIAN_ENCHANTABILITY("Obsidian: Enchantability", ConfigCategories.TOOL_VALUES, 15, 1, 30, "How enchantable an Obsidian Tool is"),
|
OBSIDIAN_ENCHANTABILITY("Obsidian: Enchantability", ConfigCategories.TOOL_VALUES, 15, 1, 30, "How enchantable an Obsidian Tool is"),
|
||||||
|
|
||||||
GRINDER_CRUSH_TIME("Crusher: Crush Time", ConfigCategories.MACHINE_VALUES, 200, 10, 1000, "How long the Crusher takes to crush an item"),
|
GRINDER_CRUSH_TIME("Crusher: Time", ConfigCategories.MACHINE_VALUES, 100, 10, 1000, "How long the Crusher takes to crush an item"),
|
||||||
GRINDER_DOUBLE_CRUSH_TIME("Double Crusher: Crush Time", ConfigCategories.MACHINE_VALUES, 300, 10, 1000, "How long the Double Crusher takes to crush an item"),
|
GRINDER_DOUBLE_CRUSH_TIME("Double Crusher: Time", ConfigCategories.MACHINE_VALUES, 150, 10, 1000, "How long the Double Crusher takes to crush an item"),
|
||||||
FURNACE_DOUBLE_SMELT_TIME("Double Furnace: Smelt Time", ConfigCategories.MACHINE_VALUES, 300, 10, 1000, "How long the Double Furnace takes to crush an item"),
|
FURNACE_DOUBLE_SMELT_TIME("Double Furnace: Time", ConfigCategories.MACHINE_VALUES, 80, 10, 1000, "How long the Double Furnace takes to crush an item"),
|
||||||
|
|
||||||
REPAIRER_SPEED_SLOWDOWN("Item Repairer: Speed Slowdown", ConfigCategories.MACHINE_VALUES, 2, 1, 100, "How much slower the Item Repairer repairs"),
|
REPAIRER_SPEED_SLOWDOWN("Repairer: Speed Slowdown", ConfigCategories.MACHINE_VALUES, 2, 1, 100, "How much slower the Item Repairer repairs"),
|
||||||
HEAT_COLLECTOR_BLOCKS("Heat Collector: Blocks Needed", ConfigCategories.MACHINE_VALUES, 4, 1, 5, "How many Blocks are needed for the Heat Collector to power Machines above it"),
|
HEAT_COLLECTOR_BLOCKS("Heat Collector: Blocks Needed", ConfigCategories.MACHINE_VALUES, 4, 1, 5, "How many Blocks are needed for the Heat Collector to power Machines above it"),
|
||||||
HEAT_COLLECTOR_LAVA_CHANCE("Heat Collector: Random Chance", ConfigCategories.MACHINE_VALUES, 10000, 10, 100000, "The Chance of the Heat Collector destroying a Lava Block around (Default Value 2000 meaning a 1/2000 Chance!)"),
|
HEAT_COLLECTOR_LAVA_CHANCE("Heat Collector: Random Chance", ConfigCategories.MACHINE_VALUES, 15000, 10, 100000, "The Chance of the Heat Collector destroying a Lava Block around (Default Value 2000 meaning a 1/2000 Chance!)"),
|
||||||
|
|
||||||
GLASS_TIME_NEEDED("Greenhouse Glass: Time Needed", ConfigCategories.MACHINE_VALUES, 1000, 10, 1000000, "The Time Needed for the Greenhouse Glass to grow a Plant below it"),
|
GLASS_TIME_NEEDED("Greenhouse Glass: Time", ConfigCategories.MACHINE_VALUES, 300, 1, 10000, "Time Needed for the Greenhouse Glass to grow a Plant below it"),
|
||||||
|
|
||||||
BREAKER_TIME_NEEDED("Breaker and Placer: Time Needed", ConfigCategories.MACHINE_VALUES, 15, 1, 10000, "The Time Needed for the Breaker and the Placer to place or break a Block"),
|
BREAKER_TIME_NEEDED("Breaker and Placer: Time Needed", ConfigCategories.MACHINE_VALUES, 15, 1, 10000, "The Time Needed for the Breaker and the Placer to place or break a Block"),
|
||||||
DROPPER_TIME_NEEDED("Dropper: Time Needed", ConfigCategories.MACHINE_VALUES, 10, 1, 10000, "The Time Needed for the Dropper to drop an Item");
|
DROPPER_TIME_NEEDED("Dropper: Time Needed", ConfigCategories.MACHINE_VALUES, 10, 1, 10000, "The Time Needed for the Dropper to drop an Item"),
|
||||||
|
|
||||||
|
CAT_DROP_CHANCE("Cat Drops: Chance", ConfigCategories.OTHER, 5000, 5, 10000000, "The 1 in X chance for a Hairy Ball to Drop from a Cat with X being this value"),
|
||||||
|
|
||||||
|
RICE_AMOUNT("Rice Amount", ConfigCategories.WORLD_GEN, 15, 1, 100, "The Chance of Rice generating"),
|
||||||
|
CANOLA_AMOUNT("Canola Amount", ConfigCategories.WORLD_GEN, 10, 1, 50, "The Chance of Canola generating"),
|
||||||
|
FLAX_AMOUNT("Flax Amount", ConfigCategories.WORLD_GEN, 8, 1, 50, "The Chance of Flax generating"),
|
||||||
|
COFFEE_AMOUNT("Coffee Amount", ConfigCategories.WORLD_GEN, 6, 1, 50, "The Chance of Coffee generating"),
|
||||||
|
|
||||||
|
GRINDER_ENERGY_USED("Energy Use: Crusher", ConfigCategories.MACHINE_VALUES, 40, 1, 500, "The Amount of Energy used by the Crusher per Tick"),
|
||||||
|
GRINDER_DOUBLE_ENERGY_USED("Energy Use: Double Crusher", ConfigCategories.MACHINE_VALUES, 60, 1, 500, "The Amount of Energy used by the Double Crusher per Tick"),
|
||||||
|
FURNACE_SOLAR_ENERGY_PRODUCED("Energy Production: Furnace Solar", ConfigCategories.MACHINE_VALUES, 15, 1, 500, "The Amount of Energy produced by the Solar per Tick"),
|
||||||
|
HEAT_COLLECTOR_ENERGY_PRODUCED("Energy Production: Heat Collectors", ConfigCategories.MACHINE_VALUES, 60, 1, 500, "The Amount of Energy produced by the Heat Collector per Tick"),
|
||||||
|
REPAIRER_ENERGY_USED("Energy Use: Repairer", ConfigCategories.MACHINE_VALUES, 1250, 1, 5000, "The Amount of Energy used by the Repairer per Tick"),
|
||||||
|
FURNACE_ENERGY_USED("Energy Use: Double Furnace", ConfigCategories.MACHINE_VALUES, 25, 1, 500, "The Amount of Energy used by the Double Furnace per Tick"),
|
||||||
|
|
||||||
|
PRESS_PROCESSING_TIME("Canola Press: Processing Time", ConfigCategories.MACHINE_VALUES, 30, 1, 1000, "The Amount of time it takes to process one Canola"),
|
||||||
|
PRESS_MB_PRODUCED("Canola Press: mB Produced", ConfigCategories.MACHINE_VALUES, 100, 1, 5000, "The Amount of Canola Oil produced from one Canola"),
|
||||||
|
PRESS_ENERGY_USED("Energy Use: Canola Press", ConfigCategories.MACHINE_VALUES, 35, 10, 500, "The Amount of Energy used by the Canola Press per Tick"),
|
||||||
|
|
||||||
|
BARREL_MB_PRODUCED("Fermenting Barrel: mB Produced", ConfigCategories.MACHINE_VALUES, 50, 1, 3000, "The Amount of mB produced by the Barrel per cycle"),
|
||||||
|
BARREL_PROCESSING_TIME("Fermenting Barrel: Processing Time", ConfigCategories.MACHINE_VALUES, 100, 1, 5000, "The Amount of time it takes to process one Canola Oil to Oil"),
|
||||||
|
COAL_GEN_ENERGY_PRODUCED("Coal Generator: Energy Produced", ConfigCategories.MACHINE_VALUES, 30, 1, 500, "The Amount of Energy generated by the Coal Generator"),
|
||||||
|
|
||||||
|
PHANTOMFACE_RANGE("Phantomface: Default Range", ConfigCategories.MACHINE_VALUES, 16, 3, 100, "The Default Range of the Phantomface"),
|
||||||
|
|
||||||
|
OIL_GEN_ENERGY_PRODUCED("Oil Generator: Energy Produced", ConfigCategories.MACHINE_VALUES, 76, 1, 500, "The Amount of Energy generated by the Oil Generator"),
|
||||||
|
OIL_GEN_FUEL_USED("Oil Generator: Fuel Usage", ConfigCategories.MACHINE_VALUES, 50, 1, 300, "The Amount of Fuel used per Burnup in the Oil Generator"),
|
||||||
|
OIL_GEN_BURN_TIME("Oil Generator: Burn Time", ConfigCategories.MACHINE_VALUES, 100, 1, 1000, "The Amount of Time Fuel keeps burning for"),
|
||||||
|
|
||||||
|
PHANTOM_PLACER_TIME("Phantom Placer and Breaker: Time Needed", ConfigCategories.MACHINE_VALUES, 30, 1, 500, "The Amount of Time a Phantom Placer/Breaker needs"),
|
||||||
|
PHANTOM_PLACER_RANGE("Phantom Placer and Breaker: Range", ConfigCategories.MACHINE_VALUES, 3, 1, 100, "The Default Range of the Phantom Placer/Breaker"),
|
||||||
|
|
||||||
|
LAVA_FACTORY_ENERGY_USED("Lava Factory: Energy Used", ConfigCategories.MACHINE_VALUES, 150000, 10, 3000000, "The amount of Energy used by the Lava Factory per Bucket of Lava produced"),
|
||||||
|
LAVA_FACTORY_TIME("Lava Factory: Production Time", ConfigCategories.MACHINE_VALUES, 200, 5, 10000, "The amount of time it takes for the Lava Factory to produce one Bucket"),
|
||||||
|
|
||||||
|
COFFEE_MACHINE_ENERGY_USED("Coffee Machine: Energy Use", ConfigCategories.MACHINE_VALUES, 150, 10, 3000, "The amount of Energy used by the Coffee Machine per Tick"),
|
||||||
|
COFFEE_CACHE_ADDED_PER_ITEM("Coffee Machine: Coffee added per Cup", ConfigCategories.MACHINE_VALUES, 1, 1, 300, "The amount of Coffee added by one Coffee Item in the Coffee Machine"),
|
||||||
|
COFFEE_CACHE_USED_PER_ITEM("Coffee Machine: Coffee used per Cup", ConfigCategories.MACHINE_VALUES, 10, 1, 300, "The amount of Coffee used to brew one Coffee in the Coffee Machine"),
|
||||||
|
COFFEE_MACHINE_TIME_USED("Coffee Machine: Time to Brew", ConfigCategories.MACHINE_VALUES, 500, 10, 10000, "The amount of time the Coffee Machine takes to brew a Coffee"),
|
||||||
|
COFFEE_MACHINE_WATER_USED("Coffee Machine: Water Used per Cup", ConfigCategories.MACHINE_VALUES, 500, 1, 4*FluidContainerRegistry.BUCKET_VOLUME, "The amount of Water the Coffee Machine uses per Cup"),
|
||||||
|
|
||||||
|
COFFEE_DRINK_AMOUNT("Coffee: Drink Amount", ConfigCategories.OTHER, 4, 1, 100, "How often a Coffee can be drunk from"),
|
||||||
|
DRILL_ENERGY_USE("Drill: Energy Use Per Block or Hit", ConfigCategories.DRILL_VALUES, 100, 5, 10000, "How much Energy the Drill uses per Block"),
|
||||||
|
|
||||||
|
DRILL_SPEED_EXTRA_USE("Speed Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 50, 0, 10000, "How much extra Energy the Speed Upgrade uses"),
|
||||||
|
DRILL_SPEED_II_EXTRA_USE("Speed II Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 75, 0, 10000, "How much extra Energy the Speed II Upgrade uses"),
|
||||||
|
DRILL_SPEED_III_EXTRA_USE("Speed III Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 175, 0, 10000, "How much extra Energy the Speed III Upgrade uses"),
|
||||||
|
DRILL_SILK_EXTRA_USE("Silk Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 30, 0, 10000, "How much extra Energy the Silk Upgrade uses"),
|
||||||
|
DRILL_FORTUNE_EXTRA_USE("Fortune Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 40, 0, 10000, "How much extra Energy the Fortune Upgrade uses"),
|
||||||
|
DRILL_FORTUNE_II_EXTRA_USE("Fortune II Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 60, 0, 10000, "How much extra Energy the Fortune II Upgrade uses"),
|
||||||
|
DRILL_THREE_BY_THREE_EXTRA_USE("3x3 Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 10, 0, 10000, "How much extra Energy the 3x3 Upgrade uses"),
|
||||||
|
DRILL_FIVE_BY_FIVE_EXTRA_USE("5x5 Upgrade: Extra Energy Use", ConfigCategories.DRILL_VALUES, 30, 0, 10000, "How much extra Energy the 5x5 Upgrade uses");
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
public final String category;
|
public final String category;
|
||||||
|
@ -67,5 +120,4 @@ public enum ConfigIntValues{
|
||||||
public int getValue(){
|
public int getValue(){
|
||||||
return ConfigValues.intValues[this.ordinal()];
|
return ConfigValues.intValues[this.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,10 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||||
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
|
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
|
||||||
import ellpeck.actuallyadditions.config.values.ConfigCrafting;
|
import ellpeck.actuallyadditions.config.values.ConfigCrafting;
|
||||||
|
import ellpeck.actuallyadditions.items.InitItems;
|
||||||
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
||||||
import ellpeck.actuallyadditions.util.INameableItem;
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
|
import ellpeck.actuallyadditions.util.Util;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -23,6 +25,13 @@ public class BlockCrafting{
|
||||||
'W', "plankWood",
|
'W', "plankWood",
|
||||||
'C', TheMiscBlocks.WOOD_CASING.getOredictName()));
|
'C', TheMiscBlocks.WOOD_CASING.getOredictName()));
|
||||||
|
|
||||||
|
//Charcoal Block
|
||||||
|
GameRegistry.addRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.CHARCOAL_BLOCK.ordinal()),
|
||||||
|
"CCC", "CCC", "CCC",
|
||||||
|
'C', new ItemStack(Items.coal, 1, 1));
|
||||||
|
GameRegistry.addShapelessRecipe(new ItemStack(Items.coal, 9, 1),
|
||||||
|
new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.CHARCOAL_BLOCK.ordinal()));
|
||||||
|
|
||||||
//Wood Casing
|
//Wood Casing
|
||||||
if(ConfigCrafting.WOOD_CASING.isEnabled())
|
if(ConfigCrafting.WOOD_CASING.isEnabled())
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()),
|
||||||
|
@ -31,6 +40,151 @@ public class BlockCrafting{
|
||||||
'R', "dustRedstone",
|
'R', "dustRedstone",
|
||||||
'S', "stickWood"));
|
'S', "stickWood"));
|
||||||
|
|
||||||
|
//Ender Casing
|
||||||
|
if(ConfigCrafting.ENDER_CASING.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()),
|
||||||
|
"WSW", "SRS", "WSW",
|
||||||
|
'W', TheMiscBlocks.ENDERPEARL_BLOCK.getOredictName(),
|
||||||
|
'R', TheMiscBlocks.QUARTZ.getOredictName(),
|
||||||
|
'S', Blocks.obsidian));
|
||||||
|
|
||||||
|
//Phantom Booster
|
||||||
|
if(ConfigCrafting.PHANTOM_BOOSTER.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockPhantomBooster),
|
||||||
|
"RDR", "DCD", "RDR",
|
||||||
|
'R', "dustRedstone",
|
||||||
|
'D', "gemDiamond",
|
||||||
|
'C', TheMiscBlocks.ENDER_CASING.getOredictName()));
|
||||||
|
|
||||||
|
//Coffee Machine
|
||||||
|
if(ConfigCrafting.COFFEE_MACHINE.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockCoffeeMachine),
|
||||||
|
" C ", " S ", "A A",
|
||||||
|
'C', ((INameableItem)InitItems.itemCoffeeBean).getOredictName(),
|
||||||
|
'S', TheMiscBlocks.STONE_CASING.getOredictName(),
|
||||||
|
'A', TheMiscItems.COIL.getOredictName()));
|
||||||
|
|
||||||
|
//Energizer
|
||||||
|
if(ConfigCrafting.ENERGIZER.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockEnergizer),
|
||||||
|
"I I", "CAC", "I I",
|
||||||
|
'I', "ingotIron",
|
||||||
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName(),
|
||||||
|
'A', TheMiscBlocks.STONE_CASING.getOredictName()));
|
||||||
|
|
||||||
|
//Energizer
|
||||||
|
if(ConfigCrafting.ENERVATOR.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockEnervator),
|
||||||
|
" I ", "CAC", " I ",
|
||||||
|
'I', "ingotIron",
|
||||||
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName(),
|
||||||
|
'A', TheMiscBlocks.STONE_CASING.getOredictName()));
|
||||||
|
|
||||||
|
//Lava Factory
|
||||||
|
if(ConfigCrafting.LAVA_FACTORY.isEnabled()){
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockLavaFactoryController),
|
||||||
|
" C ", "ISI", " L ",
|
||||||
|
'C', TheMiscBlocks.STONE_CASING.getOredictName(),
|
||||||
|
'S', TheMiscItems.COIL_ADVANCED.getOredictName(),
|
||||||
|
'I', "blockIron",
|
||||||
|
'L', Items.lava_bucket));
|
||||||
|
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 4, TheMiscBlocks.LAVA_FACTORY_CASE.ordinal()),
|
||||||
|
"ICI",
|
||||||
|
'C', TheMiscBlocks.STONE_CASING.getOredictName(),
|
||||||
|
'I', "blockIron"));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Canola Press
|
||||||
|
if(ConfigCrafting.CANOLA_PRESS.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockCanolaPress),
|
||||||
|
"CHC", "CDC", "CRC",
|
||||||
|
'C', "cobblestone",
|
||||||
|
'H', Blocks.hopper,
|
||||||
|
'R', TheMiscItems.COIL_ADVANCED.getOredictName(),
|
||||||
|
'D', TheMiscItems.CANOLA.getOredictName()));
|
||||||
|
|
||||||
|
//Fermenting Barrel
|
||||||
|
if(ConfigCrafting.FERMENTING_BARREL.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFermentingBarrel),
|
||||||
|
"CHC", "CDC", "CRC",
|
||||||
|
'C', "logWood",
|
||||||
|
'H', Blocks.hopper,
|
||||||
|
'R', TheMiscBlocks.WOOD_CASING.getOredictName(),
|
||||||
|
'D', TheMiscItems.CANOLA.getOredictName()));
|
||||||
|
|
||||||
|
//Phantomface
|
||||||
|
if(ConfigCrafting.PHANTOMFACE.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockPhantomface),
|
||||||
|
" C ", "EBE", " S ",
|
||||||
|
'E', Items.ender_eye,
|
||||||
|
'C', Blocks.chest,
|
||||||
|
'S', TheMiscItems.COIL_ADVANCED.getOredictName(),
|
||||||
|
'B', TheMiscBlocks.ENDERPEARL_BLOCK.getOredictName()));
|
||||||
|
|
||||||
|
//Phantom Placer
|
||||||
|
if(ConfigCrafting.PHANTOM_PLACER.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockPhantomPlacer),
|
||||||
|
((INameableItem)InitBlocks.blockPlacer).getOredictName(),
|
||||||
|
((INameableItem)InitBlocks.blockPhantomface).getOredictName()));
|
||||||
|
|
||||||
|
//Phantom Breaker
|
||||||
|
if(ConfigCrafting.PHANTOM_BREAKER.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockPhantomBreaker),
|
||||||
|
((INameableItem)InitBlocks.blockBreaker).getOredictName(),
|
||||||
|
((INameableItem)InitBlocks.blockPhantomface).getOredictName()));
|
||||||
|
|
||||||
|
//Phantom Energyface
|
||||||
|
if(ConfigCrafting.PHANTOM_ENERGYFACE.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockPhantomEnergyface),
|
||||||
|
" R ", "RFR", " R ",
|
||||||
|
'R', "dustRedstone",
|
||||||
|
'F', ((INameableItem)InitBlocks.blockPhantomface).getOredictName()));
|
||||||
|
|
||||||
|
//Phantom Liquiface
|
||||||
|
if(ConfigCrafting.PHANTOM_LIQUIFACE.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockPhantomLiquiface),
|
||||||
|
"RFR",
|
||||||
|
'R', Items.bucket,
|
||||||
|
'F', ((INameableItem)InitBlocks.blockPhantomface).getOredictName()));
|
||||||
|
|
||||||
|
//Liquid Placer
|
||||||
|
if(ConfigCrafting.LIQUID_PLACER.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFluidPlacer),
|
||||||
|
"RFR",
|
||||||
|
'R', Items.bucket,
|
||||||
|
'F', ((INameableItem)InitBlocks.blockPlacer).getOredictName()));
|
||||||
|
|
||||||
|
//Liquid Breaker
|
||||||
|
if(ConfigCrafting.LIQUID_BREAKER.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFluidCollector),
|
||||||
|
"RFR",
|
||||||
|
'R', Items.bucket,
|
||||||
|
'F', ((INameableItem)InitBlocks.blockBreaker).getOredictName()));
|
||||||
|
|
||||||
|
//Oil Generator
|
||||||
|
if(ConfigCrafting.OIL_GENERATOR.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockOilGenerator),
|
||||||
|
"CRC", "CBC", "CRC",
|
||||||
|
'C', "cobblestone",
|
||||||
|
'R', TheMiscBlocks.STONE_CASING.getOredictName(),
|
||||||
|
'B', InitItems.itemBucketOil));
|
||||||
|
|
||||||
|
//Coal Generator
|
||||||
|
if(ConfigCrafting.COAL_GENERATOR.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockCoalGenerator),
|
||||||
|
"CRC", "CBC", "CRC",
|
||||||
|
'C', "cobblestone",
|
||||||
|
'R', TheMiscBlocks.STONE_CASING.getOredictName(),
|
||||||
|
'B', new ItemStack(Items.coal, 1, Util.WILDCARD)));
|
||||||
|
|
||||||
|
//Enderpearl Block
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()),
|
||||||
|
"EE", "EE",
|
||||||
|
'E', Items.ender_pearl));
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.ender_pearl, 4),
|
||||||
|
TheMiscBlocks.ENDERPEARL_BLOCK.getOredictName()));
|
||||||
|
|
||||||
//Stone Casing
|
//Stone Casing
|
||||||
if(ConfigCrafting.STONE_CASING.isEnabled())
|
if(ConfigCrafting.STONE_CASING.isEnabled())
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.STONE_CASING.ordinal()),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.STONE_CASING.ordinal()),
|
||||||
|
@ -61,25 +215,25 @@ public class BlockCrafting{
|
||||||
'C', TheMiscBlocks.STONE_CASING.getOredictName()));
|
'C', TheMiscBlocks.STONE_CASING.getOredictName()));
|
||||||
|
|
||||||
//Solar Panel
|
//Solar Panel
|
||||||
/*if(ConfigCrafting.SOLAR_PANEL.isEnabled())
|
if(ConfigCrafting.SOLAR_PANEL.isEnabled())
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFurnaceSolar),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFurnaceSolar),
|
||||||
"IQI", "CDC", "IBI",
|
"IQI", "CDC", "IBI",
|
||||||
'D', "blockDiamond",
|
'D', "blockDiamond",
|
||||||
'I', "ingotIron",
|
'I', "ingotIron",
|
||||||
'Q', TheMiscBlocks.STONE_CASING.getOredictName(),
|
'Q', TheMiscBlocks.STONE_CASING.getOredictName(),
|
||||||
'C', TheMiscItems.COIL_ADVANCED.getOredictName(),
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName(),
|
||||||
'B', new ItemStack(Blocks.iron_bars)));*/
|
'B', new ItemStack(Blocks.iron_bars)));
|
||||||
|
|
||||||
//Heat Collector
|
//Heat Collector
|
||||||
/*if(ConfigCrafting.HEAT_COLLECTOR.isEnabled())
|
if(ConfigCrafting.HEAT_COLLECTOR.isEnabled())
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockHeatCollector),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockHeatCollector),
|
||||||
"BRB", "CDC", "BQB",
|
"BRB", "CDC", "BQB",
|
||||||
'D', "blockDiamond",
|
'D', "gemDiamond",
|
||||||
'R', new ItemStack(Items.repeater),
|
'R', new ItemStack(Items.repeater),
|
||||||
'Q', TheMiscBlocks.STONE_CASING.getOredictName(),
|
'Q', TheMiscBlocks.STONE_CASING.getOredictName(),
|
||||||
'L', new ItemStack(Items.lava_bucket),
|
'L', new ItemStack(Items.lava_bucket),
|
||||||
'C', TheMiscItems.COIL_ADVANCED.getOredictName(),
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName(),
|
||||||
'B', new ItemStack(Blocks.iron_bars)));*/
|
'B', new ItemStack(Blocks.iron_bars)));
|
||||||
|
|
||||||
//Quartz Pillar
|
//Quartz Pillar
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal()),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal()),
|
||||||
|
@ -158,7 +312,7 @@ public class BlockCrafting{
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGreenhouseGlass),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGreenhouseGlass),
|
||||||
"GSG", "SDS", "GSG",
|
"GSG", "SDS", "GSG",
|
||||||
'G', "blockGlass",
|
'G', "blockGlass",
|
||||||
'D', "gemDiamond",
|
'D', Blocks.obsidian,
|
||||||
'S', "treeSapling"));
|
'S', "treeSapling"));
|
||||||
|
|
||||||
//Placer
|
//Placer
|
||||||
|
@ -175,7 +329,7 @@ public class BlockCrafting{
|
||||||
"CCC", "CRP", "CCC",
|
"CCC", "CRP", "CCC",
|
||||||
'C', "cobblestone",
|
'C', "cobblestone",
|
||||||
'R', TheMiscItems.COIL.getOredictName(),
|
'R', TheMiscItems.COIL.getOredictName(),
|
||||||
'P', Items.diamond_pickaxe));
|
'P', Items.iron_pickaxe));
|
||||||
|
|
||||||
//Dropper
|
//Dropper
|
||||||
if(ConfigCrafting.DROPPER.isEnabled())
|
if(ConfigCrafting.DROPPER.isEnabled())
|
||||||
|
|
|
@ -19,6 +19,11 @@ public class FoodCrafting{
|
||||||
|
|
||||||
String knifeStack = ((INameableItem)InitItems.itemKnife).getOredictName();
|
String knifeStack = ((INameableItem)InitItems.itemKnife).getOredictName();
|
||||||
|
|
||||||
|
//Rice Bread
|
||||||
|
if(ConfigCrafting.RICE_BREAD.isEnabled())
|
||||||
|
GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RICE_DOUGH.ordinal()),
|
||||||
|
new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE_BREAD.ordinal()), 1F);
|
||||||
|
|
||||||
//Baguette
|
//Baguette
|
||||||
if(ConfigCrafting.BAGUETTE.isEnabled())
|
if(ConfigCrafting.BAGUETTE.isEnabled())
|
||||||
GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1,
|
GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1,
|
||||||
|
@ -113,7 +118,7 @@ public class FoodCrafting{
|
||||||
|
|
||||||
//Chocolate
|
//Chocolate
|
||||||
if(ConfigCrafting.CHOCOLATE.isEnabled())
|
if(ConfigCrafting.CHOCOLATE.isEnabled())
|
||||||
GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE.ordinal()),
|
GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 3, TheFoods.CHOCOLATE.ordinal()),
|
||||||
"C C", "CMC", "C C",
|
"C C", "CMC", "C C",
|
||||||
'C', new ItemStack(Items.dye, 1, 3),
|
'C', new ItemStack(Items.dye, 1, 3),
|
||||||
'M', new ItemStack(Items.milk_bucket));
|
'M', new ItemStack(Items.milk_bucket));
|
||||||
|
|
|
@ -2,10 +2,10 @@ package ellpeck.actuallyadditions.crafting;
|
||||||
|
|
||||||
import ellpeck.actuallyadditions.items.InitItems;
|
import ellpeck.actuallyadditions.items.InitItems;
|
||||||
import ellpeck.actuallyadditions.items.metalists.TheDusts;
|
import ellpeck.actuallyadditions.items.metalists.TheDusts;
|
||||||
import ellpeck.actuallyadditions.recipe.GrinderRecipeHandler;
|
import ellpeck.actuallyadditions.items.metalists.TheFoods;
|
||||||
import ellpeck.actuallyadditions.recipe.GrinderRecipeHandler.SearchCase;
|
import ellpeck.actuallyadditions.recipe.GrinderRecipeAutoRegistry;
|
||||||
import ellpeck.actuallyadditions.recipe.GrinderRecipeHandler.SpecialOreCase;
|
import ellpeck.actuallyadditions.recipe.GrinderRecipeAutoRegistry.SearchCase;
|
||||||
import ellpeck.actuallyadditions.recipe.GrinderRecipes;
|
import ellpeck.actuallyadditions.recipe.GrinderRecipeManualRegistry;
|
||||||
import ellpeck.actuallyadditions.util.Util;
|
import ellpeck.actuallyadditions.util.Util;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
|
@ -13,25 +13,31 @@ import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class GrinderCrafting{
|
public class GrinderCrafting{
|
||||||
|
|
||||||
private static GrinderRecipeHandler grindRecHan = GrinderRecipeHandler.instance();
|
|
||||||
private static GrinderRecipes grindRec = GrinderRecipes.instance();
|
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
Util.logInfo("Initializing Crusher Recipes...");
|
Util.logInfo("Initializing Crusher Recipes...");
|
||||||
|
|
||||||
grindRec.registerRecipe(new ItemStack(Blocks.iron_ore), new ItemStack(InitItems.itemDust, 2, TheDusts.IRON.ordinal()), new ItemStack(InitItems.itemDust, 1, TheDusts.GOLD.ordinal()), 10);
|
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 10));
|
||||||
grindRec.registerRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 10), null, 0);
|
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.lapis_ore), new ItemStack(InitItems.itemDust, 12, TheDusts.LAPIS.ordinal()));
|
||||||
grindRec.registerRecipe(new ItemStack(Blocks.lapis_ore), new ItemStack(InitItems.itemDust, 12, TheDusts.LAPIS.ordinal()), null, 0);
|
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Items.coal), new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()));
|
||||||
grindRecHan.specialOreCases.add(new SpecialOreCase("oreNickel", "dustPlatinum", 30));
|
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.coal_block), new ItemStack(InitItems.itemDust, 9, TheDusts.COAL.ordinal()));
|
||||||
|
|
||||||
grindRecHan.searchCases.add(new SearchCase("ore", 2));
|
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.sand));
|
||||||
grindRecHan.searchCases.add(new SearchCase("oreNether", 6));
|
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint));
|
||||||
grindRecHan.searchCases.add(new SearchCase("denseore", 8));
|
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone));
|
||||||
grindRecHan.searchCases.add(new SearchCase("gem", 1));
|
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.sugar, 2));
|
||||||
grindRecHan.searchCases.add(new SearchCase("ingot", 1));
|
|
||||||
grindRecHan.exceptions.add("ingotBrick");
|
|
||||||
grindRecHan.exceptions.add("ingotBrickNether");
|
|
||||||
|
|
||||||
grindRecHan.registerFinally();
|
GrinderRecipeManualRegistry.registerRecipe("oreNickel", "dustNickel", "dustPlatinum", 30, 2);
|
||||||
|
GrinderRecipeManualRegistry.registerRecipe("oreIron", "dustIron", "dustGold", 20, 2);
|
||||||
|
|
||||||
|
GrinderRecipeAutoRegistry.searchCases.add(new SearchCase("oreNether", 6));
|
||||||
|
GrinderRecipeAutoRegistry.searchCases.add(new SearchCase("denseore", 8));
|
||||||
|
GrinderRecipeAutoRegistry.searchCases.add(new SearchCase("gem", 1));
|
||||||
|
GrinderRecipeAutoRegistry.searchCases.add(new SearchCase("ingot", 1));
|
||||||
|
GrinderRecipeAutoRegistry.searchCases.add(new SearchCase("ore", 2));
|
||||||
|
|
||||||
|
GrinderRecipeAutoRegistry.exceptions.add("ingotBrick");
|
||||||
|
GrinderRecipeAutoRegistry.exceptions.add("ingotBrickNether");
|
||||||
|
|
||||||
|
GrinderRecipeAutoRegistry.registerFinally();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ public class InitCrafting {
|
||||||
MiscCrafting.init();
|
MiscCrafting.init();
|
||||||
FoodCrafting.init();
|
FoodCrafting.init();
|
||||||
ToolCrafting.init();
|
ToolCrafting.init();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,16 +5,16 @@ import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||||
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
|
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
|
||||||
import ellpeck.actuallyadditions.config.values.ConfigCrafting;
|
import ellpeck.actuallyadditions.config.values.ConfigCrafting;
|
||||||
import ellpeck.actuallyadditions.items.InitItems;
|
import ellpeck.actuallyadditions.items.InitItems;
|
||||||
import ellpeck.actuallyadditions.items.metalists.TheDusts;
|
import ellpeck.actuallyadditions.items.metalists.*;
|
||||||
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
import ellpeck.actuallyadditions.items.metalists.ThePotionRings;
|
|
||||||
import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops;
|
|
||||||
import ellpeck.actuallyadditions.util.Util;
|
import ellpeck.actuallyadditions.util.Util;
|
||||||
|
import net.minecraft.block.IGrowable;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemFood;
|
import net.minecraft.item.ItemFood;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.common.IPlantable;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||||
|
|
||||||
|
@ -22,7 +22,22 @@ public class ItemCrafting{
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
|
|
||||||
//Leaf Blower
|
//Rice Stuff
|
||||||
|
if(ConfigCrafting.RICE_GADGETS.isEnabled()){
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.paper, 3),
|
||||||
|
"RRR",
|
||||||
|
'R', TheFoods.RICE.getOredictName()));
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 4, TheMiscItems.RICE_SLIME.ordinal()),
|
||||||
|
" R ", "RBR", " R ",
|
||||||
|
'R', TheMiscItems.RICE_DOUGH.getOredictName(),
|
||||||
|
'B', Items.water_bucket));
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 4, TheMiscItems.RICE_SLIME.ordinal()),
|
||||||
|
" R ", "RBR", " R ",
|
||||||
|
'R', TheMiscItems.RICE_DOUGH.getOredictName(),
|
||||||
|
'B', new ItemStack(Items.potionitem)));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Leaf Blower
|
||||||
if(ConfigCrafting.LEAF_BLOWER.isEnabled())
|
if(ConfigCrafting.LEAF_BLOWER.isEnabled())
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLeafBlower),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLeafBlower),
|
||||||
" F", "IP", "IC",
|
" F", "IP", "IC",
|
||||||
|
@ -31,6 +46,91 @@ public class ItemCrafting{
|
||||||
'P', new ItemStack(Blocks.piston),
|
'P', new ItemStack(Blocks.piston),
|
||||||
'C', TheMiscItems.COIL_ADVANCED.getOredictName()));
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName()));
|
||||||
|
|
||||||
|
//Drill
|
||||||
|
if(ConfigCrafting.DRILL.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrill),
|
||||||
|
"DDD", "CRC", "III",
|
||||||
|
'D', "gemDiamond",
|
||||||
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName(),
|
||||||
|
'R', "dustRedstone",
|
||||||
|
'I', "blockIron"));
|
||||||
|
|
||||||
|
//Drill Speed
|
||||||
|
if(ConfigCrafting.DRILL_SPEED.isEnabled()){
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeed),
|
||||||
|
"ISI", "SRS", "ISI",
|
||||||
|
'I', "ingotIron",
|
||||||
|
'S', Items.sugar,
|
||||||
|
'R', "dustRedstone"));
|
||||||
|
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeedII),
|
||||||
|
"ISI", "SCS", "ISI",
|
||||||
|
'I', "ingotIron",
|
||||||
|
'S', Items.sugar,
|
||||||
|
'C', Items.cake));
|
||||||
|
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeedIII),
|
||||||
|
"ISI", "SFS", "ISI",
|
||||||
|
'I', "ingotIron",
|
||||||
|
'S', Items.sugar,
|
||||||
|
'F', "gemDiamond"));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Drill Fortune
|
||||||
|
if(ConfigCrafting.DRILL_FORTUNE.isEnabled()){
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeFortune),
|
||||||
|
"ISI", "SRS", "ISI",
|
||||||
|
'I', Blocks.glowstone,
|
||||||
|
'S', Items.redstone,
|
||||||
|
'R', Blocks.diamond_block));
|
||||||
|
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeFortuneII),
|
||||||
|
"ISI", "SRS", "ISI",
|
||||||
|
'I', Blocks.glowstone,
|
||||||
|
'S', Items.redstone,
|
||||||
|
'R', TheMiscBlocks.ENDER_CASING.getOredictName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Drill Size
|
||||||
|
if(ConfigCrafting.DRILL_SIZE.isEnabled()){
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeThreeByThree),
|
||||||
|
"DID", "ICI", "DID",
|
||||||
|
'I', "ingotIron",
|
||||||
|
'D', "gemDiamond",
|
||||||
|
'C', TheMiscItems.COIL.getOredictName()));
|
||||||
|
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeFiveByFive),
|
||||||
|
"DID", "ICI", "DID",
|
||||||
|
'I', "ingotIron",
|
||||||
|
'D', "gemDiamond",
|
||||||
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Drill Silk Touch
|
||||||
|
if(ConfigCrafting.DRILL_SILK_TOUCH.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeSilkTouch),
|
||||||
|
"DSD", "SCS", "DSD",
|
||||||
|
'D', "gemEmerald",
|
||||||
|
'S', "gemDiamond",
|
||||||
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName()));
|
||||||
|
|
||||||
|
//Drill Placing
|
||||||
|
if(ConfigCrafting.DRILL_PLACING.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeBlockPlacing),
|
||||||
|
"CEC", "RAR", "CEC",
|
||||||
|
'C', "cobblestone",
|
||||||
|
'E', Items.ender_pearl,
|
||||||
|
'A', TheMiscItems.COIL.getOredictName(),
|
||||||
|
'R', "ingotIron"));
|
||||||
|
|
||||||
|
//Battery
|
||||||
|
if(ConfigCrafting.BATTERY.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemBattery),
|
||||||
|
" R ", "ICI", "III",
|
||||||
|
'R', "dustRedstone",
|
||||||
|
'I', "ingotIron",
|
||||||
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName()));
|
||||||
|
|
||||||
//Coil
|
//Coil
|
||||||
if(ConfigCrafting.COIL.isEnabled())
|
if(ConfigCrafting.COIL.isEnabled())
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()),
|
||||||
|
@ -38,6 +138,64 @@ public class ItemCrafting{
|
||||||
'I', "ingotIron",
|
'I', "ingotIron",
|
||||||
'R', "dustRedstone"));
|
'R', "dustRedstone"));
|
||||||
|
|
||||||
|
//Cup
|
||||||
|
if(ConfigCrafting.CUP.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()),
|
||||||
|
"S S", "SCS", "SSS",
|
||||||
|
'S', "stone",
|
||||||
|
'C', ((INameableItem)InitItems.itemCoffeeBean).getOredictName()));
|
||||||
|
|
||||||
|
//Paxels
|
||||||
|
if(ConfigCrafting.PAXELS.isEnabled()){
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.woodenPaxel),
|
||||||
|
new ItemStack(Items.wooden_axe),
|
||||||
|
new ItemStack(Items.wooden_pickaxe),
|
||||||
|
new ItemStack(Items.wooden_shovel),
|
||||||
|
new ItemStack(Items.wooden_sword),
|
||||||
|
new ItemStack(Items.wooden_hoe)));
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.stonePaxel),
|
||||||
|
new ItemStack(Items.stone_axe),
|
||||||
|
new ItemStack(Items.stone_pickaxe),
|
||||||
|
new ItemStack(Items.stone_shovel),
|
||||||
|
new ItemStack(Items.stone_sword),
|
||||||
|
new ItemStack(Items.stone_hoe)));
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.ironPaxel),
|
||||||
|
new ItemStack(Items.iron_axe),
|
||||||
|
new ItemStack(Items.iron_pickaxe),
|
||||||
|
new ItemStack(Items.iron_shovel),
|
||||||
|
new ItemStack(Items.iron_sword),
|
||||||
|
new ItemStack(Items.iron_hoe)));
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.goldPaxel),
|
||||||
|
new ItemStack(Items.golden_axe),
|
||||||
|
new ItemStack(Items.golden_pickaxe),
|
||||||
|
new ItemStack(Items.golden_shovel),
|
||||||
|
new ItemStack(Items.golden_sword),
|
||||||
|
new ItemStack(Items.golden_hoe)));
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.diamondPaxel),
|
||||||
|
new ItemStack(Items.diamond_axe),
|
||||||
|
new ItemStack(Items.diamond_pickaxe),
|
||||||
|
new ItemStack(Items.diamond_shovel),
|
||||||
|
new ItemStack(Items.diamond_sword),
|
||||||
|
new ItemStack(Items.diamond_hoe)));
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.emeraldPaxel),
|
||||||
|
new ItemStack(InitItems.itemAxeEmerald),
|
||||||
|
new ItemStack(InitItems.itemPickaxeEmerald),
|
||||||
|
new ItemStack(InitItems.itemSwordEmerald),
|
||||||
|
new ItemStack(InitItems.itemShovelEmerald),
|
||||||
|
new ItemStack(InitItems.itemHoeEmerald)));
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.obsidianPaxel),
|
||||||
|
new ItemStack(InitItems.itemAxeObsidian),
|
||||||
|
new ItemStack(InitItems.itemPickaxeObsidian),
|
||||||
|
new ItemStack(InitItems.itemSwordObsidian),
|
||||||
|
new ItemStack(InitItems.itemShovelObsidian),
|
||||||
|
new ItemStack(InitItems.itemHoeObsidian)));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Resonant Rice
|
||||||
|
if(ConfigCrafting.RESONANT_RICE.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemResonantRice),
|
||||||
|
TheFoods.RICE.getOredictName(), "nuggetEnderium", Items.gunpowder));
|
||||||
|
|
||||||
//Advanced Coil
|
//Advanced Coil
|
||||||
if(ConfigCrafting.ADV_COIL.isEnabled())
|
if(ConfigCrafting.ADV_COIL.isEnabled())
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()),
|
||||||
|
@ -64,6 +222,14 @@ public class ItemCrafting{
|
||||||
'P', new ItemStack(Blocks.piston),
|
'P', new ItemStack(Blocks.piston),
|
||||||
'C', TheMiscItems.COIL_ADVANCED.getOredictName()));
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName()));
|
||||||
|
|
||||||
|
//Phantom Connector
|
||||||
|
if(ConfigCrafting.PHANTOM_CONNECTOR.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemPhantomConnector),
|
||||||
|
"YE", "EY", "S ",
|
||||||
|
'Y', Items.ender_eye,
|
||||||
|
'E', Items.ender_pearl,
|
||||||
|
'S', "stickWood"));
|
||||||
|
|
||||||
//Quartz
|
//Quartz
|
||||||
GameRegistry.addSmelting(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal()),
|
GameRegistry.addSmelting(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal()),
|
||||||
new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 1F);
|
new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 1F);
|
||||||
|
@ -76,22 +242,24 @@ public class ItemCrafting{
|
||||||
|
|
||||||
//Crafter on a Stick
|
//Crafter on a Stick
|
||||||
if(ConfigCrafting.STICK_CRAFTER.isEnabled())
|
if(ConfigCrafting.STICK_CRAFTER.isEnabled())
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemCrafterOnAStick),
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemCrafterOnAStick),
|
||||||
new ItemStack(Blocks.crafting_table),
|
new ItemStack(Blocks.crafting_table),
|
||||||
new ItemStack(Items.sign),
|
new ItemStack(Items.sign),
|
||||||
new ItemStack(Items.slime_ball));
|
"slimeball"));
|
||||||
|
|
||||||
//SpeedUpgrade
|
//Tiny Coal
|
||||||
if(ConfigCrafting.SPEED_UPGRADE.isEnabled())
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_COAL.ordinal()),
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemSpeedUpgrade, 2),
|
new ItemStack(Items.coal));
|
||||||
"RGR", "GUG", "RGR",
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_CHAR.ordinal()),
|
||||||
'U', TheMiscItems.COIL.getOredictName(),
|
new ItemStack(Items.coal, 1, 1));
|
||||||
'R', "dustRedstone",
|
|
||||||
'G', "ingotGold"));
|
|
||||||
|
|
||||||
//Mashed Food
|
//Rice Seeds
|
||||||
if(ConfigCrafting.MASHED_FOOD.isEnabled())
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemRiceSeed),
|
||||||
initMashedFoodRecipes();
|
new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()));
|
||||||
|
|
||||||
|
//Canola Seeds
|
||||||
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemCanolaSeed),
|
||||||
|
new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal()));
|
||||||
|
|
||||||
//Rings
|
//Rings
|
||||||
initPotionRingRecipes();
|
initPotionRingRecipes();
|
||||||
|
@ -133,20 +301,20 @@ public class ItemCrafting{
|
||||||
if(ConfigCrafting.RING_WATER_BREATHING.isEnabled()) addRingRecipeWithStack(ThePotionRings.WATER_BREATHING.craftingItem, ThePotionRings.WATER_BREATHING.ordinal());
|
if(ConfigCrafting.RING_WATER_BREATHING.isEnabled()) addRingRecipeWithStack(ThePotionRings.WATER_BREATHING.craftingItem, ThePotionRings.WATER_BREATHING.ordinal());
|
||||||
if(ConfigCrafting.RING_INVISIBILITY.isEnabled()) addRingRecipeWithStack(ThePotionRings.INVISIBILITY.craftingItem, ThePotionRings.INVISIBILITY.ordinal());
|
if(ConfigCrafting.RING_INVISIBILITY.isEnabled()) addRingRecipeWithStack(ThePotionRings.INVISIBILITY.craftingItem, ThePotionRings.INVISIBILITY.ordinal());
|
||||||
if(ConfigCrafting.RING_NIGHT_VISION.isEnabled()) addRingRecipeWithStack(ThePotionRings.NIGHT_VISION.craftingItem, ThePotionRings.NIGHT_VISION.ordinal());
|
if(ConfigCrafting.RING_NIGHT_VISION.isEnabled()) addRingRecipeWithStack(ThePotionRings.NIGHT_VISION.craftingItem, ThePotionRings.NIGHT_VISION.ordinal());
|
||||||
if(ConfigCrafting.RING_SATURATION.isEnabled()) addRingRecipeWithStack(ThePotionRings.SATURATION.craftingItem, ThePotionRings.SATURATION.ordinal());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addRingRecipeWithStack(ItemStack mainStack, int meta){
|
public static void addRingRecipeWithStack(ItemStack mainStack, int meta){
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRing, 1, meta), mainStack, mainStack, mainStack, mainStack, new ItemStack(Blocks.diamond_block), new ItemStack(Items.nether_wart), new ItemStack(Items.potionitem), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()));
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRing, 1, meta), mainStack, mainStack, mainStack, mainStack, new ItemStack(Blocks.diamond_block), new ItemStack(Items.nether_wart), new ItemStack(Items.potionitem), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()));
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRingAdvanced, 1, meta), new ItemStack(InitItems.itemPotionRing, 1, meta), new ItemStack(Items.nether_star));
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRingAdvanced, 1, meta), new ItemStack(InitItems.itemPotionRing, 1, meta), new ItemStack(Items.nether_star), new ItemStack(Items.nether_star));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initMashedFoodRecipes(){
|
public static void initMashedFoodRecipes(){
|
||||||
for(Object nextIterator : Item.itemRegistry){
|
if(ConfigCrafting.MASHED_FOOD.isEnabled()){
|
||||||
if(nextIterator instanceof ItemFood){
|
for(Object nextIterator : Item.itemRegistry){
|
||||||
ItemStack ingredient = new ItemStack((Item)nextIterator, 1, Util.WILDCARD);
|
if(nextIterator instanceof ItemFood || nextIterator instanceof IPlantable || nextIterator instanceof IGrowable){
|
||||||
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.MASHED_FOOD.ordinal()), ingredient, ingredient, ingredient, ingredient, new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD));
|
ItemStack ingredient = new ItemStack((Item)nextIterator, 1, Util.WILDCARD);
|
||||||
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.MASHED_FOOD.ordinal()), ingredient, ingredient, ingredient, ingredient, new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package ellpeck.actuallyadditions.crafting;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import ellpeck.actuallyadditions.config.values.ConfigCrafting;
|
import ellpeck.actuallyadditions.config.values.ConfigCrafting;
|
||||||
import ellpeck.actuallyadditions.items.InitItems;
|
import ellpeck.actuallyadditions.items.InitItems;
|
||||||
|
import ellpeck.actuallyadditions.items.metalists.TheFoods;
|
||||||
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -18,6 +19,11 @@ public class MiscCrafting{
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.DOUGH.ordinal()),
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.DOUGH.ordinal()),
|
||||||
"cropWheat", "cropWheat"));
|
"cropWheat", "cropWheat"));
|
||||||
|
|
||||||
|
//Rice Dough
|
||||||
|
if(ConfigCrafting.RICE_DOUGH.isEnabled())
|
||||||
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.RICE_DOUGH.ordinal()),
|
||||||
|
TheFoods.RICE.getOredictName(), TheFoods.RICE.getOredictName()));
|
||||||
|
|
||||||
//Paper Cone
|
//Paper Cone
|
||||||
if(ConfigCrafting.PAPER_CONE.isEnabled())
|
if(ConfigCrafting.PAPER_CONE.isEnabled())
|
||||||
GameRegistry.addRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()),
|
GameRegistry.addRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()),
|
||||||
|
@ -33,7 +39,7 @@ public class MiscCrafting{
|
||||||
//Knife Blade
|
//Knife Blade
|
||||||
if(ConfigCrafting.KNIFE_BLADE.isEnabled())
|
if(ConfigCrafting.KNIFE_BLADE.isEnabled())
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()),
|
||||||
"KF",
|
"K", "F",
|
||||||
'K', "ingotIron",
|
'K', "ingotIron",
|
||||||
'F', new ItemStack(Items.flint)));
|
'F', new ItemStack(Items.flint)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,59 +26,115 @@ public class CreativeTab extends CreativeTabs{
|
||||||
public void displayAllReleventItems(List list){
|
public void displayAllReleventItems(List list){
|
||||||
this.list = list;
|
this.list = list;
|
||||||
|
|
||||||
this.addBlock(InitBlocks.blockInputter);
|
add(InitBlocks.blockPhantomface);
|
||||||
this.addBlock(InitBlocks.blockInputterAdvanced);
|
add(InitBlocks.blockPhantomEnergyface);
|
||||||
this.addBlock(InitBlocks.blockGreenhouseGlass);
|
add(InitBlocks.blockPhantomLiquiface);
|
||||||
this.addBlock(InitBlocks.blockGrinder);
|
add(InitBlocks.blockPhantomPlacer);
|
||||||
this.addBlock(InitBlocks.blockGrinderDouble);
|
add(InitBlocks.blockPhantomBreaker);
|
||||||
this.addBlock(InitBlocks.blockFurnaceDouble);
|
add(InitBlocks.blockInputter);
|
||||||
|
add(InitBlocks.blockInputterAdvanced);
|
||||||
|
add(InitBlocks.blockPhantomBooster);
|
||||||
|
add(InitBlocks.blockCoffeeMachine);
|
||||||
|
|
||||||
//TODO Re-add
|
add(InitBlocks.blockGreenhouseGlass);
|
||||||
//this.addBlock(InitBlocks.blockFurnaceSolar);
|
add(InitBlocks.blockGrinder);
|
||||||
//this.addBlock(InitBlocks.blockHeatCollector);
|
add(InitBlocks.blockGrinderDouble);
|
||||||
this.addBlock(InitBlocks.blockItemRepairer);
|
add(InitBlocks.blockFurnaceDouble);
|
||||||
this.addBlock(InitBlocks.blockFishingNet);
|
add(InitBlocks.blockLavaFactoryController);
|
||||||
this.addBlock(InitBlocks.blockBreaker);
|
|
||||||
this.addBlock(InitBlocks.blockPlacer);
|
|
||||||
this.addBlock(InitBlocks.blockDropper);
|
|
||||||
|
|
||||||
this.addBlock(InitBlocks.blockMisc);
|
add(InitBlocks.blockEnergizer);
|
||||||
this.addBlock(InitBlocks.blockFeeder);
|
add(InitBlocks.blockEnervator);
|
||||||
this.addBlock(InitBlocks.blockCompost);
|
|
||||||
this.addBlock(InitBlocks.blockGiantChest);
|
|
||||||
|
|
||||||
this.addItem(InitItems.itemSpeedUpgrade);
|
add(InitBlocks.blockFurnaceSolar);
|
||||||
this.addItem(InitItems.itemMisc);
|
add(InitBlocks.blockHeatCollector);
|
||||||
this.addItem(InitItems.itemFertilizer);
|
add(InitBlocks.blockCoalGenerator);
|
||||||
this.addItem(InitItems.itemFoods);
|
add(InitBlocks.blockOilGenerator);
|
||||||
this.addItem(InitItems.itemKnife);
|
add(InitBlocks.blockItemRepairer);
|
||||||
this.addItem(InitItems.itemCrafterOnAStick);
|
add(InitBlocks.blockFishingNet);
|
||||||
this.addItem(InitItems.itemDust);
|
add(InitBlocks.blockBreaker);
|
||||||
this.addItem(InitItems.itemSpecialDrop);
|
add(InitBlocks.blockPlacer);
|
||||||
this.addItem(InitItems.itemLeafBlower);
|
add(InitBlocks.blockDropper);
|
||||||
this.addItem(InitItems.itemLeafBlowerAdvanced);
|
add(InitBlocks.blockFluidPlacer);
|
||||||
|
add(InitBlocks.blockFluidCollector);
|
||||||
|
|
||||||
this.addItem(InitItems.itemPickaxeEmerald);
|
add(InitBlocks.blockMisc);
|
||||||
this.addItem(InitItems.itemSwordEmerald);
|
add(InitBlocks.blockFeeder);
|
||||||
this.addItem(InitItems.itemAxeEmerald);
|
add(InitBlocks.blockCompost);
|
||||||
this.addItem(InitItems.itemShovelEmerald);
|
add(InitBlocks.blockGiantChest);
|
||||||
this.addItem(InitItems.itemHoeEmerald);
|
add(InitBlocks.blockCanolaPress);
|
||||||
|
add(InitBlocks.blockFermentingBarrel);
|
||||||
|
|
||||||
this.addItem(InitItems.itemPickaxeObsidian);
|
add(InitBlocks.blockTestifiBucksGreenWall);
|
||||||
this.addItem(InitItems.itemSwordObsidian);
|
add(InitBlocks.blockTestifiBucksWhiteWall);
|
||||||
this.addItem(InitItems.itemAxeObsidian);
|
add(InitBlocks.blockTestifiBucksGreenStairs);
|
||||||
this.addItem(InitItems.itemShovelObsidian);
|
add(InitBlocks.blockTestifiBucksWhiteStairs);
|
||||||
this.addItem(InitItems.itemHoeObsidian);
|
add(InitBlocks.blockTestifiBucksGreenSlab);
|
||||||
|
add(InitBlocks.blockTestifibucksWhiteSlab);
|
||||||
|
|
||||||
this.addItem(InitItems.itemPotionRing);
|
add(InitItems.itemDrill);
|
||||||
this.addItem(InitItems.itemPotionRingAdvanced);
|
add(InitItems.itemDrillUpgradeSpeed);
|
||||||
|
add(InitItems.itemDrillUpgradeSpeedII);
|
||||||
|
add(InitItems.itemDrillUpgradeSpeedIII);
|
||||||
|
add(InitItems.itemDrillUpgradeSilkTouch);
|
||||||
|
add(InitItems.itemDrillUpgradeFortune);
|
||||||
|
add(InitItems.itemDrillUpgradeFortuneII);
|
||||||
|
add(InitItems.itemDrillUpgradeThreeByThree);
|
||||||
|
add(InitItems.itemDrillUpgradeFiveByFive);
|
||||||
|
add(InitItems.itemDrillUpgradeBlockPlacing);
|
||||||
|
add(InitItems.itemBattery);
|
||||||
|
|
||||||
this.addItem(InitItems.itemJams);
|
add(InitItems.itemPhantomConnector);
|
||||||
|
add(InitItems.itemBucketCanolaOil);
|
||||||
|
add(InitItems.itemBucketOil);
|
||||||
|
|
||||||
|
add(InitItems.itemCoffeeSeed);
|
||||||
|
add(InitItems.itemCoffeeBean);
|
||||||
|
add(InitItems.itemRiceSeed);
|
||||||
|
add(InitItems.itemCanolaSeed);
|
||||||
|
add(InitItems.itemFlaxSeed);
|
||||||
|
add(InitItems.itemHairyBall);
|
||||||
|
add(InitItems.itemMisc);
|
||||||
|
add(InitItems.itemResonantRice);
|
||||||
|
add(InitItems.itemFertilizer);
|
||||||
|
|
||||||
|
add(InitItems.itemCoffee);
|
||||||
|
add(InitItems.itemFoods);
|
||||||
|
add(InitItems.itemKnife);
|
||||||
|
add(InitItems.itemCrafterOnAStick);
|
||||||
|
add(InitItems.itemDust);
|
||||||
|
add(InitItems.itemSpecialDrop);
|
||||||
|
add(InitItems.itemLeafBlower);
|
||||||
|
add(InitItems.itemLeafBlowerAdvanced);
|
||||||
|
|
||||||
|
add(InitItems.woodenPaxel);
|
||||||
|
add(InitItems.stonePaxel);
|
||||||
|
add(InitItems.ironPaxel);
|
||||||
|
add(InitItems.goldPaxel);
|
||||||
|
add(InitItems.diamondPaxel);
|
||||||
|
add(InitItems.emeraldPaxel);
|
||||||
|
add(InitItems.obsidianPaxel);
|
||||||
|
|
||||||
|
add(InitItems.itemPickaxeEmerald);
|
||||||
|
add(InitItems.itemSwordEmerald);
|
||||||
|
add(InitItems.itemAxeEmerald);
|
||||||
|
add(InitItems.itemShovelEmerald);
|
||||||
|
add(InitItems.itemHoeEmerald);
|
||||||
|
|
||||||
|
add(InitItems.itemPickaxeObsidian);
|
||||||
|
add(InitItems.itemSwordObsidian);
|
||||||
|
add(InitItems.itemAxeObsidian);
|
||||||
|
add(InitItems.itemShovelObsidian);
|
||||||
|
add(InitItems.itemHoeObsidian);
|
||||||
|
|
||||||
|
add(InitItems.itemJams);
|
||||||
|
|
||||||
|
add(InitItems.itemPotionRing);
|
||||||
|
add(InitItems.itemPotionRingAdvanced);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getTabIconItem(){
|
public Item getTabIconItem(){
|
||||||
return Item.getItemFromBlock(InitBlocks.blockInputter);
|
return Item.getItemFromBlock(InitBlocks.blockPhantomLiquiface);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -86,11 +142,11 @@ public class CreativeTab extends CreativeTabs{
|
||||||
return new ItemStack(this.getTabIconItem());
|
return new ItemStack(this.getTabIconItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addItem(Item item){
|
private void add(Item item){
|
||||||
item.getSubItems(item, this, list);
|
item.getSubItems(item, instance, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addBlock(Block block){
|
private void add(Block block){
|
||||||
block.getSubBlocks(new ItemStack(block).getItem(), this, list);
|
block.getSubBlocks(new ItemStack(block).getItem(), instance, list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package ellpeck.actuallyadditions.event;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.eventhandler.Event;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||||
|
import ellpeck.actuallyadditions.items.InitItems;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||||
|
|
||||||
|
public class BucketFillEvent{
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onBucketFilled(FillBucketEvent event){
|
||||||
|
Block block = event.world.getBlock(event.target.blockX, event.target.blockY, event.target.blockZ);
|
||||||
|
if(block == InitBlocks.blockCanolaOil){
|
||||||
|
event.world.setBlockToAir(event.target.blockX, event.target.blockY, event.target.blockZ);
|
||||||
|
event.result = new ItemStack(InitItems.itemBucketCanolaOil);
|
||||||
|
event.setResult(Event.Result.ALLOW);
|
||||||
|
}
|
||||||
|
if(block == InitBlocks.blockOil){
|
||||||
|
event.world.setBlockToAir(event.target.blockX, event.target.blockY, event.target.blockZ);
|
||||||
|
event.result = new ItemStack(InitItems.itemBucketOil);
|
||||||
|
event.setResult(Event.Result.ALLOW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package ellpeck.actuallyadditions.event;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
|
||||||
|
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||||
|
import ellpeck.actuallyadditions.items.InitItems;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.entity.passive.EntityOcelot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class EntityLivingEvent{
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void livingUpdateEvent(LivingUpdateEvent event){
|
||||||
|
if(!event.entityLiving.worldObj.isRemote){
|
||||||
|
if(event.entityLiving instanceof EntityOcelot){
|
||||||
|
EntityOcelot theOcelot = (EntityOcelot)event.entityLiving;
|
||||||
|
if(ConfigBoolValues.DO_CAT_DROPS.isEnabled() && theOcelot.isTamed()){
|
||||||
|
if(new Random().nextInt(ConfigIntValues.CAT_DROP_CHANCE.getValue())+1 == 1){
|
||||||
|
EntityItem item = new EntityItem(theOcelot.worldObj, theOcelot.posX + 0.5, theOcelot.posY + 0.5, theOcelot.posZ + 0.5, new ItemStack(InitItems.itemHairyBall));
|
||||||
|
theOcelot.worldObj.spawnEntityInWorld(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -12,6 +12,9 @@ public class InitEvents{
|
||||||
Util.registerEvent(new KilledEvent());
|
Util.registerEvent(new KilledEvent());
|
||||||
Util.registerEvent(new PickupEvent());
|
Util.registerEvent(new PickupEvent());
|
||||||
Util.registerEvent(new TooltipEvent());
|
Util.registerEvent(new TooltipEvent());
|
||||||
|
Util.registerEvent(new EntityLivingEvent());
|
||||||
|
Util.registerEvent(new WorldDecorationEvent());
|
||||||
|
Util.registerEvent(new BucketFillEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,9 @@ public class RenderPlayerEventAA{
|
||||||
|
|
||||||
private RenderSpecial ellpeckRender = new RenderSpecial(new ModelStandardBlock("Ellpeck"));
|
private RenderSpecial ellpeckRender = new RenderSpecial(new ModelStandardBlock("Ellpeck"));
|
||||||
private RenderSpecial hoseRender = new RenderSpecial(new ModelTorch());
|
private RenderSpecial hoseRender = new RenderSpecial(new ModelTorch());
|
||||||
private RenderSpecial paktoRender = new RenderSpecial(new ModelStandardBlock("Pakto"));
|
//private RenderSpecial paktoRender = new RenderSpecial(new ModelStandardBlock("Pakto"));
|
||||||
private RenderSpecial glenRender = new RenderSpecial(new ModelStandardBlock("Glenthor"));
|
private RenderSpecial glenRender = new RenderSpecial(new ModelStandardBlock("Glenthor"));
|
||||||
|
private RenderSpecial lordiRender = new RenderSpecial(new ModelStandardBlock("Lordi"));
|
||||||
|
|
||||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||||
public void RenderPlayerEvent(RenderPlayerEvent.Pre event){
|
public void RenderPlayerEvent(RenderPlayerEvent.Pre event){
|
||||||
|
@ -26,10 +27,10 @@ public class RenderPlayerEventAA{
|
||||||
}
|
}
|
||||||
|
|
||||||
//Paktosan
|
//Paktosan
|
||||||
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("0bac71ad-9156-487e-9ade-9c5b57274b23"))){
|
/*if(event.entityPlayer.getUniqueID().equals(UUID.fromString("0bac71ad-9156-487e-9ade-9c5b57274b23"))){
|
||||||
paktoRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
paktoRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
//TwoOfEight
|
//TwoOfEight
|
||||||
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("a57d2829-9711-4552-a7de-ee800802f643"))){
|
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("a57d2829-9711-4552-a7de-ee800802f643"))){
|
||||||
|
@ -40,6 +41,12 @@ public class RenderPlayerEventAA{
|
||||||
//dqmhose
|
//dqmhose
|
||||||
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("cb7b293a-5031-484e-b5be-b4f2f4e92726"))){
|
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("cb7b293a-5031-484e-b5be-b4f2f4e92726"))){
|
||||||
hoseRender.render(event.entityPlayer, event.partialRenderTick, 0.5F, 1.3F);
|
hoseRender.render(event.entityPlayer, event.partialRenderTick, 0.5F, 1.3F);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Lordi
|
||||||
|
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("990ecf6d-15dd-442c-b91b-323a6420c78e"))){
|
||||||
|
lordiRender.render(event.entityPlayer, event.partialRenderTick, 0.3F, 1F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
package ellpeck.actuallyadditions.event;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||||
|
import ellpeck.actuallyadditions.blocks.metalists.TheWildPlants;
|
||||||
|
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
|
||||||
|
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||||
|
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class WorldDecorationEvent{
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onWorldDecoration(DecorateBiomeEvent event){
|
||||||
|
if(ConfigBoolValues.DO_RICE_GEN.isEnabled()){
|
||||||
|
for(int i = 0; i < ConfigIntValues.RICE_AMOUNT.getValue(); i++){
|
||||||
|
if(new Random().nextInt(10) == 0){
|
||||||
|
int genX = event.chunkX+event.rand.nextInt(16)+8;
|
||||||
|
int genZ = event.chunkZ+event.rand.nextInt(16)+8;
|
||||||
|
int genY = event.world.getTopSolidOrLiquidBlock(genX, genZ);
|
||||||
|
|
||||||
|
if(event.world.getBlock(genX, genY, genZ).getMaterial() == Material.water){
|
||||||
|
ArrayList<Material> blocksAroundBottom = WorldUtil.getMaterialsAround(event.world, genX, genY, genZ);
|
||||||
|
ArrayList<Material> blocksAroundTop = WorldUtil.getMaterialsAround(event.world, genX, genY+1, genZ);
|
||||||
|
if(blocksAroundBottom.contains(Material.grass) || blocksAroundBottom.contains(Material.ground) || blocksAroundBottom.contains(Material.rock) || blocksAroundBottom.contains(Material.sand)){
|
||||||
|
if(!blocksAroundTop.contains(Material.water) && event.world.getBlock(genX, genY+1, genZ).getMaterial() == Material.air){
|
||||||
|
event.world.setBlock(genX, genY+1, genZ, InitBlocks.blockWildPlant, TheWildPlants.RICE.ordinal(), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.CANOLA.ordinal(), ConfigIntValues.CANOLA_AMOUNT.getValue(), ConfigBoolValues.DO_CANOLA_GEN.isEnabled(), Material.grass, event);
|
||||||
|
this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.FLAX.ordinal(), ConfigIntValues.FLAX_AMOUNT.getValue(), ConfigBoolValues.DO_FLAX_GEN.isEnabled(), Material.grass, event);
|
||||||
|
this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.COFFEE.ordinal(), ConfigIntValues.COFFEE_AMOUNT.getValue(), ConfigBoolValues.DO_COFFEE_GEN.isEnabled(), Material.grass, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void genPlantNormally(Block plant, int meta, int amount, boolean doIt, Material blockBelow, DecorateBiomeEvent event){
|
||||||
|
if(doIt){
|
||||||
|
for(int i = 0; i < amount; i++){
|
||||||
|
if(new Random().nextInt(100) == 0){
|
||||||
|
int genX = event.chunkX+event.rand.nextInt(16)+8;
|
||||||
|
int genZ = event.chunkZ+event.rand.nextInt(16)+8;
|
||||||
|
int genY = event.world.getTopSolidOrLiquidBlock(genX, genZ)-1;
|
||||||
|
|
||||||
|
if(event.world.getBlock(genX, genY, genZ).getMaterial() == blockBelow){
|
||||||
|
event.world.setBlock(genX, genY+1, genZ, plant, meta, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -42,7 +42,7 @@ public class RenderSpecial{
|
||||||
GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
|
GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
|
||||||
GL11.glScalef(size, size, size);
|
GL11.glScalef(size, size, size);
|
||||||
|
|
||||||
if(!(time-(bobHeight/2) < lastTimeForBobbing)){
|
if(time-(bobHeight/2) >= lastTimeForBobbing){
|
||||||
GL11.glTranslated(0, ((double)time-this.lastTimeForBobbing)/100, 0);
|
GL11.glTranslated(0, ((double)time-this.lastTimeForBobbing)/100, 0);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
|
@ -13,31 +13,34 @@ import net.minecraft.util.WeightedRandomChestContent;
|
||||||
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
||||||
import net.minecraftforge.common.ChestGenHooks;
|
import net.minecraftforge.common.ChestGenHooks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class InitVillager{
|
public class InitVillager{
|
||||||
|
|
||||||
public static ChestGenHooks jamHouseChest;
|
public static final String JAM_HOUSE_CHEST_NAME = ModUtil.MOD_ID_LOWER+".jamHouseChest";
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
Util.logInfo("Initializing Village Addons...");
|
Util.logInfo("Initializing Village Addons...");
|
||||||
|
|
||||||
if(ConfigBoolValues.JAM_VILLAGER_EXISTS.isEnabled()){
|
if(ConfigBoolValues.JAM_VILLAGER_EXISTS.isEnabled()){
|
||||||
|
initJamVillagePart();
|
||||||
int jamID = ConfigIntValues.JAM_VILLAGER_ID.getValue();
|
|
||||||
VillagerRegistry.instance().registerVillagerId(jamID);
|
|
||||||
VillagerRegistry.instance().registerVillageTradeHandler(jamID, new JamVillagerTradeHandler());
|
|
||||||
|
|
||||||
jamHouseChest = new ChestGenHooks("JamHouse", new WeightedRandomChestContent[0], 5, 20);
|
|
||||||
for(int i = 0; i < TheJams.values().length; i++){
|
|
||||||
jamHouseChest.addItem(new WeightedRandomChestContent(new ItemStack(InitItems.itemJams, new Random().nextInt(5)+1, i), 1, 1, 15));
|
|
||||||
}
|
|
||||||
jamHouseChest.addItem(new WeightedRandomChestContent(new ItemStack(Items.glass_bottle, new Random().nextInt(5)+1), 1, 1, 15));
|
|
||||||
jamHouseChest.addItem(new WeightedRandomChestContent(new ItemStack(Items.potionitem, new Random().nextInt(5)+1), 1, 1, 15));
|
|
||||||
|
|
||||||
VillagerRegistry.instance().registerVillageCreationHandler(new VillageJamHouseHandler());
|
|
||||||
MapGenStructureIO.func_143031_a(VillageComponentJamHouse.class, ModUtil.MOD_ID_LOWER + ":jamHouseStructure");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void initJamVillagePart(){
|
||||||
|
int jamID = ConfigIntValues.JAM_VILLAGER_ID.getValue();
|
||||||
|
VillagerRegistry.instance().registerVillagerId(jamID);
|
||||||
|
VillagerRegistry.instance().registerVillageTradeHandler(jamID, new JamVillagerTradeHandler());
|
||||||
|
|
||||||
|
ChestGenHooks jamHouseChest = ChestGenHooks.getInfo(JAM_HOUSE_CHEST_NAME);
|
||||||
|
jamHouseChest.setMin(5);
|
||||||
|
jamHouseChest.setMax(20);
|
||||||
|
for(int i = 0; i < TheJams.values().length; i++){
|
||||||
|
ChestGenHooks.addItem(JAM_HOUSE_CHEST_NAME, new WeightedRandomChestContent(new ItemStack(InitItems.itemJams, 1, i), 1, 1, 10));
|
||||||
|
}
|
||||||
|
ChestGenHooks.addItem(JAM_HOUSE_CHEST_NAME, new WeightedRandomChestContent(new ItemStack(Items.glass_bottle), 1, 2, 30));
|
||||||
|
ChestGenHooks.addItem(JAM_HOUSE_CHEST_NAME, new WeightedRandomChestContent(new ItemStack(Items.potionitem), 1, 1, 20));
|
||||||
|
|
||||||
|
VillagerRegistry.instance().registerVillageCreationHandler(new VillageJamHouseHandler());
|
||||||
|
MapGenStructureIO.func_143031_a(VillageComponentJamHouse.class, ModUtil.MOD_ID_LOWER+":jamHouseStructure");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,15 +18,15 @@ public class JamVillagerTradeHandler implements VillagerRegistry.IVillageTradeHa
|
||||||
private ArrayList<Trade> trades = new ArrayList<Trade>();
|
private ArrayList<Trade> trades = new ArrayList<Trade>();
|
||||||
|
|
||||||
public JamVillagerTradeHandler(){
|
public JamVillagerTradeHandler(){
|
||||||
this.addWants("ingotGold", 3, 2);
|
this.addWants("ingotGold", 5, 2);
|
||||||
this.addWants("cropWheat", 10, 10);
|
this.addWants("cropWheat", 15, 10);
|
||||||
this.addWants("dustRedstone", 15, 15);
|
this.addWants("dustRedstone", 25, 15);
|
||||||
this.addWants(new ItemStack(Items.bucket), 1, 4);
|
this.addWants(new ItemStack(Items.bucket), 5, 4);
|
||||||
this.addWants(new ItemStack(Items.glass_bottle), 5, 5);
|
this.addWants(new ItemStack(Items.glass_bottle), 12, 5);
|
||||||
this.addWants(new ItemStack(Items.potionitem), 1, 0);
|
this.addWants(new ItemStack(Items.potionitem), 1, 0);
|
||||||
this.addWants("ingotIron", 5, 5);
|
this.addWants("ingotIron", 10, 5);
|
||||||
this.addWants("gemDiamond", 1, 1);
|
this.addWants("gemDiamond", 1, 2);
|
||||||
this.addWants("dustGlowstone", 5, 10);
|
this.addWants("dustGlowstone", 12, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -48,14 +48,14 @@ public class JamVillagerTradeHandler implements VillagerRegistry.IVillageTradeHa
|
||||||
if(wantsOne == wantsTwo) wantsTwo = null;
|
if(wantsOne == wantsTwo) wantsTwo = null;
|
||||||
|
|
||||||
for(int k = 0; k < TheJams.values().length; k++){
|
for(int k = 0; k < TheJams.values().length; k++){
|
||||||
recipeList.add(new MerchantRecipe(wantsOne, wantsTwo, new ItemStack(InitItems.itemJams, rand.nextInt(5)+1, k)));
|
recipeList.add(new MerchantRecipe(wantsOne, wantsTwo, new ItemStack(InitItems.itemJams, rand.nextInt(3)+1, k)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addWants(String oredictName, int minSize, int maxSize){
|
public void addWants(String oredictName, int minSize, int maxSize){
|
||||||
ArrayList<ItemStack> stacks = OreDictionary.getOres(oredictName);
|
ArrayList<ItemStack> stacks = (ArrayList<ItemStack>)OreDictionary.getOres(oredictName, false);
|
||||||
trades.add(new Trade(stacks, minSize, maxSize));
|
trades.add(new Trade(stacks, minSize, maxSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import ellpeck.actuallyadditions.util.Util;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.WorldType;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.Level;
|
||||||
|
@ -21,13 +22,17 @@ public class OreGen implements IWorldGenerator{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){
|
||||||
switch (world.provider.dimensionId){
|
if(world.provider.terrainType == WorldType.FLAT) return;
|
||||||
|
|
||||||
|
switch(world.provider.dimensionId){
|
||||||
case -1:
|
case -1:
|
||||||
generateNether(world, random, chunkX*16, chunkZ*16);
|
generateNether(world, random, chunkX*16, chunkZ*16);
|
||||||
case 0:
|
//case 0:
|
||||||
generateSurface(world, random, chunkX*16, chunkZ*16);
|
// generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||||
case 1:
|
case 1:
|
||||||
generateEnd(world, random, chunkX*16, chunkZ*16);
|
generateEnd(world, random, chunkX*16, chunkZ*16);
|
||||||
|
default:
|
||||||
|
generateSurface(world, random, chunkX*16, chunkZ*16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +42,9 @@ public class OreGen implements IWorldGenerator{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int x, int z){
|
private void generateSurface(World world, Random random, int x, int z){
|
||||||
if(ConfigBoolValues.GENERATE_QUARTZ.isEnabled()) this.addOreSpawn(InitBlocks.blockMisc, TheMiscBlocks.ORE_QUARTZ.ordinal(), Blocks.stone, world, random, x, z, this.getRandom(ConfigIntValues.BLACK_QUARTZ_BASE_AMOUNT.getValue(), ConfigIntValues.BLACK_QUARTZ_ADD_CHANCE.getValue(), random), ConfigIntValues.BLACK_QUARTZ_CHANCE.getValue(), ConfigIntValues.BLACK_QUARTZ_MIN_HEIGHT.getValue(), ConfigIntValues.BLACK_QUARTZ_MAX_HEIGHT.getValue());
|
if(ConfigBoolValues.GENERATE_QUARTZ.isEnabled()){
|
||||||
|
this.addOreSpawn(InitBlocks.blockMisc, TheMiscBlocks.ORE_QUARTZ.ordinal(), Blocks.stone, world, random, x, z, this.getRandom(ConfigIntValues.BLACK_QUARTZ_BASE_AMOUNT.getValue(), ConfigIntValues.BLACK_QUARTZ_ADD_CHANCE.getValue(), random), ConfigIntValues.BLACK_QUARTZ_CHANCE.getValue(), ConfigIntValues.BLACK_QUARTZ_MIN_HEIGHT.getValue(), ConfigIntValues.BLACK_QUARTZ_MAX_HEIGHT.getValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
@ -55,7 +62,7 @@ public class OreGen implements IWorldGenerator{
|
||||||
new WorldGenMinable(block, meta, maxVeinSize, blockIn).generate(world, random, posX, posY, posZ);
|
new WorldGenMinable(block, meta, maxVeinSize, blockIn).generate(world, random, posX, posY, posZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else ModUtil.AA_LOGGER.log(Level.FATAL, "Couldn't generate '" + block.getUnlocalizedName() + "' into the world because the Min Y coordinate is bigger than the Max! This is definitely a Config Error! Check the Files!");
|
else ModUtil.LOGGER.log(Level.FATAL, "Couldn't generate '" + block.getUnlocalizedName() + "' into the world because the Min Y coordinate is bigger than the Max! This is definitely a Config Error! Check the Files!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRandom(int base, int extra, Random rand){
|
public int getRandom(int base, int extra, Random rand){
|
||||||
|
@ -64,6 +71,6 @@ public class OreGen implements IWorldGenerator{
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
Util.logInfo("Registering World Generator...");
|
Util.logInfo("Registering World Generator...");
|
||||||
GameRegistry.registerWorldGenerator(new OreGen(), 0);
|
GameRegistry.registerWorldGenerator(new OreGen(), 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.world.World;
|
||||||
import net.minecraft.world.gen.structure.StructureBoundingBox;
|
import net.minecraft.world.gen.structure.StructureBoundingBox;
|
||||||
import net.minecraft.world.gen.structure.StructureComponent;
|
import net.minecraft.world.gen.structure.StructureComponent;
|
||||||
import net.minecraft.world.gen.structure.StructureVillagePieces;
|
import net.minecraft.world.gen.structure.StructureVillagePieces;
|
||||||
|
import net.minecraftforge.common.ChestGenHooks;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
@ -49,8 +50,8 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{
|
||||||
|
|
||||||
for (int i = 0; i < xSize; i++){
|
for (int i = 0; i < xSize; i++){
|
||||||
for(int j = 0; j < zSize; j++){
|
for(int j = 0; j < zSize; j++){
|
||||||
this.clearCurrentPositionBlocksUpwards(world, j, ySize, i, sbb);
|
this.clearCurrentPositionBlocksUpwards(world, i, ySize, j, sbb);
|
||||||
this.func_151554_b(world, Blocks.cobblestone, 0, j, -1, i, sbb);
|
this.func_151554_b(world, Blocks.cobblestone, 0, i, -1, j, sbb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,12 +164,9 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{
|
||||||
|
|
||||||
//Loot Chest
|
//Loot Chest
|
||||||
this.placeBlockAtCurrentPosition(world, Blocks.chest, 0, 8, 1, 6, sbb);
|
this.placeBlockAtCurrentPosition(world, Blocks.chest, 0, 8, 1, 6, sbb);
|
||||||
int posX = this.getXWithOffset(8, 6);
|
TileEntity chest = world.getTileEntity(this.getXWithOffset(8, 6), this.getYWithOffset(1), this.getZWithOffset(8, 6));
|
||||||
int posY = this.getYWithOffset(1);
|
|
||||||
int posZ = this.getZWithOffset(8, 6);
|
|
||||||
TileEntity chest = world.getTileEntity(posX, posY, posZ);
|
|
||||||
if(chest != null && chest instanceof TileEntityChest){
|
if(chest != null && chest instanceof TileEntityChest){
|
||||||
WeightedRandomChestContent.generateChestContents(rand, InitVillager.jamHouseChest.getItems(rand), (TileEntityChest)chest, InitVillager.jamHouseChest.getCount(rand));
|
WeightedRandomChestContent.generateChestContents(rand, ChestGenHooks.getItems(InitVillager.JAM_HOUSE_CHEST_NAME, rand), (TileEntityChest)chest, ChestGenHooks.getCount(InitVillager.JAM_HOUSE_CHEST_NAME, rand));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Torches
|
//Torches
|
||||||
|
|
|
@ -50,28 +50,30 @@ public class ContainerBreaker extends Container{
|
||||||
ItemStack currentStack = theSlot.getStack();
|
ItemStack currentStack = theSlot.getStack();
|
||||||
ItemStack newStack = currentStack.copy();
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= inventoryStart){
|
if(currentStack.getItem() != null){
|
||||||
this.mergeItemStack(newStack, 0, 9+1, false);
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, 0, 9, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= hotbarStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot < inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(newStack.stackSize == 0) theSlot.putStack(null);
|
|
||||||
else theSlot.onSlotChanged();
|
|
||||||
if(newStack.stackSize == currentStack.stackSize) return null;
|
|
||||||
theSlot.onPickupFromSlot(player, newStack);
|
|
||||||
|
|
||||||
return currentStack;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,126 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||||
|
import ellpeck.actuallyadditions.inventory.slot.SlotOutput;
|
||||||
|
import ellpeck.actuallyadditions.items.InitItems;
|
||||||
|
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityCanolaPress;
|
||||||
|
import invtweaks.api.container.InventoryContainer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.ICrafting;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
|
@InventoryContainer
|
||||||
|
public class ContainerCanolaPress extends Container{
|
||||||
|
|
||||||
|
private TileEntityCanolaPress press;
|
||||||
|
|
||||||
|
private int lastEnergyStored;
|
||||||
|
private int lastTankAmount;
|
||||||
|
private int lastProcessTime;
|
||||||
|
|
||||||
|
public ContainerCanolaPress(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
|
this.press = (TileEntityCanolaPress)tile;
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(this.press, 0, 81, 10));
|
||||||
|
this.addSlotToContainer(new Slot(this.press, 1, 136, 73));
|
||||||
|
this.addSlotToContainer(new SlotOutput(this.press, 2, 136, 42));
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++){
|
||||||
|
for (int j = 0; j < 9; j++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 9; i++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.press.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting iCraft){
|
||||||
|
super.addCraftingToCrafters(iCraft);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 0, this.press.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
|
iCraft.sendProgressBarUpdate(this, 1, this.press.tank.getFluidAmount());
|
||||||
|
iCraft.sendProgressBarUpdate(this, 2, this.press.currentProcessTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges(){
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
for(Object crafter : this.crafters){
|
||||||
|
ICrafting iCraft = (ICrafting)crafter;
|
||||||
|
|
||||||
|
if(this.lastEnergyStored != this.press.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.press.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
|
if(this.lastTankAmount != this.press.tank.getFluidAmount()) iCraft.sendProgressBarUpdate(this, 1, this.press.tank.getFluidAmount());
|
||||||
|
if(this.lastProcessTime != this.press.currentProcessTime) iCraft.sendProgressBarUpdate(this, 2, this.press.currentProcessTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastEnergyStored = this.press.getEnergyStored(ForgeDirection.UNKNOWN);
|
||||||
|
this.lastTankAmount = this.press.tank.getFluidAmount();
|
||||||
|
this.lastProcessTime = this.press.currentProcessTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void updateProgressBar(int par1, int par2){
|
||||||
|
if(par1 == 0) this.press.storage.setEnergyStored(par2);
|
||||||
|
if(par1 == 1) this.press.tank.setFluid(new FluidStack(InitBlocks.fluidCanolaOil, par2));
|
||||||
|
if(par1 == 2) this.press.currentProcessTime = par2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
|
final int inventoryStart = 3;
|
||||||
|
final int inventoryEnd = inventoryStart+26;
|
||||||
|
final int hotbarStart = inventoryEnd+1;
|
||||||
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
|
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||||
|
if(theSlot.getHasStack()){
|
||||||
|
ItemStack currentStack = theSlot.getStack();
|
||||||
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
if(currentStack.getItem() == InitItems.itemMisc && currentStack.getItemDamage() == TheMiscItems.CANOLA.ordinal()){
|
||||||
|
this.mergeItemStack(newStack, 0, 1, false);
|
||||||
|
}
|
||||||
|
if(currentStack.getItem() == Items.bucket){
|
||||||
|
this.mergeItemStack(newStack, 1, 2, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,117 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityCoalGenerator;
|
||||||
|
import invtweaks.api.container.InventoryContainer;
|
||||||
|
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;
|
||||||
|
import net.minecraft.tileentity.TileEntityFurnace;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
@InventoryContainer
|
||||||
|
public class ContainerCoalGenerator extends Container{
|
||||||
|
|
||||||
|
private TileEntityCoalGenerator generator;
|
||||||
|
|
||||||
|
private int lastEnergyStored;
|
||||||
|
private int lastBurnTime;
|
||||||
|
private int lastMaxBurnTime;
|
||||||
|
|
||||||
|
public ContainerCoalGenerator(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
|
this.generator = (TileEntityCoalGenerator)tile;
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(this.generator, 0, 87, 43));
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++){
|
||||||
|
for (int j = 0; j < 9; j++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 9; i++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.generator.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting iCraft){
|
||||||
|
super.addCraftingToCrafters(iCraft);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 0, this.generator.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
|
iCraft.sendProgressBarUpdate(this, 1, this.generator.currentBurnTime);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 2, this.generator.maxBurnTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges(){
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
for(Object crafter : this.crafters){
|
||||||
|
ICrafting iCraft = (ICrafting)crafter;
|
||||||
|
|
||||||
|
if(this.lastEnergyStored != this.generator.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.generator.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
|
if(this.lastBurnTime != this.generator.currentBurnTime) iCraft.sendProgressBarUpdate(this, 1, this.generator.currentBurnTime);
|
||||||
|
if(this.lastMaxBurnTime != this.generator.maxBurnTime) iCraft.sendProgressBarUpdate(this, 2, this.generator.maxBurnTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastEnergyStored = this.generator.getEnergyStored(ForgeDirection.UNKNOWN);
|
||||||
|
this.lastBurnTime = this.generator.currentBurnTime;
|
||||||
|
this.lastMaxBurnTime = this.generator.maxBurnTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void updateProgressBar(int par1, int par2){
|
||||||
|
if(par1 == 0) this.generator.storage.setEnergyStored(par2);
|
||||||
|
if(par1 == 1) this.generator.currentBurnTime = par2;
|
||||||
|
if(par1 == 2) this.generator.maxBurnTime = par2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
|
final int inventoryStart = 1;
|
||||||
|
final int inventoryEnd = inventoryStart+26;
|
||||||
|
final int hotbarStart = inventoryEnd+1;
|
||||||
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
|
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||||
|
if(theSlot.getHasStack()){
|
||||||
|
ItemStack currentStack = theSlot.getStack();
|
||||||
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
if(TileEntityFurnace.getItemBurnTime(currentStack) > 0){
|
||||||
|
this.mergeItemStack(newStack, 0, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,150 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.inventory.slot.SlotOutput;
|
||||||
|
import ellpeck.actuallyadditions.items.InitItems;
|
||||||
|
import ellpeck.actuallyadditions.items.ItemCoffee;
|
||||||
|
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityCoffeeMachine;
|
||||||
|
import invtweaks.api.container.InventoryContainer;
|
||||||
|
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;
|
||||||
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
|
@InventoryContainer
|
||||||
|
public class ContainerCoffeeMachine extends Container{
|
||||||
|
|
||||||
|
private TileEntityCoffeeMachine machine;
|
||||||
|
|
||||||
|
private int lastCoffeeAmount;
|
||||||
|
private int lastEnergyAmount;
|
||||||
|
private int lastBrewTime;
|
||||||
|
private int lastWaterAmount;
|
||||||
|
|
||||||
|
public ContainerCoffeeMachine(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
|
this.machine = (TileEntityCoffeeMachine)tile;
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, 37, 6));
|
||||||
|
this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_INPUT, 80, 42));
|
||||||
|
this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_OUTPUT, 80, 73));
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; i++){
|
||||||
|
for (int j = 0; j < 2; j++){
|
||||||
|
this.addSlotToContainer(new Slot(machine, j+i*2+3, 125+j*18, 6+i*18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_WATER_INPUT, 26, 73));
|
||||||
|
this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_WATER_OUTPUT, 45, 73));
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++){
|
||||||
|
for (int j = 0; j < 9; j++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 9; i++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting iCraft){
|
||||||
|
super.addCraftingToCrafters(iCraft);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 0, this.machine.storage.getEnergyStored());
|
||||||
|
iCraft.sendProgressBarUpdate(this, 1, this.machine.coffeeCacheAmount);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 2, this.machine.brewTime);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 3, this.machine.tank.getFluidAmount());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges(){
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
for(Object crafter : this.crafters){
|
||||||
|
ICrafting iCraft = (ICrafting)crafter;
|
||||||
|
|
||||||
|
if(this.lastEnergyAmount != this.machine.storage.getEnergyStored()) iCraft.sendProgressBarUpdate(this, 0, this.machine.storage.getEnergyStored());
|
||||||
|
if(this.lastCoffeeAmount != this.machine.coffeeCacheAmount) iCraft.sendProgressBarUpdate(this, 1, this.machine.coffeeCacheAmount);
|
||||||
|
if(this.lastBrewTime != this.machine.brewTime) iCraft.sendProgressBarUpdate(this, 2, this.machine.brewTime);
|
||||||
|
if(this.lastWaterAmount != this.machine.tank.getFluidAmount()) iCraft.sendProgressBarUpdate(this, 3, this.machine.tank.getFluidAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastEnergyAmount = this.machine.storage.getEnergyStored();
|
||||||
|
this.lastCoffeeAmount = this.machine.coffeeCacheAmount;
|
||||||
|
this.lastBrewTime = this.machine.brewTime;
|
||||||
|
this.lastWaterAmount = this.machine.tank.getFluidAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void updateProgressBar(int par1, int par2){
|
||||||
|
if(par1 == 0) this.machine.storage.setEnergyStored(par2);
|
||||||
|
if(par1 == 1) this.machine.coffeeCacheAmount = par2;
|
||||||
|
if(par1 == 2) this.machine.brewTime = par2;
|
||||||
|
if(par1 == 3) this.machine.tank.setFluid(new FluidStack(FluidRegistry.WATER, par2));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.machine.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
|
final int inventoryStart = 13;
|
||||||
|
final int inventoryEnd = inventoryStart+26;
|
||||||
|
final int hotbarStart = inventoryEnd+1;
|
||||||
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
|
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||||
|
if(theSlot.getHasStack()){
|
||||||
|
ItemStack currentStack = theSlot.getStack();
|
||||||
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
|
if(currentStack.getItem() != null){
|
||||||
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
if(currentStack.getItem() == InitItems.itemCoffeeBean){
|
||||||
|
this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS+1, false);
|
||||||
|
}
|
||||||
|
if(currentStack.getItem() == InitItems.itemMisc && currentStack.getItemDamage() == TheMiscItems.CUP.ordinal()){
|
||||||
|
this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_INPUT, TileEntityCoffeeMachine.SLOT_INPUT+1, false);
|
||||||
|
}
|
||||||
|
if(ItemCoffee.getIngredientFromStack(newStack) != null){
|
||||||
|
this.mergeItemStack(newStack, 3, 10, false);
|
||||||
|
}
|
||||||
|
if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME))){
|
||||||
|
this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_WATER_INPUT, TileEntityCoffeeMachine.SLOT_WATER_INPUT+1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,195 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory;
|
||||||
|
|
||||||
|
import ellpeck.actuallyadditions.inventory.slot.SlotImmovable;
|
||||||
|
import ellpeck.actuallyadditions.items.ItemDrill;
|
||||||
|
import ellpeck.actuallyadditions.items.ItemDrillUpgrade;
|
||||||
|
import invtweaks.api.container.InventoryContainer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
@InventoryContainer
|
||||||
|
public class ContainerDrill extends Container{
|
||||||
|
|
||||||
|
private static final int SLOT_AMOUNT = 5;
|
||||||
|
|
||||||
|
private InventoryDrill drillInventory = new InventoryDrill();
|
||||||
|
private InventoryPlayer inventory;
|
||||||
|
|
||||||
|
public ContainerDrill(InventoryPlayer inventory){
|
||||||
|
this.inventory = inventory;
|
||||||
|
|
||||||
|
for(int i = 0; i < SLOT_AMOUNT; i++){
|
||||||
|
this.addSlotToContainer(new Slot(drillInventory, i, 44+i*18, 19){
|
||||||
|
@Override
|
||||||
|
public boolean isItemValid(ItemStack stack){
|
||||||
|
return stack.getItem() instanceof ItemDrillUpgrade;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < 3; i++){
|
||||||
|
for(int j = 0; j < 9; j++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 58+i*18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(int i = 0; i < 9; i++){
|
||||||
|
if(i == inventory.currentItem) this.addSlotToContainer(new SlotImmovable(inventory, i, 8+i*18, 116));
|
||||||
|
else this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 116));
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack stack = inventory.getCurrentItem();
|
||||||
|
if(stack != null && stack.getItem() instanceof ItemDrill){
|
||||||
|
ItemStack[] slots = ((ItemDrill)stack.getItem()).getSlotsFromNBT(inventory.getCurrentItem());
|
||||||
|
if(slots != null && slots.length > 0) this.drillInventory.slots = slots;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.drillInventory.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onContainerClosed(EntityPlayer player){
|
||||||
|
ItemStack stack = inventory.getCurrentItem();
|
||||||
|
if(stack != null && stack.getItem() instanceof ItemDrill){
|
||||||
|
((ItemDrill)stack.getItem()).writeSlotsToNBT(this.drillInventory.slots, inventory.getCurrentItem());
|
||||||
|
}
|
||||||
|
super.onContainerClosed(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
|
final int inventoryStart = 5;
|
||||||
|
final int inventoryEnd = inventoryStart+26;
|
||||||
|
final int hotbarStart = inventoryEnd+1;
|
||||||
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
|
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||||
|
if(theSlot.getHasStack()){
|
||||||
|
ItemStack currentStack = theSlot.getStack();
|
||||||
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
|
if(currentStack.getItem() != null){
|
||||||
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
if(currentStack.getItem() instanceof ItemDrillUpgrade){
|
||||||
|
this.mergeItemStack(newStack, 0, SLOT_AMOUNT, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class InventoryDrill implements IInventory{
|
||||||
|
|
||||||
|
public ItemStack[] slots = new ItemStack[SLOT_AMOUNT];
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getInventoryName(){
|
||||||
|
return "drill";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCustomInventoryName(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getInventoryStackLimit(){
|
||||||
|
return 64;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void markDirty(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void openInventory(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void closeInventory(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValidForSlot(int slot, ItemStack stack){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isUseableByPlayer(EntityPlayer player){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getStackInSlotOnClosing(int i){
|
||||||
|
return getStackInSlot(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setInventorySlotContents(int i, ItemStack stack){
|
||||||
|
this.slots[i] = stack;
|
||||||
|
this.markDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getSizeInventory(){
|
||||||
|
return slots.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getStackInSlot(int i){
|
||||||
|
if(i < this.getSizeInventory()){
|
||||||
|
return slots[i];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack decrStackSize(int i, int j){
|
||||||
|
if (slots[i] != null){
|
||||||
|
ItemStack stackAt;
|
||||||
|
if(slots[i].stackSize <= j){
|
||||||
|
stackAt = slots[i];
|
||||||
|
slots[i] = null;
|
||||||
|
this.markDirty();
|
||||||
|
return stackAt;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
stackAt = slots[i].splitStack(j);
|
||||||
|
if (slots[i].stackSize == 0) slots[i] = null;
|
||||||
|
this.markDirty();
|
||||||
|
return stackAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -50,28 +50,30 @@ public class ContainerDropper extends Container{
|
||||||
ItemStack currentStack = theSlot.getStack();
|
ItemStack currentStack = theSlot.getStack();
|
||||||
ItemStack newStack = currentStack.copy();
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= inventoryStart){
|
if(currentStack.getItem() != null){
|
||||||
this.mergeItemStack(newStack, 0, 9+1, false);
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, 0, 9, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= hotbarStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot < inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(newStack.stackSize == 0) theSlot.putStack(null);
|
|
||||||
else theSlot.onSlotChanged();
|
|
||||||
if(newStack.stackSize == currentStack.stackSize) return null;
|
|
||||||
theSlot.onPickupFromSlot(player, newStack);
|
|
||||||
|
|
||||||
return currentStack;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,107 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory;
|
||||||
|
|
||||||
|
import cofh.api.energy.IEnergyContainerItem;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.inventory.slot.SlotOutput;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityEnergizer;
|
||||||
|
import invtweaks.api.container.InventoryContainer;
|
||||||
|
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;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
@InventoryContainer
|
||||||
|
public class ContainerEnergizer extends Container{
|
||||||
|
|
||||||
|
private TileEntityEnergizer energizer;
|
||||||
|
|
||||||
|
private int lastEnergyStored;
|
||||||
|
|
||||||
|
public ContainerEnergizer(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
|
this.energizer = (TileEntityEnergizer)tile;
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(this.energizer, 0, 76, 73));
|
||||||
|
this.addSlotToContainer(new SlotOutput(this.energizer, 1, 76, 42));
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++){
|
||||||
|
for (int j = 0; j < 9; j++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 9; i++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.energizer.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting iCraft){
|
||||||
|
super.addCraftingToCrafters(iCraft);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 0, this.energizer.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges(){
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
for(Object crafter : this.crafters){
|
||||||
|
ICrafting iCraft = (ICrafting)crafter;
|
||||||
|
|
||||||
|
if(this.lastEnergyStored != this.energizer.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.energizer.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastEnergyStored = this.energizer.getEnergyStored(ForgeDirection.UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void updateProgressBar(int par1, int par2){
|
||||||
|
if(par1 == 0) this.energizer.storage.setEnergyStored(par2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
|
final int inventoryStart = 2;
|
||||||
|
final int inventoryEnd = inventoryStart+26;
|
||||||
|
final int hotbarStart = inventoryEnd+1;
|
||||||
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
|
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||||
|
if(theSlot.getHasStack()){
|
||||||
|
ItemStack currentStack = theSlot.getStack();
|
||||||
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
if(currentStack.getItem() instanceof IEnergyContainerItem){
|
||||||
|
this.mergeItemStack(newStack, 0, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,109 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory;
|
||||||
|
|
||||||
|
import cofh.api.energy.IEnergyContainerItem;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.inventory.slot.SlotOutput;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityEnervator;
|
||||||
|
import invtweaks.api.container.InventoryContainer;
|
||||||
|
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;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
@InventoryContainer
|
||||||
|
public class ContainerEnervator extends Container{
|
||||||
|
|
||||||
|
private TileEntityEnervator enervator;
|
||||||
|
|
||||||
|
private int lastEnergyStored;
|
||||||
|
|
||||||
|
public ContainerEnervator(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
|
this.enervator = (TileEntityEnervator)tile;
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(this.enervator, 0, 76, 73));
|
||||||
|
this.addSlotToContainer(new SlotOutput(this.enervator, 1, 76, 42));
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++){
|
||||||
|
for (int j = 0; j < 9; j++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 9; i++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.enervator.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting iCraft){
|
||||||
|
super.addCraftingToCrafters(iCraft);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 0, this.enervator.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges(){
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
for(Object crafter : this.crafters){
|
||||||
|
ICrafting iCraft = (ICrafting)crafter;
|
||||||
|
|
||||||
|
if(this.lastEnergyStored != this.enervator.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.enervator.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastEnergyStored = this.enervator.getEnergyStored(ForgeDirection.UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void updateProgressBar(int par1, int par2){
|
||||||
|
if(par1 == 0) this.enervator.storage.setEnergyStored(par2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
|
final int inventoryStart = 2;
|
||||||
|
final int inventoryEnd = inventoryStart+26;
|
||||||
|
final int hotbarStart = inventoryEnd+1;
|
||||||
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
|
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||||
|
if(theSlot.getHasStack()){
|
||||||
|
ItemStack currentStack = theSlot.getStack();
|
||||||
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
if(currentStack.getItem() instanceof IEnergyContainerItem){
|
||||||
|
this.mergeItemStack(newStack, 0, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -79,28 +79,30 @@ public class ContainerFeeder extends Container{
|
||||||
ItemStack currentStack = theSlot.getStack();
|
ItemStack currentStack = theSlot.getStack();
|
||||||
ItemStack newStack = currentStack.copy();
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= inventoryStart){
|
if(currentStack.getItem() != null){
|
||||||
this.mergeItemStack(newStack, 0, 1, false);
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, 0, 1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= hotbarStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot < inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(newStack.stackSize == 0) theSlot.putStack(null);
|
|
||||||
else theSlot.onSlotChanged();
|
|
||||||
if(newStack.stackSize == currentStack.stackSize) return null;
|
|
||||||
theSlot.onPickupFromSlot(player, newStack);
|
|
||||||
|
|
||||||
return currentStack;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,128 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||||
|
import ellpeck.actuallyadditions.inventory.slot.SlotOutput;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityFermentingBarrel;
|
||||||
|
import invtweaks.api.container.InventoryContainer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.ICrafting;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
|
@InventoryContainer
|
||||||
|
public class ContainerFermentingBarrel extends Container{
|
||||||
|
|
||||||
|
private TileEntityFermentingBarrel barrel;
|
||||||
|
|
||||||
|
private int lastProcessTime;
|
||||||
|
private int lastCanolaTank;
|
||||||
|
private int lastOilTank;
|
||||||
|
|
||||||
|
public ContainerFermentingBarrel(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
|
this.barrel = (TileEntityFermentingBarrel)tile;
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(this.barrel, 0, 42, 74));
|
||||||
|
this.addSlotToContainer(new SlotOutput(this.barrel, 1, 42, 43));
|
||||||
|
this.addSlotToContainer(new Slot(this.barrel, 2, 118, 74));
|
||||||
|
this.addSlotToContainer(new SlotOutput(this.barrel, 3, 118, 43));
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++){
|
||||||
|
for (int j = 0; j < 9; j++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 9; i++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.barrel.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting iCraft){
|
||||||
|
super.addCraftingToCrafters(iCraft);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 0, this.barrel.oilTank.getFluidAmount());
|
||||||
|
iCraft.sendProgressBarUpdate(this, 1, this.barrel.canolaTank.getFluidAmount());
|
||||||
|
iCraft.sendProgressBarUpdate(this, 2, this.barrel.currentProcessTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges(){
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
for(Object crafter : this.crafters){
|
||||||
|
ICrafting iCraft = (ICrafting)crafter;
|
||||||
|
|
||||||
|
if(this.lastOilTank != this.barrel.oilTank.getFluidAmount()) iCraft.sendProgressBarUpdate(this, 0, this.barrel.oilTank.getFluidAmount());
|
||||||
|
if(this.lastCanolaTank != this.barrel.canolaTank.getFluidAmount()) iCraft.sendProgressBarUpdate(this, 1, this.barrel.canolaTank.getFluidAmount());
|
||||||
|
if(this.lastProcessTime != this.barrel.currentProcessTime) iCraft.sendProgressBarUpdate(this, 2, this.barrel.currentProcessTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastOilTank = this.barrel.oilTank.getFluidAmount();
|
||||||
|
this.lastCanolaTank = this.barrel.canolaTank.getFluidAmount();
|
||||||
|
this.lastProcessTime = this.barrel.currentProcessTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void updateProgressBar(int par1, int par2){
|
||||||
|
if(par1 == 0) this.barrel.oilTank.setFluid(new FluidStack(InitBlocks.fluidOil, par2));
|
||||||
|
if(par1 == 1) this.barrel.canolaTank.setFluid(new FluidStack(InitBlocks.fluidCanolaOil, par2));
|
||||||
|
if(par1 == 2) this.barrel.currentProcessTime = par2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
|
final int inventoryStart = 4;
|
||||||
|
final int inventoryEnd = inventoryStart+26;
|
||||||
|
final int hotbarStart = inventoryEnd+1;
|
||||||
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
|
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||||
|
if(theSlot.getHasStack()){
|
||||||
|
ItemStack currentStack = theSlot.getStack();
|
||||||
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
|
if(currentStack.getItem() != null){
|
||||||
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
if(FluidContainerRegistry.containsFluid(currentStack, new FluidStack(InitBlocks.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME))){
|
||||||
|
this.mergeItemStack(newStack, 0, 1, false);
|
||||||
|
}
|
||||||
|
if(currentStack.getItem() == Items.bucket){
|
||||||
|
this.mergeItemStack(newStack, 2, 3, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,88 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory;
|
||||||
|
|
||||||
|
import ellpeck.actuallyadditions.inventory.slot.SlotOutput;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityFluidCollector;
|
||||||
|
import invtweaks.api.container.InventoryContainer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
|
|
||||||
|
@InventoryContainer
|
||||||
|
public class ContainerFluidCollector extends Container{
|
||||||
|
|
||||||
|
private TileEntityFluidCollector collector;
|
||||||
|
|
||||||
|
public ContainerFluidCollector(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
|
this.collector = (TileEntityFluidCollector)tile;
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(collector, 0, 90, 73));
|
||||||
|
this.addSlotToContainer(new SlotOutput(collector, 1, 90, 42));
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++){
|
||||||
|
for (int j = 0; j < 9; j++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 9; i++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.collector.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
|
final int inventoryStart = 2;
|
||||||
|
final int inventoryEnd = inventoryStart+26;
|
||||||
|
final int hotbarStart = inventoryEnd+1;
|
||||||
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
|
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||||
|
if(theSlot.getHasStack()){
|
||||||
|
ItemStack currentStack = theSlot.getStack();
|
||||||
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
|
if(currentStack.getItem() != null){
|
||||||
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
if(this.collector.isPlacer){
|
||||||
|
if(FluidContainerRegistry.isBucket(currentStack) && !newStack.isItemEqual(FluidContainerRegistry.EMPTY_BUCKET)){
|
||||||
|
this.mergeItemStack(newStack, 0, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(newStack.isItemEqual(FluidContainerRegistry.EMPTY_BUCKET)){
|
||||||
|
this.mergeItemStack(newStack, 0, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,15 +13,14 @@ import net.minecraft.inventory.ICrafting;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||||
import net.minecraft.tileentity.TileEntityFurnace;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
@InventoryContainer
|
@InventoryContainer
|
||||||
public class ContainerFurnaceDouble extends Container{
|
public class ContainerFurnaceDouble extends Container{
|
||||||
|
|
||||||
private TileEntityFurnaceDouble tileFurnace;
|
private TileEntityFurnaceDouble tileFurnace;
|
||||||
|
|
||||||
private int lastCoalTime;
|
private int lastEnergy;
|
||||||
private int lastCoalTimeLeft;
|
|
||||||
private int lastFirstCrushTime;
|
private int lastFirstCrushTime;
|
||||||
private int lastSecondCrushTime;
|
private int lastSecondCrushTime;
|
||||||
private int lastBurnTime;
|
private int lastBurnTime;
|
||||||
|
@ -29,15 +28,11 @@ public class ContainerFurnaceDouble extends Container{
|
||||||
public ContainerFurnaceDouble(InventoryPlayer inventory, TileEntityBase tile){
|
public ContainerFurnaceDouble(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
this.tileFurnace = (TileEntityFurnaceDouble)tile;
|
this.tileFurnace = (TileEntityFurnaceDouble)tile;
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_COAL, 80, 21));
|
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_INPUT_1, 51, 21));
|
this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_INPUT_1, 51, 21));
|
||||||
this.addSlotToContainer(new SlotOutput(this.tileFurnace, TileEntityFurnaceDouble.SLOT_OUTPUT_1, 51, 69));
|
this.addSlotToContainer(new SlotOutput(this.tileFurnace, TileEntityFurnaceDouble.SLOT_OUTPUT_1, 51, 69));
|
||||||
this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_INPUT_2, 109, 21));
|
this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_INPUT_2, 109, 21));
|
||||||
this.addSlotToContainer(new SlotOutput(this.tileFurnace, TileEntityFurnaceDouble.SLOT_OUTPUT_2, 108, 69));
|
this.addSlotToContainer(new SlotOutput(this.tileFurnace, TileEntityFurnaceDouble.SLOT_OUTPUT_2, 108, 69));
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(this.tileFurnace, this.tileFurnace.speedUpgradeSlot, 155, 21));
|
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++){
|
for (int i = 0; i < 3; i++){
|
||||||
for (int j = 0; j < 9; j++){
|
for (int j = 0; j < 9; j++){
|
||||||
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
||||||
|
@ -51,11 +46,10 @@ public class ContainerFurnaceDouble extends Container{
|
||||||
@Override
|
@Override
|
||||||
public void addCraftingToCrafters(ICrafting iCraft){
|
public void addCraftingToCrafters(ICrafting iCraft){
|
||||||
super.addCraftingToCrafters(iCraft);
|
super.addCraftingToCrafters(iCraft);
|
||||||
iCraft.sendProgressBarUpdate(this, 0, this.tileFurnace.coalTime);
|
iCraft.sendProgressBarUpdate(this, 0, this.tileFurnace.firstSmeltTime);
|
||||||
iCraft.sendProgressBarUpdate(this, 1, this.tileFurnace.coalTimeLeft);
|
iCraft.sendProgressBarUpdate(this, 1, this.tileFurnace.secondSmeltTime);
|
||||||
iCraft.sendProgressBarUpdate(this, 2, this.tileFurnace.firstSmeltTime);
|
iCraft.sendProgressBarUpdate(this, 2, this.tileFurnace.maxBurnTime);
|
||||||
iCraft.sendProgressBarUpdate(this, 3, this.tileFurnace.secondSmeltTime);
|
iCraft.sendProgressBarUpdate(this, 3, this.tileFurnace.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
iCraft.sendProgressBarUpdate(this, 4, this.tileFurnace.maxBurnTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -64,28 +58,25 @@ public class ContainerFurnaceDouble extends Container{
|
||||||
for(Object crafter : this.crafters){
|
for(Object crafter : this.crafters){
|
||||||
ICrafting iCraft = (ICrafting)crafter;
|
ICrafting iCraft = (ICrafting)crafter;
|
||||||
|
|
||||||
if(this.lastCoalTime != this.tileFurnace.coalTime) iCraft.sendProgressBarUpdate(this, 0, this.tileFurnace.coalTime);
|
if(this.lastFirstCrushTime != this.tileFurnace.firstSmeltTime) iCraft.sendProgressBarUpdate(this, 0, this.tileFurnace.firstSmeltTime);
|
||||||
if(this.lastCoalTimeLeft != this.tileFurnace.coalTimeLeft) iCraft.sendProgressBarUpdate(this, 1, this.tileFurnace.coalTimeLeft);
|
if(this.lastSecondCrushTime != this.tileFurnace.secondSmeltTime) iCraft.sendProgressBarUpdate(this, 1, this.tileFurnace.secondSmeltTime);
|
||||||
if(this.lastFirstCrushTime != this.tileFurnace.firstSmeltTime) iCraft.sendProgressBarUpdate(this, 2, this.tileFurnace.firstSmeltTime);
|
if(this.lastBurnTime != this.tileFurnace.maxBurnTime) iCraft.sendProgressBarUpdate(this, 2, this.tileFurnace.maxBurnTime);
|
||||||
if(this.lastSecondCrushTime != this.tileFurnace.secondSmeltTime) iCraft.sendProgressBarUpdate(this, 3, this.tileFurnace.secondSmeltTime);
|
if(this.lastEnergy != this.tileFurnace.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 3, this.tileFurnace.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
if(this.lastBurnTime != this.tileFurnace.maxBurnTime) iCraft.sendProgressBarUpdate(this, 4, this.tileFurnace.maxBurnTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lastCoalTime = this.tileFurnace.coalTime;
|
|
||||||
this.lastCoalTimeLeft = this.tileFurnace.coalTimeLeft;
|
|
||||||
this.lastFirstCrushTime = this.tileFurnace.firstSmeltTime;
|
this.lastFirstCrushTime = this.tileFurnace.firstSmeltTime;
|
||||||
this.lastSecondCrushTime = this.tileFurnace.secondSmeltTime;
|
this.lastSecondCrushTime = this.tileFurnace.secondSmeltTime;
|
||||||
this.lastBurnTime = this.tileFurnace.maxBurnTime;
|
this.lastBurnTime = this.tileFurnace.maxBurnTime;
|
||||||
|
this.lastEnergy = this.tileFurnace.getEnergyStored(ForgeDirection.UNKNOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void updateProgressBar(int par1, int par2){
|
public void updateProgressBar(int par1, int par2){
|
||||||
if(par1 == 0) this.tileFurnace.coalTime = par2;
|
if(par1 == 0) this.tileFurnace.firstSmeltTime = par2;
|
||||||
if(par1 == 1) this.tileFurnace.coalTimeLeft = par2;
|
if(par1 == 1) this.tileFurnace.secondSmeltTime = par2;
|
||||||
if(par1 == 2) this.tileFurnace.firstSmeltTime = par2;
|
if(par1 == 2) this.tileFurnace.maxBurnTime = par2;
|
||||||
if(par1 == 3) this.tileFurnace.secondSmeltTime = par2;
|
if(par1 == 3) this.tileFurnace.storage.setEnergyStored(par2);
|
||||||
if(par1 == 4) this.tileFurnace.maxBurnTime = par2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -95,7 +86,7 @@ public class ContainerFurnaceDouble extends Container{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 6;
|
final int inventoryStart = 4;
|
||||||
final int inventoryEnd = inventoryStart+26;
|
final int inventoryEnd = inventoryStart+26;
|
||||||
final int hotbarStart = inventoryEnd+1;
|
final int hotbarStart = inventoryEnd+1;
|
||||||
final int hotbarEnd = hotbarStart+8;
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
@ -105,35 +96,33 @@ public class ContainerFurnaceDouble extends Container{
|
||||||
ItemStack currentStack = theSlot.getStack();
|
ItemStack currentStack = theSlot.getStack();
|
||||||
ItemStack newStack = currentStack.copy();
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= inventoryStart){
|
if(currentStack.getItem() != null){
|
||||||
if(FurnaceRecipes.smelting().getSmeltingResult(currentStack) != null){
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_1, TileEntityFurnaceDouble.SLOT_INPUT_1+1, false);
|
if(FurnaceRecipes.smelting().getSmeltingResult(currentStack) != null){
|
||||||
this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_2, TileEntityFurnaceDouble.SLOT_INPUT_2+2, false);
|
this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_1, TileEntityFurnaceDouble.SLOT_INPUT_1+1, false);
|
||||||
|
this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_2, TileEntityFurnaceDouble.SLOT_INPUT_2+2, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(TileEntityFurnace.getItemBurnTime(currentStack) > 0){
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_COAL, TileEntityFurnaceDouble.SLOT_COAL+1, false);
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= hotbarStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot < inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(newStack.stackSize == 0) theSlot.putStack(null);
|
|
||||||
else theSlot.onSlotChanged();
|
|
||||||
if(newStack.stackSize == currentStack.stackSize) return null;
|
|
||||||
theSlot.onPickupFromSlot(player, newStack);
|
|
||||||
|
|
||||||
return currentStack;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,28 +50,30 @@ public class ContainerGiantChest extends Container{
|
||||||
ItemStack currentStack = theSlot.getStack();
|
ItemStack currentStack = theSlot.getStack();
|
||||||
ItemStack newStack = currentStack.copy();
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= inventoryStart){
|
if(currentStack.getItem() != null){
|
||||||
this.mergeItemStack(newStack, 0, 117, false);
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, 0, 117, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= hotbarStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot < inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(newStack.stackSize == 0) theSlot.putStack(null);
|
|
||||||
else theSlot.onSlotChanged();
|
|
||||||
if(newStack.stackSize == currentStack.stackSize) return null;
|
|
||||||
theSlot.onPickupFromSlot(player, newStack);
|
|
||||||
|
|
||||||
return currentStack;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package ellpeck.actuallyadditions.inventory;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import ellpeck.actuallyadditions.inventory.slot.SlotOutput;
|
import ellpeck.actuallyadditions.inventory.slot.SlotOutput;
|
||||||
import ellpeck.actuallyadditions.recipe.GrinderRecipes;
|
import ellpeck.actuallyadditions.recipe.GrinderRecipeManualRegistry;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityGrinder;
|
import ellpeck.actuallyadditions.tile.TileEntityGrinder;
|
||||||
import invtweaks.api.container.InventoryContainer;
|
import invtweaks.api.container.InventoryContainer;
|
||||||
|
@ -13,7 +13,7 @@ import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ICrafting;
|
import net.minecraft.inventory.ICrafting;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntityFurnace;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
@InventoryContainer
|
@InventoryContainer
|
||||||
public class ContainerGrinder extends Container{
|
public class ContainerGrinder extends Container{
|
||||||
|
@ -21,18 +21,15 @@ public class ContainerGrinder extends Container{
|
||||||
private TileEntityGrinder tileGrinder;
|
private TileEntityGrinder tileGrinder;
|
||||||
private boolean isDouble;
|
private boolean isDouble;
|
||||||
|
|
||||||
private int lastCoalTime;
|
|
||||||
private int lastCoalTimeLeft;
|
|
||||||
private int lastFirstCrushTime;
|
private int lastFirstCrushTime;
|
||||||
private int lastSecondCrushTime;
|
private int lastSecondCrushTime;
|
||||||
private int lastMaxCrushTime;
|
private int lastMaxCrushTime;
|
||||||
|
private int lastEnergyStored;
|
||||||
|
|
||||||
public ContainerGrinder(InventoryPlayer inventory, TileEntityBase tile, boolean isDouble){
|
public ContainerGrinder(InventoryPlayer inventory, TileEntityBase tile, boolean isDouble){
|
||||||
this.tileGrinder = (TileEntityGrinder)tile;
|
this.tileGrinder = (TileEntityGrinder)tile;
|
||||||
this.isDouble = isDouble;
|
this.isDouble = isDouble;
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(this.tileGrinder, TileEntityGrinder.SLOT_COAL, this.isDouble ? 80 : 51, 21));
|
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(this.tileGrinder, TileEntityGrinder.SLOT_INPUT_1, this.isDouble ? 51 : 80, 21));
|
this.addSlotToContainer(new Slot(this.tileGrinder, TileEntityGrinder.SLOT_INPUT_1, this.isDouble ? 51 : 80, 21));
|
||||||
this.addSlotToContainer(new SlotOutput(this.tileGrinder, TileEntityGrinder.SLOT_OUTPUT_1_1, this.isDouble ? 37 : 66, 69));
|
this.addSlotToContainer(new SlotOutput(this.tileGrinder, TileEntityGrinder.SLOT_OUTPUT_1_1, this.isDouble ? 37 : 66, 69));
|
||||||
this.addSlotToContainer(new SlotOutput(this.tileGrinder, TileEntityGrinder.SLOT_OUTPUT_1_2, this.isDouble ? 64 : 92, 69));
|
this.addSlotToContainer(new SlotOutput(this.tileGrinder, TileEntityGrinder.SLOT_OUTPUT_1_2, this.isDouble ? 64 : 92, 69));
|
||||||
|
@ -42,8 +39,6 @@ public class ContainerGrinder extends Container{
|
||||||
this.addSlotToContainer(new SlotOutput(this.tileGrinder, TileEntityGrinder.SLOT_OUTPUT_2_2, 121, 69));
|
this.addSlotToContainer(new SlotOutput(this.tileGrinder, TileEntityGrinder.SLOT_OUTPUT_2_2, 121, 69));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(this.tileGrinder, this.tileGrinder.speedUpgradeSlot, this.isDouble ? 155 : 146, 21));
|
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++){
|
for (int i = 0; i < 3; i++){
|
||||||
for (int j = 0; j < 9; j++){
|
for (int j = 0; j < 9; j++){
|
||||||
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
||||||
|
@ -57,11 +52,10 @@ public class ContainerGrinder extends Container{
|
||||||
@Override
|
@Override
|
||||||
public void addCraftingToCrafters(ICrafting iCraft){
|
public void addCraftingToCrafters(ICrafting iCraft){
|
||||||
super.addCraftingToCrafters(iCraft);
|
super.addCraftingToCrafters(iCraft);
|
||||||
iCraft.sendProgressBarUpdate(this, 0, this.tileGrinder.coalTime);
|
iCraft.sendProgressBarUpdate(this, 0, this.tileGrinder.firstCrushTime);
|
||||||
iCraft.sendProgressBarUpdate(this, 1, this.tileGrinder.coalTimeLeft);
|
iCraft.sendProgressBarUpdate(this, 1, this.tileGrinder.maxCrushTime);
|
||||||
iCraft.sendProgressBarUpdate(this, 2, this.tileGrinder.firstCrushTime);
|
if(this.isDouble) iCraft.sendProgressBarUpdate(this, 2, this.tileGrinder.secondCrushTime);
|
||||||
iCraft.sendProgressBarUpdate(this, 3, this.tileGrinder.maxCrushTime);
|
iCraft.sendProgressBarUpdate(this, 3, this.tileGrinder.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
if(this.isDouble) iCraft.sendProgressBarUpdate(this, 4, this.tileGrinder.secondCrushTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -70,28 +64,25 @@ public class ContainerGrinder extends Container{
|
||||||
for(Object crafter : this.crafters){
|
for(Object crafter : this.crafters){
|
||||||
ICrafting iCraft = (ICrafting)crafter;
|
ICrafting iCraft = (ICrafting)crafter;
|
||||||
|
|
||||||
if(this.lastCoalTime != this.tileGrinder.coalTime) iCraft.sendProgressBarUpdate(this, 0, this.tileGrinder.coalTime);
|
if(this.lastFirstCrushTime != this.tileGrinder.firstCrushTime) iCraft.sendProgressBarUpdate(this, 0, this.tileGrinder.firstCrushTime);
|
||||||
if(this.lastCoalTimeLeft != this.tileGrinder.coalTimeLeft) iCraft.sendProgressBarUpdate(this, 1, this.tileGrinder.coalTimeLeft);
|
if(this.lastMaxCrushTime != this.tileGrinder.maxCrushTime) iCraft.sendProgressBarUpdate(this, 1, this.tileGrinder.maxCrushTime);
|
||||||
if(this.lastFirstCrushTime != this.tileGrinder.firstCrushTime) iCraft.sendProgressBarUpdate(this, 2, this.tileGrinder.firstCrushTime);
|
if(this.isDouble) if(this.lastSecondCrushTime != this.tileGrinder.secondCrushTime) iCraft.sendProgressBarUpdate(this, 2, this.tileGrinder.secondCrushTime);
|
||||||
if(this.lastMaxCrushTime != this.tileGrinder.maxCrushTime) iCraft.sendProgressBarUpdate(this, 3, this.tileGrinder.maxCrushTime);
|
if(this.lastEnergyStored != this.tileGrinder.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 3, this.tileGrinder.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
if(this.isDouble) if(this.lastSecondCrushTime != this.tileGrinder.secondCrushTime) iCraft.sendProgressBarUpdate(this, 4, this.tileGrinder.secondCrushTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lastCoalTime = this.tileGrinder.coalTime;
|
|
||||||
this.lastCoalTimeLeft = this.tileGrinder.coalTimeLeft;
|
|
||||||
this.lastFirstCrushTime = this.tileGrinder.firstCrushTime;
|
this.lastFirstCrushTime = this.tileGrinder.firstCrushTime;
|
||||||
this.lastMaxCrushTime = this.tileGrinder.maxCrushTime;
|
this.lastMaxCrushTime = this.tileGrinder.maxCrushTime;
|
||||||
if(this.isDouble) this.lastSecondCrushTime = this.tileGrinder.secondCrushTime;
|
if(this.isDouble) this.lastSecondCrushTime = this.tileGrinder.secondCrushTime;
|
||||||
|
this.lastEnergyStored = this.tileGrinder.getEnergyStored(ForgeDirection.UNKNOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void updateProgressBar(int par1, int par2){
|
public void updateProgressBar(int par1, int par2){
|
||||||
if(par1 == 0) this.tileGrinder.coalTime = par2;
|
if(par1 == 0) this.tileGrinder.firstCrushTime = par2;
|
||||||
if(par1 == 1) this.tileGrinder.coalTimeLeft = par2;
|
if(par1 == 1) this.tileGrinder.maxCrushTime = par2;
|
||||||
if(par1 == 2) this.tileGrinder.firstCrushTime = par2;
|
if(this.isDouble && par1 == 2) this.tileGrinder.secondCrushTime = par2;
|
||||||
if(par1 == 3) this.tileGrinder.maxCrushTime = par2;
|
if(par1 == 3) this.tileGrinder.storage.setEnergyStored(par2);
|
||||||
if(this.isDouble && par1 == 4) this.tileGrinder.secondCrushTime = par2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -101,7 +92,7 @@ public class ContainerGrinder extends Container{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = this.isDouble ? 8 : 5;
|
final int inventoryStart = this.isDouble ? 6 : 3;
|
||||||
final int inventoryEnd = inventoryStart+26;
|
final int inventoryEnd = inventoryStart+26;
|
||||||
final int hotbarStart = inventoryEnd+1;
|
final int hotbarStart = inventoryEnd+1;
|
||||||
final int hotbarEnd = hotbarStart+8;
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
@ -111,35 +102,33 @@ public class ContainerGrinder extends Container{
|
||||||
ItemStack currentStack = theSlot.getStack();
|
ItemStack currentStack = theSlot.getStack();
|
||||||
ItemStack newStack = currentStack.copy();
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= inventoryStart){
|
if(currentStack.getItem() != null){
|
||||||
if(GrinderRecipes.instance().getOutput(currentStack, false) != null){
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_1, TileEntityGrinder.SLOT_INPUT_1+1, false);
|
if(GrinderRecipeManualRegistry.getOutput(currentStack, false) != null){
|
||||||
if(this.isDouble) this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_2, TileEntityGrinder.SLOT_INPUT_2+1, false);
|
this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_1, TileEntityGrinder.SLOT_INPUT_1+1, false);
|
||||||
|
if(this.isDouble) this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_2, TileEntityGrinder.SLOT_INPUT_2+1, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(TileEntityFurnace.getItemBurnTime(currentStack) > 0){
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
this.mergeItemStack(newStack, TileEntityGrinder.SLOT_COAL, TileEntityGrinder.SLOT_COAL+1, false);
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= hotbarStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot < inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(newStack.stackSize == 0) theSlot.putStack(null);
|
|
||||||
else theSlot.onSlotChanged();
|
|
||||||
if(newStack.stackSize == currentStack.stackSize) return null;
|
|
||||||
theSlot.onPickupFromSlot(player, newStack);
|
|
||||||
|
|
||||||
return currentStack;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package ellpeck.actuallyadditions.inventory;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.inventory.gui.GuiInputter;
|
||||||
import ellpeck.actuallyadditions.inventory.slot.SlotFilter;
|
import ellpeck.actuallyadditions.inventory.slot.SlotFilter;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityInputter;
|
import ellpeck.actuallyadditions.tile.TileEntityInputter;
|
||||||
|
@ -19,11 +20,14 @@ public class ContainerInputter extends Container{
|
||||||
private TileEntityInputter tileInputter;
|
private TileEntityInputter tileInputter;
|
||||||
|
|
||||||
private int lastSideToPut;
|
private int lastSideToPut;
|
||||||
private int lastSlotToPut;
|
|
||||||
private int lastSideToPull;
|
private int lastSideToPull;
|
||||||
private int lastSlotToPull;
|
private int lastIsPullWhitelist;
|
||||||
private int lastPlaceToPutSlotAmount;
|
private int lastIsPutWhitelist;
|
||||||
private int lastPlaceToPullSlotAmount;
|
|
||||||
|
private int lastSlotPutStart;
|
||||||
|
private int lastSlotPutEnd;
|
||||||
|
private int lastSlotPullStart;
|
||||||
|
private int lastSlotPullEnd;
|
||||||
|
|
||||||
private boolean isAdvanced;
|
private boolean isAdvanced;
|
||||||
|
|
||||||
|
@ -35,22 +39,21 @@ public class ContainerInputter extends Container{
|
||||||
|
|
||||||
if(isAdvanced){
|
if(isAdvanced){
|
||||||
for(int i = 0; i < 2; i++){
|
for(int i = 0; i < 2; i++){
|
||||||
this.addSlotToContainer(new SlotFilter(this.tileInputter, 1+i*6, 20+i*84, 6));
|
for(int x = 0; x < 3; x++){
|
||||||
this.addSlotToContainer(new SlotFilter(this.tileInputter, 2+i*6, 38+i*84, 6));
|
for(int y = 0;y < 4; y++){
|
||||||
this.addSlotToContainer(new SlotFilter(this.tileInputter, 3+i*6, 56+i*84, 6));
|
this.addSlotToContainer(new SlotFilter(this.tileInputter, 1+y+x*4+i*12, 20+i*84+x*18, 6+y*18));
|
||||||
this.addSlotToContainer(new SlotFilter(this.tileInputter, 4+i*6, 20+i*84, 24));
|
}
|
||||||
this.addSlotToContainer(new SlotFilter(this.tileInputter, 5+i*6, 38+i*84, 24));
|
}
|
||||||
this.addSlotToContainer(new SlotFilter(this.tileInputter, 6+i*6, 56+i*84, 24));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < 3; i++){
|
for(int i = 0; i < 3; i++){
|
||||||
for (int j = 0; j < 9; j++){
|
for (int j = 0; j < 9; j++){
|
||||||
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18 + (isAdvanced ? 12 : 0)));
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18 + (isAdvanced ? GuiInputter.OFFSET_ADVANCED : 0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(int i = 0; i < 9; i++){
|
for(int i = 0; i < 9; i++){
|
||||||
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155 + (isAdvanced ? 12 : 0)));
|
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155 + (isAdvanced ? GuiInputter.OFFSET_ADVANCED : 0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,11 +61,14 @@ public class ContainerInputter extends Container{
|
||||||
public void addCraftingToCrafters(ICrafting iCraft){
|
public void addCraftingToCrafters(ICrafting iCraft){
|
||||||
super.addCraftingToCrafters(iCraft);
|
super.addCraftingToCrafters(iCraft);
|
||||||
iCraft.sendProgressBarUpdate(this, 0, this.tileInputter.sideToPut);
|
iCraft.sendProgressBarUpdate(this, 0, this.tileInputter.sideToPut);
|
||||||
iCraft.sendProgressBarUpdate(this, 1, this.tileInputter.slotToPut);
|
iCraft.sendProgressBarUpdate(this, 1, this.tileInputter.sideToPull);
|
||||||
iCraft.sendProgressBarUpdate(this, 2, this.tileInputter.sideToPull);
|
iCraft.sendProgressBarUpdate(this, 2, this.tileInputter.isPullWhitelist ? 1 : 0);
|
||||||
iCraft.sendProgressBarUpdate(this, 3, this.tileInputter.slotToPull);
|
iCraft.sendProgressBarUpdate(this, 3, this.tileInputter.isPutWhitelist ? 1 : 0);
|
||||||
iCraft.sendProgressBarUpdate(this, 4, this.tileInputter.placeToPullSlotAmount);
|
|
||||||
iCraft.sendProgressBarUpdate(this, 5, this.tileInputter.placeToPutSlotAmount);
|
iCraft.sendProgressBarUpdate(this, 4, this.tileInputter.slotToPutStart);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 5, this.tileInputter.slotToPutEnd);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 6, this.tileInputter.slotToPullStart);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 7, this.tileInputter.slotToPullEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -71,30 +77,39 @@ public class ContainerInputter extends Container{
|
||||||
for(Object crafter : this.crafters){
|
for(Object crafter : this.crafters){
|
||||||
ICrafting iCraft = (ICrafting)crafter;
|
ICrafting iCraft = (ICrafting)crafter;
|
||||||
if(this.lastSideToPut != this.tileInputter.sideToPut) iCraft.sendProgressBarUpdate(this, 0, this.tileInputter.sideToPut);
|
if(this.lastSideToPut != this.tileInputter.sideToPut) iCraft.sendProgressBarUpdate(this, 0, this.tileInputter.sideToPut);
|
||||||
if(this.lastSlotToPut != this.tileInputter.slotToPut) iCraft.sendProgressBarUpdate(this, 1, this.tileInputter.slotToPut);
|
if(this.lastSideToPull != this.tileInputter.sideToPull) iCraft.sendProgressBarUpdate(this, 1, this.tileInputter.sideToPull);
|
||||||
if(this.lastSideToPull != this.tileInputter.sideToPull) iCraft.sendProgressBarUpdate(this, 2, this.tileInputter.sideToPull);
|
if(this.lastIsPullWhitelist != (this.tileInputter.isPullWhitelist ? 1 : 0)) iCraft.sendProgressBarUpdate(this, 2, this.tileInputter.isPullWhitelist ? 1 : 0);
|
||||||
if(this.lastSlotToPull != this.tileInputter.slotToPull) iCraft.sendProgressBarUpdate(this, 3, this.tileInputter.slotToPull);
|
if(this.lastIsPutWhitelist != (this.tileInputter.isPutWhitelist ? 1 : 0)) iCraft.sendProgressBarUpdate(this, 3, this.tileInputter.isPutWhitelist ? 1 : 0);
|
||||||
if(this.lastPlaceToPullSlotAmount != this.tileInputter.placeToPullSlotAmount) iCraft.sendProgressBarUpdate(this, 4, this.tileInputter.placeToPullSlotAmount);
|
|
||||||
if(this.lastPlaceToPutSlotAmount != this.tileInputter.placeToPutSlotAmount) iCraft.sendProgressBarUpdate(this, 5, this.tileInputter.placeToPutSlotAmount);
|
|
||||||
}
|
|
||||||
this.lastSideToPut = this.tileInputter.sideToPut;
|
|
||||||
this.lastSlotToPut = this.tileInputter.slotToPut;
|
|
||||||
this.lastSideToPull = this.tileInputter.sideToPull;
|
|
||||||
this.lastSlotToPull = this.tileInputter.slotToPull;
|
|
||||||
this.lastPlaceToPullSlotAmount = this.tileInputter.placeToPullSlotAmount;
|
|
||||||
this.lastPlaceToPutSlotAmount = this.tileInputter.placeToPutSlotAmount;
|
|
||||||
|
|
||||||
|
if(this.lastSlotPutStart != this.tileInputter.slotToPutStart) iCraft.sendProgressBarUpdate(this, 4, this.tileInputter.slotToPutStart);
|
||||||
|
if(this.lastSlotPutEnd != this.tileInputter.slotToPutEnd) iCraft.sendProgressBarUpdate(this, 5, this.tileInputter.slotToPutEnd);
|
||||||
|
if(this.lastSlotPullStart != this.tileInputter.slotToPullStart) iCraft.sendProgressBarUpdate(this, 6, this.tileInputter.slotToPullStart);
|
||||||
|
if(this.lastSlotPullEnd != this.tileInputter.slotToPullEnd) iCraft.sendProgressBarUpdate(this, 7, this.tileInputter.slotToPullEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastSideToPut = this.tileInputter.sideToPut;
|
||||||
|
this.lastSideToPull = this.tileInputter.sideToPull;
|
||||||
|
this.lastIsPutWhitelist = this.tileInputter.isPutWhitelist ? 1 : 0;
|
||||||
|
this.lastIsPullWhitelist = this.tileInputter.isPullWhitelist ? 1 : 0;
|
||||||
|
|
||||||
|
this.lastSlotPutStart = this.tileInputter.slotToPutStart;
|
||||||
|
this.lastSlotPutEnd = this.tileInputter.slotToPutEnd;
|
||||||
|
this.lastSlotPullStart = this.tileInputter.slotToPullStart;
|
||||||
|
this.lastSlotPullEnd = this.tileInputter.slotToPullEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void updateProgressBar(int par1, int par2){
|
public void updateProgressBar(int par1, int par2){
|
||||||
if(par1 == 0) this.tileInputter.sideToPut = par2;
|
if(par1 == 0) this.tileInputter.sideToPut = par2;
|
||||||
if(par1 == 1) this.tileInputter.slotToPut = par2;
|
if(par1 == 1) this.tileInputter.sideToPull = par2;
|
||||||
if(par1 == 2) this.tileInputter.sideToPull = par2;
|
if(par1 == 2) this.tileInputter.isPullWhitelist = par2 == 1;
|
||||||
if(par1 == 3) this.tileInputter.slotToPull = par2;
|
if(par1 == 3) this.tileInputter.isPutWhitelist = par2 == 1;
|
||||||
if(par1 == 4) this.tileInputter.placeToPullSlotAmount = par2;
|
|
||||||
if(par1 == 5) this.tileInputter.placeToPutSlotAmount = par2;
|
if(par1 == 4) this.tileInputter.slotToPutStart = par2;
|
||||||
|
if(par1 == 5) this.tileInputter.slotToPutEnd = par2;
|
||||||
|
if(par1 == 6) this.tileInputter.slotToPullStart = par2;
|
||||||
|
if(par1 == 7) this.tileInputter.slotToPullEnd = par2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -104,38 +119,40 @@ public class ContainerInputter extends Container{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = this.isAdvanced ? 13 : 1;
|
final int inventory = this.isAdvanced ? 25 : 1;
|
||||||
final int inventoryEnd = inventoryStart+26;
|
final int inventoryEnd = inventory+26;
|
||||||
final int hotbarStart = inventoryEnd+1;
|
final int hotbar = inventoryEnd+1;
|
||||||
final int hotbarEnd = hotbarStart+8;
|
final int hotbarEnd = hotbar+8;
|
||||||
|
|
||||||
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||||
if(theSlot.getHasStack()){
|
if(theSlot.getHasStack()){
|
||||||
ItemStack currentStack = theSlot.getStack();
|
ItemStack currentStack = theSlot.getStack();
|
||||||
ItemStack newStack = currentStack.copy();
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= inventoryStart){
|
if(currentStack.getItem() != null){
|
||||||
this.mergeItemStack(newStack, 0, 1, false);
|
if(slot <= hotbarEnd && slot >= inventory){
|
||||||
}
|
this.mergeItemStack(newStack, 0, 1, false);
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= hotbarStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, inventoryEnd, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, hotbarStart, hotbarEnd, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot < inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, hotbarEnd, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newStack.stackSize == 0) theSlot.putStack(null);
|
if(slot <= hotbarEnd && slot >= hotbar){
|
||||||
else theSlot.onSlotChanged();
|
this.mergeItemStack(newStack, inventory, inventoryEnd, false);
|
||||||
if(newStack.stackSize == currentStack.stackSize) return null;
|
}
|
||||||
theSlot.onPickupFromSlot(player, newStack);
|
|
||||||
|
|
||||||
return currentStack;
|
else if(slot <= inventoryEnd && slot >= inventory){
|
||||||
|
this.mergeItemStack(newStack, hotbar, hotbarEnd, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventory){
|
||||||
|
this.mergeItemStack(newStack, inventory, hotbarEnd, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,123 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||||
|
import ellpeck.actuallyadditions.inventory.slot.SlotOutput;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityOilGenerator;
|
||||||
|
import invtweaks.api.container.InventoryContainer;
|
||||||
|
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;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
|
@InventoryContainer
|
||||||
|
public class ContainerOilGenerator extends Container{
|
||||||
|
|
||||||
|
private TileEntityOilGenerator generator;
|
||||||
|
|
||||||
|
private int lastEnergyStored;
|
||||||
|
private int lastBurnTime;
|
||||||
|
private int lastTankAmount;
|
||||||
|
|
||||||
|
public ContainerOilGenerator(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
|
this.generator = (TileEntityOilGenerator)tile;
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(this.generator, 0, 98, 74));
|
||||||
|
this.addSlotToContainer(new SlotOutput(this.generator, 1, 98, 43));
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++){
|
||||||
|
for (int j = 0; j < 9; j++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 9; i++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.generator.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting iCraft){
|
||||||
|
super.addCraftingToCrafters(iCraft);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 0, this.generator.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
|
iCraft.sendProgressBarUpdate(this, 1, this.generator.currentBurnTime);
|
||||||
|
iCraft.sendProgressBarUpdate(this, 2, this.generator.tank.getFluidAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges(){
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
for(Object crafter : this.crafters){
|
||||||
|
ICrafting iCraft = (ICrafting)crafter;
|
||||||
|
|
||||||
|
if(this.lastEnergyStored != this.generator.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.generator.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
|
if(this.lastBurnTime != this.generator.currentBurnTime) iCraft.sendProgressBarUpdate(this, 1, this.generator.currentBurnTime);
|
||||||
|
if(this.lastTankAmount != this.generator.tank.getFluidAmount()) iCraft.sendProgressBarUpdate(this, 2, this.generator.tank.getFluidAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastEnergyStored = this.generator.getEnergyStored(ForgeDirection.UNKNOWN);
|
||||||
|
this.lastBurnTime = this.generator.currentBurnTime;
|
||||||
|
this.lastTankAmount = this.generator.tank.getFluidAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void updateProgressBar(int par1, int par2){
|
||||||
|
if(par1 == 0) this.generator.storage.setEnergyStored(par2);
|
||||||
|
if(par1 == 1) this.generator.currentBurnTime = par2;
|
||||||
|
if(par1 == 2) this.generator.tank.setFluid(new FluidStack(InitBlocks.fluidOil, par2));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
|
final int inventoryStart = 2;
|
||||||
|
final int inventoryEnd = inventoryStart+26;
|
||||||
|
final int hotbarStart = inventoryEnd+1;
|
||||||
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
|
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||||
|
if(theSlot.getHasStack()){
|
||||||
|
ItemStack currentStack = theSlot.getStack();
|
||||||
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
|
if(currentStack.getItem() != null){
|
||||||
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
if(FluidContainerRegistry.containsFluid(currentStack, new FluidStack(InitBlocks.fluidOil, FluidContainerRegistry.BUCKET_VOLUME))){
|
||||||
|
this.mergeItemStack(newStack, 0, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,80 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory;
|
||||||
|
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityPhantomPlacer;
|
||||||
|
import invtweaks.api.container.InventoryContainer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
@InventoryContainer
|
||||||
|
public class ContainerPhantomPlacer extends Container{
|
||||||
|
|
||||||
|
private TileEntityPhantomPlacer placer;
|
||||||
|
|
||||||
|
public ContainerPhantomPlacer(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
|
this.placer = (TileEntityPhantomPlacer)tile;
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++){
|
||||||
|
for (int j = 0; j < 3; j++){
|
||||||
|
this.addSlotToContainer(new Slot(this.placer, j+i*3, 62+j*18, 21+i*18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++){
|
||||||
|
for (int j = 0; j < 9; j++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 9; i++){
|
||||||
|
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player){
|
||||||
|
return this.placer.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
|
final int inventoryStart = 9;
|
||||||
|
final int inventoryEnd = inventoryStart+26;
|
||||||
|
final int hotbarStart = inventoryEnd+1;
|
||||||
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
|
||||||
|
Slot theSlot = (Slot)this.inventorySlots.get(slot);
|
||||||
|
if(theSlot.getHasStack()){
|
||||||
|
ItemStack currentStack = theSlot.getStack();
|
||||||
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
|
if(currentStack.getItem() != null){
|
||||||
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, 0, 9, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,21 +12,18 @@ import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ICrafting;
|
import net.minecraft.inventory.ICrafting;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntityFurnace;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
@InventoryContainer
|
@InventoryContainer
|
||||||
public class ContainerRepairer extends Container{
|
public class ContainerRepairer extends Container{
|
||||||
|
|
||||||
private TileEntityItemRepairer tileRepairer;
|
private TileEntityItemRepairer tileRepairer;
|
||||||
|
|
||||||
private int lastCoalTime;
|
private int lastEnergy;
|
||||||
private int lastCoalTimeLeft;
|
|
||||||
|
|
||||||
public ContainerRepairer(InventoryPlayer inventory, TileEntityBase tile){
|
public ContainerRepairer(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
this.tileRepairer = (TileEntityItemRepairer)tile;
|
this.tileRepairer = (TileEntityItemRepairer)tile;
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(this.tileRepairer, TileEntityItemRepairer.SLOT_COAL, 80, 21));
|
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(this.tileRepairer, TileEntityItemRepairer.SLOT_INPUT, 47, 53));
|
this.addSlotToContainer(new Slot(this.tileRepairer, TileEntityItemRepairer.SLOT_INPUT, 47, 53));
|
||||||
this.addSlotToContainer(new SlotOutput(this.tileRepairer, TileEntityItemRepairer.SLOT_OUTPUT, 109, 53));
|
this.addSlotToContainer(new SlotOutput(this.tileRepairer, TileEntityItemRepairer.SLOT_OUTPUT, 109, 53));
|
||||||
|
|
||||||
|
@ -43,8 +40,7 @@ public class ContainerRepairer extends Container{
|
||||||
@Override
|
@Override
|
||||||
public void addCraftingToCrafters(ICrafting iCraft){
|
public void addCraftingToCrafters(ICrafting iCraft){
|
||||||
super.addCraftingToCrafters(iCraft);
|
super.addCraftingToCrafters(iCraft);
|
||||||
iCraft.sendProgressBarUpdate(this, 0, this.tileRepairer.coalTime);
|
iCraft.sendProgressBarUpdate(this, 0, this.tileRepairer.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
iCraft.sendProgressBarUpdate(this, 1, this.tileRepairer.coalTimeLeft);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -53,19 +49,16 @@ public class ContainerRepairer extends Container{
|
||||||
for(Object crafter : this.crafters){
|
for(Object crafter : this.crafters){
|
||||||
ICrafting iCraft = (ICrafting)crafter;
|
ICrafting iCraft = (ICrafting)crafter;
|
||||||
|
|
||||||
if(this.lastCoalTime != this.tileRepairer.coalTime) iCraft.sendProgressBarUpdate(this, 0, this.tileRepairer.coalTime);
|
if(this.lastEnergy != this.tileRepairer.getEnergyStored(ForgeDirection.UNKNOWN)) iCraft.sendProgressBarUpdate(this, 0, this.tileRepairer.getEnergyStored(ForgeDirection.UNKNOWN));
|
||||||
if(this.lastCoalTimeLeft != this.tileRepairer.coalTimeLeft) iCraft.sendProgressBarUpdate(this, 1, this.tileRepairer.coalTimeLeft);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lastCoalTime = this.tileRepairer.coalTime;
|
this.lastEnergy = this.tileRepairer.getEnergyStored(ForgeDirection.UNKNOWN);
|
||||||
this.lastCoalTimeLeft = this.tileRepairer.coalTimeLeft;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void updateProgressBar(int par1, int par2){
|
public void updateProgressBar(int par1, int par2){
|
||||||
if(par1 == 0) this.tileRepairer.coalTime = par2;
|
if(par1 == 0) this.tileRepairer.storage.setEnergyStored(par2);
|
||||||
if(par1 == 1) this.tileRepairer.coalTimeLeft = par2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -75,7 +68,7 @@ public class ContainerRepairer extends Container{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
public ItemStack transferStackInSlot(EntityPlayer player, int slot){
|
||||||
final int inventoryStart = 3;
|
final int inventoryStart = 2;
|
||||||
final int inventoryEnd = inventoryStart+26;
|
final int inventoryEnd = inventoryStart+26;
|
||||||
final int hotbarStart = inventoryEnd+1;
|
final int hotbarStart = inventoryEnd+1;
|
||||||
final int hotbarEnd = hotbarStart+8;
|
final int hotbarEnd = hotbarStart+8;
|
||||||
|
@ -85,34 +78,32 @@ public class ContainerRepairer extends Container{
|
||||||
ItemStack currentStack = theSlot.getStack();
|
ItemStack currentStack = theSlot.getStack();
|
||||||
ItemStack newStack = currentStack.copy();
|
ItemStack newStack = currentStack.copy();
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= inventoryStart){
|
if(currentStack.getItem() != null){
|
||||||
if(TileEntityItemRepairer.canBeRepaired(currentStack)){
|
if(slot <= hotbarEnd && slot >= inventoryStart){
|
||||||
this.mergeItemStack(newStack, TileEntityItemRepairer.SLOT_INPUT, TileEntityItemRepairer.SLOT_INPUT+1, false);
|
if(TileEntityItemRepairer.canBeRepaired(currentStack)){
|
||||||
|
this.mergeItemStack(newStack, TileEntityItemRepairer.SLOT_INPUT, TileEntityItemRepairer.SLOT_INPUT+1, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(TileEntityFurnace.getItemBurnTime(currentStack) > 0){
|
if(slot <= hotbarEnd && slot >= hotbarStart){
|
||||||
this.mergeItemStack(newStack, TileEntityItemRepairer.SLOT_COAL, TileEntityItemRepairer.SLOT_COAL+1, false);
|
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(slot < inventoryStart){
|
||||||
|
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newStack.stackSize == 0) theSlot.putStack(null);
|
||||||
|
else theSlot.onSlotChanged();
|
||||||
|
if(newStack.stackSize == currentStack.stackSize) return null;
|
||||||
|
theSlot.onPickupFromSlot(player, newStack);
|
||||||
|
|
||||||
|
return currentStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(slot <= hotbarEnd && slot >= hotbarStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot <= inventoryEnd && slot >= inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(slot < inventoryStart){
|
|
||||||
this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(newStack.stackSize == 0) theSlot.putStack(null);
|
|
||||||
else theSlot.onSlotChanged();
|
|
||||||
if(newStack.stackSize == currentStack.stackSize) return null;
|
|
||||||
theSlot.onPickupFromSlot(player, newStack);
|
|
||||||
|
|
||||||
return currentStack;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ package ellpeck.actuallyadditions.inventory;
|
||||||
import cpw.mods.fml.common.network.IGuiHandler;
|
import cpw.mods.fml.common.network.IGuiHandler;
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||||
import ellpeck.actuallyadditions.ActuallyAdditions;
|
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||||
|
import ellpeck.actuallyadditions.inventory.gui.*;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityGrinder;
|
|
||||||
import ellpeck.actuallyadditions.util.Util;
|
import ellpeck.actuallyadditions.util.Util;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -13,39 +13,53 @@ public class GuiHandler implements IGuiHandler{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getServerGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z){
|
public Object getServerGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z){
|
||||||
switch (id){
|
TileEntityBase tile = null;
|
||||||
|
if(id != CRAFTER_ID && id != DRILL_ID){
|
||||||
|
tile = (TileEntityBase)world.getTileEntity(x, y, z);
|
||||||
|
}
|
||||||
|
switch(id){
|
||||||
case FEEDER_ID:
|
case FEEDER_ID:
|
||||||
TileEntityBase tileFeeder = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new ContainerFeeder(entityPlayer.inventory, tile);
|
||||||
return new ContainerFeeder(entityPlayer.inventory, tileFeeder);
|
|
||||||
case GIANT_CHEST_ID:
|
case GIANT_CHEST_ID:
|
||||||
TileEntityBase tileChest = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new ContainerGiantChest(entityPlayer.inventory, tile);
|
||||||
return new ContainerGiantChest(entityPlayer.inventory, tileChest);
|
|
||||||
case CRAFTER_ID:
|
case CRAFTER_ID:
|
||||||
return new ContainerCrafter(entityPlayer);
|
return new ContainerCrafter(entityPlayer);
|
||||||
case GRINDER_ID:
|
case GRINDER_ID:
|
||||||
TileEntityBase tileGrinder = (TileEntityGrinder)world.getTileEntity(x, y, z);
|
return new ContainerGrinder(entityPlayer.inventory, tile, false);
|
||||||
return new ContainerGrinder(entityPlayer.inventory, tileGrinder, false);
|
|
||||||
case GRINDER_DOUBLE_ID:
|
case GRINDER_DOUBLE_ID:
|
||||||
TileEntityBase tileGrinderDouble = (TileEntityGrinder)world.getTileEntity(x, y, z);
|
return new ContainerGrinder(entityPlayer.inventory, tile, true);
|
||||||
return new ContainerGrinder(entityPlayer.inventory, tileGrinderDouble, true);
|
|
||||||
case FURNACE_DOUBLE_ID:
|
case FURNACE_DOUBLE_ID:
|
||||||
TileEntityBase tileFurnace = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new ContainerFurnaceDouble(entityPlayer.inventory, tile);
|
||||||
return new ContainerFurnaceDouble(entityPlayer.inventory, tileFurnace);
|
|
||||||
case INPUTTER_ID:
|
case INPUTTER_ID:
|
||||||
TileEntityBase tileInputter = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new ContainerInputter(entityPlayer.inventory, tile, false);
|
||||||
return new ContainerInputter(entityPlayer.inventory, tileInputter, false);
|
|
||||||
case INPUTTER_ADVANCED_ID:
|
case INPUTTER_ADVANCED_ID:
|
||||||
TileEntityBase tileInputterAdvanced = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new ContainerInputter(entityPlayer.inventory, tile, true);
|
||||||
return new ContainerInputter(entityPlayer.inventory, tileInputterAdvanced, true);
|
|
||||||
case REPAIRER_ID:
|
case REPAIRER_ID:
|
||||||
TileEntityBase tileRepairer = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new ContainerRepairer(entityPlayer.inventory, tile);
|
||||||
return new ContainerRepairer(entityPlayer.inventory, tileRepairer);
|
|
||||||
case BREAKER_ID:
|
case BREAKER_ID:
|
||||||
TileEntityBase tileBreaker = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new ContainerBreaker(entityPlayer.inventory, tile);
|
||||||
return new ContainerBreaker(entityPlayer.inventory, tileBreaker);
|
|
||||||
case DROPPER_ID:
|
case DROPPER_ID:
|
||||||
TileEntityBase tileDropper = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new ContainerDropper(entityPlayer.inventory, tile);
|
||||||
return new ContainerDropper(entityPlayer.inventory, tileDropper);
|
case CANOLA_PRESS_ID:
|
||||||
|
return new ContainerCanolaPress(entityPlayer.inventory, tile);
|
||||||
|
case FERMENTING_BARREL_ID:
|
||||||
|
return new ContainerFermentingBarrel(entityPlayer.inventory, tile);
|
||||||
|
case COAL_GENERATOR_ID:
|
||||||
|
return new ContainerCoalGenerator(entityPlayer.inventory, tile);
|
||||||
|
case OIL_GENERATOR_ID:
|
||||||
|
return new ContainerOilGenerator(entityPlayer.inventory, tile);
|
||||||
|
case PHANTOM_PLACER_ID:
|
||||||
|
return new ContainerPhantomPlacer(entityPlayer.inventory, tile);
|
||||||
|
case FLUID_COLLECTOR_ID:
|
||||||
|
return new ContainerFluidCollector(entityPlayer.inventory, tile);
|
||||||
|
case COFFEE_MACHINE_ID:
|
||||||
|
return new ContainerCoffeeMachine(entityPlayer.inventory, tile);
|
||||||
|
case DRILL_ID:
|
||||||
|
return new ContainerDrill(entityPlayer.inventory);
|
||||||
|
case ENERGIZER_ID:
|
||||||
|
return new ContainerEnergizer(entityPlayer.inventory, tile);
|
||||||
|
case ENERVATOR_ID:
|
||||||
|
return new ContainerEnervator(entityPlayer.inventory, tile);
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -53,39 +67,53 @@ public class GuiHandler implements IGuiHandler{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getClientGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z){
|
public Object getClientGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z){
|
||||||
switch (id){
|
TileEntityBase tile = null;
|
||||||
|
if(id != CRAFTER_ID && id != DRILL_ID){
|
||||||
|
tile = (TileEntityBase)world.getTileEntity(x, y, z);
|
||||||
|
}
|
||||||
|
switch(id){
|
||||||
case FEEDER_ID:
|
case FEEDER_ID:
|
||||||
TileEntityBase tileFeeder = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new GuiFeeder(entityPlayer.inventory, tile);
|
||||||
return new GuiFeeder(entityPlayer.inventory, tileFeeder);
|
|
||||||
case GIANT_CHEST_ID:
|
case GIANT_CHEST_ID:
|
||||||
TileEntityBase tileChest = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new GuiGiantChest(entityPlayer.inventory, tile);
|
||||||
return new GuiGiantChest(entityPlayer.inventory, tileChest);
|
|
||||||
case CRAFTER_ID:
|
case CRAFTER_ID:
|
||||||
return new GuiCrafter(entityPlayer);
|
return new GuiCrafter(entityPlayer);
|
||||||
case GRINDER_ID:
|
case GRINDER_ID:
|
||||||
TileEntityBase tileGrinder = (TileEntityGrinder)world.getTileEntity(x, y, z);
|
return new GuiGrinder(entityPlayer.inventory, tile, false);
|
||||||
return new GuiGrinder(entityPlayer.inventory, tileGrinder, false);
|
|
||||||
case GRINDER_DOUBLE_ID:
|
case GRINDER_DOUBLE_ID:
|
||||||
TileEntityBase tileGrinderDouble = (TileEntityGrinder)world.getTileEntity(x, y, z);
|
return new GuiGrinder(entityPlayer.inventory, tile, true);
|
||||||
return new GuiGrinder(entityPlayer.inventory, tileGrinderDouble, true);
|
|
||||||
case FURNACE_DOUBLE_ID:
|
case FURNACE_DOUBLE_ID:
|
||||||
TileEntityBase tileFurnace = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new GuiFurnaceDouble(entityPlayer.inventory, tile);
|
||||||
return new GuiFurnaceDouble(entityPlayer.inventory, tileFurnace);
|
|
||||||
case INPUTTER_ID:
|
case INPUTTER_ID:
|
||||||
TileEntityBase tileInputter = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new GuiInputter(entityPlayer.inventory, tile, x, y, z, world, false);
|
||||||
return new GuiInputter(entityPlayer.inventory, tileInputter, x, y, z, world, false);
|
|
||||||
case INPUTTER_ADVANCED_ID:
|
case INPUTTER_ADVANCED_ID:
|
||||||
TileEntityBase tileInputterAdvanced = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new GuiInputter(entityPlayer.inventory, tile, x, y, z, world, true);
|
||||||
return new GuiInputter(entityPlayer.inventory, tileInputterAdvanced, x, y, z, world, true);
|
|
||||||
case REPAIRER_ID:
|
case REPAIRER_ID:
|
||||||
TileEntityBase tileRepairer = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new GuiRepairer(entityPlayer.inventory, tile);
|
||||||
return new GuiRepairer(entityPlayer.inventory, tileRepairer);
|
|
||||||
case BREAKER_ID:
|
case BREAKER_ID:
|
||||||
TileEntityBase tileBreaker = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new GuiBreaker(entityPlayer.inventory, tile);
|
||||||
return new GuiBreaker(entityPlayer.inventory, tileBreaker);
|
|
||||||
case DROPPER_ID:
|
case DROPPER_ID:
|
||||||
TileEntityBase tileDropper = (TileEntityBase)world.getTileEntity(x, y, z);
|
return new GuiDropper(entityPlayer.inventory, tile);
|
||||||
return new GuiDropper(entityPlayer.inventory, tileDropper);
|
case CANOLA_PRESS_ID:
|
||||||
|
return new GuiCanolaPress(entityPlayer.inventory, tile);
|
||||||
|
case FERMENTING_BARREL_ID:
|
||||||
|
return new GuiFermentingBarrel(entityPlayer.inventory, tile);
|
||||||
|
case COAL_GENERATOR_ID:
|
||||||
|
return new GuiCoalGenerator(entityPlayer.inventory, tile);
|
||||||
|
case OIL_GENERATOR_ID:
|
||||||
|
return new GuiOilGenerator(entityPlayer.inventory, tile);
|
||||||
|
case PHANTOM_PLACER_ID:
|
||||||
|
return new GuiPhantomPlacer(entityPlayer.inventory, tile);
|
||||||
|
case FLUID_COLLECTOR_ID:
|
||||||
|
return new GuiFluidCollector(entityPlayer.inventory, tile);
|
||||||
|
case COFFEE_MACHINE_ID:
|
||||||
|
return new GuiCoffeeMachine(entityPlayer.inventory, tile, x, y, z, world);
|
||||||
|
case DRILL_ID:
|
||||||
|
return new GuiDrill(entityPlayer.inventory);
|
||||||
|
case ENERGIZER_ID:
|
||||||
|
return new GuiEnergizer(entityPlayer.inventory, tile);
|
||||||
|
case ENERVATOR_ID:
|
||||||
|
return new GuiEnervator(entityPlayer.inventory, tile);
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -102,6 +130,16 @@ public class GuiHandler implements IGuiHandler{
|
||||||
public static final int INPUTTER_ADVANCED_ID = 8;
|
public static final int INPUTTER_ADVANCED_ID = 8;
|
||||||
public static final int BREAKER_ID = 9;
|
public static final int BREAKER_ID = 9;
|
||||||
public static final int DROPPER_ID = 10;
|
public static final int DROPPER_ID = 10;
|
||||||
|
public static final int CANOLA_PRESS_ID = 11;
|
||||||
|
public static final int FERMENTING_BARREL_ID = 12;
|
||||||
|
public static final int COAL_GENERATOR_ID = 13;
|
||||||
|
public static final int OIL_GENERATOR_ID = 14;
|
||||||
|
public static final int PHANTOM_PLACER_ID = 15;
|
||||||
|
public static final int FLUID_COLLECTOR_ID = 16;
|
||||||
|
public static final int COFFEE_MACHINE_ID = 17;
|
||||||
|
public static final int DRILL_ID = 18;
|
||||||
|
public static final int ENERGIZER_ID = 19;
|
||||||
|
public static final int ENERVATOR_ID = 20;
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
Util.logInfo("Initializing GuiHandler...");
|
Util.logInfo("Initializing GuiHandler...");
|
||||||
|
|
|
@ -1,161 +0,0 @@
|
||||||
package ellpeck.actuallyadditions.inventory;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import ellpeck.actuallyadditions.network.PacketHandler;
|
|
||||||
import ellpeck.actuallyadditions.network.PacketInputterButton;
|
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityInputter;
|
|
||||||
import ellpeck.actuallyadditions.util.AssetUtil;
|
|
||||||
import ellpeck.actuallyadditions.util.ModUtil;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
||||||
import net.minecraft.client.renderer.OpenGlHelper;
|
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.StatCollector;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class GuiInputter extends GuiContainer{
|
|
||||||
|
|
||||||
private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiInputter");
|
|
||||||
private static final ResourceLocation resLocAdvanced = AssetUtil.getGuiLocation("guiInputterAdvanced");
|
|
||||||
|
|
||||||
private TileEntityInputter tileInputter;
|
|
||||||
|
|
||||||
private int x;
|
|
||||||
private int y;
|
|
||||||
private int z;
|
|
||||||
private World world;
|
|
||||||
|
|
||||||
private SmallerButton buttonSlotPutP;
|
|
||||||
private SmallerButton buttonSlotPullP;
|
|
||||||
private SmallerButton buttonSlotPutM;
|
|
||||||
private SmallerButton buttonSlotPullM;
|
|
||||||
|
|
||||||
private boolean isAdvanced;
|
|
||||||
|
|
||||||
public static final String[] sideString = new String[]{
|
|
||||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.disabled"),
|
|
||||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.up"),
|
|
||||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.down"),
|
|
||||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.north"),
|
|
||||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.east"),
|
|
||||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.south"),
|
|
||||||
StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.west")};
|
|
||||||
|
|
||||||
public GuiInputter(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world, boolean isAdvanced){
|
|
||||||
super(new ContainerInputter(inventory, tile, isAdvanced));
|
|
||||||
this.tileInputter = (TileEntityInputter)tile;
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
this.z = z;
|
|
||||||
this.world = world;
|
|
||||||
this.xSize = 176;
|
|
||||||
this.ySize = 93+86 + (isAdvanced ? 12 : 0);
|
|
||||||
this.isAdvanced = isAdvanced;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
|
||||||
AssetUtil.displayNameAndInventoryString(this.fontRendererObj, xSize, this.isAdvanced ? 105-5 : 93-5, -10, this.tileInputter.getInventoryName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
|
||||||
public void initGui(){
|
|
||||||
super.initGui();
|
|
||||||
|
|
||||||
SmallerButton buttonSidePutP = new SmallerButton(0, guiLeft + 70, guiTop + 43 + (isAdvanced ? 12 : 0), ">");
|
|
||||||
SmallerButton buttonSidePutM = new SmallerButton(1, guiLeft + 5, guiTop + 43 + (isAdvanced ? 12 : 0), "<");
|
|
||||||
buttonSlotPutP = new SmallerButton(2, guiLeft + 70, guiTop + 64 + (isAdvanced ? 12 : 0), "+");
|
|
||||||
buttonSlotPutM = new SmallerButton(3, guiLeft + 5, guiTop + 64 + (isAdvanced ? 12 : 0), "-");
|
|
||||||
|
|
||||||
SmallerButton buttonSidePullP = new SmallerButton(4, guiLeft + 155, guiTop + 43 + (isAdvanced ? 12 : 0), ">");
|
|
||||||
SmallerButton buttonSidePullM = new SmallerButton(5, guiLeft + 90, guiTop + 43 + (isAdvanced ? 12 : 0), "<");
|
|
||||||
buttonSlotPullP = new SmallerButton(6, guiLeft+ 155, guiTop + 64 + (isAdvanced ? 12 : 0), "+");
|
|
||||||
buttonSlotPullM = new SmallerButton(7, guiLeft + 90, guiTop + 64 + (isAdvanced ? 12 : 0), "-");
|
|
||||||
|
|
||||||
this.buttonList.add(buttonSidePutP);
|
|
||||||
this.buttonList.add(buttonSlotPutP);
|
|
||||||
this.buttonList.add(buttonSidePullP);
|
|
||||||
this.buttonList.add(buttonSlotPullP);
|
|
||||||
this.buttonList.add(buttonSidePutM);
|
|
||||||
this.buttonList.add(buttonSlotPutM);
|
|
||||||
this.buttonList.add(buttonSidePullM);
|
|
||||||
this.buttonList.add(buttonSlotPullM);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
|
|
||||||
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
|
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93 + (isAdvanced ? 12 : 0), 0, 0, 176, 86);
|
|
||||||
|
|
||||||
this.mc.getTextureManager().bindTexture(this.isAdvanced ? resLocAdvanced : resLoc);
|
|
||||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93 + (isAdvanced ? 12 : 0));
|
|
||||||
|
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.put"), guiLeft + 22 + 3, guiTop + 32 + (isAdvanced ? 12 : 0), 4210752);
|
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.pull"), guiLeft + 107 + 3, guiTop + 32 + (isAdvanced ? 12 : 0), 4210752);
|
|
||||||
|
|
||||||
this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft + 24 + 1, guiTop + 45 + 3 + (isAdvanced ? 12 : 0), 4210752);
|
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPut == -1 ? StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPut).toString(), guiLeft + 24 + 3, guiTop + 66 + 3 + (isAdvanced ? 12 : 0), 4210752);
|
|
||||||
|
|
||||||
this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft + 109 + 1, guiTop + 45 + 3 + (isAdvanced ? 12 : 0), 4210752);
|
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPull == -1 ? StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPull).toString(), guiLeft + 109 + 3, guiTop + 66 + 3 + (isAdvanced ? 12 : 0), 4210752);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int x, int y, float f){
|
|
||||||
super.drawScreen(x, y, f);
|
|
||||||
|
|
||||||
this.buttonSlotPullP.enabled = this.tileInputter.placeToPullSlotAmount > 0;
|
|
||||||
this.buttonSlotPullM.enabled = this.tileInputter.placeToPullSlotAmount > 0;
|
|
||||||
|
|
||||||
this.buttonSlotPutP.enabled = this.tileInputter.placeToPutSlotAmount > 0;
|
|
||||||
this.buttonSlotPutM.enabled = this.tileInputter.placeToPutSlotAmount > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(GuiButton button){
|
|
||||||
PacketHandler.theNetwork.sendToServer(new PacketInputterButton(x, y, z, world, button.id));
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SmallerButton extends GuiButton{
|
|
||||||
|
|
||||||
private final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiInputter");
|
|
||||||
|
|
||||||
public SmallerButton(int id, int x, int y, String display){
|
|
||||||
super(id, x, y, 16, 16, display);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawButton(Minecraft mc, int x, int y){
|
|
||||||
if (this.visible){
|
|
||||||
FontRenderer renderer = mc.fontRenderer;
|
|
||||||
mc.getTextureManager().bindTexture(resLoc);
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
this.field_146123_n = x >= this.xPosition && y >= this.yPosition && x < this.xPosition + this.width && y < this.yPosition + this.height;
|
|
||||||
int k = this.getHoverState(this.field_146123_n);
|
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
|
||||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
|
||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, 176, k*16, 16, 16);
|
|
||||||
this.mouseDragged(mc, x, y);
|
|
||||||
|
|
||||||
int color = 14737632;
|
|
||||||
if (packedFGColour != 0) color = packedFGColour;
|
|
||||||
else if (!this.enabled) color = 10526880;
|
|
||||||
else if (this.field_146123_n) color = 16777120;
|
|
||||||
|
|
||||||
this.drawCenteredString(renderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height-8) / 2, color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,7 +1,8 @@
|
||||||
package ellpeck.actuallyadditions.inventory;
|
package ellpeck.actuallyadditions.inventory.gui;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.inventory.ContainerBreaker;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityBreaker;
|
import ellpeck.actuallyadditions.tile.TileEntityBreaker;
|
||||||
import ellpeck.actuallyadditions.util.AssetUtil;
|
import ellpeck.actuallyadditions.util.AssetUtil;
|
||||||
|
@ -26,7 +27,7 @@ public class GuiBreaker extends GuiContainer{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawGuiContainerForegroundLayer(int x, int y){
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
AssetUtil.displayNameAndInventoryString(this.fontRendererObj, xSize, 93-5, -10, this.breaker.getInventoryName());
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.breaker.getInventoryName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -0,0 +1,76 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory.gui;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.inventory.ContainerCanolaPress;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityCanolaPress;
|
||||||
|
import ellpeck.actuallyadditions.util.AssetUtil;
|
||||||
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class GuiCanolaPress extends GuiContainer{
|
||||||
|
|
||||||
|
private TileEntityCanolaPress press;
|
||||||
|
|
||||||
|
private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiCanolaPress");
|
||||||
|
|
||||||
|
public GuiCanolaPress(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
|
super(new ContainerCanolaPress(inventory, tile));
|
||||||
|
this.press = (TileEntityCanolaPress)tile;
|
||||||
|
this.xSize = 176;
|
||||||
|
this.ySize = 93+86;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.press.getInventoryName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
|
||||||
|
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);
|
||||||
|
|
||||||
|
this.mc.getTextureManager().bindTexture(resLoc);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
||||||
|
|
||||||
|
if(this.press.getEnergyStored(ForgeDirection.UNKNOWN) > 0){
|
||||||
|
int i = this.press.getEnergyScaled(83);
|
||||||
|
drawTexturedModalRect(this.guiLeft + 43, this.guiTop+89-i, 176, 29, 16, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.press.tank.getFluidAmount() > 0){
|
||||||
|
int i = this.press.getTankScaled(83);
|
||||||
|
drawTexturedModalRect(this.guiLeft + 117, this.guiTop+89-i, 192, 29, 16, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.press.currentProcessTime > 0){
|
||||||
|
int i = this.press.getProcessScaled(29);
|
||||||
|
drawTexturedModalRect(this.guiLeft + 83, this.guiTop+32, 176, 0, 12, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
String text1 = this.press.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.press.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF";
|
||||||
|
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text1), x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
String text2 = this.press.tank.getFluidAmount() + "/" + this.press.tank.getCapacity() + " mB " +StatCollector.translateToLocal("fluid.canolaoil");
|
||||||
|
if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text2), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory.gui;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.inventory.ContainerCoalGenerator;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityCoalGenerator;
|
||||||
|
import ellpeck.actuallyadditions.util.AssetUtil;
|
||||||
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class GuiCoalGenerator extends GuiContainer{
|
||||||
|
|
||||||
|
private TileEntityCoalGenerator generator;
|
||||||
|
|
||||||
|
private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiCoalGenerator");
|
||||||
|
|
||||||
|
public GuiCoalGenerator(InventoryPlayer inventory, TileEntityBase tile){
|
||||||
|
super(new ContainerCoalGenerator(inventory, tile));
|
||||||
|
this.generator = (TileEntityCoalGenerator)tile;
|
||||||
|
this.xSize = 176;
|
||||||
|
this.ySize = 93+86;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.generator.getInventoryName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
|
||||||
|
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);
|
||||||
|
|
||||||
|
this.mc.getTextureManager().bindTexture(resLoc);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
||||||
|
|
||||||
|
if(this.generator.getEnergyStored(ForgeDirection.UNKNOWN) > 0){
|
||||||
|
int i = this.generator.getEnergyScaled(83);
|
||||||
|
drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 0, 16, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.generator.currentBurnTime > 0){
|
||||||
|
int i = this.generator.getBurningScaled(13);
|
||||||
|
this.drawTexturedModalRect(guiLeft+87, guiTop+27+12-i, 176, 96-i, 14, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
String text1 = this.generator.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.generator.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF";
|
||||||
|
if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){
|
||||||
|
this.func_146283_a(Collections.singletonList(text1), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,118 @@
|
||||||
|
package ellpeck.actuallyadditions.inventory.gui;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.inventory.ContainerCoffeeMachine;
|
||||||
|
import ellpeck.actuallyadditions.network.PacketHandler;
|
||||||
|
import ellpeck.actuallyadditions.network.gui.PacketGuiButton;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
|
import ellpeck.actuallyadditions.tile.TileEntityCoffeeMachine;
|
||||||
|
import ellpeck.actuallyadditions.util.AssetUtil;
|
||||||
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class GuiCoffeeMachine extends GuiContainer{
|
||||||
|
|
||||||
|
private TileEntityCoffeeMachine machine;
|
||||||
|
|
||||||
|
private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiCoffeeMachine");
|
||||||
|
|
||||||
|
private int x;
|
||||||
|
private int y;
|
||||||
|
private int z;
|
||||||
|
private World world;
|
||||||
|
|
||||||
|
public GuiCoffeeMachine(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world){
|
||||||
|
super(new ContainerCoffeeMachine(inventory, tile));
|
||||||
|
this.machine = (TileEntityCoffeeMachine)tile;
|
||||||
|
this.xSize = 176;
|
||||||
|
this.ySize = 93+86;
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.z = z;
|
||||||
|
this.world = world;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public void initGui(){
|
||||||
|
super.initGui();
|
||||||
|
|
||||||
|
GuiButton buttonOkay = new GuiButton(0, guiLeft+60, guiTop+11, 58, 20, StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.ok"));
|
||||||
|
this.buttonList.add(buttonOkay);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(GuiButton button){
|
||||||
|
PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawGuiContainerForegroundLayer(int x, int y){
|
||||||
|
AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.machine.getInventoryName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
|
||||||
|
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);
|
||||||
|
|
||||||
|
this.mc.getTextureManager().bindTexture(resLoc);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93);
|
||||||
|
|
||||||
|
if(this.machine.getEnergyStored(ForgeDirection.UNKNOWN) > 0){
|
||||||
|
int i = this.machine.getEnergyScaled(83);
|
||||||
|
drawTexturedModalRect(this.guiLeft+17, this.guiTop+89-i, 176, 0, 6, i);
|
||||||
|
}
|
||||||
|
if(this.machine.tank.getFluidAmount() > 0){
|
||||||
|
int i = this.machine.getWaterScaled(64);
|
||||||
|
drawTexturedModalRect(this.guiLeft+27, this.guiTop+70-i, 182, 0, 6, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.machine.coffeeCacheAmount > 0){
|
||||||
|
int i = this.machine.getCoffeeScaled(30);
|
||||||
|
drawTexturedModalRect(this.guiLeft+41, this.guiTop+56-i, 192, 0, 8, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.machine.brewTime > 0){
|
||||||
|
int i = this.machine.getBrewScaled(23);
|
||||||
|
drawTexturedModalRect(this.guiLeft+53, this.guiTop+42, 192, 30, i, 16);
|
||||||
|
|
||||||
|
int j = this.machine.getBrewScaled(26);
|
||||||
|
drawTexturedModalRect(this.guiLeft+99+25-j, this.guiTop+44, 192+25-j, 46, j, 12);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int x, int y, float f){
|
||||||
|
super.drawScreen(x, y, f);
|
||||||
|
|
||||||
|
String text1 = this.machine.getEnergyStored(ForgeDirection.UNKNOWN) + "/" + this.machine.getMaxEnergyStored(ForgeDirection.UNKNOWN) + " RF";
|
||||||
|
if(x >= guiLeft+16 && y >= guiTop+5 && x <= guiLeft+23 && y <= guiTop+89){
|
||||||
|
this.func_146283_a(Collections.singletonList(text1), x, y);
|
||||||
|
}
|
||||||
|
String text3 = this.machine.tank.getFluidAmount() + "/" + this.machine.tank.getCapacity() + " mB "+StatCollector.translateToLocal(FluidRegistry.WATER.getUnlocalizedName());
|
||||||
|
if(x >= guiLeft+27 && y >= guiTop+5 && x <= guiLeft+33 && y <= guiTop+70){
|
||||||
|
this.func_146283_a(Collections.singletonList(text3), x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
String text2 = this.machine.coffeeCacheAmount + "/" + this.machine.coffeeCacheMaxAmount+" "+StatCollector.translateToLocal("info."+ModUtil.MOD_ID_LOWER+".gui.coffee");
|
||||||
|
if(x >= guiLeft+40 && y >= guiTop+25 && x <= guiLeft+49 && y <= guiTop+56){
|
||||||
|
this.func_146283_a(Collections.singletonList(text2), x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue