Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2020-12-27 10:16:39 -05:00
3 changed files with 9 additions and 7 deletions

View File

@@ -36,7 +36,10 @@ public class BlockForge extends PayloadAcceptor{
hasPower = true; hasPower = true;
rotate = true; rotate = true;
config(Block.class, (BlockForgeBuild tile, Block block) -> tile.recipe = block); config(Block.class, (BlockForgeBuild tile, Block block) -> {
if(tile.recipe != block) tile.progress = 0f;
tile.recipe = block;
});
consumes.add(new ConsumeItemDynamic((BlockForgeBuild e) -> e.recipe != null ? e.recipe.requirements : ItemStack.empty)); consumes.add(new ConsumeItemDynamic((BlockForgeBuild e) -> e.recipe != null ? e.recipe.requirements : ItemStack.empty));
} }
@@ -95,8 +98,6 @@ public class BlockForge extends PayloadAcceptor{
payVector.setZero(); payVector.setZero();
progress = 0f; progress = 0f;
} }
}else{
progress = 0;
} }
heat = Mathf.lerpDelta(heat, Mathf.num(produce), 0.3f); heat = Mathf.lerpDelta(heat, Mathf.num(produce), 0.3f);

View File

@@ -18,6 +18,7 @@ public class BlockLoader extends PayloadAcceptor{
public float loadTime = 2f; public float loadTime = 2f;
public int itemsLoaded = 5; public int itemsLoaded = 5;
public float liquidsLoaded = 5f; public float liquidsLoaded = 5f;
public int maxBlockSize = 2;
public BlockLoader(String name){ public BlockLoader(String name){
super(name); super(name);
@@ -60,8 +61,8 @@ public class BlockLoader extends PayloadAcceptor{
@Override @Override
public boolean acceptPayload(Building source, Payload payload){ public boolean acceptPayload(Building source, Payload payload){
return super.acceptPayload(source, payload) && return super.acceptPayload(source, payload) &&
(payload instanceof BuildPayload) && (payload instanceof BuildPayload build) &&
((((BuildPayload)payload).build.block.hasItems && ((BuildPayload)payload).block().unloadable && ((BuildPayload)payload).block().itemCapacity >= 10)/* || ((build.build.block.hasItems && build.block().unloadable && build.block().itemCapacity >= 10 && build.block().size <= maxBlockSize)/* ||
((BlockPayload)payload).entity.block().hasLiquids && ((BlockPayload)payload).block().liquidCapacity >= 10f)*/); ((BlockPayload)payload).entity.block().hasLiquids && ((BlockPayload)payload).block().liquidCapacity >= 10f)*/);
} }
@@ -99,7 +100,7 @@ public class BlockLoader extends PayloadAcceptor{
//load up items //load up items
if(payload.block().hasItems && items.any()){ if(payload.block().hasItems && items.any()){
if(timer(timerLoad, loadTime)){ if(efficiency() > 0.01f && timer(timerLoad, loadTime / efficiency())){
//load up items a set amount of times //load up items a set amount of times
for(int j = 0; j < itemsLoaded && items.any(); j++){ for(int j = 0; j < itemsLoaded && items.any(); j++){

View File

@@ -31,7 +31,7 @@ public class BlockUnloader extends BlockLoader{
//load up items //load up items
if(payload.block().hasItems && !full()){ if(payload.block().hasItems && !full()){
if(timer(timerLoad, loadTime)){ if(efficiency() > 0.01f && timer(timerLoad, loadTime / efficiency())){
//load up items a set amount of times //load up items a set amount of times
for(int j = 0; j < itemsLoaded && !full(); j++){ for(int j = 0; j < itemsLoaded && !full(); j++){
for(int i = 0; i < items.length(); i++){ for(int i = 0; i < items.length(); i++){