-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add stonecutter No functionality, just block at the moment!!! * runtime states for lightning rod & powder snow * feat: powder snow freezing
- Loading branch information
1 parent
af47c03
commit 43e8fac
Showing
31 changed files
with
183 additions
and
2 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
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,94 @@ | ||
package cn.nukkit.block; | ||
|
||
import cn.nukkit.Player; | ||
import cn.nukkit.item.Item; | ||
import cn.nukkit.item.ItemBlock; | ||
import cn.nukkit.item.ItemTool; | ||
import cn.nukkit.math.BlockFace; | ||
import cn.nukkit.utils.Faceable; | ||
|
||
public class BlockStonecutterBlock extends BlockSolidMeta implements Faceable { | ||
|
||
public BlockStonecutterBlock() { | ||
this(0); | ||
} | ||
|
||
public BlockStonecutterBlock(int meta) { | ||
super(meta); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "Stonecutter Block"; | ||
} | ||
|
||
@Override | ||
public int getId() { | ||
return STONECUTTER_BLOCK; | ||
} | ||
|
||
@Override | ||
public double getHardness() { | ||
return 3.5; | ||
} | ||
|
||
@Override | ||
public double getResistance() { | ||
return 17.5; | ||
} | ||
|
||
@Override | ||
public boolean canHarvestWithHand() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public int getToolType() { | ||
return ItemTool.TYPE_PICKAXE; | ||
} | ||
|
||
@Override | ||
public int getToolTier() { | ||
return ItemTool.TIER_WOODEN; | ||
} | ||
|
||
@Override | ||
public Item[] getDrops(Item item) { | ||
return new Item[]{toItem()}; | ||
} | ||
|
||
@Override | ||
public Item toItem() { | ||
return new ItemBlock(new BlockStonecutterBlock()); | ||
} | ||
|
||
@Override | ||
public double getMaxY() { | ||
return y + 0.5625; | ||
} | ||
|
||
@Override | ||
public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) { | ||
this.setDamage(Block.FACES2534[player != null ? player.getDirection().getHorizontalIndex() : 0]); | ||
return super.place(item, block, target, face, fx, fy, fz, player); | ||
} | ||
|
||
//TODO: Add Stonecutter functionality | ||
/*@Override | ||
public boolean canBeActivated() { | ||
return true; | ||
} | ||
@Override | ||
public boolean onActivate(Item item, Player player) { | ||
if (player != null) { | ||
player.addWindow(new StonecutterInventory(player.getUIInventory(), this), Player.STONECUTTER_WINDOW_ID); | ||
} | ||
return true; | ||
}*/ | ||
|
||
@Override | ||
public BlockFace getBlockFace() { | ||
return BlockFace.fromHorizontalIndex(this.getDamage() & 0x7); | ||
} | ||
} |
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
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
19 changes: 19 additions & 0 deletions
19
src/main/java/cn/nukkit/event/entity/EntityFreezeEvent.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,19 @@ | ||
package cn.nukkit.event.entity; | ||
|
||
import cn.nukkit.entity.Entity; | ||
import cn.nukkit.event.Cancellable; | ||
import cn.nukkit.event.HandlerList; | ||
|
||
public class EntityFreezeEvent extends EntityEvent implements Cancellable { | ||
private final Entity entity; | ||
|
||
private static final HandlerList handlers = new HandlerList(); | ||
|
||
public static HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
|
||
public EntityFreezeEvent(Entity human) { | ||
this.entity = human; | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.