Skip to content

Commit

Permalink
Fix GoalSelector crash
Browse files Browse the repository at this point in the history
Fixes crash caused by removing all goals - https://pastebin.com/YkKb9xhd

Removing goals is redundant as Minecraft handles goals not being run while the entity has a passenger (Example: `WanderAroundGoal#canStart()`)

I also changed it so the player must have an empty hand, as pokemon can hold more than just cobblemon items.

I also bumped version and changed the gradle from 48GB to 2GB because that absolutely demolished my 16GB RAM PC and is not needed lmao
  • Loading branch information
Neovitalism committed Feb 22, 2024
1 parent 8e226ba commit 282bdcd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx48G
org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true

# Fabric Properties
Expand All @@ -9,7 +9,7 @@ yarn_mappings=1.20.1+build.1
loader_version=0.14.22

# Mod Properties
mod_version=1.2.1
mod_version=1.2.2
maven_group=net.ioixd
archives_base_name=cobblemounts

Expand Down
8 changes: 3 additions & 5 deletions src/main/java/net/ioixd/Cobblemounts.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import net.fabricmc.fabric.api.event.player.UseEntityCallback;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.minecraft.item.Item;
import net.minecraft.entity.ai.goal.EatGrassGoal;
import net.minecraft.entity.ai.goal.WanderAroundGoal;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
Expand Down Expand Up @@ -65,12 +66,9 @@ public void onInitialize() {
}

}
Item item = player.getMainHandStack().getItem();
if (!item.getTranslationKey().contains("item.cobblemon")) {
if (player.getMainHandStack().isEmpty()) {
player.startRiding(entity, false);
pkmnEntity.clearGoalsAndTasks();
}

}
}
}
Expand Down

0 comments on commit 282bdcd

Please sign in to comment.