Particle Settings

Grinder Fix.
This commit is contained in:
AlgorithmX2
2014-01-29 20:47:55 -06:00
parent e7575c157b
commit 1b6455421e
22 changed files with 127 additions and 41 deletions
+8 -1
View File
@@ -94,7 +94,8 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
try try
{ {
ResourceLocation resLoc = new ResourceLocation( Name ); ResourceLocation resLoc = new ResourceLocation( Name );
resLoc = new ResourceLocation( resLoc.getResourceDomain(), String.format( "%s/%s%s", new Object[] { "textures/blocks", resLoc.getResourcePath(), ".png" } ) ); resLoc = new ResourceLocation( resLoc.getResourceDomain(), String.format( "%s/%s%s", new Object[] { "textures/blocks",
resLoc.getResourcePath(), ".png" } ) );
Resource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc ); Resource res = Minecraft.getMinecraft().getResourceManager().getResource( resLoc );
if ( res != null ) if ( res != null )
@@ -687,4 +688,10 @@ public class AEBaseBlock extends BlockContainer implements IAEFeature
return AEBaseItemBlock.class; return AEBaseItemBlock.class;
} }
@Override
public void postInit()
{
// override!
}
} }
+6 -2
View File
@@ -18,6 +18,7 @@ import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderBlockCharger; import appeng.client.render.blocks.RenderBlockCharger;
import appeng.client.render.effects.LightningEffect; import appeng.client.render.effects.LightningEffect;
import appeng.core.CommonHelper;
import appeng.core.Configuration; import appeng.core.Configuration;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision; import appeng.helpers.ICustomCollision;
@@ -86,8 +87,11 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
for (int bolts = 0; bolts < 3; bolts++) for (int bolts = 0; bolts < 3; bolts++)
{ {
LightningEffect fx = new LightningEffect( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D ); if ( CommonHelper.proxy.shouldAddParticles( r ) )
Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); {
LightningEffect fx = new LightningEffect( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx );
}
} }
} }
+6 -2
View File
@@ -19,6 +19,7 @@ import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender; import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQuartzTorch; import appeng.client.render.blocks.RenderQuartzTorch;
import appeng.client.render.effects.LightningEffect; import appeng.client.render.effects.LightningEffect;
import appeng.core.CommonHelper;
import appeng.core.Configuration; import appeng.core.Configuration;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.helpers.ICustomCollision; import appeng.helpers.ICustomCollision;
@@ -119,9 +120,12 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
double zOff = -0.3 * up.offsetZ; double zOff = -0.3 * up.offsetZ;
for (int bolts = 0; bolts < 3; bolts++) for (int bolts = 0; bolts < 3; bolts++)
{ {
LightningEffect fx = new LightningEffect( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D ); if ( CommonHelper.proxy.shouldAddParticles( r ) )
{
LightningEffect fx = new LightningEffect( w, xOff + 0.5 + x, yOff + 0.5 + y, zOff + 0.5 + z, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx );
}
} }
} }
+2 -1
View File
@@ -40,7 +40,8 @@ public class BlockQuantumLinkChamber extends AEBaseBlock
{ {
if ( bridge.hasQES() ) if ( bridge.hasQES() )
{ {
CommonHelper.proxy.spawnEnergy( w, bx + 0.5, by + 0.5, bz + 0.5 ); if ( CommonHelper.proxy.shouldAddParticles( r ) )
CommonHelper.proxy.spawnEnergy( w, bx + 0.5, by + 0.5, bz + 0.5 );
} }
} }
} }
+9 -5
View File
@@ -7,6 +7,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFX;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.client.render.effects.VibrantEffect; import appeng.client.render.effects.VibrantEffect;
import appeng.core.CommonHelper;
import appeng.core.Configuration; import appeng.core.Configuration;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@@ -29,13 +30,16 @@ public class BlockQuartzLamp extends BlockQuartzGlass
if ( !Configuration.instance.enableEffects ) if ( !Configuration.instance.enableEffects )
return; return;
double d0 = (double) (r.nextFloat() - 0.5F) * 0.96D; if ( CommonHelper.proxy.shouldAddParticles( r ) )
double d1 = (double) (r.nextFloat() - 0.5F) * 0.96D; {
double d2 = (double) (r.nextFloat() - 0.5F) * 0.96D; double d0 = (double) (r.nextFloat() - 0.5F) * 0.96D;
double d1 = (double) (r.nextFloat() - 0.5F) * 0.96D;
double d2 = (double) (r.nextFloat() - 0.5F) * 0.96D;
VibrantEffect fx = new VibrantEffect( w, 0.5 + x + d0, 0.5 + y + d1, 0.5 + z + d2, 0.0D, 0.0D, 0.0D ); VibrantEffect fx = new VibrantEffect( w, 0.5 + x + d0, 0.5 + y + d1, 0.5 + z + d2, 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx );
}
} }
} }
+7
View File
@@ -8,6 +8,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
@@ -34,6 +35,12 @@ public class OreQuartz extends AEBaseBlock implements IOrientableBlock
enhanceBrightness = false; enhanceBrightness = false;
} }
@Override
public void postInit()
{
OreDictionary.registerOre( "oreCertusQuartz", new ItemStack( this ) );
}
@Override @Override
protected Class<? extends BaseBlockRender> getRenderer() protected Class<? extends BaseBlockRender> getRenderer()
{ {
+6 -2
View File
@@ -8,6 +8,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.client.render.effects.ChargedOreEffect; import appeng.client.render.effects.ChargedOreEffect;
import appeng.core.CommonHelper;
import appeng.core.Configuration; import appeng.core.Configuration;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@@ -63,8 +64,11 @@ public class OreQuartzCharged extends OreQuartz
break; break;
} }
ChargedOreEffect fx = new ChargedOreEffect( w, x + xOff, y + yOff, z + zOff, 0.0f, 0.0f, 0.0f ); if ( CommonHelper.proxy.shouldAddParticles( r ) )
Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); {
ChargedOreEffect fx = new ChargedOreEffect( w, x + xOff, y + yOff, z + zOff, 0.0f, 0.0f, 0.0f );
Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx );
}
} }
} }
+10
View File
@@ -2,6 +2,7 @@ package appeng.client;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFX;
@@ -104,4 +105,13 @@ public class ClientHelper extends ServerHelper
Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx );
} }
@Override
public boolean shouldAddParticles(Random r)
{
if ( Minecraft.getMinecraft().gameSettings.particleSetting == 0 )
return true;
return r.nextInt( Minecraft.getMinecraft().gameSettings.particleSetting ) == 0;
}
} }
@@ -37,9 +37,6 @@ public class ToolBiometricCardRender implements IItemRenderer
float f5 = ((Icon) par2Icon).getMaxU(); float f5 = ((Icon) par2Icon).getMaxU();
float f6 = ((Icon) par2Icon).getMinV(); float f6 = ((Icon) par2Icon).getMinV();
float f7 = ((Icon) par2Icon).getMaxV(); float f7 = ((Icon) par2Icon).getMaxV();
float f8 = 1.0F;
float f9 = 0.0F;
float f10 = 0.0F;
float f12 = 0.0625F; float f12 = 0.0625F;
Tessellator tessellator = Tessellator.instance; Tessellator tessellator = Tessellator.instance;
+3
View File
@@ -1,6 +1,7 @@
package appeng.core; package appeng.core;
import java.util.List; import java.util.List;
import java.util.Random;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet;
@@ -28,4 +29,6 @@ public abstract class CommonHelper
public abstract void spawnEnergy(World w, double posX, double posY, double posZ); public abstract void spawnEnergy(World w, double posX, double posY, double posZ);
public abstract boolean shouldAddParticles(Random r);
} }
+3 -1
View File
@@ -63,9 +63,11 @@ public class Configuration extends net.minecraftforge.common.Configuration imple
public String grinderOres[] = { public String grinderOres[] = {
// Vanilla Items // Vanilla Items
"Obsidian", "EnderPearl", "Coal", "Iron", "Gold", "Charcoal", "Obsidian", "Ender", "Coal", "Iron", "Gold", "Charcoal", "NetherQuartz",
// Common Mod Ores // Common Mod Ores
"Copper", "Tin", "Silver", "Lead", "Bronze", "Copper", "Tin", "Silver", "Lead", "Bronze",
// AE
"CertusQuartz", "Wheat", "Fluix",
// Other Mod Ores // Other Mod Ores
"Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum" }; "Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum" };
+2
View File
@@ -348,6 +348,8 @@ public class Registration
feature.feature().register(); feature.feature().register();
feature.postInit();
return feature.feature(); return feature.feature();
} }
else if ( obj == null ) else if ( obj == null )
+2
View File
@@ -5,4 +5,6 @@ public interface IAEFeature
public AEFeatureHandler feature(); public AEFeatureHandler feature();
void postInit();
} }
@@ -33,15 +33,23 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
public GrinderRecipeManager() { public GrinderRecipeManager() {
RecipeList = new ArrayList(); RecipeList = new ArrayList();
addOre( "Gold", new ItemStack( Block.oreGold ) );
addOre( "Iron", new ItemStack( Block.oreIron ) );
addIngot( "Gold", new ItemStack( Item.ingotGold ) );
addIngot( "Iron", new ItemStack( Item.ingotIron ) );
addOre( "Obsidian", new ItemStack( Block.obsidian ) );
addOre( "EnderPearl", new ItemStack( Item.enderPearl ) );
addOre( "Coal", new ItemStack( Item.coal ) ); addOre( "Coal", new ItemStack( Item.coal ) );
addOre( "Charcoal", new ItemStack( Item.coal, 1, 1 ) ); addOre( "Charcoal", new ItemStack( Item.coal, 1, 1 ) );
addOre( "NetherQuartz", new ItemStack( Block.oreNetherQuartz ) );
addIngot( "NetherQuartz", new ItemStack( Item.netherQuartz ) );
addOre( "Gold", new ItemStack( Block.oreGold ) );
addIngot( "Gold", new ItemStack( Item.ingotGold ) );
addOre( "Iron", new ItemStack( Block.oreIron ) );
addIngot( "Iron", new ItemStack( Item.ingotIron ) );
addOre( "Obsidian", new ItemStack( Block.obsidian ) );
addIngot( "Ender", new ItemStack( Item.enderPearl ) );
addIngot( "Wheat", new ItemStack( Item.wheat ) );
OreDictionaryHandler.instance.observe( this ); OreDictionaryHandler.instance.observe( this );
} }
@@ -61,8 +69,7 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
return; return;
} }
log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " for " log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " for " + cost );
+ cost );
RecipeList.add( new AppEngGrinderRecipe( copy( in ), copy( out ), cost ) ); RecipeList.add( new AppEngGrinderRecipe( copy( in ), copy( out ), cost ) );
} }
@@ -75,8 +82,8 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
return; return;
} }
log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional "
+ " with optional " + Platform.getItemDisplayName( optional ) + " for " + cost ); + Platform.getItemDisplayName( optional ) + " for " + cost );
RecipeList.add( new AppEngGrinderRecipe( copy( in ), copy( out ), copy( optional ), chance, cost ) ); RecipeList.add( new AppEngGrinderRecipe( copy( in ), copy( out ), copy( optional ), chance, cost ) );
} }
@@ -110,14 +117,10 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
{ {
if ( name.equals( "Obsidian" ) ) if ( name.equals( "Obsidian" ) )
return 1; return 1;
if ( name.equals( "EnderPearl" ) )
return 1;
if ( name.equals( "Charcoal" ) ) if ( name.equals( "Charcoal" ) )
return 1; return 1;
if ( name.equals( "Coal" ) ) if ( name.equals( "Coal" ) )
return 1; return 1;
if ( name.contains( "Quartz" ) )
return 1;
return 2; return 2;
} }
@@ -200,19 +203,18 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
@Override @Override
public void oreRegistered(String Name, ItemStack item) public void oreRegistered(String Name, ItemStack item)
{ {
if ( Name.startsWith( "ore" ) || Name.startsWith( "ingot" ) || Name.startsWith( "dust" ) ) if ( Name.startsWith( "ore" ) || Name.startsWith( "crystal" ) || Name.startsWith( "ingot" ) || Name.startsWith( "dust" ) )
{ {
for (String ore : Configuration.instance.grinderOres) for (String ore : Configuration.instance.grinderOres)
{ {
if ( ore.equals( "CertusQuartz" ) )
continue;
if ( ore.equals( "NetherQuartz" ) )
continue;
if ( Name.equals( "ore" + ore ) ) if ( Name.equals( "ore" + ore ) )
{ {
addOre( ore, item ); addOre( ore, item );
} }
else if ( Name.equals( "crystal" + ore ) )
{
addIngot( ore, item );
}
else if ( Name.equals( "ingot" + ore ) ) else if ( Name.equals( "ingot" + ore ) )
{ {
addIngot( ore, item ); addIngot( ore, item );
+5
View File
@@ -49,4 +49,9 @@ public class AEBaseItem extends Item implements IAEFeature
return false; return false;
} }
@Override
public void postInit()
{
// override!
}
} }
+4 -4
View File
@@ -16,14 +16,14 @@ import cpw.mods.fml.relauncher.SideOnly;
public enum MaterialType public enum MaterialType
{ {
CertusQuartzCrystal(AEFeature.Core), CertusQuartzCrystalCharged(AEFeature.Core, EntityChargedQuartz.class), CertusQuartzCrystal(AEFeature.Core, "crystalCertusQuartz"), CertusQuartzCrystalCharged(AEFeature.Core, EntityChargedQuartz.class),
CertusQuartzDust, NetherQuartzDust(AEFeature.Core, "dustNetherQuartz"), Flour(AEFeature.Flour, "dustWheat"), GoldDust(AEFeature.Core, "dustGold"), IronDust( CertusQuartzDust(AEFeature.Core, "dustCertusQuartz"), NetherQuartzDust(AEFeature.Core, "dustNetherQuartz"), Flour(AEFeature.Flour, "dustWheat"), GoldDust(
AEFeature.Core, "dustIron"), IronNugget(AEFeature.Core, "nuggetIron"), AEFeature.Core, "dustGold"), IronDust(AEFeature.Core, "dustIron"), IronNugget(AEFeature.Core, "nuggetIron"),
Silicon(AEFeature.Core, "itemSilicon"), MatterBall, Silicon(AEFeature.Core, "itemSilicon"), MatterBall,
FluixCrystal(AEFeature.Core, "crystalFLuix"), FluixDust(AEFeature.Core, "dustFluix"), FluixPearl(AEFeature.Core, "pearlFluix"), FluixCrystal(AEFeature.Core, "crystalFluix"), FluixDust(AEFeature.Core, "dustFluix"), FluixPearl(AEFeature.Core, "pearlFluix"),
PureifiedCertusQuartzCrystal, PureifiedNetherQuartzCrystal, PureifiedFluixCrystal, PureifiedCertusQuartzCrystal, PureifiedNetherQuartzCrystal, PureifiedFluixCrystal,
+5
View File
@@ -27,4 +27,9 @@ public class ToolQuartzAxe extends ItemAxe implements IAEFeature
feature = new AEFeatureHandler( EnumSet.of( Type, AEFeature.QuartzAxe ), this, Type.name() ); feature = new AEFeatureHandler( EnumSet.of( Type, AEFeature.QuartzAxe ), this, Type.name() );
} }
@Override
public void postInit()
{
// override!
}
} }
+5
View File
@@ -27,4 +27,9 @@ public class ToolQuartzHoe extends ItemHoe implements IAEFeature
feature = new AEFeatureHandler( EnumSet.of( Type, AEFeature.QuartzHoe ), this, Type.name() ); feature = new AEFeatureHandler( EnumSet.of( Type, AEFeature.QuartzHoe ), this, Type.name() );
} }
@Override
public void postInit()
{
// override!
}
} }
@@ -27,4 +27,9 @@ public class ToolQuartzPickaxe extends ItemPickaxe implements IAEFeature
feature = new AEFeatureHandler( EnumSet.of( Type, AEFeature.QuartzPickaxe ), this, Type.name() ); feature = new AEFeatureHandler( EnumSet.of( Type, AEFeature.QuartzPickaxe ), this, Type.name() );
} }
@Override
public void postInit()
{
// override!
}
} }
+5
View File
@@ -27,4 +27,9 @@ public class ToolQuartzSpade extends ItemSpade implements IAEFeature
feature = new AEFeatureHandler( EnumSet.of( Type, AEFeature.QuartzSpade ), this, Type.name() ); feature = new AEFeatureHandler( EnumSet.of( Type, AEFeature.QuartzSpade ), this, Type.name() );
} }
@Override
public void postInit()
{
// override!
}
} }
+5
View File
@@ -25,4 +25,9 @@ public class ToolQuartzSword extends ItemSword implements IAEFeature
feature = new AEFeatureHandler( EnumSet.of( Type, AEFeature.QuartzSword ), this, Type.name() ); feature = new AEFeatureHandler( EnumSet.of( Type, AEFeature.QuartzSword ), this, Type.name() );
} }
@Override
public void postInit()
{
// override!
}
} }
+7
View File
@@ -2,6 +2,7 @@ package appeng.server;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
@@ -84,4 +85,10 @@ public class ServerHelper extends CommonHelper
// :P // :P
} }
@Override
public boolean shouldAddParticles(Random r)
{
return false;
}
} }