mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-18 11:19:24 +00:00
Cleanup
This commit is contained in:
1 parent
05578b50f5
commit
3fd69cc5a5
15 files changed
+120
-127
No files matched your search
@@ -33,7 +33,7 @@ public class TileLumos extends TileEntity {
|
||||
if (block instanceof BlockLumos) {
|
||||
final EntityPlayer player = worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 4);
|
||||
|
||||
if ( (meta == 0 && worldObj.rand.nextInt(15) == 0) && worldObj.isRemote) {
|
||||
if (meta == 0 && worldObj.rand.nextInt(15) == 0 && worldObj.isRemote) {
|
||||
spawnParticles();
|
||||
}
|
||||
if ( (meta == 1 || meta == 2) && player == null) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class EntityHomingShard extends EntityThrowable implements IEntityAdditio
|
||||
final int strength, final boolean persistent) {
|
||||
super(world, thrower);
|
||||
this.target = target;
|
||||
this.targetClass = target.getClass();
|
||||
targetClass = target.getClass();
|
||||
this.persistent = persistent;
|
||||
setStrength(strength);
|
||||
final Vec3 vec = thrower.getLookVec();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package taintedmagic.common.handler;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
import baubles.api.BaublesApi;
|
||||
@@ -186,7 +185,6 @@ public class TMEventHandler {
|
||||
|
||||
if (focus != null && focus instanceof ItemFocusMageMace) {
|
||||
if (wand.consumeAllVis(held, player, focus.getVisCost(held), true, false)) {
|
||||
;
|
||||
}
|
||||
else {
|
||||
event.setCanceled(true);
|
||||
@@ -238,8 +236,8 @@ public class TMEventHandler {
|
||||
* Give the player the Creation research upon crafting the Shard of Creation
|
||||
*/
|
||||
public void giveResearch (final EntityPlayer player) {
|
||||
if (!player.worldObj.isRemote && (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION")
|
||||
&& ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATIONSHARD"))) {
|
||||
if (!player.worldObj.isRemote && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION")
|
||||
&& ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATIONSHARD")) {
|
||||
Thaumcraft.proxy.getResearchManager().completeResearch(player, "CREATION");
|
||||
PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("CREATION"), (EntityPlayerMP) player);
|
||||
player.addChatMessage(
|
||||
|
||||
@@ -41,7 +41,7 @@ public class UpdateHandler {
|
||||
catch (final MalformedURLException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
catch (IOException e) {
|
||||
catch (final IOException e) {
|
||||
TaintedMagic.logger.error("Could not connect to GitHub repository!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class WandHandler implements IWandRodOnUpdate {
|
||||
final int roundPeriod = period < 1.0F ? 1 : Math.round(period);
|
||||
|
||||
if (player.ticksExisted % roundPeriod == 0) {
|
||||
Aspect[] primals = Aspect.getPrimalAspects().toArray(new Aspect[0]);
|
||||
final Aspect[] primals = Aspect.getPrimalAspects().toArray(new Aspect[0]);
|
||||
for (final Aspect primal : primals) {
|
||||
((ItemWandCasting) stack.getItem()).addVis(stack, primal, 1, true);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ItemMagicFunguar extends ItemFood {
|
||||
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 60, 1));
|
||||
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 100, 2));
|
||||
|
||||
Aspect[] aspects = Aspect.getPrimalAspects().toArray(new Aspect[0]);
|
||||
final Aspect[] aspects = Aspect.getPrimalAspects().toArray(new Aspect[0]);
|
||||
final int i = world.rand.nextInt(aspects.length);
|
||||
|
||||
if (!world.isRemote) {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ItemMaterial extends Item {
|
||||
* 11 Fragment of Creation
|
||||
*/
|
||||
private static final int SUBTYPES = 12;
|
||||
private IIcon[] icons = new IIcon[SUBTYPES];
|
||||
private final IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public ItemMaterial () {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
|
||||
@@ -17,7 +17,7 @@ import taintedmagic.common.TaintedMagic;
|
||||
public class ItemSalis extends Item {
|
||||
|
||||
private static final int SUBTYPES = 2;
|
||||
private IIcon[] icons = new IIcon[SUBTYPES];
|
||||
private final IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public ItemSalis () {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ItemWarpFertilizer extends Item {
|
||||
public boolean onItemUse (final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y,
|
||||
final int z, final int side, final float hitX, final float hitY, final float hitZ) {
|
||||
super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
||||
if (! (world.getBlock(x, y, z) instanceof BlockCustomPlant) || (world.getBlockMetadata(x, y, z) != 1))
|
||||
if (! (world.getBlock(x, y, z) instanceof BlockCustomPlant) || world.getBlockMetadata(x, y, z) != 1)
|
||||
return false;
|
||||
if (world.isRemote) {
|
||||
particles(world, x, y, z, 10 + world.rand.nextInt(11));
|
||||
|
||||
@@ -74,7 +74,7 @@ public class ItemVoidwalkerBoots extends ItemArmor
|
||||
int priority = 0;
|
||||
double ratio = damageReduceAmount / 90.0D;
|
||||
|
||||
if (source.isMagicDamage() || (source.isFireDamage() || source.isExplosion())) {
|
||||
if (source.isMagicDamage() || source.isFireDamage() || source.isExplosion()) {
|
||||
priority = 1;
|
||||
ratio = damageReduceAmount / 80.0D;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ public class ItemThaumicDisassembler extends Item {
|
||||
final Block block = world.getBlock(x, y, z);
|
||||
final boolean air = world.isAirBlock(x, y + 1, z);
|
||||
|
||||
if (side == 0 || !air || (block != Blocks.grass && block != Blocks.dirt))
|
||||
if (side == 0 || !air || block != Blocks.grass && block != Blocks.dirt)
|
||||
return false;
|
||||
|
||||
final Block farm = Blocks.farmland;
|
||||
|
||||
@@ -15,7 +15,7 @@ import taintedmagic.common.TaintedMagic;
|
||||
public class ItemWandCap extends Item {
|
||||
|
||||
private static final int SUBTYPES = 4;
|
||||
private IIcon[] icons = new IIcon[SUBTYPES];
|
||||
private final IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public ItemWandCap () {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
|
||||
@@ -15,7 +15,7 @@ import taintedmagic.common.TaintedMagic;
|
||||
public class ItemWandRod extends Item {
|
||||
|
||||
private static final int SUBTYPES = 2;
|
||||
private IIcon[] icons = new IIcon[SUBTYPES];
|
||||
private final IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public ItemWandRod () {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
|
||||
@@ -16,7 +16,7 @@ import thaumcraft.api.research.ResearchPage;
|
||||
*/
|
||||
public class ThaumcraftResearchItem extends ResearchItem {
|
||||
|
||||
private ResearchItem original;
|
||||
private final ResearchItem original;
|
||||
|
||||
public ThaumcraftResearchItem (final String tag, final String origin, final String originCategory, final int col,
|
||||
final int row, final ResourceLocation icon) {
|
||||
|
||||
@@ -67,122 +67,117 @@ public class WorldGenWarpwoodTree extends WorldGenAbstractTree {
|
||||
|
||||
if (!flag)
|
||||
return false;
|
||||
else {
|
||||
final Block block1 = world.getBlock(x, y - 1, z);
|
||||
final boolean isSoil = block1.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (BlockSapling) Blocks.sapling);
|
||||
if (isSoil && y < 256 - height - 1) {
|
||||
block1.onPlantGrow(world, x, y - 1, z, x, y, z);
|
||||
final int start = y + height - 5;
|
||||
final int end = y + height + 3 + random.nextInt(3);
|
||||
final Block block1 = world.getBlock(x, y - 1, z);
|
||||
final boolean isSoil = block1.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (BlockSapling) Blocks.sapling);
|
||||
if (!isSoil || y >= 256 - height - 1)
|
||||
return false;
|
||||
block1.onPlantGrow(world, x, y - 1, z, x, y, z);
|
||||
final int start = y + height - 5;
|
||||
final int end = y + height + 3 + random.nextInt(3);
|
||||
|
||||
int k2;
|
||||
for (k2 = start; k2 <= end; ++k2) {
|
||||
final int cty = MathHelper.clamp_int(k2, y + height - 3, y + height);
|
||||
int k2;
|
||||
for (k2 = start; k2 <= end; ++k2) {
|
||||
final int cty = MathHelper.clamp_int(k2, y + height - 3, y + height);
|
||||
|
||||
for (int xx = x - 5; xx <= x + 5; ++xx) {
|
||||
for (int zz = z - 5; zz <= z + 5; ++zz) {
|
||||
final double d3 = xx - x;
|
||||
final double d4 = k2 - cty;
|
||||
final double d5 = zz - z;
|
||||
final double dist = d3 * d3 + d4 * d4 + d5 * d5;
|
||||
for (int xx = x - 5; xx <= x + 5; ++xx) {
|
||||
for (int zz = z - 5; zz <= z + 5; ++zz) {
|
||||
final double d3 = xx - x;
|
||||
final double d4 = k2 - cty;
|
||||
final double d5 = zz - z;
|
||||
final double dist = d3 * d3 + d4 * d4 + d5 * d5;
|
||||
|
||||
if (dist < 10 + random.nextInt(8)
|
||||
&& world.getBlock(xx, k2, zz).canBeReplacedByLeaves(world, xx, k2, zz)) {
|
||||
setBlockAndNotifyAdequately(world, xx, k2, zz, leaves, 1);
|
||||
}
|
||||
}
|
||||
if (dist < 10 + random.nextInt(8) && world.getBlock(xx, k2, zz).canBeReplacedByLeaves(world, xx, k2, zz)) {
|
||||
setBlockAndNotifyAdequately(world, xx, k2, zz, leaves, 1);
|
||||
}
|
||||
}
|
||||
|
||||
int chance = height;
|
||||
boolean lastblock = false;
|
||||
|
||||
for (k2 = 0; k2 < height; k2++) {
|
||||
final Block block2 = world.getBlock(x, y + k2, z);
|
||||
|
||||
if (!block2.isAir(world, x, y + k2, z) && !block2.isLeaves(world, x, y + k2, z)
|
||||
&& !block2.isReplaceable(world, x, y + k2, z)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (k2 > 0 && !lastblock && random.nextInt(chance) == 0) {
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z, trunk, 2);
|
||||
lastblock = true;
|
||||
}
|
||||
else {
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z, trunk, 0);
|
||||
lastblock = false;
|
||||
chance--;
|
||||
}
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + k2, z, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + k2, z, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z - 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z + 1, trunk, 0);
|
||||
}
|
||||
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x - 1, y, z - 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 1, y, z + 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x - 1, y, z + 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 1, y, z - 1, trunk, 0);
|
||||
|
||||
if (random.nextInt(3) != 0) {
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + 1, z - 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) != 0) {
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + 1, z + 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) != 0) {
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + 1, z + 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) != 0) {
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + 1, z - 1, trunk, 0);
|
||||
}
|
||||
|
||||
setBlockAndNotifyAdequately(world, x - 2, y, z, trunk, 5);
|
||||
setBlockAndNotifyAdequately(world, x + 2, y, z, trunk, 5);
|
||||
setBlockAndNotifyAdequately(world, x, y, z - 2, trunk, 9);
|
||||
setBlockAndNotifyAdequately(world, x, y, z + 2, trunk, 9);
|
||||
setBlockAndNotifyAdequately(world, x - 2, y - 1, z, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 2, y - 1, z, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x, y - 1, z - 2, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x, y - 1, z + 2, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + height - 4, z - 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + height - 4, z + 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + height - 4, z + 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + height - 4, z - 1, trunk, 0);
|
||||
|
||||
if (random.nextInt(3) == 0) {
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + height - 5, z - 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) == 0) {
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + height - 5, z + 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) == 0) {
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + height - 5, z + 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) == 0) {
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + height - 5, z - 1, trunk, 0);
|
||||
}
|
||||
|
||||
setBlockAndNotifyAdequately(world, x - 2, y + height - 4, z, trunk, 5);
|
||||
setBlockAndNotifyAdequately(world, x + 2, y + height - 4, z, trunk, 5);
|
||||
setBlockAndNotifyAdequately(world, x, y + height - 4, z - 2, trunk, 9);
|
||||
setBlockAndNotifyAdequately(world, x, y + height - 4, z + 2, trunk, 9);
|
||||
|
||||
final WorldGenerator flowers = new WorldGenCustomFlowers(BlockRegistry.BlockNightshadeBush, 0);
|
||||
flowers.generate(world, random, x, y, z);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
int chance = height;
|
||||
boolean lastblock = false;
|
||||
|
||||
for (k2 = 0; k2 < height; k2++) {
|
||||
final Block block2 = world.getBlock(x, y + k2, z);
|
||||
|
||||
if (!block2.isAir(world, x, y + k2, z) && !block2.isLeaves(world, x, y + k2, z)
|
||||
&& !block2.isReplaceable(world, x, y + k2, z)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (k2 > 0 && !lastblock && random.nextInt(chance) == 0) {
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z, trunk, 2);
|
||||
lastblock = true;
|
||||
}
|
||||
else {
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z, trunk, 0);
|
||||
lastblock = false;
|
||||
chance--;
|
||||
}
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + k2, z, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + k2, z, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z - 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z + 1, trunk, 0);
|
||||
}
|
||||
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x - 1, y, z - 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 1, y, z + 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x - 1, y, z + 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 1, y, z - 1, trunk, 0);
|
||||
|
||||
if (random.nextInt(3) != 0) {
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + 1, z - 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) != 0) {
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + 1, z + 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) != 0) {
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + 1, z + 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) != 0) {
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + 1, z - 1, trunk, 0);
|
||||
}
|
||||
|
||||
setBlockAndNotifyAdequately(world, x - 2, y, z, trunk, 5);
|
||||
setBlockAndNotifyAdequately(world, x + 2, y, z, trunk, 5);
|
||||
setBlockAndNotifyAdequately(world, x, y, z - 2, trunk, 9);
|
||||
setBlockAndNotifyAdequately(world, x, y, z + 2, trunk, 9);
|
||||
setBlockAndNotifyAdequately(world, x - 2, y - 1, z, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 2, y - 1, z, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x, y - 1, z - 2, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x, y - 1, z + 2, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + height - 4, z - 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + height - 4, z + 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + height - 4, z + 1, trunk, 0);
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + height - 4, z - 1, trunk, 0);
|
||||
|
||||
if (random.nextInt(3) == 0) {
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + height - 5, z - 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) == 0) {
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + height - 5, z + 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) == 0) {
|
||||
setBlockAndNotifyAdequately(world, x - 1, y + height - 5, z + 1, trunk, 0);
|
||||
}
|
||||
|
||||
if (random.nextInt(3) == 0) {
|
||||
setBlockAndNotifyAdequately(world, x + 1, y + height - 5, z - 1, trunk, 0);
|
||||
}
|
||||
|
||||
setBlockAndNotifyAdequately(world, x - 2, y + height - 4, z, trunk, 5);
|
||||
setBlockAndNotifyAdequately(world, x + 2, y + height - 4, z, trunk, 5);
|
||||
setBlockAndNotifyAdequately(world, x, y + height - 4, z - 2, trunk, 9);
|
||||
setBlockAndNotifyAdequately(world, x, y + height - 4, z + 2, trunk, 9);
|
||||
|
||||
final WorldGenerator flowers = new WorldGenCustomFlowers(BlockRegistry.BlockNightshadeBush, 0);
|
||||
flowers.generate(world, random, x, y, z);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user