Skip to content

Commit

Permalink
fix 1.20 mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
2ndDerivative committed Nov 3, 2024
1 parent f4d2846 commit 75a1844
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import net.minecraft.predicate.NumberRange;
import net.minecraft.predicate.entity.AdvancementEntityPredicateDeserializer;
import net.minecraft.predicate.entity.AdvancementEntityPredicateSerializer;
import net.minecraft.predicate.entity.EntityPredicate;
import net.minecraft.predicate.entity.LootContextPredicate;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Identifier;

Expand All @@ -16,7 +16,7 @@ public class HerdingWolfCriterion extends AbstractCriterion<HerdingWolfCriterion

public HerdingWolfCriterion(){}

public HerdingWolfCriterion.Conditions conditionsFromJson(JsonObject jsonObject, EntityPredicate.Extended extended, AdvancementEntityPredicateDeserializer advancementEntityPredicateDeserializer) {
public HerdingWolfCriterion.Conditions conditionsFromJson(JsonObject jsonObject, LootContextPredicate extended, AdvancementEntityPredicateDeserializer advancementEntityPredicateDeserializer) {
NumberRange.IntRange intRange = NumberRange.IntRange.fromJson(jsonObject.get("number"));
return new HerdingWolfCriterion.Conditions(extended, intRange);
}
Expand All @@ -29,7 +29,7 @@ public void trigger(ServerPlayerEntity player, int number){
public static class Conditions extends AbstractCriterionConditions {
private final NumberRange.IntRange number;

public Conditions(EntityPredicate.Extended player, NumberRange.IntRange intRange) {
public Conditions(LootContextPredicate player, NumberRange.IntRange intRange) {
super(ID, player);
this.number = intRange;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void tick() {
}

private List<SheepEntity> getNearbySheep(double range){
return this.dog.getWorld().getEntitiesByClass(SheepEntity.class,
return this.dog.method_48926().getEntitiesByClass(SheepEntity.class,
dog.getBoundingBox().expand(range,4,range), EntityPredicates.VALID_ENTITY);
}

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/babydontherdme/mixin/WolfEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.entity.passive.TameableEntity;
import net.minecraft.entity.passive.WolfEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.world.EntityView;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -69,4 +70,8 @@ private void lowerHerdingTime(CallbackInfo ci){
}
//this.setCustomName(Text.of(String.valueOf(herdingTime)));
}
@Override
public EntityView method_48926() {
return this.getWorld();
}
}

0 comments on commit 75a1844

Please sign in to comment.