Merge branch 'rv1' of https://bitbucket.org/AlgorithmX2/appliedenergistics2 into rv1
This commit is contained in:
commit
ee7869a61a
4 changed files with 52 additions and 12 deletions
|
@ -19,11 +19,13 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
|
import appeng.api.parts.IBoxProvider;
|
||||||
import appeng.api.parts.IFacadeContainer;
|
import appeng.api.parts.IFacadeContainer;
|
||||||
import appeng.api.parts.IFacadePart;
|
import appeng.api.parts.IFacadePart;
|
||||||
import appeng.api.parts.IPartCollsionHelper;
|
import appeng.api.parts.IPartCollsionHelper;
|
||||||
import appeng.api.parts.IPartHost;
|
import appeng.api.parts.IPartHost;
|
||||||
import appeng.api.parts.IPartRenderHelper;
|
import appeng.api.parts.IPartRenderHelper;
|
||||||
|
import appeng.api.parts.ISimplifiedBundle;
|
||||||
import appeng.client.render.BusRenderHelper;
|
import appeng.client.render.BusRenderHelper;
|
||||||
import appeng.client.render.RenderBlocksWorkaround;
|
import appeng.client.render.RenderBlocksWorkaround;
|
||||||
import appeng.core.AELog;
|
import appeng.core.AELog;
|
||||||
|
@ -34,13 +36,16 @@ import appeng.util.Platform;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class FacadePart implements IFacadePart
|
public class FacadePart implements IFacadePart, IBoxProvider
|
||||||
{
|
{
|
||||||
|
|
||||||
public final ItemStack facade;
|
public final ItemStack facade;
|
||||||
public final ForgeDirection side;
|
public final ForgeDirection side;
|
||||||
public int thickness = 2;
|
public int thickness = 2;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
ISimplifiedBundle prevLight;
|
||||||
|
|
||||||
public FacadePart(ItemStack facade, ForgeDirection side) {
|
public FacadePart(ItemStack facade, ForgeDirection side) {
|
||||||
if ( facade == null )
|
if ( facade == null )
|
||||||
throw new RuntimeException( "Facade Part constructed on null item." );
|
throw new RuntimeException( "Facade Part constructed on null item." );
|
||||||
|
@ -70,6 +75,13 @@ public class FacadePart implements IFacadePart
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getBoxes(IPartCollsionHelper bch)
|
||||||
|
{
|
||||||
|
getBoxes( bch, null );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isFacade(ItemStack is)
|
public static boolean isFacade(ItemStack is)
|
||||||
{
|
{
|
||||||
if ( is.getItem() instanceof IFacadeItem )
|
if ( is.getItem() instanceof IFacadeItem )
|
||||||
|
@ -183,9 +195,15 @@ public class FacadePart implements IFacadePart
|
||||||
rbw.calculations = true;
|
rbw.calculations = true;
|
||||||
rbw.faces = EnumSet.noneOf( ForgeDirection.class );
|
rbw.faces = EnumSet.noneOf( ForgeDirection.class );
|
||||||
|
|
||||||
instance.setRenderColor( color );
|
if ( prevLight != null && rbw.similarLighting( blk, rbw.blockAccess, x, y, z, prevLight ) )
|
||||||
rbw.renderStandardBlock( instance.getBlock(), x, y, z );
|
rbw.populate( prevLight );
|
||||||
instance.setRenderColor( 0xffffff );
|
else
|
||||||
|
{
|
||||||
|
instance.setRenderColor( color );
|
||||||
|
rbw.renderStandardBlock( instance.getBlock(), x, y, z );
|
||||||
|
instance.setRenderColor( 0xffffff );
|
||||||
|
prevLight = rbw.getLightingCache();
|
||||||
|
}
|
||||||
|
|
||||||
rbw.calculations = false;
|
rbw.calculations = false;
|
||||||
rbw.faces = calculateFaceOpenFaces( rbw.blockAccess, fc, x, y, z, side );
|
rbw.faces = calculateFaceOpenFaces( rbw.blockAccess, fc, x, y, z, side );
|
||||||
|
@ -516,4 +534,5 @@ public class FacadePart implements IFacadePart
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,13 @@ final public class QuartzWorldGen implements IWorldGenerator
|
||||||
{
|
{
|
||||||
int sealevel = w.provider.getAverageGroundLevel() + 1;
|
int sealevel = w.provider.getAverageGroundLevel() + 1;
|
||||||
|
|
||||||
|
if ( sealevel < 20 )
|
||||||
|
{
|
||||||
|
int x = (chunkX << 4) + 8;
|
||||||
|
int z = (chunkZ << 4) + 8;
|
||||||
|
sealevel = w.getHeightValue( x, z );
|
||||||
|
}
|
||||||
|
|
||||||
if ( oreNormal == null || oreCharged == null )
|
if ( oreNormal == null || oreCharged == null )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
15
me/cache/CraftingGridCache.java
vendored
15
me/cache/CraftingGridCache.java
vendored
|
@ -287,18 +287,17 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||||
|
|
||||||
private void updatePatterns()
|
private void updatePatterns()
|
||||||
{
|
{
|
||||||
// update the stuff that was in the list...
|
HashMap<IAEItemStack, ImmutableSet<ICraftingPatternDetails>> oldItems = craftableItems;
|
||||||
for (IAEItemStack out : craftableItems.keySet())
|
|
||||||
{
|
|
||||||
out.reset();
|
|
||||||
sg.postAlterationOfStoredItems( StorageChannel.ITEMS, out, new BaseActionSource() );
|
|
||||||
}
|
|
||||||
|
|
||||||
// erase list.
|
// erase list.
|
||||||
craftingMethods.clear();
|
craftingMethods.clear();
|
||||||
craftableItems.clear();
|
craftableItems = new HashMap();
|
||||||
emitableItems.clear();
|
emitableItems.clear();
|
||||||
|
|
||||||
|
// update the stuff that was in the list...
|
||||||
|
for (IAEItemStack out : oldItems.keySet())
|
||||||
|
sg.postAlterationOfStoredItems( StorageChannel.ITEMS, out, new BaseActionSource() );
|
||||||
|
|
||||||
// re-create list..
|
// re-create list..
|
||||||
for (ICraftingProvider cp : providers)
|
for (ICraftingProvider cp : providers)
|
||||||
cp.provideCrafting( this );
|
cp.provideCrafting( this );
|
||||||
|
@ -320,7 +319,6 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||||
tmpCraft.put( out, methods = new HashSet() );
|
tmpCraft.put( out, methods = new HashSet() );
|
||||||
|
|
||||||
methods.add( details );
|
methods.add( details );
|
||||||
sg.postAlterationOfStoredItems( StorageChannel.ITEMS, out, new BaseActionSource() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,6 +326,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||||
for (Entry<IAEItemStack, Set<ICraftingPatternDetails>> e : tmpCraft.entrySet())
|
for (Entry<IAEItemStack, Set<ICraftingPatternDetails>> e : tmpCraft.entrySet())
|
||||||
{
|
{
|
||||||
craftableItems.put( e.getKey(), ImmutableSortedSet.copyOf( e.getValue() ) );
|
craftableItems.put( e.getKey(), ImmutableSortedSet.copyOf( e.getValue() ) );
|
||||||
|
sg.postAlterationOfStoredItems( StorageChannel.ITEMS, e.getKey(), new BaseActionSource() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -519,6 +519,14 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||||
{
|
{
|
||||||
newDef.dspDamage = 0;
|
newDef.dspDamage = 0;
|
||||||
}
|
}
|
||||||
|
else if ( fuzzy == FuzzyMode.PERCENT_99 )
|
||||||
|
{
|
||||||
|
if ( def.damageValue == 0 )
|
||||||
|
newDef.dspDamage = 0;
|
||||||
|
else
|
||||||
|
newDef.dspDamage = 1;
|
||||||
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage );
|
int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage );
|
||||||
|
@ -551,6 +559,13 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||||
{
|
{
|
||||||
newDef.dspDamage = def.maxDamage + 1;
|
newDef.dspDamage = def.maxDamage + 1;
|
||||||
}
|
}
|
||||||
|
else if ( fuzzy == FuzzyMode.PERCENT_99 )
|
||||||
|
{
|
||||||
|
if ( def.damageValue == 0 )
|
||||||
|
newDef.dspDamage = 0;
|
||||||
|
else
|
||||||
|
newDef.dspDamage = def.maxDamage + 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage );
|
int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage );
|
||||||
|
|
Loading…
Reference in a new issue