Skip to content

Commit be9fdd0

Browse files
- Spider Jockeys realized that the skeletons also belong to you and can die properly
- Servers now no longer crash
1 parent 824fee0 commit be9fdd0

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

common/src/main/java/com/github/teamfusion/summonerscrolls/common/entity/summons/spider/SpiderJockeySummon.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,32 @@
1414
import org.jetbrains.annotations.Nullable;
1515

1616
public class SpiderJockeySummon extends SpiderSummon {
17+
18+
private SkeletonSummon skeletonSummon;
19+
1720
public SpiderJockeySummon(EntityType<? extends BaseSummonedEntity> entityType, Level level) {
1821
super(entityType, level);
1922
}
2023

24+
@Override
25+
public void tick() {
26+
if (this.skeletonSummon != null && this.skeletonSummon.getOwnerUUID() != this.getOwnerUUID()) {
27+
this.skeletonSummon.setOwnerUUID(getOwnerUUID());
28+
this.skeletonSummon.setDespawnDelay(getDespawnDelay());
29+
}
30+
super.tick();
31+
}
32+
2133
@Override
2234
public @Nullable SpawnGroupData finalizeSpawn(ServerLevelAccessor serverLevelAccessor, DifficultyInstance difficultyInstance, MobSpawnType mobSpawnType, @Nullable SpawnGroupData spawnGroupData, @Nullable CompoundTag compoundTag) {
2335

2436
SkeletonSummon skeleton = SummonerEntityTypes.SKELETON_SUMMON.get().create(this.level());
25-
skeleton.setOwnerUUID(getOwnerUUID());
26-
skeleton.setDespawnDelay(600);
2737
skeleton.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0);
2838
skeleton.finalizeSpawn(serverLevelAccessor, difficultyInstance, mobSpawnType, null, null);
2939
skeleton.startRiding(this);
3040

41+
this.skeletonSummon = skeleton;
42+
3143
return super.finalizeSpawn(serverLevelAccessor, difficultyInstance, mobSpawnType, spawnGroupData, compoundTag);
3244
}
3345
}

common/src/main/java/com/github/teamfusion/summonerscrolls/common/recipe/AnvilScrollRecipe.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.github.teamfusion.summonerscrolls.common.recipe;
22

3+
import com.github.teamfusion.summonerscrolls.SummonerScrolls;
34
import com.google.gson.JsonObject;
45
import net.minecraft.core.RegistryAccess;
56
import net.minecraft.nbt.CompoundTag;
@@ -83,6 +84,7 @@ public static class Serializer implements RecipeSerializer<AnvilScrollRecipe> {
8384
public static final String ID = "anvil_scroll";
8485

8586
public AnvilScrollRecipe fromJson(ResourceLocation resourceLocation, JsonObject jsonObject) {
87+
8688
Ingredient ingredient = Ingredient.fromJson(GsonHelper.getNonNull(jsonObject, "scroll"));
8789
Ingredient ingredient2 = Ingredient.fromJson(GsonHelper.getNonNull(jsonObject, "upgrade"));
8890
ItemStack itemStack = ShapedRecipe.itemStackFromJson(GsonHelper.getAsJsonObject(jsonObject, "result"));
@@ -99,6 +101,7 @@ public AnvilScrollRecipe fromNetwork(ResourceLocation resourceLocation, Friendly
99101
}
100102

101103
public void toNetwork(FriendlyByteBuf friendlyByteBuf, AnvilScrollRecipe anvilScrollRecipe) {
104+
102105
anvilScrollRecipe.scroll.toNetwork(friendlyByteBuf);
103106
anvilScrollRecipe.upgrade.toNetwork(friendlyByteBuf);
104107
friendlyByteBuf.writeItem(anvilScrollRecipe.result);

common/src/main/java/com/github/teamfusion/summonerscrolls/common/registry/SummonerRecipes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class SummonerRecipes {
1919

2020
public static final Supplier<RecipeSerializer<AnvilScrollRecipe>> ANVIL_SCROLL_SERIALIZER = RECIPE_SERIALIZERS.register(
2121
AnvilScrollRecipe.Serializer.ID,
22-
AnvilScrollRecipe.Serializer::new
22+
() -> AnvilScrollRecipe.Serializer.INSTANCE
2323
);
2424

2525
public static final Supplier<RecipeType<AnvilScrollRecipe>> ANVIL_SCROLL_TYPE =

common/src/main/java/com/github/teamfusion/summonerscrolls/mixin/client/ShulkerBulletRendererMixin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
public class ShulkerBulletRendererMixin {
2929

3030
@Shadow @Final private ShulkerBulletModel<ShulkerBullet> model;
31-
@Shadow @Final private static RenderType RENDER_TYPE;
3231
@Unique
3332
private static final ResourceLocation SUMMON_TEXTURE = new ResourceLocation(SummonerScrolls.MOD_ID, "textures/entity/projectiles/spark_summon.png");
3433

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ enabled_platforms=fabric,forge
66
output_datagen=src/main/generated
77

88
archives_base_name=summonerscrolls
9-
mod_version=1.0.1
9+
mod_version=1.0.2
1010
maven_group=com.github.teamfusion.summonerscrolls
1111

1212
architectury_version=9.1.12

0 commit comments

Comments
 (0)