From 96576a7fc516106eaaecb54fbbae484a5ed4dae0 Mon Sep 17 00:00:00 2001 From: thatsIch Date: Fri, 8 May 2015 16:46:47 +0200 Subject: [PATCH] Closes #1413: Removes RB integration since lacking 1.7.10+ support --- gradle.properties | 1 - gradle/scripts/dependencies.gradle | 1 - .../appeng/block/solids/BlockSkyStone.java | 65 +++++-------- .../appeng/integration/abstraction/IRB.java | 31 ------- .../java/appeng/integration/modules/RB.java | 92 ------------------- 5 files changed, 21 insertions(+), 169 deletions(-) delete mode 100644 src/main/java/appeng/integration/abstraction/IRB.java delete mode 100644 src/main/java/appeng/integration/modules/RB.java diff --git a/gradle.properties b/gradle.properties index 2f89287bf..6f17a7f56 100644 --- a/gradle.properties +++ b/gradle.properties @@ -53,5 +53,4 @@ api_craftguide_version=1 api_immibis_version=1 api_mfr_version=1 api_railcraft_version=1 -api_rblocks_version=1 api_rf_version=2 diff --git a/gradle/scripts/dependencies.gradle b/gradle/scripts/dependencies.gradle index 6bd959999..6b49341dc 100644 --- a/gradle/scripts/dependencies.gradle +++ b/gradle/scripts/dependencies.gradle @@ -112,7 +112,6 @@ dependencies { compile(group: 'api', name: 'immibis', version: "${api_immibis_version}") compile(group: 'api', name: 'mfr', version: "${api_mfr_version}") compile(group: 'api', name: 'railcraft', version: "${api_railcraft_version}") - compile(group: 'api', name: 'rblocks', version: "${api_rblocks_version}") compile(group: 'api', name: 'rf', version: "${api_rf_version}") testCompile "junit:junit:4.11" diff --git a/src/main/java/appeng/block/solids/BlockSkyStone.java b/src/main/java/appeng/block/solids/BlockSkyStone.java index 5c0cdc161..9f4d00731 100644 --- a/src/main/java/appeng/block/solids/BlockSkyStone.java +++ b/src/main/java/appeng/block/solids/BlockSkyStone.java @@ -29,7 +29,6 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; @@ -41,40 +40,37 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import rblocks.api.RotatableBlockEnable; - import appeng.api.util.IOrientable; import appeng.api.util.IOrientableBlock; import appeng.block.AEBaseBlock; -import appeng.core.AppEng; import appeng.core.WorldSettings; import appeng.core.features.AEFeature; import appeng.helpers.LocationRotation; import appeng.helpers.NullRotation; -import appeng.integration.IntegrationType; -import appeng.integration.abstraction.IRB; import appeng.util.Platform; -@RotatableBlockEnable public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock { + private static final float BLOCK_RESISTANCE = 150.0f; + private static final double BREAK_SPEAK_SCALAR = 0.1; + private static final double BREAK_SPEAK_THRESHOLD = 7.0; @SideOnly( Side.CLIENT ) - IIcon Block; + private IIcon block; @SideOnly( Side.CLIENT ) - IIcon Brick; + private IIcon brick; @SideOnly( Side.CLIENT ) - IIcon SmallBrick; + private IIcon smallBrick; public BlockSkyStone() { super( BlockSkyStone.class, Material.rock ); this.setHardness( 50 ); this.hasSubtypes = true; - this.blockResistance = 150.0f; + this.blockResistance = BLOCK_RESISTANCE; this.setHarvestLevel( "pickaxe", 3, 0 ); this.setFeature( EnumSet.of( AEFeature.Core ) ); @@ -82,21 +78,21 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock } @SubscribeEvent - public void breakFaster( PlayerEvent.BreakSpeed Ev ) + public void breakFaster( PlayerEvent.BreakSpeed event ) { - if( Ev.block == this && Ev.entityPlayer != null ) + if( event.block == this && event.entityPlayer != null ) { - ItemStack is = Ev.entityPlayer.inventory.getCurrentItem(); + ItemStack is = event.entityPlayer.inventory.getCurrentItem(); int level = -1; - if( is != null ) + if( is != null && is.getItem() != null ) { level = is.getItem().getHarvestLevel( is, "pickaxe" ); } - if( Ev.metadata > 0 || level >= 3 || Ev.originalSpeed > 7.0 ) + if( event.metadata > 0 || level >= 3 || event.originalSpeed > BREAK_SPEAK_THRESHOLD ) { - Ev.newSpeed /= 0.1; + event.newSpeed /= BREAK_SPEAK_SCALAR; } } } @@ -126,12 +122,6 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock } } - // use AE2's renderer, no rotatable blocks. - int getRealRenderType() - { - return this.getRenderType(); - } - @Override public boolean usesMetadata() { @@ -141,19 +131,6 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock @Override public IOrientable getOrientable( final IBlockAccess w, final int x, final int y, final int z ) { - if( AppEng.instance.isIntegrationEnabled( IntegrationType.RB ) ) - { - TileEntity te = w.getTileEntity( x, y, z ); - if( te != null ) - { - IOrientable out = ( (IRB) AppEng.instance.getIntegration( IntegrationType.RB ) ).getOrientable( te ); - if( out != null ) - { - return out; - } - } - } - if( w.getBlockMetadata( x, y, z ) == 0 ) { return new LocationRotation( w, x, y, z ); @@ -188,9 +165,9 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock public void registerBlockIcons( IIconRegister ir ) { super.registerBlockIcons( ir ); - this.Block = ir.registerIcon( this.getTextureName() + ".Block" ); - this.Brick = ir.registerIcon( this.getTextureName() + ".Brick" ); - this.SmallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" ); + this.block = ir.registerIcon( this.getTextureName() + ".Block" ); + this.brick = ir.registerIcon( this.getTextureName() + ".Brick" ); + this.smallBrick = ir.registerIcon( this.getTextureName() + ".SmallBrick" ); } @Override @@ -199,15 +176,15 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock { if( metadata == 1 ) { - return this.Block; + return this.block; } if( metadata == 2 ) { - return this.Brick; + return this.brick; } if( metadata == 3 ) { - return this.SmallBrick; + return this.smallBrick; } return super.getIcon( direction, metadata ); } @@ -230,9 +207,9 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock } @Override - public void breakBlock( World w, int x, int y, int z, Block b, int WTF ) + public void breakBlock( World w, int x, int y, int z, Block b, int metadata ) { - super.breakBlock( w, x, y, z, b, WTF ); + super.breakBlock( w, x, y, z, b, metadata ); if( Platform.isServer() ) { WorldSettings.getInstance().getCompass().updateArea( w, x, y, z ); diff --git a/src/main/java/appeng/integration/abstraction/IRB.java b/src/main/java/appeng/integration/abstraction/IRB.java deleted file mode 100644 index bcf07178b..000000000 --- a/src/main/java/appeng/integration/abstraction/IRB.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.integration.abstraction; - - -import net.minecraft.tileentity.TileEntity; - -import appeng.api.util.IOrientable; - - -public interface IRB -{ - - IOrientable getOrientable( TileEntity te ); -} diff --git a/src/main/java/appeng/integration/modules/RB.java b/src/main/java/appeng/integration/modules/RB.java deleted file mode 100644 index b8543d5de..000000000 --- a/src/main/java/appeng/integration/modules/RB.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * This file is part of Applied Energistics 2. - * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. - * - * Applied Energistics 2 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Applied Energistics 2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Applied Energistics 2. If not, see . - */ - -package appeng.integration.modules; - - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -import rblocks.api.IOrientable; - -import appeng.integration.BaseModule; -import appeng.integration.abstraction.IRB; - - -public class RB extends BaseModule implements IRB -{ - - public static RB instance; - - @Override - public void init() throws Throwable - { - this.testClassExistence( IOrientable.class ); - } - - @Override - public void postInit() - { - - } - - @Override - public appeng.api.util.IOrientable getOrientable( TileEntity te ) - { - if( te instanceof IOrientable ) - { - return new RBWrapper( (IOrientable) te ); - } - return null; - } - - private class RBWrapper implements appeng.api.util.IOrientable - { - - private final IOrientable internal; - - public RBWrapper( IOrientable ww ) - { - this.internal = ww; - } - - @Override - public boolean canBeRotated() - { - return this.internal.canBeRotated(); - } - - @Override - public ForgeDirection getForward() - { - return this.internal.getForward(); - } - - @Override - public ForgeDirection getUp() - { - return this.internal.getUp(); - } - - @Override - public void setOrientation( ForgeDirection Forward, ForgeDirection Up ) - { - this.internal.setOrientation( Forward, Up ); - } - } -}