mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-27 23:45:48 +00:00
Added frypan rotation
This commit is contained in:
1 parent
b410720aab
commit
499aabe952
3 files changed
+54
-9
No files matched your search
@@ -1,6 +1,8 @@
|
||||
package tconstruct.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.FrypanLogic;
|
||||
@@ -10,13 +12,12 @@ import tconstruct.library.blocks.InventoryBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.*;
|
||||
|
||||
public class EquipBlock extends InventoryBlock
|
||||
{
|
||||
@@ -88,7 +89,30 @@ public class EquipBlock extends InventoryBlock
|
||||
world.spawnParticle("flame", f, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||||
super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack);
|
||||
int i3 = MathHelper.floor_double((par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
|
||||
int newMeta = 0;
|
||||
|
||||
switch(i3){
|
||||
case 3:
|
||||
newMeta = 0;
|
||||
break;
|
||||
case 0:
|
||||
newMeta = 3;
|
||||
break;
|
||||
case 1:
|
||||
newMeta = 1;
|
||||
break;
|
||||
case 2:
|
||||
newMeta = 2;
|
||||
break;
|
||||
}
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, newMeta, 2);
|
||||
}
|
||||
|
||||
public int getLightValue (IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return !isActive(world, x, y, z) ? 0 : 9;
|
||||
|
||||
Reference in new issue
Block a user