Skip to content

Commit

Permalink
1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
seymourimadeit committed Jun 13, 2024
1 parent 706f04b commit c6360a0
Show file tree
Hide file tree
Showing 26 changed files with 55 additions and 83 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.105'
id 'net.neoforged.gradle.userdev' version '7.0.140'
}

version = mod_version
Expand Down
10 changes: 1 addition & 9 deletions changelog-1.20.5.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
- Added Komodo Dragon (Alexs Mobs) to mob blacklist
- Added separate config option for mobs attacking guards
- Update to 1.20.5
- Adjusted range of Crossbow guards firing arrows
- Made iron golems float and walk back to nearest land when in water
- Fixed guards not returning back to checkpoint
- Added advancement to recruiting a guard
- Made guards not attack zombified piglins
- Enabled illagers attacking animals during raids by default
- Update to 1.20.6
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ org.gradle.debug=false
## Environment Properties
# You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge
# The Minecraft version must agree with the Neo version to get a valid artifact
minecraft_version=1.20.5
minecraft_version=1.21
# The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.20.5,1.21)
minecraft_version_range=[1.21, 1.22)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=20.5.5-beta
neo_version=21.0.0-beta
# The Neo version range can use any version of Neo as bounds
neo_version_range=[20.4,)
# The loader version range can only use the major version of FML as bounds
Expand All @@ -32,7 +32,7 @@ mod_name=Guard Villagers
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=MIT for code, assets are ARR
# The mod version. See https://semver.org/
mod_version=2.1.1-1.20.5
mod_version=2.2.0
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 0 additions & 3 deletions src/main/java/tallestegg/guardvillagers/GuardItems.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package tallestegg.guardvillagers;

import com.google.common.base.Predicate;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.SpawnEggItem;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.common.DeferredSpawnEggItem;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tallestegg/guardvillagers/GuardLootTables.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public class GuardLootTables {
public static final ResourceKey<LootTable> GUARD_FEET = registerLootTable("entities/guard_feet");

public static ResourceKey<LootTable> registerLootTable(String id) {
return ResourceKey.create(Registries.LOOT_TABLE, new ResourceLocation(GuardVillagers.MODID, id));
return ResourceKey.create(Registries.LOOT_TABLE, ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, id));
}

public static LootContextParamSet register(String p_81429_, Consumer<LootContextParamSet.Builder> p_81430_) {
LootContextParamSet.Builder lootcontextparamset$builder = new LootContextParamSet.Builder();
p_81430_.accept(lootcontextparamset$builder);
LootContextParamSet lootcontextparamset = lootcontextparamset$builder.build();
ResourceLocation resourcelocation = new ResourceLocation(GuardVillagers.MODID + p_81429_);
ResourceLocation resourcelocation = ResourceLocation.parse(GuardVillagers.MODID + p_81429_);
LootContextParamSet lootcontextparamset1 = REGISTRY.put(resourcelocation, lootcontextparamset);
if (lootcontextparamset1 != null) {
throw new IllegalStateException("Loot table parameter set " + resourcelocation + " is already registered");
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/tallestegg/guardvillagers/HandlerEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import net.neoforged.neoforge.event.entity.living.LivingEvent;
import net.neoforged.neoforge.event.entity.living.LivingHurtEvent;
import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;
import net.neoforged.neoforge.event.tick.EntityTickEvent;
import tallestegg.guardvillagers.common.entities.Guard;
import tallestegg.guardvillagers.common.entities.ai.goals.AttackEntityDaytimeGoal;
import tallestegg.guardvillagers.common.entities.ai.goals.GetOutOfWaterGoal;
Expand Down Expand Up @@ -96,7 +97,7 @@ public static void onEntityHurt(LivingHurtEvent event) {
}

@SubscribeEvent
public static void onLivingTick(LivingEvent.LivingTickEvent event) {
public static void onLivingTick(EntityTickEvent.Pre event) {
if (event.getEntity() instanceof AbstractHorse horse) {
Vec3 vec3 = new Vec3(horse.xxa, horse.yya, horse.zza);
if (horse.hasControllingPassenger() && horse.getControllingPassenger() instanceof Guard) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
@EventBusSubscriber(value = Dist.CLIENT, bus = EventBusSubscriber.Bus.MOD)
public class GuardClientEvents {
public static ModelLayerLocation GUARD = new ModelLayerLocation(
new ResourceLocation(GuardVillagers.MODID + "guard"), "guard");
ResourceLocation.parse(GuardVillagers.MODID + "guard"), "guard");
public static ModelLayerLocation GUARD_STEVE = new ModelLayerLocation(
new ResourceLocation(GuardVillagers.MODID + "guard_steve"), "guard_steve");
ResourceLocation.parse(GuardVillagers.MODID + "guard_steve"), "guard_steve");
public static ModelLayerLocation GUARD_ARMOR_OUTER = new ModelLayerLocation(
new ResourceLocation(GuardVillagers.MODID + "guard_armor_outer"), "guard_armor_outer");
ResourceLocation.parse(GuardVillagers.MODID + "guard_armor_outer"), "guard_armor_outer");
public static ModelLayerLocation GUARD_ARMOR_INNER = new ModelLayerLocation(
new ResourceLocation(GuardVillagers.MODID + "guard_armor_inner"), "guard_armor_inner");
ResourceLocation.parse(GuardVillagers.MODID + "guard_armor_inner"), "guard_armor_inner");

@SubscribeEvent
public static void layerDefinitions(EntityRenderersEvent.RegisterLayerDefinitions event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//@Mod.EventBusSubscriber(modid = GuardVillagers.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class GuardSounds {
public static final DeferredRegister<SoundEvent> SOUNDS = DeferredRegister.create(Registries.SOUND_EVENT, GuardVillagers.MODID);
public static final Holder<SoundEvent> GUARD_AMBIENT = SOUNDS.register("entity.guard.ambient", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(GuardVillagers.MODID, "entity.guard.ambient")));
public static final Holder<SoundEvent> GUARD_DEATH = SOUNDS.register("entity.guard.death", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(GuardVillagers.MODID, "entity.guard.death")));
public static final Holder<SoundEvent> GUARD_HURT = SOUNDS.register("entity.guard.hurt", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(GuardVillagers.MODID, "entity.guard.hurt")));
public static final Holder<SoundEvent> GUARD_AMBIENT = SOUNDS.register("entity.guard.ambient", () -> SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "entity.guard.ambient")));
public static final Holder<SoundEvent> GUARD_DEATH = SOUNDS.register("entity.guard.death", () -> SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "entity.guard.death")));
public static final Holder<SoundEvent> GUARD_HURT = SOUNDS.register("entity.guard.hurt", () -> SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "entity.guard.hurt")));
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import tallestegg.guardvillagers.networking.GuardSetPatrolPosPacket;

