-
Notifications
You must be signed in to change notification settings - Fork 0
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
32 changed files
with
371 additions
and
17 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
src/main/java/mod/emt/harkenscythe/blocks/HSBloodCrucible.java
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,51 @@ | ||
package mod.emt.harkenscythe.blocks; | ||
|
||
import java.util.Random; | ||
import net.minecraft.block.BlockCauldron; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.EnumHand; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
|
||
public class HSBloodCrucible extends BlockCauldron | ||
{ | ||
public HSBloodCrucible() | ||
{ | ||
super(); | ||
} | ||
|
||
@Override | ||
public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
public void fillWithRain(World world, BlockPos pos) | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public Item getItemDropped(IBlockState state, Random rand, int fortune) | ||
{ | ||
return Item.getItemFromBlock(this); | ||
} | ||
|
||
@Override | ||
public ItemStack getItem(World world, BlockPos pos, IBlockState state) | ||
{ | ||
return new ItemStack(Item.getItemFromBlock(this)); | ||
} | ||
} |
142 changes: 142 additions & 0 deletions
142
src/main/java/mod/emt/harkenscythe/blocks/HSSoulCrucible.java
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,142 @@ | ||
package mod.emt.harkenscythe.blocks; | ||
|
||
import java.util.Random; | ||
import mod.emt.harkenscythe.init.HSItems; | ||
import net.minecraft.block.BlockCauldron; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.init.SoundEvents; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.EnumHand; | ||
import net.minecraft.util.SoundCategory; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
|
||
public class HSSoulCrucible extends BlockCauldron | ||
{ | ||
public HSSoulCrucible() | ||
{ | ||
super(); | ||
} | ||
|
||
@Override | ||
public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) | ||
{ | ||
|
||
} | ||
|
||
// TODO: Works, but needs refactoring | ||
@Override | ||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) | ||
{ | ||
if (world.isRemote) | ||
{ | ||
return false; | ||
} | ||
ItemStack stack = player.getHeldItem(hand); | ||
if (!stack.isEmpty()) | ||
{ | ||
int level = state.getValue(LEVEL); | ||
Item item = stack.getItem(); | ||
|
||
if (item == HSItems.essence_keeper || item == HSItems.essence_vessel || item == HSItems.essence_keeper_soul || item == HSItems.essence_vessel_soul) | ||
{ | ||
// Filling the crucible | ||
if (level < 3 && !player.isSneaking()) | ||
{ | ||
if (item == HSItems.essence_keeper_soul || item == HSItems.essence_vessel_soul) | ||
{ | ||
if (!player.capabilities.isCreativeMode) | ||
{ | ||
if (stack.getItemDamage() + 20 < stack.getMaxDamage()) | ||
{ | ||
stack.setItemDamage(stack.getItemDamage() + 20); | ||
} | ||
else if (item == HSItems.essence_keeper_soul) | ||
{ | ||
stack.shrink(1); | ||
player.setHeldItem(hand, new ItemStack(HSItems.essence_keeper)); | ||
} | ||
else if (item == HSItems.essence_vessel_soul) | ||
{ | ||
stack.shrink(1); | ||
player.setHeldItem(hand, new ItemStack(HSItems.essence_vessel)); | ||
} | ||
} | ||
|
||
world.playSound(null, pos, SoundEvents.ITEM_BOTTLE_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F); | ||
this.setWaterLevel(world, pos, state, level + 1); | ||
} | ||
} | ||
// Emptying the crucible | ||
else if (level > 0 && player.isSneaking()) | ||
{ | ||
if (!player.capabilities.isCreativeMode) | ||
{ | ||
if (item == HSItems.essence_keeper || item == HSItems.essence_vessel) | ||
{ | ||
stack.shrink(1); | ||
if (item == HSItems.essence_keeper) | ||
{ | ||
ItemStack newEssenceKeeperSoul = new ItemStack(HSItems.essence_keeper_soul); | ||
player.setHeldItem(hand, newEssenceKeeperSoul); | ||
} | ||
else if (item == HSItems.essence_vessel) | ||
{ | ||
ItemStack newEssenceVesselSoul = new ItemStack(HSItems.essence_vessel_soul); | ||
newEssenceVesselSoul.setItemDamage(newEssenceVesselSoul.getItemDamage() + 20); | ||
player.setHeldItem(hand, newEssenceVesselSoul); | ||
} | ||
} | ||
else if (item == HSItems.essence_keeper_soul || item == HSItems.essence_vessel_soul) | ||
{ | ||
if (stack.getItemDamage() <= 0) | ||
{ | ||
return false; | ||
} | ||
else if (stack.getItemDamage() - 20 < 0) | ||
{ | ||
stack.setItemDamage(stack.getItemDamage() - 20); | ||
} | ||
else if (item == HSItems.essence_keeper_soul) | ||
{ | ||
stack.shrink(1); | ||
player.setHeldItem(hand, new ItemStack(HSItems.essence_keeper_soul)); | ||
} | ||
else if (item == HSItems.essence_vessel_soul) | ||
{ | ||
stack.shrink(1); | ||
player.setHeldItem(hand, new ItemStack(HSItems.essence_vessel_soul)); | ||
} | ||
} | ||
} | ||
world.playSound(null, pos, SoundEvents.ITEM_BOTTLE_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F); | ||
this.setWaterLevel(world, pos, state, level - 1); | ||
} | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
@Override | ||
public void fillWithRain(World world, BlockPos pos) | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public Item getItemDropped(IBlockState state, Random rand, int fortune) | ||
{ | ||
return Item.getItemFromBlock(this); | ||
} | ||
|
||
@Override | ||
public ItemStack getItem(World world, BlockPos pos, IBlockState state) | ||
{ | ||
return new ItemStack(Item.getItemFromBlock(this)); | ||
} | ||
} |
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
8 changes: 8 additions & 0 deletions
8
src/main/resources/assets/harkenscythe/blockstates/blood_crucible.json
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,8 @@ | ||
{ | ||
"variants": { | ||
"level=0": {"model": "harkenscythe:blood_crucible_empty"}, | ||
"level=1": {"model": "harkenscythe:blood_crucible_level1"}, | ||
"level=2": {"model": "harkenscythe:blood_crucible_level2"}, | ||
"level=3": {"model": "harkenscythe:blood_crucible_level3"} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/resources/assets/harkenscythe/blockstates/soul_crucible.json
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,8 @@ | ||
{ | ||
"variants": { | ||
"level=0": {"model": "harkenscythe:soul_crucible_empty"}, | ||
"level=1": {"model": "harkenscythe:soul_crucible_level1"}, | ||
"level=2": {"model": "harkenscythe:soul_crucible_level2"}, | ||
"level=3": {"model": "harkenscythe:soul_crucible_level3"} | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
src/main/resources/assets/harkenscythe/models/block/blood_crucible_empty.json
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,10 @@ | ||
{ | ||
"parent": "block/cauldron_empty", | ||
"textures": { | ||
"particle": "harkenscythe:blocks/blood_crucible_side", | ||
"top": "harkenscythe:blocks/blood_crucible_top", | ||
"bottom": "harkenscythe:blocks/blood_crucible_bottom", | ||
"side": "harkenscythe:blocks/blood_crucible_side", | ||
"inside": "harkenscythe:blocks/blood_crucible_inner" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/resources/assets/harkenscythe/models/block/blood_crucible_level1.json
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,11 @@ | ||
{ | ||
"parent": "block/cauldron_level1", | ||
"textures": { | ||
"particle": "harkenscythe:blocks/blood_crucible_side", | ||
"top": "harkenscythe:blocks/blood_crucible_top", | ||
"bottom": "harkenscythe:blocks/blood_crucible_bottom", | ||
"side": "harkenscythe:blocks/blood_crucible_side", | ||
"inside": "harkenscythe:blocks/blood_crucible_inner", | ||
"water": "harkenscythe:blocks/blood_crucible_liquid" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/resources/assets/harkenscythe/models/block/blood_crucible_level2.json
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,11 @@ | ||
{ | ||
"parent": "block/cauldron_level2", | ||
"textures": { | ||
"particle": "harkenscythe:blocks/blood_crucible_side", | ||
"top": "harkenscythe:blocks/blood_crucible_top", | ||
"bottom": "harkenscythe:blocks/blood_crucible_bottom", | ||
"side": "harkenscythe:blocks/blood_crucible_side", | ||
"inside": "harkenscythe:blocks/blood_crucible_inner", | ||
"water": "harkenscythe:blocks/blood_crucible_liquid" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/resources/assets/harkenscythe/models/block/blood_crucible_level3.json
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,11 @@ | ||
{ | ||
"parent": "block/cauldron_level3", | ||
"textures": { | ||
"particle": "harkenscythe:blocks/blood_crucible_side", | ||
"top": "harkenscythe:blocks/blood_crucible_top", | ||
"bottom": "harkenscythe:blocks/blood_crucible_bottom", | ||
"side": "harkenscythe:blocks/blood_crucible_side", | ||
"inside": "harkenscythe:blocks/blood_crucible_inner", | ||
"water": "harkenscythe:blocks/blood_crucible_liquid" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/resources/assets/harkenscythe/models/block/soul_crucible_empty.json
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,10 @@ | ||
{ | ||
"parent": "block/cauldron_empty", | ||
"textures": { | ||
"particle": "harkenscythe:blocks/soul_crucible_side", | ||
"top": "harkenscythe:blocks/soul_crucible_top", | ||
"bottom": "harkenscythe:blocks/soul_crucible_bottom", | ||
"side": "harkenscythe:blocks/soul_crucible_side", | ||
"inside": "harkenscythe:blocks/soul_crucible_inner" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/resources/assets/harkenscythe/models/block/soul_crucible_level1.json
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,11 @@ | ||
{ | ||
"parent": "block/cauldron_level1", | ||
"textures": { | ||
"particle": "harkenscythe:blocks/soul_crucible_side", | ||
"top": "harkenscythe:blocks/soul_crucible_top", | ||
"bottom": "harkenscythe:blocks/soul_crucible_bottom", | ||
"side": "harkenscythe:blocks/soul_crucible_side", | ||
"inside": "harkenscythe:blocks/soul_crucible_inner", | ||
"water": "harkenscythe:blocks/soul_crucible_liquid" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/resources/assets/harkenscythe/models/block/soul_crucible_level2.json
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,11 @@ | ||
{ | ||
"parent": "block/cauldron_level2", | ||
"textures": { | ||
"particle": "harkenscythe:blocks/soul_crucible_side", | ||
"top": "harkenscythe:blocks/soul_crucible_top", | ||
"bottom": "harkenscythe:blocks/soul_crucible_bottom", | ||
"side": "harkenscythe:blocks/soul_crucible_side", | ||
"inside": "harkenscythe:blocks/soul_crucible_inner", | ||
"water": "harkenscythe:blocks/soul_crucible_liquid" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/resources/assets/harkenscythe/models/block/soul_crucible_level3.json
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,11 @@ | ||
{ | ||
"parent": "block/cauldron_level3", | ||
"textures": { | ||
"particle": "harkenscythe:blocks/soul_crucible_side", | ||
"top": "harkenscythe:blocks/soul_crucible_top", | ||
"bottom": "harkenscythe:blocks/soul_crucible_bottom", | ||
"side": "harkenscythe:blocks/soul_crucible_side", | ||
"inside": "harkenscythe:blocks/soul_crucible_inner", | ||
"water": "harkenscythe:blocks/soul_crucible_liquid" | ||
} | ||
} |
Oops, something went wrong.