parent
d3e860edb2
commit
5fe5fce53c
1 changed files with 4 additions and 11 deletions
|
@ -86,7 +86,6 @@ public class RecipeCrafter {
|
||||||
public int currentTickTime = 0;
|
public int currentTickTime = 0;
|
||||||
public int currentNeededTicks = 1;//Set to 1 to stop rare crashes
|
public int currentNeededTicks = 1;//Set to 1 to stop rare crashes
|
||||||
double lastEnergy;
|
double lastEnergy;
|
||||||
public boolean isactive = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is used to change the speed of the crafting operation.
|
* This is used to change the speed of the crafting operation.
|
||||||
|
@ -266,7 +265,6 @@ public class RecipeCrafter {
|
||||||
if (data.hasKey("currentTickTime"))
|
if (data.hasKey("currentTickTime"))
|
||||||
currentTickTime = data.getInteger("currentTickTime");
|
currentTickTime = data.getInteger("currentTickTime");
|
||||||
|
|
||||||
isactive = data.getBoolean("isActive");
|
|
||||||
if (parentTile != null && parentTile.getWorldObj() != null && parentTile.getWorldObj().isRemote) {
|
if (parentTile != null && parentTile.getWorldObj() != null && parentTile.getWorldObj().isRemote) {
|
||||||
parentTile.getWorldObj().markBlockForUpdate(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord);
|
parentTile.getWorldObj().markBlockForUpdate(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord);
|
||||||
parentTile.getWorldObj().markBlockRangeForRenderUpdate(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord, parentTile.xCoord, parentTile.yCoord, parentTile.zCoord);
|
parentTile.getWorldObj().markBlockRangeForRenderUpdate(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord, parentTile.xCoord, parentTile.yCoord, parentTile.zCoord);
|
||||||
|
@ -278,19 +276,14 @@ public class RecipeCrafter {
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
NBTTagCompound data = new NBTTagCompound();
|
||||||
|
|
||||||
data.setDouble("currentTickTime", currentTickTime);
|
data.setDouble("currentTickTime", currentTickTime);
|
||||||
data.setBoolean("isActive", isActiveServer());
|
|
||||||
|
|
||||||
tag.setTag("Crater", data);
|
tag.setTag("Crater", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private boolean isActiveServer() {
|
private boolean isActive() {
|
||||||
return currentRecipe != null && energy.getEnergy() >= currentRecipe.euPerTick() && currentTickTime != -1;
|
return currentRecipe != null && energy.getEnergy() >= currentRecipe.euPerTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isActive() {
|
|
||||||
return isactive;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addSpeedMulti(double amount) {
|
public void addSpeedMulti(double amount) {
|
||||||
if (speedMultiplier + amount <= 0.99) {
|
if (speedMultiplier + amount <= 0.99) {
|
||||||
|
@ -326,7 +319,7 @@ public class RecipeCrafter {
|
||||||
|
|
||||||
|
|
||||||
public void setIsActive() {
|
public void setIsActive() {
|
||||||
if(isActiveServer()){
|
if(isActive()){
|
||||||
parentTile.getWorldObj().setBlockMetadataWithNotify(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord, 1, 2);
|
parentTile.getWorldObj().setBlockMetadataWithNotify(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord, 1, 2);
|
||||||
} else {
|
} else {
|
||||||
parentTile.getWorldObj().setBlockMetadataWithNotify(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord, 0, 2);
|
parentTile.getWorldObj().setBlockMetadataWithNotify(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord, 0, 2);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue