This commit is contained in:
AlgorithmX2 2014-08-18 16:13:34 -05:00
commit ee7869a61a
4 changed files with 52 additions and 12 deletions

View file

@ -19,11 +19,13 @@ import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import appeng.api.AEApi;
import appeng.api.parts.IBoxProvider;
import appeng.api.parts.IFacadeContainer;
import appeng.api.parts.IFacadePart;
import appeng.api.parts.IPartCollsionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartRenderHelper;
import appeng.api.parts.ISimplifiedBundle;
import appeng.client.render.BusRenderHelper;
import appeng.client.render.RenderBlocksWorkaround;
import appeng.core.AELog;
@ -34,13 +36,16 @@ import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class FacadePart implements IFacadePart
public class FacadePart implements IFacadePart, IBoxProvider
{
public final ItemStack facade;
public final ForgeDirection side;
public int thickness = 2;
@SideOnly(Side.CLIENT)
ISimplifiedBundle prevLight;
public FacadePart(ItemStack facade, ForgeDirection side) {
if ( facade == null )
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)
{
if ( is.getItem() instanceof IFacadeItem )
@ -183,9 +195,15 @@ public class FacadePart implements IFacadePart
rbw.calculations = true;
rbw.faces = EnumSet.noneOf( ForgeDirection.class );
instance.setRenderColor( color );
rbw.renderStandardBlock( instance.getBlock(), x, y, z );
instance.setRenderColor( 0xffffff );
if ( prevLight != null && rbw.similarLighting( blk, rbw.blockAccess, x, y, z, prevLight ) )
rbw.populate( prevLight );
else
{
instance.setRenderColor( color );
rbw.renderStandardBlock( instance.getBlock(), x, y, z );
instance.setRenderColor( 0xffffff );
prevLight = rbw.getLightingCache();
}
rbw.calculations = false;
rbw.faces = calculateFaceOpenFaces( rbw.blockAccess, fc, x, y, z, side );
@ -516,4 +534,5 @@ public class FacadePart implements IFacadePart
return false;
}
}

View file

@ -37,6 +37,13 @@ final public class QuartzWorldGen implements IWorldGenerator
{
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 )
return;

View file

@ -287,18 +287,17 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
private void updatePatterns()
{
// update the stuff that was in the list...
for (IAEItemStack out : craftableItems.keySet())
{
out.reset();
sg.postAlterationOfStoredItems( StorageChannel.ITEMS, out, new BaseActionSource() );
}
HashMap<IAEItemStack, ImmutableSet<ICraftingPatternDetails>> oldItems = craftableItems;
// erase list.
craftingMethods.clear();
craftableItems.clear();
craftableItems = new HashMap();
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..
for (ICraftingProvider cp : providers)
cp.provideCrafting( this );
@ -320,7 +319,6 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
tmpCraft.put( out, methods = new HashSet() );
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())
{
craftableItems.put( e.getKey(), ImmutableSortedSet.copyOf( e.getValue() ) );
sg.postAlterationOfStoredItems( StorageChannel.ITEMS, e.getKey(), new BaseActionSource() );
}
}

View file

@ -519,6 +519,14 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
{
newDef.dspDamage = 0;
}
else if ( fuzzy == FuzzyMode.PERCENT_99 )
{
if ( def.damageValue == 0 )
newDef.dspDamage = 0;
else
newDef.dspDamage = 1;
}
else
{
int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage );
@ -551,6 +559,13 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
{
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
{
int breakpoint = fuzzy.calculateBreakPoint( def.maxDamage );