mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-09 03:23:09 +01:00
Merge pull request #456 from gamrguy/kelp-harvester
Allow harvesters to harvest kelp tops
This commit is contained in:
commit
56f5ca45e3
1 changed files with 7 additions and 3 deletions
|
@ -15,6 +15,7 @@ import net.minecraft.block.Blocks;
|
|||
import net.minecraft.block.CocoaBlock;
|
||||
import net.minecraft.block.CropsBlock;
|
||||
import net.minecraft.block.KelpBlock;
|
||||
import net.minecraft.block.KelpTopBlock;
|
||||
import net.minecraft.block.SugarCaneBlock;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -109,6 +110,11 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
|
|||
|
||||
if (state.getCollisionShape(world, pos)
|
||||
.isEmpty() || state.getBlock() instanceof CocoaBlock) {
|
||||
if (state.getBlock() instanceof KelpBlock)
|
||||
return true;
|
||||
if (state.getBlock() instanceof KelpTopBlock)
|
||||
return true;
|
||||
|
||||
for (IProperty<?> property : state.getProperties()) {
|
||||
if (!(property instanceof IntegerProperty))
|
||||
continue;
|
||||
|
@ -118,8 +124,6 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (state.getBlock() instanceof KelpBlock)
|
||||
return true;
|
||||
if (state.getBlock() instanceof IPlantable)
|
||||
return true;
|
||||
}
|
||||
|
@ -132,7 +136,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
|
|||
CropsBlock crop = (CropsBlock) state.getBlock();
|
||||
return crop.withAge(0);
|
||||
}
|
||||
if (state.getBlock() == Blocks.SUGAR_CANE) {
|
||||
if (state.getBlock() == Blocks.SUGAR_CANE || state.getBlock() == Blocks.KELP) {
|
||||
if (state.getFluidState()
|
||||
.isEmpty())
|
||||
return Blocks.AIR.getDefaultState();
|
||||
|
|
Loading…
Reference in a new issue