Skip to content

Commit

Permalink
discover the concept of "abstract class"
Browse files Browse the repository at this point in the history
  • Loading branch information
orifu committed Sep 25, 2024
1 parent cf6852f commit ee87889
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import net.minecraft.world.World;
import net.minecraft.world.WorldView;

public class BasicBerryBush extends PlantBlock implements BerryBush {
public abstract class BasicBerryBush extends PlantBlock implements BerryBush {
protected static final Vec3d BERRY_BUSH_SLOWING_VECTOR = new Vec3d(0.5D, 0.25D, 0.5D);
protected static final int GROW_CHANCE = 5;
protected static final int MAX_BERRY_AMOUNT = 3;
Expand Down Expand Up @@ -183,11 +183,6 @@ public int getSizeChangeAge() {
return sizeChangeAge;
}

@Override
public IntProperty getAge() {
throw new AssertionError("getAge() should always be overridden");
}

@Override
public Berry getBerry() {
return berry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.World;

public class SpikedBerryBush extends BasicBerryBush {
public abstract class SpikedBerryBush extends BasicBerryBush {
private static final float MINIMUM_DAMAGE_DISTANCE = 0.003f;
private final float damage;

Expand Down

0 comments on commit ee87889

Please sign in to comment.