Skip to content

Commit

Permalink
Merge remote-tracking branch 'Keridos/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Sep 10, 2024
2 parents 6d214e0 + 03e2881 commit febb2df
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/main/java/openmodularturrets/blocks/misc/LeverBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ private static ForgeDirection decipherMetadata(int metadata) {
}

@Override
public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) {
TurretBaseTierOneTileEntity base = getTurretBase(par1World, par2, par3, par4);
LeverTileEntity lever = (LeverTileEntity) par1World.getTileEntity(par2, par3, par4);

if (base != null) {
public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX,
float subY, float subZ) {
TurretBaseTierOneTileEntity base = getTurretBase(worldIn, x, y, z);
TileEntity te = worldIn.getTileEntity(x, y, z);
if (base != null && te instanceof LeverTileEntity lever) {
lever.isTurning = true;
if (lever.rotation == 0F) {
par1World.playSoundEffect(par2, par3, par4, "openmodularturrets:windup", 1.0F, 1.0F);
worldIn.playSoundEffect(x, y, z, "openmodularturrets:windup", 1.0F, 1.0F);
base.receiveEnergy(ForgeDirection.UNKNOWN, 50, false);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,14 +547,16 @@ public void updateEntity() {
this.storage.setCapacity(getMaxEnergyStorageWithExtenders());

// Thaumcraft
if (ModCompatibility.ThaumcraftLoaded && TurretHeadUtil.hasPotentiaUpgradeAddon(this)) {
if (amountOfPotentia > 0.05F && storage.getEnergyStored() < storage.getMaxEnergyStored()) {
float multiplier = VisNetHandler.drainVis(worldObj, xCoord, yCoord, zCoord, Aspect.ORDER, 5) == 5 ? 5f : 0.5f;
this.amountOfPotentia -= 0.05f;
this.storage.modifyEnergyStored(Math.round(ConfigHandler.getPotentiaToRFRatio() * multiplier));
if (ModCompatibility.ThaumcraftLoaded && TurretHeadUtil.hasPotentiaUpgradeAddon(this)
&& (storage.getMaxEnergyStored() - storage.getEnergyStored()
<= ConfigHandler.getPotentiaToRFRatio() * 5)) {
if (VisNetHandler.drainVis(worldObj, xCoord, yCoord, zCoord, Aspect.ORDER, 5) == 5) {
this.storage.modifyEnergyStored(ConfigHandler.getPotentiaToRFRatio() * 5);
} else if (this.amountOfPotentia > 0.05F) {
this.amountOfPotentia = this.amountOfPotentia - 0.05F;
this.storage.modifyEnergyStored(ConfigHandler.getPotentiaToRFRatio() * 5);
}
}
}

if (ModCompatibility.IC2Loaded && ConfigHandler.EUSupport
&& storage.getMaxEnergyStored() != storage.getEnergyStored()
Expand Down

0 comments on commit febb2df

Please sign in to comment.