Compare commits

..

6 Commits

Author SHA1 Message Date
yueh c345826641 Reset the lastUsedChannels on a gridstorage change 2015-07-06 09:59:45 +02:00
yueh 9c3ca0e3d7 Splitted channeldata into two ints
Previously it did encode the current and previous used channels into the
same as well as mask it with 0xFF. Which lead to an overflow every 256
gridnodes requiring a channel. This will not happen at > 2^31

Also removes the need to bitshift them for every access.

Fixes #1510
2015-06-16 18:11:46 +02:00
thatsIch 52d62b8202 Merge pull request #1591 from thatsIch/e-update-to-bc-7
Updates BC to 7.0.9 for rv2
2015-06-14 18:19:03 +02:00
thatsIch 643f559186 Fixes #1559: Level Emitter with P:R alloy wire does not crash anymore
Required to implement a more advanced interface, if not done that way, the parts will update themselves recursively
2015-06-14 10:10:51 +02:00
thatsIch 09ed06e47f Fixes #1588: Charged Certus Quartz Ore has its own oredictionary entry 2015-06-14 10:10:36 +02:00
thatsIch 741b5bee1f Updates BC to 7.0.9
Fixes disabling of BC integration
2015-06-13 22:53:57 +02:00
8 changed files with 85 additions and 56 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ fmp_version=1.1.1.324
code_chicken_lib_version=1.1.3.127
code_chicken_core_version=1.0.4.35
nei_version=1.0.4.90
bc_version=6.4.6
bc_version=7.0.9
#########################################################
# Self Compiled APIs #
+7 -1
View File
@@ -45,10 +45,16 @@ repositories {
url = "http://maven.tterrag.com/"
}
maven {
maven {
name = "RX14 Proxy"
url = "http://mvn.rx14.co.uk/repo/"
}
ivy {
name "BuildCraft"
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]"
}
// CurseForge DNS for TE is not available or I am just being unlucky, code part can stay since this is applicable to any other curseforge mod though
// ivy {
// name = "CoFHLib"
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, 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
@@ -29,7 +29,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi;
import appeng.api.exceptions.MissingDefinition;
@@ -67,12 +66,6 @@ public class OreQuartz extends AEBaseBlock
return RenderQuartzOre.class;
}
@Override
public void postInit()
{
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( this ) );
}
@Override
public int getMixedBrightnessForBlock( IBlockAccess par1iBlockAccess, int par2, int par3, int par4 )
{
+57 -30
View File
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, 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
@@ -44,7 +44,7 @@ import codechicken.lib.data.MCDataOutput;
import codechicken.lib.raytracer.IndexedCuboid6;
import codechicken.lib.vec.Cuboid6;
import codechicken.lib.vec.Vector3;
import codechicken.multipart.IRedstonePart;
import codechicken.multipart.IMaskedRedstonePart;
import codechicken.multipart.JCuboidPart;
import codechicken.multipart.JNormalOcclusion;
import codechicken.multipart.NormalOcclusionTest;
@@ -83,24 +83,41 @@ import appeng.util.Platform;
*
* TSlottedPart,ISidedHollowConnect
*/
public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IRedstonePart, AEMultiTile
public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IMaskedRedstonePart, AEMultiTile
{
public static final ThreadLocal<Boolean> DISABLE_FACADE_OCCLUSION = new ThreadLocal<Boolean>();
private static final double SHORTER = 6.0 / 16.0;
private static final double LONGER = 10.0 / 16.0;
private static final double MIN_DIRECTION = 0;
private static final double MAX_DIRECTION = 1.0;
private static final Cuboid6[] SIDE_TESTS = new Cuboid6[] {
new Cuboid6( 6.0 / 16.0, 0, 6.0 / 16.0, 10.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0 ), // DOWN(0, -1, 0),
// DOWN(0, -1, 0),
new Cuboid6( SHORTER, MIN_DIRECTION, SHORTER, LONGER, SHORTER, LONGER ),
new Cuboid6( 6.0 / 16.0, 10.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0, 1.0, 10.0 / 16.0 ), // UP(0, 1, 0),
// UP(0, 1, 0),
new Cuboid6( SHORTER, LONGER, SHORTER, LONGER, MAX_DIRECTION, LONGER ),
new Cuboid6( 6.0 / 16.0, 6.0 / 16.0, 0.0, 10.0 / 16.0, 10.0 / 16.0, 6.0 / 16.0 ),// NORTH(0, 0, -1),
// NORTH(0, 0, -1),
new Cuboid6( SHORTER, SHORTER, MIN_DIRECTION, LONGER, LONGER, SHORTER ),
new Cuboid6( 6.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0, 10.0 / 16.0, 10.0 / 16.0, 1.0 ),// SOUTH(0, 0, 1),
// SOUTH(0, 0, 1),
new Cuboid6( SHORTER, SHORTER, LONGER, LONGER, LONGER, MAX_DIRECTION ),
new Cuboid6( 0.0, 6.0 / 16.0, 6.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0, 10.0 / 16.0 ),// WEST(-1, 0, 0),
// WEST(-1, 0, 0),
new Cuboid6( MIN_DIRECTION, SHORTER, SHORTER, SHORTER, LONGER, LONGER ),
new Cuboid6( 10.0 / 16.0, 6.0 / 16.0, 6.0 / 16.0, 1.0, 10.0 / 16.0, 10.0 / 16.0 ),// EAST(1, 0, 0),
// EAST(1, 0, 0),
new Cuboid6( LONGER, SHORTER, SHORTER, MAX_DIRECTION, LONGER, LONGER ),
};
/**
* Mask for {@link IMaskedRedstonePart#getConnectionMask(int)}
*
* the bits are derived from the rotation, where 4 is the center
*/
private static final int CONNECTION_MASK = 0x000010;
public CableBusContainer cb = new CableBusContainer( this );
boolean canUpdate = false;
@@ -559,15 +576,6 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
public void clearContainer()
{
this.cb = new CableBusContainer( this );
} @Override
public Iterable<Cuboid6> getCollisionBoxes()
{
LinkedList<Cuboid6> l = new LinkedList<Cuboid6>();
for( AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) )
{
l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) );
}
return l;
}
@Override
@@ -579,7 +587,11 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
}
DISABLE_FACADE_OCCLUSION.set( true );
boolean blocked = !this.tile().canAddPart( new NormallyOccludedPart( SIDE_TESTS[side.ordinal()] ) );
final int ordinal = side.ordinal();
final Cuboid6 sideTest = SIDE_TESTS[ordinal];
final NormallyOccludedPart occludedPart = new NormallyOccludedPart( sideTest );
boolean blocked = !this.tile().canAddPart( occludedPart );
DISABLE_FACADE_OCCLUSION.remove();
return blocked;
@@ -627,15 +639,6 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
public Set<LayerFlags> getLayerFlags()
{
return this.cb.getLayerFlags();
} @Override
public Iterable<IndexedCuboid6> getSubParts()
{
LinkedList<IndexedCuboid6> l = new LinkedList<IndexedCuboid6>();
for( Cuboid6 c : this.getCollisionBoxes() )
{
l.add( new IndexedCuboid6( 0, c ) );
}
return l;
}
@Override
@@ -664,7 +667,31 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
return this.cb.isInWorld();
}
@Override
public Iterable<Cuboid6> getCollisionBoxes()
{
LinkedList<Cuboid6> l = new LinkedList<Cuboid6>();
for( AxisAlignedBB b : this.cb.getSelectedBoundingBoxesFromPool( false, true, null, true ) )
{
l.add( new Cuboid6( b.minX, b.minY, b.minZ, b.maxX, b.maxY, b.maxZ ) );
}
return l;
}
@Override
public Iterable<IndexedCuboid6> getSubParts()
{
LinkedList<IndexedCuboid6> l = new LinkedList<IndexedCuboid6>();
for( Cuboid6 c : this.getCollisionBoxes() )
{
l.add( new IndexedCuboid6( 0, c ) );
}
return l;
}
@Override
public int getConnectionMask( int side )
{
return CONNECTION_MASK;
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
* Copyright (c) 2013 - 2015, 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
@@ -27,7 +27,7 @@ public enum IntegrationType
RC( IntegrationSide.BOTH, "Railcraft", "Railcraft" ),
BC( IntegrationSide.BOTH, "BuildCraft", "BuildCraft|Silicon" ),
BC( IntegrationSide.BOTH, "BuildCraft", "BuildCraft|Core" ),
RF( IntegrationSide.BOTH, "RedstoneFlux Power - Tiles", "CoFHAPI" ),
@@ -31,6 +31,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.common.event.FMLInterModComms;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy;
import buildcraft.BuildCraftTransport;
import buildcraft.api.blueprints.BuilderAPI;
@@ -181,9 +182,9 @@ public final class BC extends BaseModule implements IBC
public void registerPowerP2P()
{
IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 0 ), TunnelType.RF_POWER );
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 1 ), TunnelType.RF_POWER );
reg.addNewAttunement( new ItemStack( BuildCraftEnergy.engineBlock, 1, 2 ), TunnelType.RF_POWER );
reg.addNewAttunement( new ItemStack( BuildCraftCore.engineBlock, 1, 0 ), TunnelType.RF_POWER );
reg.addNewAttunement( new ItemStack( BuildCraftCore.engineBlock, 1, 1 ), TunnelType.RF_POWER );
reg.addNewAttunement( new ItemStack( BuildCraftCore.engineBlock, 1, 2 ), TunnelType.RF_POWER );
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerCobblestone ), TunnelType.RF_POWER );
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerDiamond ), TunnelType.RF_POWER );
reg.addNewAttunement( new ItemStack( BuildCraftTransport.pipePowerGold ), TunnelType.RF_POWER );
+11 -11
View File
@@ -71,7 +71,8 @@ public class GridNode implements IGridNode, IPathItem
private Object visitorIterationNumber = null;
// connection criteria
private int compressedData = 0;
private int channelData = 0;
private int usedChannels = 0;
private int lastUsedChannels = 0;
public GridNode( IGridBlock what )
{
@@ -90,7 +91,7 @@ public class GridNode implements IGridNode, IPathItem
public int usedChannels()
{
return this.channelData >> 8;
return this.lastUsedChannels;
}
public Class<? extends IGridHost> getMachineClass()
@@ -358,7 +359,7 @@ public class GridNode implements IGridNode, IPathItem
@Override
public boolean meetsChannelRequirements()
{
return ( !this.gridProxy.getFlags().contains( GridFlags.REQUIRE_CHANNEL ) || this.getUsedChannels() > 0 );
return( !this.gridProxy.getFlags().contains( GridFlags.REQUIRE_CHANNEL ) || this.getUsedChannels() > 0 );
}
@Override
@@ -384,7 +385,7 @@ public class GridNode implements IGridNode, IPathItem
public int getUsedChannels()
{
return this.channelData & 0xff;
return this.usedChannels;
}
public void FindConnections()
@@ -581,7 +582,8 @@ public class GridNode implements IGridNode, IPathItem
public void setGridStorage( GridStorage s )
{
this.myStorage = s;
this.channelData = 0;
this.usedChannels = 0;
this.lastUsedChannels = 0;
}
@Override
@@ -600,7 +602,7 @@ public class GridNode implements IGridNode, IPathItem
{
if( zeroOut )
{
this.channelData &= ~0xff;
this.usedChannels = 0;
}
int idx = this.connections.indexOf( fast );
@@ -631,7 +633,7 @@ public class GridNode implements IGridNode, IPathItem
@Override
public void incrementChannelCount( int usedChannels )
{
this.channelData += usedChannels;
this.usedChannels += usedChannels;
}
@Override
@@ -650,8 +652,7 @@ public class GridNode implements IGridNode, IPathItem
if( this.getLastUsedChannels() != this.getUsedChannels() )
{
this.channelData &= 0xff;
this.channelData |= this.channelData << 8;
this.lastUsedChannels = this.usedChannels;
if( this.getInternalGrid() != null )
{
@@ -662,7 +663,7 @@ public class GridNode implements IGridNode, IPathItem
public int getLastUsedChannels()
{
return ( this.channelData >> 8 ) & 0xff;
return lastUsedChannels;
}
private static class MachineSecurityBreak implements Callable<Void>
@@ -683,7 +684,6 @@ public class GridNode implements IGridNode, IPathItem
}
}
private static class ConnectionComparator implements Comparator<IGridConnection>
{
private final IGridNode gn;
@@ -18,6 +18,8 @@ ore=mc:stained_hardened_clay:* -> blockStainedHardenedClay
ore=ae2:ItemMaterial.NetherQuartzDust -> dustNetherQuartz
ore=ae2:ItemMaterial.CertusQuartzDust -> dustCertusQuartz
ore=ae2:ItemMaterial.FluixDust -> dustFluix
ore=ae2:tile.OreQuartz -> oreCertusQuartz
ore=ae2:tile.OreQuartzCharged -> oreCertusQuartz
group= mc:iron_ingot oredictionary:ingotCopper oredictionary:ingotTin oredictionary:ingotSilver oredictionary:ingotLead oredictionary:ingotBronze oredictionary:ingotBrass oredictionary:ingotNickel oredictionary:ingotInvar oredictionary:ingotAluminium -> metalIngots
group= oredictionary:dustEnder oredictionary:dustEnderPearl -> dustEnder