mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-16 15:23:41 +01:00
Merge branch 'mc1.15/dev' into mc1.16/dev
This commit is contained in:
commit
5966040d12
1 changed files with 9 additions and 4 deletions
|
@ -15,6 +15,7 @@ import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.block.CocoaBlock;
|
import net.minecraft.block.CocoaBlock;
|
||||||
import net.minecraft.block.CropsBlock;
|
import net.minecraft.block.CropsBlock;
|
||||||
import net.minecraft.block.KelpBlock;
|
import net.minecraft.block.KelpBlock;
|
||||||
|
import net.minecraft.block.KelpTopBlock;
|
||||||
import net.minecraft.block.SugarCaneBlock;
|
import net.minecraft.block.SugarCaneBlock;
|
||||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -43,7 +44,8 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
|
||||||
@Override
|
@Override
|
||||||
public Vector3d getActiveAreaOffset(MovementContext context) {
|
public Vector3d getActiveAreaOffset(MovementContext context) {
|
||||||
return Vector3d.of(context.state.get(HORIZONTAL_FACING)
|
return Vector3d.of(context.state.get(HORIZONTAL_FACING)
|
||||||
.getDirectionVec()).scale(.45);
|
.getDirectionVec())
|
||||||
|
.scale(.45);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -109,6 +111,11 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
|
||||||
|
|
||||||
if (state.getCollisionShape(world, pos)
|
if (state.getCollisionShape(world, pos)
|
||||||
.isEmpty() || state.getBlock() instanceof CocoaBlock) {
|
.isEmpty() || state.getBlock() instanceof CocoaBlock) {
|
||||||
|
if (state.getBlock() instanceof KelpBlock)
|
||||||
|
return true;
|
||||||
|
if (state.getBlock() instanceof KelpTopBlock)
|
||||||
|
return true;
|
||||||
|
|
||||||
for (Property<?> property : state.getProperties()) {
|
for (Property<?> property : state.getProperties()) {
|
||||||
if (!(property instanceof IntegerProperty))
|
if (!(property instanceof IntegerProperty))
|
||||||
continue;
|
continue;
|
||||||
|
@ -118,8 +125,6 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.getBlock() instanceof KelpBlock)
|
|
||||||
return true;
|
|
||||||
if (state.getBlock() instanceof IPlantable)
|
if (state.getBlock() instanceof IPlantable)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -132,7 +137,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour {
|
||||||
CropsBlock crop = (CropsBlock) state.getBlock();
|
CropsBlock crop = (CropsBlock) state.getBlock();
|
||||||
return crop.withAge(0);
|
return crop.withAge(0);
|
||||||
}
|
}
|
||||||
if (state.getBlock() == Blocks.SUGAR_CANE) {
|
if (state.getBlock() == Blocks.SUGAR_CANE || state.getBlock() == Blocks.KELP) {
|
||||||
if (state.getFluidState()
|
if (state.getFluidState()
|
||||||
.isEmpty())
|
.isEmpty())
|
||||||
return Blocks.AIR.getDefaultState();
|
return Blocks.AIR.getDefaultState();
|
||||||
|
|
Loading…
Reference in a new issue