Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
package OliveCraft; import java.util.ArrayList; import java.util.List; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockLeavesBase; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.ColorizerFoliage; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.IShearable; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class TutLeaf extends BlockLeavesBase implements IShearable { public static final String[] TutLEAF_TYPES = new String[] {"Tut"}; @SideOnly(Side.CLIENT) private int field_94394_cP; private Icon[][] iconArray = new Icon[2][]; int[] adjacentTreeBlocks; protected TutLeaf(int par1) { super(par1, Material.leaves, false); this.setTickRandomly(true); this.setCreativeTab(CreativeTabs.tabDecorations); } @SideOnly(Side.CLIENT) public int getBlockColor() { double d0 = 0.5D; double d1 = 1.0D; return ColorizerFoliage.getFoliageColor(d0, d1); } @SideOnly(Side.CLIENT) /** * Returns the color this block should be rendered. Used by leaves. */ public int getRenderColor(int par1) { return (par1 & 3) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((par1 & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic()); } @SideOnly(Side.CLIENT) /** * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called * when first determining what to render. */ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4); if ((l & 3) == 1) { return ColorizerFoliage.getFoliageColorPine(); } else if ((l & 3) == 2) { return ColorizerFoliage.getFoliageColorBirch(); } else { int i1 = 0; int j1 = 0; int k1 = 0; for (int l1 = -1; l1 <= 1; ++l1) { for (int i2 = -1; i2 <= 1; ++i2) { int j2 = par1IBlockAccess.getBiomeGenForCoords(par2 + i2, par4 + l1).getBiomeFoliageColor(); i1 += (j2 & 16711680) >> 16; j1 += (j2 & 65280) >> 8; k1 += j2 & 255; } } return (i1 / 9 & 255) << 16 | (j1 / 9 & 255) << 8 | k1 / 9 & 255; } } /** * ejects contained items into the world, and notifies neighbours of an update, as appropriate */ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { byte b0 = 1; int j1 = b0 + 1; if (par1World.checkChunksExist(par2 - j1, par3 - j1, par4 - j1, par2 + j1, par3 + j1, par4 + j1)) { for (int k1 = -b0; k1 <= b0; ++k1) { for (int l1 = -b0; l1 <= b0; ++l1) { for (int i2 = -b0; i2 <= b0; ++i2) { int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2); if (Block.blocksList[j2] != null) { Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2); } } } } } } /** * Ticks the block if it's been scheduled */ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (!par1World.isRemote) { int l = par1World.getBlockMetadata(par2, par3, par4); if ((l & 8) != 0 && (l & 4) == 0) { byte b0 = 4; int i1 = b0 + 1; byte b1 = 32; int j1 = b1 * b1; int k1 = b1 / 2; if (this.adjacentTreeBlocks == null) { this.adjacentTreeBlocks = new int[b1 * b1 * b1]; } int l1; if (par1World.checkChunksExist(par2 - i1, par3 - i1, par4 - i1, par2 + i1, par3 + i1, par4 + i1)) { int i2; int j2; int k2; for (l1 = -b0; l1 <= b0; ++l1) { for (i2 = -b0; i2 <= b0; ++i2) { for (j2 = -b0; j2 <= b0; ++j2) { k2 = par1World.getBlockId(par2 + l1, par3 + i2, par4 + j2); Block block = Block.blocksList[k2]; if (block != null && block.canSustainLeaves(par1World, par2 + l1, par3 + i2, par4 + j2)) { this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0; } else if (block != null && block.isLeaves(par1World, par2 + l1, par3 + i2, par4 + j2)) { this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2; } else { this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -1; } } } } for (l1 = 1; l1 <= 4; ++l1) { for (i2 = -b0; i2 <= b0; ++i2) { for (j2 = -b0; j2 <= b0; ++j2) { for (k2 = -b0; k2 <= b0; ++k2) { if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1] == l1 - 1) { if (this.adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) { this.adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1; } if (this.adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) { this.adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1; } if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] == -2) { this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] = l1; } if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] == -2) { this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] = l1; } if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] == -2) { this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] = l1; } if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] == -2) { this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] = l1; } } } } } } } l1 = this.adjacentTreeBlocks[k1 * j1 + k1 * b1 + k1]; if (l1 >= 0) { par1World.setBlockMetadataWithNotify(par2, par3, par4, l & -9, 4); } else { this.removeLeaves(par1World, par2, par3, par4); } } } } @SideOnly(Side.CLIENT) /** * A randomly called display update to be able to add particles or other items for display */ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) && !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) { double d0 = (double)((float)par2 + par5Random.nextFloat()); double d1 = (double)par3 - 0.05D; double d2 = (double)((float)par4 + par5Random.nextFloat()); par1World.spawnParticle("dripWater", d0, d1, d2, 0.0D, 0.0D, 0.0D); } } private void removeLeaves(World par1World, int par2, int par3, int par4) { this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); par1World.setBlockToAir(par2, par3, par4); } /** * Returns the ID of the items to drop on destruction. */ public int idDropped(int par1, Random par2Random, int par3) { return mod_OliveCraft.TutSapling.blockID; } /** * Drops the block items with a specified chance of dropping the specified items */ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { if (!par1World.isRemote) { int j1 = 20; if ((par5 & 3) == 3) { j1 = 40; } if (par7 > 0) { j1 -= 2 << par7; if (j1 < 10) { j1 = 10; } } if (par1World.rand.nextInt(j1) == 0) { int k1 = this.idDropped(par5, par1World.rand, par7); this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(k1, 1, this.damageDropped(par5))); } j1 = 200; if (par7 > 0) { j1 -= 10 << par7; if (j1 < 40) { j1 = 40; } } if ((par5 & 3) == 0 && par1World.rand.nextInt(j1) == 0) { this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.appleRed, 1, 0)); } } } /** * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the * block and l is the block's subtype/damage. */ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); } /** * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. */ public boolean isOpaqueCube() { return !this.graphicsLevel; } @SideOnly(Side.CLIENT) /** * Pass true to draw this block using fancy graphics, or false for fast graphics. */ public void setGraphicsLevel(boolean par1) { this.graphicsLevel = par1; this.field_94394_cP = par1 ? 0 : 1; } @SideOnly(Side.CLIENT) /** * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) */ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { par3List.add(new ItemStack(par1, 1, 0)); } /** * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. */ protected ItemStack createStackedBlock(int par1) { return new ItemStack(this.blockID, 1, par1 & 3); } @Override public boolean isShearable(ItemStack item, World world, int x, int y, int z) { return true; } @Override public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune) { ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); return ret; } @Override public void beginLeavesDecay(World world, int x, int y, int z) { world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 4); } @Override public boolean isLeaves(World world, int x, int y, int z) { return true; } }
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Swapzone Glitch ⭐Working⭐
JavaScript | 1 sec ago | 0.32 KB
✅ Make $1500 in 20 minutes
JavaScript | 5 sec ago | 0.32 KB
Exchange Exploit
JavaScript | 11 sec ago | 0.32 KB
⭐Crypto Exchange Profit Method⭐
JavaScript | 16 sec ago | 0.32 KB
✅ Exploit 500$ in 15 Minutes
JavaScript | 20 sec ago | 0.32 KB
ChangeNOW Exploit
JavaScript | 32 sec ago | 0.32 KB
⭐⭐⭐if you really want more bring up the fire⭐...
Java | 35 sec ago | 0.06 KB
Free Crypto Method (NEVER SEEN BEFORE)
JavaScript | 37 sec ago | 0.32 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!