mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Coal generator comparator output
This commit is contained in:
parent
cfd7ec41df
commit
af3ef16975
4 changed files with 16 additions and 5 deletions
|
@ -139,7 +139,7 @@ public final class InitBooklet{
|
||||||
crystalPages.add(new PageCrafting(crystalPages.size()+1, MiscCrafting.RECIPES_CRYSTAL_BLOCKS).setNoText());
|
crystalPages.add(new PageCrafting(crystalPages.size()+1, MiscCrafting.RECIPES_CRYSTAL_BLOCKS).setNoText());
|
||||||
chaptersIntroduction[2] = new BookletChapter("engineerHouse", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.EMERALD), new PageTextOnly(1), new PagePicture(2, "page_engineer_house", 145));
|
chaptersIntroduction[2] = new BookletChapter("engineerHouse", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.EMERALD), new PageTextOnly(1), new PagePicture(2, "page_engineer_house", 145));
|
||||||
chaptersIntroduction[6] = new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), crystalPages.toArray(new BookletPage[crystalPages.size()])).setSpecial();
|
chaptersIntroduction[6] = new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), crystalPages.toArray(new BookletPage[crystalPages.size()])).setSpecial();
|
||||||
chaptersIntroduction[5] = new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator), new PageCrafting(1, BlockCrafting.recipeCoalGen).setWildcard().addTextReplacement("<rf>", TileEntityCoalGenerator.PRODUCE));
|
chaptersIntroduction[5] = new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityCoalGenerator.PRODUCE), new PageCrafting(2, BlockCrafting.recipeCoalGen).setWildcard().setNoText());
|
||||||
ArrayList<BookletPage> empowererPages = new ArrayList<BookletPage>();
|
ArrayList<BookletPage> empowererPages = new ArrayList<BookletPage>();
|
||||||
empowererPages.addAll(Arrays.asList(new PageTextOnly(1), new PagePicture(2, "page_empowerer", 137), new PageCrafting(3, BlockCrafting.recipeEmpowerer), new PageCrafting(4, BlockCrafting.recipeDisplayStand)));
|
empowererPages.addAll(Arrays.asList(new PageTextOnly(1), new PagePicture(2, "page_empowerer", 137), new PageCrafting(3, BlockCrafting.recipeEmpowerer), new PageCrafting(4, BlockCrafting.recipeDisplayStand)));
|
||||||
for(int i = 0; i < EmpowererHandler.MAIN_PAGE_RECIPES.size(); i++){
|
for(int i = 0; i < EmpowererHandler.MAIN_PAGE_RECIPES.size(); i++){
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
|
||||||
private int lastEnergy;
|
private int lastEnergy;
|
||||||
private int lastBurnTime;
|
private int lastBurnTime;
|
||||||
private int lastCurrentBurnTime;
|
private int lastCurrentBurnTime;
|
||||||
|
private int lastCompare;
|
||||||
|
|
||||||
public TileEntityCoalGenerator(){
|
public TileEntityCoalGenerator(){
|
||||||
super(1, "coalGenerator");
|
super(1, "coalGenerator");
|
||||||
|
@ -82,7 +83,9 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
|
||||||
this.slots.set(0, StackUtil.addStackSize(this.slots.get(0), -1));
|
this.slots.set(0, StackUtil.addStackSize(this.slots.get(0), -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flag != this.currentBurnTime > 0){
|
if(flag != this.currentBurnTime > 0 || this.lastCompare != this.getComparatorStrength()){
|
||||||
|
this.lastCompare = this.getComparatorStrength();
|
||||||
|
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,6 +97,12 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getComparatorStrength(){
|
||||||
|
float calc = ((float)this.storage.getEnergyStored()/(float)this.storage.getMaxEnergyStored())*15F;
|
||||||
|
return (int)calc;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int i, ItemStack stack){
|
public boolean isItemValidForSlot(int i, ItemStack stack){
|
||||||
return TileEntityFurnace.getItemBurnTime(stack) > 0;
|
return TileEntityFurnace.getItemBurnTime(stack) > 0;
|
||||||
|
|
|
@ -47,6 +47,7 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn
|
||||||
private int lastBurnTime;
|
private int lastBurnTime;
|
||||||
private int lastMaxBurnTime;
|
private int lastMaxBurnTime;
|
||||||
private int lastEnergyProduce;
|
private int lastEnergyProduce;
|
||||||
|
private int lastCompare;
|
||||||
|
|
||||||
public TileEntityOilGenerator(){
|
public TileEntityOilGenerator(){
|
||||||
super("oilGenerator");
|
super("oilGenerator");
|
||||||
|
@ -107,7 +108,6 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn
|
||||||
public void updateEntity(){
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!this.world.isRemote){
|
if(!this.world.isRemote){
|
||||||
int lastCompare = this.getComparatorStrength();
|
|
||||||
boolean flag = this.currentBurnTime > 0;
|
boolean flag = this.currentBurnTime > 0;
|
||||||
|
|
||||||
if(this.currentBurnTime > 0 && this.currentEnergyProduce > 0){
|
if(this.currentBurnTime > 0 && this.currentEnergyProduce > 0){
|
||||||
|
@ -133,7 +133,9 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flag != this.currentBurnTime > 0 || lastCompare != this.getComparatorStrength()){
|
if(flag != this.currentBurnTime > 0 || this.lastCompare != this.getComparatorStrength()){
|
||||||
|
this.lastCompare = this.getComparatorStrength();
|
||||||
|
|
||||||
this.markDirty();
|
this.markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -870,7 +870,7 @@ booklet.actuallyadditions.chapter.repairer.name=Item Repairer
|
||||||
booklet.actuallyadditions.chapter.repairer.text.1=The <item>Item Repairer<r> uses <imp><rf> CF/t<r> to repair items that can be repaired in an Anvil <imp>without needing any materials<r>!
|
booklet.actuallyadditions.chapter.repairer.text.1=The <item>Item Repairer<r> uses <imp><rf> CF/t<r> to repair items that can be repaired in an Anvil <imp>without needing any materials<r>!
|
||||||
|
|
||||||
booklet.actuallyadditions.chapter.coalGen.name=Coal Generator
|
booklet.actuallyadditions.chapter.coalGen.name=Coal Generator
|
||||||
booklet.actuallyadditions.chapter.coalGen.text.1=The <item>Coal Generator<r> generates <imp><rf> CF/t<r> through the use of everything that can be put into a furnace. <n>Note that it only starts burning something up if the buffer isn't already full of power. <n>It will <imp>stop generating<r> when powered by <imp>Redstone<r>.
|
booklet.actuallyadditions.chapter.coalGen.text.1=The <item>Coal Generator<r> generates <imp><rf> CF/t<r> through the use of everything that can be put into a furnace. <n>Note that it only starts burning something up if the buffer isn't already full of power. <n>It will <imp>stop generating<r> when powered by <imp>Redstone<r>. <n>Additionally, using a <item>Comparator<r> will yield the percentage of <imp>energy stored<r>.
|
||||||
|
|
||||||
booklet.actuallyadditions.chapter.solarPanel.name=Solar Panel
|
booklet.actuallyadditions.chapter.solarPanel.name=Solar Panel
|
||||||
booklet.actuallyadditions.chapter.solarPanel.text.1=The <item>Solar Panel<r> <imp>produces <rf> CF/t<r> when it has direct daylight above it and it is daytime. Any blocks above it that are transparent will <imp>decrease its efficiency<r>, however. <n><n><i>Panelled walls
|
booklet.actuallyadditions.chapter.solarPanel.text.1=The <item>Solar Panel<r> <imp>produces <rf> CF/t<r> when it has direct daylight above it and it is daytime. Any blocks above it that are transparent will <imp>decrease its efficiency<r>, however. <n><n><i>Panelled walls
|
||||||
|
|
Loading…
Reference in a new issue