From 497b9c2e51e9518102cd099e6f88acf0c9d2e029 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Fri, 15 Aug 2014 20:26:16 -0500 Subject: [PATCH 1/4] Fixed Bug: #0907 - World Gen Broken --- hooks/QuartzWorldGen.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hooks/QuartzWorldGen.java b/hooks/QuartzWorldGen.java index 4a61d6a7b..f13b1c7b7 100644 --- a/hooks/QuartzWorldGen.java +++ b/hooks/QuartzWorldGen.java @@ -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; From 339709bed9e28270778f795fbc79f1dc3e885daf Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 17 Aug 2014 03:58:06 -0500 Subject: [PATCH 2/4] Performance Change for Facade Lighting Calculations. --- facade/FacadePart.java | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/facade/FacadePart.java b/facade/FacadePart.java index d6a00f4f7..b18083cfb 100644 --- a/facade/FacadePart.java +++ b/facade/FacadePart.java @@ -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; } + } From 4338caa78228dedb8e472eff309ad614fe33d966 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 17 Aug 2014 03:58:42 -0500 Subject: [PATCH 3/4] Non-Configured Level Emitters no longer prevent crafting recipes from registering. --- me/cache/CraftingGridCache.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/me/cache/CraftingGridCache.java b/me/cache/CraftingGridCache.java index 7ef8ba895..a6459cb57 100644 --- a/me/cache/CraftingGridCache.java +++ b/me/cache/CraftingGridCache.java @@ -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> 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> e : tmpCraft.entrySet()) { craftableItems.put( e.getKey(), ImmutableSortedSet.copyOf( e.getValue() ) ); + sg.postAlterationOfStoredItems( StorageChannel.ITEMS, e.getKey(), new BaseActionSource() ); } } From 3831fdd23577aefcc6160d422f8b4405d91b6c98 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 17 Aug 2014 04:21:07 -0500 Subject: [PATCH 4/4] Fixed Bug: #0910 - Fuzzy Comparison (Split Damage at 99%) --- util/item/AEItemStack.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/util/item/AEItemStack.java b/util/item/AEItemStack.java index c400b8508..cbf90ad5f 100644 --- a/util/item/AEItemStack.java +++ b/util/item/AEItemStack.java @@ -519,6 +519,14 @@ public final class AEItemStack extends AEStack 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 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 );