public class GuardInventoryScreen extends AbstractContainerScreen<GuardContainer> {
private static final ResourceLocation GUARD_GUI_TEXTURES = new ResourceLocation(GuardVillagers.MODID, "textures/container/inventory.png");
private static final WidgetSprites GUARD_FOLLOWING_ICONS = new WidgetSprites(new ResourceLocation(GuardVillagers.MODID, "following/following"), new ResourceLocation(GuardVillagers.MODID, "following/following_highlighted"));
private static final WidgetSprites GUARD_NOT_FOLLOWING_ICONS = new WidgetSprites(new ResourceLocation(GuardVillagers.MODID, "following/not_following"), new ResourceLocation(GuardVillagers.MODID, "following/not_following_highlighted"));
private static final WidgetSprites GUARD_PATROLLING_ICONS = new WidgetSprites(new ResourceLocation(GuardVillagers.MODID, "patrolling/patrolling1"), new ResourceLocation(GuardVillagers.MODID, "patrolling/patrolling2"));
private static final WidgetSprites GUARD_NOT_PATROLLING_ICONS = new WidgetSprites(new ResourceLocation(GuardVillagers.MODID, "patrolling/notpatrolling1"), new ResourceLocation(GuardVillagers.MODID, "patrolling/notpatrolling2"));
private static final ResourceLocation GUARD_GUI_TEXTURES = ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "textures/container/inventory.png");
private static final WidgetSprites GUARD_FOLLOWING_ICONS = new WidgetSprites(ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "following/following"), ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "following/following_highlighted"));
private static final WidgetSprites GUARD_NOT_FOLLOWING_ICONS = new WidgetSprites(ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "following/not_following"), ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "following/not_following_highlighted"));
private static final WidgetSprites GUARD_PATROLLING_ICONS = new WidgetSprites(ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "patrolling/patrolling1"), ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "patrolling/patrolling2"));
private static final WidgetSprites GUARD_NOT_PATROLLING_ICONS = new WidgetSprites(ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "patrolling/notpatrolling1"), ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID, "patrolling/notpatrolling2"));
private final Guard guard;
private Player player;
private float mousePosX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ protected void scale(Guard entitylivingbaseIn, PoseStack matrixStackIn, float pa
@Override
public ResourceLocation getTextureLocation(Guard entity) {
return !GuardConfig.CLIENT.GuardSteve.get()
? new ResourceLocation(GuardVillagers.MODID,
? ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID,
"textures/entity/guard/guard_" + entity.getGuardVariant() + ".png")
: new ResourceLocation(GuardVillagers.MODID,
: ResourceLocation.fromNamespaceAndPath(GuardVillagers.MODID,
"textures/entity/guard/guard_steve_" + entity.getGuardVariant() + ".png");
}
}
Loading

0 comments on commit c6360a0

Please sign in to comment.