Skip to content

Commit

Permalink
update to 1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
OverlordsIII committed Jun 14, 2024
1 parent 66213d2 commit 7ae05f2
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 39 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
}

Expand Down
15 changes: 8 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@ org.gradle.jvmargs = -Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.3
minecraft_version=1.20.5
yarn_mappings=1.20.5+build.1
loader_version=0.15.10

#Fabric api
fabric_version=0.92.0+1.20.4
fabric_version=0.97.6+1.20.5


#Other Dependencies
mod_menu_version=9.0.0
cloth_config_version=13.0.121
mod_menu_version=10.0.0-beta.1
cloth_config_version=14.0.126

# Mod Properties
mod_version = 2.3.0
maven_group = io.github.overlordsiii
archives_base_name = npc-variety-1.20.4
archives_base_name = npc-variety-1.20.5

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
Expand Down
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.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import io.github.overlordsiii.npcvariety.api.SkinVariantManager;
import io.github.overlordsiii.npcvariety.api.TextureIdList;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
Expand Down Expand Up @@ -38,11 +39,12 @@ public MerchantEntityMixin(EntityType<? extends MerchantEntity> entityType, Worl
private static final TrackedData<Integer> EYE_INDEX = DataTracker.registerData(MerchantEntity.class, TrackedDataHandlerRegistry.INTEGER);

@Inject(method = "initDataTracker", at = @At("TAIL"))
private void setIndexes(CallbackInfo ci) {
this.dataTracker.startTracking(SKIN_INDEX, this.random.nextInt(8));
this.dataTracker.startTracking(EYE_INDEX, getRandomEyeIndex());
private void setIndexes(DataTracker.Builder builder, CallbackInfo ci) {
builder.add(SKIN_INDEX, this.random.nextInt(8));
builder.add(EYE_INDEX, getRandomEyeIndex());
}

@Unique
private int getRandomEyeIndex() {
if (this.random.nextBoolean()) {
return 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public VillagerEntityMixin(EntityType<? extends MerchantEntity> entityType, Worl
super(entityType, world);
}

@Inject(method = "createChild", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/VillagerEntity;initialize(Lnet/minecraft/world/ServerWorldAccess;Lnet/minecraft/world/LocalDifficulty;Lnet/minecraft/entity/SpawnReason;Lnet/minecraft/entity/EntityData;Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/entity/EntityData;"), locals = LocalCapture.CAPTURE_FAILHARD)
@Inject(method = "createChild", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/VillagerEntity;initialize(Lnet/minecraft/world/ServerWorldAccess;Lnet/minecraft/world/LocalDifficulty;Lnet/minecraft/entity/SpawnReason;Lnet/minecraft/entity/EntityData;)Lnet/minecraft/entity/EntityData;"), locals = LocalCapture.CAPTURE_FAILHARD)
private void inheritTraits(ServerWorld serverWorld, PassiveEntity passiveEntity, CallbackInfoReturnable<VillagerEntity> cir, VillagerType villagerType3, VillagerEntity villagerEntity) {
if (passiveEntity instanceof VillagerEntity dad && NpcVariety.CONFIG.inheritTraits) {
boolean dadInheritSkin = this.random.nextBoolean();
Expand All @@ -56,7 +56,7 @@ private void inheritTraits(ServerWorld serverWorld, PassiveEntity passiveEntity,


@Inject(method = "initialize", at = @At("TAIL"))
private void resetSkinIndexBasedOnBiome(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, EntityData entityData, NbtCompound entityTag, CallbackInfoReturnable<EntityData> cir) {
private void resetSkinIndexBasedOnBiome(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, EntityData entityData, CallbackInfoReturnable<EntityData> cir) {
if (spawnReason == SpawnReason.STRUCTURE && NpcVariety.CONFIG.naturalVariation) {
BiomeSpawnRate rate = getRateFromType(this.getVillagerData());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public WanderingTraderEntityMixin(EntityType<? extends MerchantEntity> entityTyp
}

@Override
protected void initDataTracker() {
super.initDataTracker();
this.dataTracker.startTracking(robeIndex, this.random.nextInt(2));
protected void initDataTracker(DataTracker.Builder builder) {
super.initDataTracker(builder);
builder.add(robeIndex, this.random.nextInt(2));
}

@Inject(method = "writeCustomDataToNbt", at = @At("HEAD"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


@Mixin(ZombieVillagerEntity.class)
public class ZombieVillagerEntityMixin extends ZombieEntity implements SkinVariantManager {
public abstract class ZombieVillagerEntityMixin extends ZombieEntity implements SkinVariantManager {

@SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
private static final TextureIdList SKIN_TEXTURE_ID_LIST = new TextureIdList("textures/entity/zombie_villager/", 10, "skin");
Expand All @@ -41,8 +41,8 @@ private void addSkinDataToTag(NbtCompound tag, CallbackInfo ci) {
}

@Inject(method = "initDataTracker", at = @At("TAIL"))
private void initIndex(CallbackInfo ci) {
this.dataTracker.startTracking(SKIN_INDEX, this.random.nextInt(8));
private void initIndex(DataTracker.Builder builder, CallbackInfo ci) {
builder.add(SKIN_INDEX, this.random.nextInt(8));
}

@Inject(method = "readCustomDataFromNbt", at = @At("TAIL"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ protected EvokerEntityMixin(EntityType<? extends SpellcastingIllagerEntity> enti
}

@Inject(method = "initDataTracker", at = @At("HEAD"))
protected void initDataTracker(CallbackInfo ci) {
this.dataTracker.startTracking(shoeIndex, this.random.nextInt(2));
this.dataTracker.startTracking(headIndex, getEyePatchIndex());
protected void initDataTracker(DataTracker.Builder builder, CallbackInfo ci) {
builder.add(shoeIndex, this.random.nextInt(2));
builder.add(headIndex, getEyePatchIndex());
}

private int getEyePatchIndex() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ protected IllagerEntityMixin(EntityType<? extends RaiderEntity> entityType, Worl
}

@Override
protected void initDataTracker() {
super.initDataTracker();
this.dataTracker.startTracking(EYE_INDEX, getRandomEyeIndex());
this.dataTracker.startTracking(SKIN_INDEX, this.random.nextInt(8));
protected void initDataTracker(DataTracker.Builder builder) {
super.initDataTracker(builder);
builder.add(EYE_INDEX, this.getRandomEyeIndex());
builder.add(SKIN_INDEX, this.random.nextInt(8));
}



@Override
public void readCustomDataFromNbt(NbtCompound tag) {
super.readCustomDataFromNbt(tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ protected PillagerEntityMixin(EntityType<? extends IllagerEntity> entityType, Wo
}

@Inject(method = "initDataTracker", at = @At("HEAD"))
private void addHeadIndex(CallbackInfo ci) {
this.dataTracker.startTracking(headIndex, getEyePatchIndex());
private void addHeadIndex(DataTracker.Builder builder, CallbackInfo ci) {
builder.add(headIndex, getEyePatchIndex());
}

private int getEyePatchIndex() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ protected RavagerEntityMixin(EntityType<? extends RaiderEntity> entityType, Worl
}

@Override
protected void initDataTracker() {
super.initDataTracker();
this.dataTracker.startTracking(skinIndex, this.random.nextInt(8));
this.dataTracker.startTracking(eyeIndex, this.random.nextInt(5));
protected void initDataTracker(DataTracker.Builder builder) {
super.initDataTracker(builder);
builder.add(skinIndex, this.random.nextInt(8));
builder.add(eyeIndex, this.random.nextInt(5));
}

@Inject(method = "readCustomDataFromNbt", at = @At("HEAD"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ protected VindicatorEntityMixin(EntityType<? extends IllagerEntity> entityType,
}

@Override
protected void initDataTracker() {
super.initDataTracker();
this.dataTracker.startTracking(headIndex, getEyePatchIndex());
this.dataTracker.startTracking(shoeIndex, this.random.nextInt(2));
protected void initDataTracker(DataTracker.Builder builder) {
super.initDataTracker(builder);
builder.add(headIndex, getEyePatchIndex());
builder.add(shoeIndex, this.random.nextInt(2));
}

@Inject(method = "readCustomDataFromNbt", at = @At("HEAD"))
Expand Down

0 comments on commit 7ae05f2

Please sign in to comment.