-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
2,252 additions
and
2,912 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package thaumicboots; | ||
|
||
import net.minecraft.block.material.Material; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.init.Blocks; | ||
|
||
import flaxbeard.thaumicexploration.ThaumicExploration; | ||
import flaxbeard.thaumicexploration.common.ConfigTX; | ||
import thaumicboots.main.utils.compat.ExplorationsHelper; | ||
|
||
public interface IGrief { | ||
|
||
public default void grief(EntityPlayer player) { | ||
// anti-griefing config | ||
if (ExplorationsHelper.isActive()) { | ||
if (!ConfigTX.allowBootsIce) { | ||
return; | ||
} | ||
for (int x = -5; x < 6; x++) { | ||
for (int z = -5; z < 6; z++) { | ||
int X = (int) (player.posX + x); | ||
int Y = (int) (player.posY - 1); | ||
int Z = (int) (player.posZ + z); | ||
|
||
// if the block isn't water | ||
if (player.worldObj.getBlock(X, Y, Z) != Blocks.water) { | ||
continue; | ||
} | ||
|
||
// if the block hasn't some water properties | ||
if (player.worldObj.getBlock(X, Y, Z).getMaterial() != Material.water) { | ||
continue; | ||
} | ||
|
||
// if the metadata of the block isn't 0 | ||
if (player.worldObj.getBlockMetadata(X, Y, Z) != 0) { | ||
continue; | ||
} | ||
|
||
// if the player is in water | ||
if (player.isInWater()) { | ||
continue; | ||
} | ||
|
||
// ???, someone needs to figure out what this does. | ||
if ((Math.abs(x) + Math.abs(z) >= 8)) { | ||
continue; | ||
} | ||
|
||
player.worldObj.setBlock(X, Y, Z, ThaumicExploration.meltyIce); | ||
player.worldObj.spawnParticle("snowballpoof", X, Y + 1, Z, 0.0D, 0.025D, 0.0D); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package thaumicboots.api; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
|
||
public interface IComet extends ISpecialEffect, IGrief { | ||
|
||
public default void specialEffect(Item item, EntityPlayer player) { | ||
ItemStack itemStack = player.inventory.armorItemInSlot(0); | ||
if (!itemStack.hasTagCompound()) { | ||
NBTTagCompound par1NBTTagCompound = new NBTTagCompound(); | ||
itemStack.setTagCompound(par1NBTTagCompound); | ||
itemStack.stackTagCompound.setInteger("runTicks", 0); | ||
} | ||
grief(player); | ||
int ticks = itemStack.stackTagCompound.getInteger("runTicks"); | ||
double motion = Math.abs(player.motionX) + Math.abs(player.motionZ) + Math.abs(player.motionY); | ||
if (motion > 0.1F || !player.onGround || player.isOnLadder()) { | ||
if (ticks < 100) ticks++; | ||
} else { | ||
ticks = 0; | ||
} | ||
if (!player.isWet() && motion > 0.1F) { | ||
player.worldObj.spawnParticle( | ||
"fireworksSpark", | ||
player.posX + Math.random() - 0.5F, | ||
player.boundingBox.minY + 0.25F + ((Math.random() - 0.5) * 0.25F), | ||
player.posZ + Math.random() - 0.5F, | ||
0.0D, | ||
0.025D, | ||
0.0D); | ||
} | ||
itemStack.stackTagCompound.setInteger("runTicks", ticks); | ||
return; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package thaumicboots.api; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
|
||
public interface ICometMeteorMix extends IMeteor, IComet { | ||
|
||
public default void specialEffect(Item item, EntityPlayer player) { | ||
ItemStack itemStack = player.inventory.armorItemInSlot(0); | ||
if (!itemStack.hasTagCompound()) { | ||
NBTTagCompound par1NBTTagCompound = new NBTTagCompound(); | ||
itemStack.setTagCompound(par1NBTTagCompound); | ||
itemStack.stackTagCompound.setBoolean("IsSmashingMix", false); | ||
itemStack.stackTagCompound.setInteger("smashTicksMix", 0); | ||
itemStack.stackTagCompound.setInteger("airTicksMix", 0); | ||
itemStack.stackTagCompound.setInteger("runTicksMix", 0); | ||
} | ||
grief(player); | ||
|
||
boolean smashing = itemStack.stackTagCompound.getBoolean("IsSmashingMix"); | ||
int ticksSmash = itemStack.stackTagCompound.getInteger("smashTicksMix"); | ||
int ticksAir = itemStack.stackTagCompound.getInteger("airTicksMix"); | ||
int ticksRun = itemStack.stackTagCompound.getInteger("runTicksMix"); | ||
double motionRun = Math.abs(player.motionX) + Math.abs(player.motionZ) + Math.abs(player.motionY); | ||
if (motionRun > 0.1F || !player.onGround || player.isOnLadder()) { | ||
if (ticksRun < 100) ticksRun++; | ||
} else { | ||
ticksRun = 0; | ||
} | ||
if (player.onGround || player.isOnLadder()) { | ||
int size = 0; | ||
if (ticksSmash > 5) size = 1; | ||
if (ticksSmash > 10) size = 2; | ||
if (ticksSmash > 15) size = 3; | ||
smashing = false; | ||
ticksSmash = 0; | ||
ticksAir = 0; | ||
if (size > 0) { | ||
player.worldObj.createExplosion(player, player.posX, player.posY, player.posZ, size, false); | ||
} | ||
} | ||
|
||
// COME ON AND SLAM | ||
if (!player.onGround && !player.isOnLadder() && !player.isInWater()) { | ||
if (!player.isSneaking()) { | ||
ticksAir++; | ||
} | ||
|
||
if (player.isSneaking() && ticksAir > 5) { | ||
smashing = true; | ||
} | ||
} | ||
|
||
if (player.capabilities.isFlying) { | ||
smashing = false; | ||
ticksSmash = 0; | ||
ticksAir = 0; | ||
} | ||
if (smashing) { | ||
|
||
for (String particleName : new String[] { "flame", "smoke", "flame" }) { | ||
player.worldObj.spawnParticle( | ||
particleName, | ||
player.posX + Math.random() - 0.5F, | ||
player.posY + Math.random() - 0.5F, | ||
player.posZ + Math.random() - 0.5F, | ||
0.0D, | ||
0.0D, | ||
0.0D); | ||
} | ||
|
||
player.motionY -= 0.1F; | ||
ticksSmash++; | ||
} | ||
|
||
if (!player.isWet() && motionRun > 0.1F) { | ||
for (String particleName : new String[] { "fireworksSpark", "flame", "flame" }) { | ||
player.worldObj.spawnParticle( | ||
particleName, | ||
player.posX + Math.random() - 0.5F, | ||
player.boundingBox.minY + 0.25F + ((Math.random() - 0.5) * 0.25F), | ||
player.posZ + Math.random() - 0.5F, | ||
0.0D, | ||
0.025D, | ||
0.0D); | ||
} | ||
} | ||
|
||
itemStack.stackTagCompound.setInteger("runTicksMix", ticksRun); | ||
itemStack.stackTagCompound.setBoolean("IsSmashingMix", smashing); | ||
itemStack.stackTagCompound.setInteger("smashTicksMix", ticksSmash); | ||
itemStack.stackTagCompound.setInteger("airTicksMix", ticksAir); | ||
} | ||
} |
Oops, something went wrong.