Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
gamerforEA committed Oct 5, 2017
1 parent 9b65281 commit 15ca41b
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/main/java/appeng/block/AEBaseTileBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public boolean onBlockEventReceived(final World p_149696_1_, final int p_149696_
{
super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_);
final TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_);
return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false;
return tileentity != null && tileentity.receiveClientEvent(p_149696_5_, p_149696_6_);
}

@Override
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/appeng/core/AppEng.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.network.NetworkRegistry;
import net.minecraftforge.common.ForgeVersion;
import net.minecraftforge.common.config.Configuration;

import javax.annotation.Nonnull;
Expand All @@ -67,9 +68,9 @@ public final class AppEng

// depend on version of forge used for build.
"after:appliedenergistics2-core;" + "required-after:Forge@[" // require forge.
+ net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
+ ForgeVersion.majorVersion + '.' // majorVersion
+ ForgeVersion.minorVersion + '.' // minorVersion
+ ForgeVersion.revisionVersion + '.' // revisionVersion
// TODO gamerforEA code replace, old code: + net.minecraftforge.common.ForgeVersion.buildVersion + ",)";
+ "1448,)"; // buildVersion
// TODO gamerforEA code end
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/helpers/DualityInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ public IInventory getStorage()
}

@Override
public appeng.api.util.IConfigManager getConfigManager()
public IConfigManager getConfigManager()
{
return this.cm;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/hooks/DispenserBlockTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected ItemStack dispenseStack(final IBlockSource dispenser, final ItemStack

// TODO gamerforEA code start
if (tm instanceof Item)
((Item) tm).onItemUse(dispensedItem, Platform.getPlayer((WorldServer) w), w, x, y, z, enumfacing.ordinal(), 0.5f, 0.5f, 0.5f);
tm.onItemUse(dispensedItem, Platform.getPlayer((WorldServer) w), w, x, y, z, enumfacing.ordinal(), 0.5f, 0.5f, 0.5f);
else
// TODO gamerforEA code end
tm.onItemUse(dispensedItem, Platform.getPlayer((WorldServer) w), w, x, y, z, enumfacing.ordinal(), 0.5f, 0.5f, 0.5f);
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/appeng/items/tools/powered/ToolMassCannon.java
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,7 @@ public boolean isBlackListed(final ItemStack cellItem, final IAEItemStack reques
if (pen > 0)
return false;

if (requestedAddition.getItem() instanceof ItemPaintBall)
return false;

return true;
return !(requestedAddition.getItem() instanceof ItemPaintBall);
}

@Override
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/appeng/me/cache/GridStorageCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,7 @@ public void cellUpdate(final MENetworkCellArrayUpdate ev)
if (cc instanceof IActionHost)
{
final IGridNode node = ((IActionHost) cc).getActionableNode();
if (node != null && node.isActive())
Active = true;
else
Active = false;
Active = node != null && node.isActive();
}

if (Active)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ public IAEItemStack injectItems(final IAEItemStack input, final Actionable type,
{
result.setDead();
// TODO gamerforEA code clear (dupe fix): worked = false;
;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
import appeng.util.inv.AdaptorIInventory;
import com.gamerforea.ae.BusUtils;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/appeng/spatial/CachedPlane.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,8 @@ public boolean inBlackList(final CachedPlane dst, final int x, final int z, fina
final Block dstBlock = dst.world.getBlock(x + dst.x_offset, dst_y, z + dst.z_offset);
final int dstMeta = dst.world.getBlockMetadata(x + dst.x_offset, dst_y, z + dst.z_offset);

if (EventConfig.inList(EventConfig.pilonBlackList, dstBlock, dstMeta))
return true;
return EventConfig.inList(EventConfig.pilonBlackList, dstBlock, dstMeta);

return false;
}

public boolean access(final FakePlayer player, final CachedPlane dst, final int x, final int z, final int src_y, final int dst_y)
Expand Down
16 changes: 2 additions & 14 deletions src/main/java/appeng/util/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,8 @@ private static boolean isNotValidSetting(final Enum e)
if (e == SearchBoxMode.NEI_AUTOSEARCH && !IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI))
return true;

if (e == SearchBoxMode.NEI_MANUAL_SEARCH && !IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI))
return true;
return e == SearchBoxMode.NEI_MANUAL_SEARCH && !IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI);

return false;
}

public static void openGUI(
Expand Down Expand Up @@ -383,7 +381,6 @@ public static boolean NBTEqualityTest(final NBTBase left, final NBTBase right)
switch (id)
{
case 10:
{
final NBTTagCompound ctA = (NBTTagCompound) left;
final NBTTagCompound ctB = (NBTTagCompound) right;

Expand All @@ -405,10 +402,8 @@ public static boolean NBTEqualityTest(final NBTBase left, final NBTBase right)
}

return true;
}

case 9: // ) // A instanceof NBTTagList )
{
final NBTTagList lA = (NBTTagList) left;
final NBTTagList lB = (NBTTagList) right;
if (lA.tagCount() != lB.tagCount())
Expand All @@ -429,7 +424,6 @@ public static boolean NBTEqualityTest(final NBTBase left, final NBTBase right)
}

return true;
}

case 1: // ( A instanceof NBTTagByte )
return ((NBTBase.NBTPrimitive) left).func_150287_d() == ((NBTBase.NBTPrimitive) right).func_150287_d();
Expand Down Expand Up @@ -502,7 +496,6 @@ public static int NBTOrderlessHash(final NBTBase nbt)
switch (id)
{
case 10:
{
final NBTTagCompound ctA = (NBTTagCompound) nbt;

final Set<String> cA = ctA.func_150296_c();
Expand All @@ -513,10 +506,8 @@ public static int NBTOrderlessHash(final NBTBase nbt)
}

return hash;
}

case 9: // ) // A instanceof NBTTagList )
{
final NBTTagList lA = (NBTTagList) nbt;
hash += 9 * lA.tagCount();

Expand All @@ -527,7 +518,6 @@ public static int NBTOrderlessHash(final NBTBase nbt)
}

return hash;
}

case 1: // ( A instanceof NBTTagByte )
return hash + ((NBTBase.NBTPrimitive) nbt).func_150290_f();
Expand Down Expand Up @@ -830,9 +820,7 @@ public static boolean hasSpecialComparison(final IAEItemStack willAdd)
if (willAdd == null)
return false;
final IAETagCompound tag = willAdd.getTagCompound();
if (tag != null && tag.getSpecialComparison() != null)
return true;
return false;
return tag != null && tag.getSpecialComparison() != null;
}

public static boolean hasSpecialComparison(final ItemStack willAdd)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/gamerforea/ae/EventConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public final class EventConfig
{
private static final String[] DEFAULT_BLOCKS = new String[] { "minecraft:bedrock", "modid:blockname:meta" };
private static final String[] DEFAULT_BLOCKS = { "minecraft:bedrock", "modid:blockname:meta" };
public static final Set<String> pilonBlackList = Sets.newHashSet(DEFAULT_BLOCKS);
public static final Set<String> formationPlaneBlackList = Sets.newHashSet(DEFAULT_BLOCKS);
public static final Set<String> annihilationPlaneBlackList = Sets.newHashSet(DEFAULT_BLOCKS);
Expand Down

0 comments on commit 15ca41b

Please sign in to comment.