mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-27 23:45:57 +00:00
Step 1: File Standardization
This commit is contained in:
1 parent
69c287f828
commit
3f6fa103dc
1177 files changed
+2
-2
No files matched your search
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jun 26, 2014, 7:32:16 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.entity;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class EntityVineBall extends EntityThrowable {
|
||||
|
||||
public EntityVineBall(World par1World) {
|
||||
super(par1World);
|
||||
dataWatcher.addObject(30, 0F);
|
||||
dataWatcher.setObjectWatched(30);
|
||||
}
|
||||
|
||||
public EntityVineBall(EntityPlayer player, boolean gravity) {
|
||||
super(player.worldObj, player);
|
||||
dataWatcher.addObject(30, gravity ? 0.03F : 0F);
|
||||
dataWatcher.setObjectWatched(30);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition var1) {
|
||||
if(var1 != null) {
|
||||
int meta = var1.sideHit;
|
||||
int[] metaPlace = new int[] {
|
||||
1, 4, 8, 2
|
||||
};
|
||||
|
||||
if(meta > 1 && meta < 6) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(meta);
|
||||
int x = var1.blockX + dir.offsetX;
|
||||
int y = var1.blockY + dir.offsetY;
|
||||
int z = var1.blockZ + dir.offsetZ;
|
||||
while(y > 0) {
|
||||
Block block = worldObj.getBlock(x, y, z);
|
||||
if(block.isAir(worldObj, x, y, z)) {
|
||||
worldObj.setBlock(x, y, z, ModBlocks.solidVines, metaPlace[meta - 2], 1 | 2);
|
||||
worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(ModBlocks.solidVines) + (metaPlace[meta - 2] << 12));
|
||||
y--;
|
||||
} else break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getGravityVelocity() {
|
||||
return dataWatcher.getWatchableObjectFloat(30);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user