mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-28 11:29:19 +00:00
3.5.1
This commit is contained in:
@@ -195,7 +195,7 @@ public abstract class AbstractCustomListener implements Listener {
|
||||
Sprinkler sprinkler = this.itemManager.getSprinklerBy3DItemID(itemID);
|
||||
if (sprinkler != null) {
|
||||
ItemStack newItem = this.itemManager.getItemStack(null, sprinkler.get2DItemID());
|
||||
if (newItem != null) {
|
||||
if (newItem != null && newItem.getType() != Material.AIR) {
|
||||
newItem.setAmount(itemStack.getAmount());
|
||||
item.setItemStack(newItem);
|
||||
}
|
||||
@@ -205,7 +205,7 @@ public abstract class AbstractCustomListener implements Listener {
|
||||
Pot pot = this.itemManager.getPotByBlockID(itemID);
|
||||
if (pot != null) {
|
||||
ItemStack newItem = this.itemManager.getItemStack(null, pot.getDryItem());
|
||||
if (newItem != null) {
|
||||
if (newItem != null && newItem.getType() != Material.AIR) {
|
||||
newItem.setAmount(itemStack.getAmount());
|
||||
item.setItemStack(newItem);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class SimpleLocation {
|
||||
}
|
||||
|
||||
public ChunkPos getChunkPos() {
|
||||
return new ChunkPos(x >> 4, z >> 4);
|
||||
return new ChunkPos((int) Math.floor((double) getX() / 16), (int) Math.floor((double) getZ() / 16));
|
||||
}
|
||||
|
||||
public SimpleLocation add(int x, int y, int z) {
|
||||
|
||||
@@ -83,6 +83,9 @@ public class AbstractCustomCropsBlock implements DataBlock {
|
||||
* @return can be ticked or not
|
||||
*/
|
||||
public boolean canTick(int interval) {
|
||||
if (interval <= 0) {
|
||||
return false;
|
||||
}
|
||||
if (interval == 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user