Skip to content

Commit

Permalink
Update to 1.21.4 (without the book)
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Dec 8, 2024
1 parent 596a884 commit 6141217
Show file tree
Hide file tree
Showing 23 changed files with 149 additions and 127 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id 'fabric-loom' version '1.5.+'
id 'fabric-loom' version '1.8.+'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

archivesBaseName = project.archives_base_name
version = project.mod_version
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.1
loader_version=0.15.6
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.1
loader_version=0.16.9

# Mod Properties
mod_version=1.3.10
mod_version=1.3.11
maven_group=io.github.redstoneparadox
archives_base_name=creeperfall

# Dependencies

# check this on https://modmuss50.me/fabric.html
fabric_version=0.91.1+1.20.4
fabric_version=0.110.2+1.21.4

# check this on https://nucleoid.xyz/use/
plasmid_version=0.5.102-SNAPSHOT+1.20.4
plasmid_version=0.6.2+1.21.4

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
import net.minecraft.util.Identifier;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import xyz.nucleoid.plasmid.game.GameType;
import xyz.nucleoid.plasmid.api.game.GameType;

public class Creeperfall implements ModInitializer {

public static final String ID = "creeperfall";
public static final Logger LOGGER = LogManager.getLogger(ID);

public static final GameType<CreeperfallConfig> TYPE = GameType.register(
new Identifier(ID, "creeperfall"),
Identifier.of(ID, "creeperfall"),
CreeperfallConfig.CODEC,
CreeperfallWaiting::open
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.entity.passive.CatEntity;
import net.minecraft.entity.passive.OcelotEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;

Expand Down Expand Up @@ -44,7 +45,7 @@ protected void initGoals() {
1,
true,
true,
livingEntity -> true
(livingEntity, world) -> true
)
);
this.targetSelector.add(2, new CreeperfallFollowTargetGoal<>(
Expand All @@ -53,7 +54,7 @@ protected void initGoals() {
1,
true,
true,
livingEntity -> true
(livingEntity, world) -> true
)
);
}
Expand Down Expand Up @@ -93,7 +94,7 @@ public void tick() {
}

if (getY() <= 0) {
kill();
kill((ServerWorld) this.getWorld());
}
super.tick();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected void initGoals() {
10,
true,
false,
livingEntity -> livingEntity instanceof CreeperEntity
(livingEntity, world) -> livingEntity instanceof CreeperEntity
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.entity.ai.goal.LookAtEntityGoal;
import net.minecraft.entity.mob.CreeperEntity;
import net.minecraft.entity.passive.OcelotEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.world.World;

import java.util.Set;
Expand All @@ -28,7 +29,7 @@ public CreeperfallOcelotEntity(EntityTracker tracker, World world) {
@Override
protected void initGoals() {
super.initGoals();
this.targetSelector.add(1, new CreeperfallFollowTargetGoal<>(this, CreeperEntity.class, 10, false, false, Entity::isOnGround, false));
this.targetSelector.add(1, new CreeperfallFollowTargetGoal<>(this, CreeperEntity.class, 10, false, false, (livingEntity, world) -> livingEntity.isOnGround(), false));
this.goalSelector.add(1, new LookAtEntityGoal(this, CreeperEntity.class, 128.0F));
}

Expand All @@ -43,7 +44,7 @@ public void tick() {

for (CreeperEntity creeper: creepers) {
if (getPos().distanceTo(creeper.getPos()) <= 4 && creeper.isOnGround()) {
creeper.kill();
creeper.kill((ServerWorld) this.getWorld());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ protected void initGoals() {
10,
true,
false,
livingEntity -> livingEntity instanceof CreeperEntity && !livingEntity.isOnGround()
(livingEntity, world) -> livingEntity instanceof CreeperEntity && !livingEntity.isOnGround()
)
);
}

@Override
public void setOnFireFor(int seconds) {
public void setOnFireForTicks(int ticks) {

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.redstoneparadox.creeperfall.entity.ai.goal;

import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.TargetPredicate;
import net.minecraft.entity.ai.goal.ActiveTargetGoal;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.util.math.Box;
Expand All @@ -11,12 +12,12 @@
public class CreeperfallFollowTargetGoal<T extends LivingEntity> extends ActiveTargetGoal<T> {
private final boolean airborneTargetsOnly;

public CreeperfallFollowTargetGoal(MobEntity mob, Class<T> targetClass, int reciprocalChance, boolean checkVisibility, boolean checkCanNavigate, @Nullable Predicate<LivingEntity> targetPredicate) {
public CreeperfallFollowTargetGoal(MobEntity mob, Class<T> targetClass, int reciprocalChance, boolean checkVisibility, boolean checkCanNavigate, @Nullable TargetPredicate.EntityPredicate targetPredicate) {
super(mob, targetClass, reciprocalChance, checkVisibility, checkCanNavigate, targetPredicate);
this.airborneTargetsOnly = true;
}

public CreeperfallFollowTargetGoal(MobEntity mob, Class<T> targetClass, int reciprocalChance, boolean checkVisibility, boolean checkCanNavigate, @Nullable Predicate<LivingEntity> targetPredicate, boolean airborneTargetsOnly) {
public CreeperfallFollowTargetGoal(MobEntity mob, Class<T> targetClass, int reciprocalChance, boolean checkVisibility, boolean checkCanNavigate, @Nullable TargetPredicate.EntityPredicate targetPredicate, boolean airborneTargetsOnly) {
super(mob, targetClass, reciprocalChance, checkVisibility, checkCanNavigate, targetPredicate);
this.airborneTargetsOnly = airborneTargetsOnly;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.entity.ai.goal.LookAtEntityGoal;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.world.ServerWorld;

public class LookUpAtEntityGoal extends LookAtEntityGoal {
public LookUpAtEntityGoal(MobEntity mob, Class<? extends LivingEntity> targetType, float range) {
Expand All @@ -19,9 +20,9 @@ public boolean canStart() {
}

if (this.targetType == PlayerEntity.class) {
this.target = mob.getWorld().getClosestPlayer(targetPredicate, mob, mob.getX(), mob.getEyeY(), mob.getZ());
this.target = ((ServerWorld) mob.getWorld()).getClosestPlayer(targetPredicate, mob, mob.getX(), mob.getEyeY(), mob.getZ());
} else {
this.target = mob.getWorld().getClosestEntity(targetType, targetPredicate, mob, mob.getX(), mob.getEyeY(), mob.getZ(), mob.getBoundingBox().expand(range, range, range));
this.target = ((ServerWorld) mob.getWorld()).getClosestEntity(targetType, targetPredicate, mob, mob.getX(), mob.getEyeY(), mob.getZ(), mob.getBoundingBox().expand(range, range, range));
}

return this.target != null;
Expand Down
Loading

0 comments on commit 6141217

Please sign in to comment.