This repository has been archived by the owner on Mar 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finally got this in.
- Loading branch information
Showing
3 changed files
with
84 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package burptech.block; | ||
|
||
import burptech.BurpTechCore; | ||
import net.minecraft.block.BlockCocoa; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.world.World; | ||
|
||
public class BlockIlluminatedCocoa extends BlockCocoa | ||
{ | ||
public BlockIlluminatedCocoa(int blockId, boolean illuminated) | ||
{ | ||
super(blockId); | ||
|
||
if (illuminated) | ||
{ | ||
this.setLightValue(.9375F); | ||
} else | ||
{ | ||
this.setTickRandomly(true); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) | ||
{ | ||
if (blockID == BurpTechCore.configuration.blocks.illuminatedCocoaOn.blockID) | ||
return true; | ||
|
||
int meta = world.getBlockMetadata(x, y, z); | ||
|
||
ItemStack currentItem = player.getCurrentEquippedItem(); | ||
|
||
if (currentItem == null) | ||
return true; | ||
|
||
if (currentItem.itemID == Item.glowstone.itemID && ((meta & 12) >> 2) == 2) | ||
{ | ||
world.setBlock(x, y, z, BurpTechCore.configuration.blocks.illuminatedCocoaOn.blockID, meta, 1 | 2 | 4); | ||
if (!player.capabilities.isCreativeMode) | ||
{ | ||
currentItem.stackSize--; | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
} |
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