Fix cheaty item and liquid turrets (#8176)
* Update Turret.java * Update TractorBeamTurret.java * Update TractorBeamTurret.java * Update ItemTurret.java * Update LiquidTurret.java
This commit is contained in:
@@ -88,7 +88,7 @@ public class ItemTurret extends Turret{
|
|||||||
super.onProximityAdded();
|
super.onProximityAdded();
|
||||||
|
|
||||||
//add first ammo item to cheaty blocks so they can shoot properly
|
//add first ammo item to cheaty blocks so they can shoot properly
|
||||||
if(cheating() && ammo.size > 0){
|
if(cheating() && ammoTypes.size > 0){
|
||||||
handleItem(this, ammoTypes.entries().next().key);
|
handleItem(this, ammoTypes.entries().next().key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,16 @@ public class LiquidTurret extends Turret{
|
|||||||
|
|
||||||
public class LiquidTurretBuild extends TurretBuild{
|
public class LiquidTurretBuild extends TurretBuild{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProximityAdded(){
|
||||||
|
super.onProximityAdded();
|
||||||
|
|
||||||
|
//add first ammo liquid to cheaty blocks so they can shoot properly
|
||||||
|
if(cheating() && ammoTypes.size > 0){
|
||||||
|
handleLiquid(this, ammoTypes.entries().next().key, 1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldActiveSound(){
|
public boolean shouldActiveSound(){
|
||||||
return wasShooting && enabled;
|
return wasShooting && enabled;
|
||||||
|
|||||||
@@ -500,7 +500,8 @@ public class Turret extends ReloadTurret{
|
|||||||
if(ammo.size >= 2 && ammo.peek().amount < ammoPerShot && ammo.get(ammo.size - 2).amount >= ammoPerShot){
|
if(ammo.size >= 2 && ammo.peek().amount < ammoPerShot && ammo.get(ammo.size - 2).amount >= ammoPerShot){
|
||||||
ammo.swap(ammo.size - 1, ammo.size - 2);
|
ammo.swap(ammo.size - 1, ammo.size - 2);
|
||||||
}
|
}
|
||||||
return ammo.size > 0 && ammo.peek().amount >= ammoPerShot;
|
|
||||||
|
return ammo.size > 0 && ammo.peek().amount >= ammoPerShot || cheating();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean charging(){
|
public boolean charging(){
|
||||||
|
|||||||
Reference in New Issue
Block a user