diff --git a/.gitignore b/.gitignore index 2e425d6f..c91201e0 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ logs forge*changelog.txt .DS_Store src/generated/resources/.cache/ +old-src/ diff --git a/src/api/java/com/sweetrpg/catherder/api/impl/MissingColorMaterial.java b/src/api/java/com/sweetrpg/catherder/api/impl/MissingColorMaterial.java index 1578da13..c26db0ec 100644 --- a/src/api/java/com/sweetrpg/catherder/api/impl/MissingColorMaterial.java +++ b/src/api/java/com/sweetrpg/catherder/api/impl/MissingColorMaterial.java @@ -17,7 +17,7 @@ public ResourceLocation getTexture() { @Override public Component getTooltip() { - return Component.translatable("cattree.color.missing", "//TODO"); + return Component.translatable("cattree.color.missing"); } @Override diff --git a/src/api/java/com/sweetrpg/catherder/api/impl/MissingDyeMaterial.java b/src/api/java/com/sweetrpg/catherder/api/impl/MissingDyeMaterial.java index 5f68ce42..03a714b3 100644 --- a/src/api/java/com/sweetrpg/catherder/api/impl/MissingDyeMaterial.java +++ b/src/api/java/com/sweetrpg/catherder/api/impl/MissingDyeMaterial.java @@ -17,7 +17,7 @@ public ResourceLocation getTexture() { @Override public Component getTooltip() { - return Component.translatable("cattree.dye.missing", "//TODO"); + return Component.translatable("cattree.dye.missing"); } @Override diff --git a/src/api/java/com/sweetrpg/catherder/api/impl/MissingStructureMaterial.java b/src/api/java/com/sweetrpg/catherder/api/impl/MissingStructureMaterial.java index 426e9180..d55bddd1 100644 --- a/src/api/java/com/sweetrpg/catherder/api/impl/MissingStructureMaterial.java +++ b/src/api/java/com/sweetrpg/catherder/api/impl/MissingStructureMaterial.java @@ -17,7 +17,7 @@ public ResourceLocation getTexture() { @Override public Component getTooltip() { - return Component.translatable("structure.missing", "//TODO"); + return Component.translatable("structure.missing"); } @Override diff --git a/src/api/java/com/sweetrpg/catherder/api/inferface/AbstractCatEntity.java b/src/api/java/com/sweetrpg/catherder/api/inferface/AbstractCatEntity.java index 4c5abdb7..700cded1 100644 --- a/src/api/java/com/sweetrpg/catherder/api/inferface/AbstractCatEntity.java +++ b/src/api/java/com/sweetrpg/catherder/api/inferface/AbstractCatEntity.java @@ -16,6 +16,8 @@ import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.AttributeInstance; import net.minecraft.world.entity.TamableAnimal; +import net.minecraft.world.entity.ai.control.MoveControl; +import net.minecraft.world.entity.ai.navigation.PathNavigation; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -97,4 +99,49 @@ public Component getGenderTip() { public Component getGenderName() { return this.getTranslationKey(Gender::getUnlocalizedName); } + + public void setNavigation(PathNavigation p) { + if (this.navigation == p) return; + this.navigation.stop(); + this.navigation = p; + } + + //TODO try to replicate the bug and check if moveControl.haveWantedPosition using debug magic + public void setMoveControl(MoveControl m) { + breakMoveControl(); + + this.moveControl = m; + } + + public void breakMoveControl() { + /* + * Force the MoveControl To Reset : + * this will set the dog's wanted Position to his current Position + * which will cause the moveControl to halt movement and reset in the + * next tick(). + * And then immediately update the moveControl by calling tick() so + * that everything is resolved before anything else. + */ + this.moveControl.setWantedPosition( + this.getX(), + this.getY(), + this.getZ(), 1.0 + ); + this.moveControl.tick(); + + //Also reset jump just to be sure. + this.setJumping(false); + + //Also reset accelerations just to be sure. + this.setSpeed(0.0F); + this.setXxa(0.0F); + this.setYya(0.0F); + this.setZza(0.0F); + } + + public abstract void resetNavigation(); + + public abstract void resetMoveControl(); + + public abstract boolean canSwimUnderwater(); } diff --git a/src/api/java/com/sweetrpg/catherder/api/inferface/ICatAlteration.java b/src/api/java/com/sweetrpg/catherder/api/inferface/ICatAlteration.java index d56e6d59..57858edd 100644 --- a/src/api/java/com/sweetrpg/catherder/api/inferface/ICatAlteration.java +++ b/src/api/java/com/sweetrpg/catherder/api/inferface/ICatAlteration.java @@ -17,6 +17,7 @@ import net.minecraft.world.level.Level; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.fluids.FluidType; public interface ICatAlteration { @@ -69,7 +70,7 @@ default InteractionResult processInteract(AbstractCatEntity catIn, Level worldIn return InteractionResult.PASS; } - default InteractionResult canBeRiddenInWater(AbstractCatEntity catIn, Entity rider) { + default InteractionResult canBeRiddenInWater(AbstractCatEntity catIn) { return InteractionResult.PASS; } @@ -162,6 +163,18 @@ default InteractionResult onLivingFall(AbstractCatEntity catIn, float distance, return InteractionResult.PASS; } + default InteractionResult isBlockSafe(BlockState blockIn) { + return InteractionResult.PASS; + } + + default InteractionResult canSwimUnderwater(AbstractCatEntity catIn) { + return InteractionResult.PASS; + } + + default InteractionResult canResistPushFromFluidType(FluidType type) { + return InteractionResult.PASS; + } + default LazyOptional getCapability(AbstractCatEntity catIn, Capability cap, Direction side) { return null; } diff --git a/src/api/java/com/sweetrpg/catherder/api/registry/Accessory.java b/src/api/java/com/sweetrpg/catherder/api/registry/Accessory.java index 76befd8e..814b8221 100644 --- a/src/api/java/com/sweetrpg/catherder/api/registry/Accessory.java +++ b/src/api/java/com/sweetrpg/catherder/api/registry/Accessory.java @@ -83,6 +83,10 @@ public boolean of(T accessoryIn) { return this.of(accessoryIn); } + public boolean of(T accessoryDelegateIn) { + return accessoryDelegateIn.equals(this); + } + private ResourceLocation modelTexture; public T setModelTexture(ResourceLocation modelTextureIn) { diff --git a/src/api/java/com/sweetrpg/catherder/api/registry/AccessoryInstance.java b/src/api/java/com/sweetrpg/catherder/api/registry/AccessoryInstance.java index b2133c32..9d062235 100644 --- a/src/api/java/com/sweetrpg/catherder/api/registry/AccessoryInstance.java +++ b/src/api/java/com/sweetrpg/catherder/api/registry/AccessoryInstance.java @@ -18,22 +18,22 @@ public class AccessoryInstance { public static final Comparator RENDER_SORTER = Comparator.comparing(AccessoryInstance::getRenderIndex); @Deprecated // Do not call directly use AccessoryInstance#getAccessory - private final Accessory accessoryDelegate; + private final Accessory accessory; public AccessoryInstance(Accessory typeIn) { - this.accessoryDelegate = typeIn; + this.accessory = typeIn; } public Accessory getAccessory() { - return this.accessoryDelegate; + return this.accessory; } public boolean of(Supplier accessoryIn) { - return this.accessoryDelegate.of(accessoryIn); + return this.accessory.of(accessoryIn); } public boolean of(T accessoryIn) { - return this.accessoryDelegate.of(accessoryIn); + return this.accessory.of(accessoryIn); } public boolean ofType(Supplier accessoryTypeIn) { @@ -44,12 +44,12 @@ public boolean ofType(T accessoryTypeIn) { return this.ofType(accessoryTypeIn); } - public boolean ofType(ResourceLocation accessoryTypeDelegateIn) { - return CatHerderAPI.ACCESSORY_TYPE.get().getKey(this.accessoryDelegate.getType()).equals(accessoryTypeDelegateIn); + public boolean ofType(T accessoryTypeDelegateIn) { + return accessoryTypeDelegateIn.equals(this.accessory.getType()); } public AccessoryInstance copy() { - return new AccessoryInstance(this.accessoryDelegate); + return new AccessoryInstance(this.accessory); } public ItemStack getReturnItem() { @@ -61,7 +61,7 @@ public byte getRenderIndex() { } public final void writeInstance(CompoundTag compound) { - ResourceLocation rl = CatHerderAPI.ACCESSORIES.get().getKey(this.accessoryDelegate); + ResourceLocation rl = CatHerderAPI.ACCESSORIES.get().getKey(this.getAccessory()); if (rl != null) { compound.putString("type", rl.toString()); } diff --git a/src/api/java/com/sweetrpg/catherder/api/registry/AccessoryType.java b/src/api/java/com/sweetrpg/catherder/api/registry/AccessoryType.java index cb4fea18..f4608a28 100644 --- a/src/api/java/com/sweetrpg/catherder/api/registry/AccessoryType.java +++ b/src/api/java/com/sweetrpg/catherder/api/registry/AccessoryType.java @@ -1,10 +1,10 @@ package com.sweetrpg.catherder.api.registry; -import javax.annotation.Nullable; - import com.sweetrpg.catherder.api.CatHerderAPI; import net.minecraft.Util; +import javax.annotation.Nullable; + public class AccessoryType { @Nullable @@ -15,7 +15,7 @@ public int numberToPutOn() { } public String getTranslationKey() { - if (this.translationKey == null) { + if(this.translationKey == null) { this.translationKey = Util.makeDescriptionId("accessory_type", CatHerderAPI.ACCESSORY_TYPE.get().getKey(this)); } return this.translationKey; diff --git a/src/api/java/com/sweetrpg/catherder/api/registry/IColorMaterial.java b/src/api/java/com/sweetrpg/catherder/api/registry/IColorMaterial.java index aed3e8d9..8b7dab54 100644 --- a/src/api/java/com/sweetrpg/catherder/api/registry/IColorMaterial.java +++ b/src/api/java/com/sweetrpg/catherder/api/registry/IColorMaterial.java @@ -1,8 +1,8 @@ package com.sweetrpg.catherder.api.registry; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.resources.ResourceLocation; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.crafting.Ingredient; public abstract class IColorMaterial { diff --git a/src/api/java/com/sweetrpg/catherder/api/registry/TalentInstance.java b/src/api/java/com/sweetrpg/catherder/api/registry/TalentInstance.java index be09b162..51183dbd 100644 --- a/src/api/java/com/sweetrpg/catherder/api/registry/TalentInstance.java +++ b/src/api/java/com/sweetrpg/catherder/api/registry/TalentInstance.java @@ -12,21 +12,25 @@ public class TalentInstance implements ICatAlteration { - protected final Talent talentDelegate; + protected final Talent talent; protected int level; +// public TalentInstance(Talent talentIn, int levelIn) { +// this(talentIn, levelIn); +// } + public TalentInstance(Talent talentIn) { this(talentIn, 1); } - public TalentInstance(Talent talentDelegateIn, int levelIn) { - this.talentDelegate = talentDelegateIn; + public TalentInstance(Talent talent, int levelIn) { + this.talent = talent; this.level = levelIn; } public Talent getTalent() { - return this.talentDelegate; + return this.talent; } public final int level() { @@ -45,8 +49,12 @@ public boolean of(Talent talentIn) { return this.of(talentIn); } +// public boolean of(IRegistryDelegate talentDelegateIn) { +// return talentDelegateIn.equals(this.talentDelegate); +// } + public TalentInstance copy() { - return this.talentDelegate.getDefault(this.level); + return this.talent.getDefault(this.level); } public void writeToNBT(AbstractCatEntity catIn, CompoundTag compound) { @@ -66,7 +74,7 @@ public void readFromBuf(FriendlyByteBuf buf) { } public final void writeInstance(AbstractCatEntity catIn, CompoundTag compound) { - ResourceLocation rl = CatHerderAPI.TALENTS.get().getKey(this.talentDelegate); + ResourceLocation rl = CatHerderAPI.TALENTS.get().getKey(this.talent); if (rl != null) { compound.putString("type", rl.toString()); } @@ -97,7 +105,7 @@ public T cast(Class type) { @Override public String toString() { - return String.format("%s [talent: %s, level: %d]", this.getClass().getSimpleName(), CatHerderAPI.TALENTS.get().getKey(talentDelegate), this.level); + return String.format("%s [talent: %s, level: %d]", this.getClass().getSimpleName(), talent, this.level); } /** diff --git a/src/generated/resources/assets/catherder/blockstates/cheese_wheel.json b/src/generated/resources/assets/catherder/blockstates/cheese_wheel.json index 49e71422..5fface50 100644 --- a/src/generated/resources/assets/catherder/blockstates/cheese_wheel.json +++ b/src/generated/resources/assets/catherder/blockstates/cheese_wheel.json @@ -1,112 +1,112 @@ { "variants": { - "facing=east,servings=0": { + "facing=north,servings=0": { "model": "catherder:block/cheese_wheel_servings0" }, - "facing=east,servings=1": { - "model": "catherder:block/cheese_wheel_servings1" + "facing=south,servings=0": { + "model": "catherder:block/cheese_wheel_servings0" }, - "facing=east,servings=2": { - "model": "catherder:block/cheese_wheel_servings2" + "facing=west,servings=0": { + "model": "catherder:block/cheese_wheel_servings0" }, - "facing=east,servings=3": { - "model": "catherder:block/cheese_wheel_servings3" + "facing=east,servings=0": { + "model": "catherder:block/cheese_wheel_servings0" }, - "facing=east,servings=4": { - "model": "catherder:block/cheese_wheel_servings4" + "facing=north,servings=1": { + "model": "catherder:block/cheese_wheel_servings1" }, - "facing=east,servings=5": { - "model": "catherder:block/cheese_wheel_servings5" + "facing=south,servings=1": { + "model": "catherder:block/cheese_wheel_servings1" }, - "facing=east,servings=6": { - "model": "catherder:block/cheese_wheel_servings6" + "facing=west,servings=1": { + "model": "catherder:block/cheese_wheel_servings1" }, - "facing=east,servings=7": { - "model": "catherder:block/cheese_wheel_servings7" + "facing=east,servings=1": { + "model": "catherder:block/cheese_wheel_servings1" }, - "facing=east,servings=8": { - "model": "catherder:block/cheese_wheel_servings8" + "facing=north,servings=2": { + "model": "catherder:block/cheese_wheel_servings2" }, - "facing=north,servings=0": { - "model": "catherder:block/cheese_wheel_servings0" + "facing=south,servings=2": { + "model": "catherder:block/cheese_wheel_servings2" }, - "facing=north,servings=1": { - "model": "catherder:block/cheese_wheel_servings1" + "facing=west,servings=2": { + "model": "catherder:block/cheese_wheel_servings2" }, - "facing=north,servings=2": { + "facing=east,servings=2": { "model": "catherder:block/cheese_wheel_servings2" }, "facing=north,servings=3": { "model": "catherder:block/cheese_wheel_servings3" }, - "facing=north,servings=4": { - "model": "catherder:block/cheese_wheel_servings4" + "facing=south,servings=3": { + "model": "catherder:block/cheese_wheel_servings3" }, - "facing=north,servings=5": { - "model": "catherder:block/cheese_wheel_servings5" + "facing=west,servings=3": { + "model": "catherder:block/cheese_wheel_servings3" }, - "facing=north,servings=6": { - "model": "catherder:block/cheese_wheel_servings6" + "facing=east,servings=3": { + "model": "catherder:block/cheese_wheel_servings3" }, - "facing=north,servings=7": { - "model": "catherder:block/cheese_wheel_servings7" + "facing=north,servings=4": { + "model": "catherder:block/cheese_wheel_servings4" }, - "facing=north,servings=8": { - "model": "catherder:block/cheese_wheel_servings8" + "facing=south,servings=4": { + "model": "catherder:block/cheese_wheel_servings4" }, - "facing=south,servings=0": { - "model": "catherder:block/cheese_wheel_servings0" + "facing=west,servings=4": { + "model": "catherder:block/cheese_wheel_servings4" }, - "facing=south,servings=1": { - "model": "catherder:block/cheese_wheel_servings1" + "facing=east,servings=4": { + "model": "catherder:block/cheese_wheel_servings4" }, - "facing=south,servings=2": { - "model": "catherder:block/cheese_wheel_servings2" + "facing=north,servings=5": { + "model": "catherder:block/cheese_wheel_servings5" }, - "facing=south,servings=3": { - "model": "catherder:block/cheese_wheel_servings3" + "facing=south,servings=5": { + "model": "catherder:block/cheese_wheel_servings5" }, - "facing=south,servings=4": { - "model": "catherder:block/cheese_wheel_servings4" + "facing=west,servings=5": { + "model": "catherder:block/cheese_wheel_servings5" }, - "facing=south,servings=5": { + "facing=east,servings=5": { "model": "catherder:block/cheese_wheel_servings5" }, - "facing=south,servings=6": { + "facing=north,servings=6": { "model": "catherder:block/cheese_wheel_servings6" }, - "facing=south,servings=7": { - "model": "catherder:block/cheese_wheel_servings7" - }, - "facing=south,servings=8": { - "model": "catherder:block/cheese_wheel_servings8" + "facing=south,servings=6": { + "model": "catherder:block/cheese_wheel_servings6" }, - "facing=west,servings=0": { - "model": "catherder:block/cheese_wheel_servings0" + "facing=west,servings=6": { + "model": "catherder:block/cheese_wheel_servings6" }, - "facing=west,servings=1": { - "model": "catherder:block/cheese_wheel_servings1" + "facing=east,servings=6": { + "model": "catherder:block/cheese_wheel_servings6" }, - "facing=west,servings=2": { - "model": "catherder:block/cheese_wheel_servings2" + "facing=north,servings=7": { + "model": "catherder:block/cheese_wheel_servings7" }, - "facing=west,servings=3": { - "model": "catherder:block/cheese_wheel_servings3" + "facing=south,servings=7": { + "model": "catherder:block/cheese_wheel_servings7" }, - "facing=west,servings=4": { - "model": "catherder:block/cheese_wheel_servings4" + "facing=west,servings=7": { + "model": "catherder:block/cheese_wheel_servings7" }, - "facing=west,servings=5": { - "model": "catherder:block/cheese_wheel_servings5" + "facing=east,servings=7": { + "model": "catherder:block/cheese_wheel_servings7" }, - "facing=west,servings=6": { - "model": "catherder:block/cheese_wheel_servings6" + "facing=north,servings=8": { + "model": "catherder:block/cheese_wheel_servings8" }, - "facing=west,servings=7": { - "model": "catherder:block/cheese_wheel_servings7" + "facing=south,servings=8": { + "model": "catherder:block/cheese_wheel_servings8" }, "facing=west,servings=8": { "model": "catherder:block/cheese_wheel_servings8" + }, + "facing=east,servings=8": { + "model": "catherder:block/cheese_wheel_servings8" } } } \ No newline at end of file diff --git a/src/generated/resources/assets/catherder/lang/de_de.json b/src/generated/resources/assets/catherder/lang/de_de.json index 8fa7625f..d8024569 100644 --- a/src/generated/resources/assets/catherder/lang/de_de.json +++ b/src/generated/resources/assets/catherder/lang/de_de.json @@ -41,12 +41,12 @@ "block.catherder.cat_bath": "Katzenbad", "block.catherder.cat_bowl": "Katzennapf", "block.catherder.cat_tree": "Kratzbaum", - "block.catherder.cat_tree.owner": "Dieses Bett gehört %s.", - "block.catherder.cat_tree.set_owner_help": "Wenn Sie bei gedrückter Umschalttaste Ihre Katze in der Nähe haben, kommt sie und macht sich den Baum zu eigen. Wenn das Unvorstellbare passiert und sie sterben, klicken Sie mit der rechten Maustaste auf den Baum, um sie wiederzubeleben.", + "block.catherder.cat_tree.owner": "Dieses Bett geh\u00F6rt %s.", + "block.catherder.cat_tree.set_owner_help": "Wenn Sie bei gedr\u00FCckter Umschalttaste Ihre Katze in der N\u00E4he haben, kommt sie und macht sich den Baum zu eigen. Wenn das Unvorstellbare passiert und sie sterben, klicken Sie mit der rechten Maustaste auf den Baum, um sie wiederzubeleben.", "block.catherder.catnip": "Katzenminze", "block.catherder.litter_box": "Katzentoilette", "block.catherder.mouse_trap": "Mausefalle", - "block.catherder.pet_door": "Haustiertür", + "block.catherder.pet_door": "Haustiert\u00FCr", "block.catherder.wild_catnip": "Wildkatzenminze", "cat.gender.female": "Female", "cat.gender.female.indicator": "(F)", @@ -193,7 +193,6 @@ "item.catherder.yarn": "Ball of Yarn", "itemGroup.catherder": "Cat Herder", "itemGroup.catherder.cattree": "Cat Tree Variants", - "itemGroup.catherder.petdoor": "Pet Door Variants", "modgui.catherder.config.catsettings": "Cat Behaviour Settings", "modgui.catherder.config.catsettings.tooltip": "Change certain behaviours of cats.", "modgui.catherder.config.general": "General Settings", diff --git a/src/generated/resources/assets/catherder/lang/en_gb.json b/src/generated/resources/assets/catherder/lang/en_gb.json index 5983f120..a02c75c5 100644 --- a/src/generated/resources/assets/catherder/lang/en_gb.json +++ b/src/generated/resources/assets/catherder/lang/en_gb.json @@ -193,7 +193,6 @@ "item.catherder.yarn": "Ball of Yarn", "itemGroup.catherder": "Cat Herder", "itemGroup.catherder.cattree": "Cat Tree Variants", - "itemGroup.catherder.petdoor": "Pet Door Variants", "modgui.catherder.config.catsettings": "Cat Behaviour Settings", "modgui.catherder.config.catsettings.tooltip": "Change certain behaviours of cats.", "modgui.catherder.config.general": "General Settings", diff --git a/src/generated/resources/assets/catherder/lang/en_us.json b/src/generated/resources/assets/catherder/lang/en_us.json index e3345ebf..68764b29 100644 --- a/src/generated/resources/assets/catherder/lang/en_us.json +++ b/src/generated/resources/assets/catherder/lang/en_us.json @@ -197,7 +197,6 @@ "item.catherder.yarn": "Ball of Yarn", "itemGroup.catherder": "Cat Herder", "itemGroup.catherder.cattree": "Cat Tree Variants", - "itemGroup.catherder.petdoor": "Pet Door Variants", "modgui.catherder.config.catsettings": "Cat Behavior Settings", "modgui.catherder.config.catsettings.tooltip": "Change certain behaviors of cats.", "modgui.catherder.config.general": "General Settings", diff --git a/src/generated/resources/assets/catherder/lang/ko_kr.json b/src/generated/resources/assets/catherder/lang/ko_kr.json index 5983f120..a02c75c5 100644 --- a/src/generated/resources/assets/catherder/lang/ko_kr.json +++ b/src/generated/resources/assets/catherder/lang/ko_kr.json @@ -193,7 +193,6 @@ "item.catherder.yarn": "Ball of Yarn", "itemGroup.catherder": "Cat Herder", "itemGroup.catherder.cattree": "Cat Tree Variants", - "itemGroup.catherder.petdoor": "Pet Door Variants", "modgui.catherder.config.catsettings": "Cat Behaviour Settings", "modgui.catherder.config.catsettings.tooltip": "Change certain behaviours of cats.", "modgui.catherder.config.general": "General Settings", diff --git a/src/generated/resources/assets/catherder/lang/ru_ru.json b/src/generated/resources/assets/catherder/lang/ru_ru.json index 5983f120..a02c75c5 100644 --- a/src/generated/resources/assets/catherder/lang/ru_ru.json +++ b/src/generated/resources/assets/catherder/lang/ru_ru.json @@ -193,7 +193,6 @@ "item.catherder.yarn": "Ball of Yarn", "itemGroup.catherder": "Cat Herder", "itemGroup.catherder.cattree": "Cat Tree Variants", - "itemGroup.catherder.petdoor": "Pet Door Variants", "modgui.catherder.config.catsettings": "Cat Behaviour Settings", "modgui.catherder.config.catsettings.tooltip": "Change certain behaviours of cats.", "modgui.catherder.config.general": "General Settings", diff --git a/src/generated/resources/assets/catherder/lang/vi_vn.json b/src/generated/resources/assets/catherder/lang/vi_vn.json index 5983f120..a02c75c5 100644 --- a/src/generated/resources/assets/catherder/lang/vi_vn.json +++ b/src/generated/resources/assets/catherder/lang/vi_vn.json @@ -193,7 +193,6 @@ "item.catherder.yarn": "Ball of Yarn", "itemGroup.catherder": "Cat Herder", "itemGroup.catherder.cattree": "Cat Tree Variants", - "itemGroup.catherder.petdoor": "Pet Door Variants", "modgui.catherder.config.catsettings": "Cat Behaviour Settings", "modgui.catherder.config.catsettings.tooltip": "Change certain behaviours of cats.", "modgui.catherder.config.general": "General Settings", diff --git a/src/generated/resources/assets/catherder/lang/zh_cn.json b/src/generated/resources/assets/catherder/lang/zh_cn.json index 5983f120..a02c75c5 100644 --- a/src/generated/resources/assets/catherder/lang/zh_cn.json +++ b/src/generated/resources/assets/catherder/lang/zh_cn.json @@ -193,7 +193,6 @@ "item.catherder.yarn": "Ball of Yarn", "itemGroup.catherder": "Cat Herder", "itemGroup.catherder.cattree": "Cat Tree Variants", - "itemGroup.catherder.petdoor": "Pet Door Variants", "modgui.catherder.config.catsettings": "Cat Behaviour Settings", "modgui.catherder.config.catsettings.tooltip": "Change certain behaviours of cats.", "modgui.catherder.config.general": "General Settings", diff --git a/src/generated/resources/assets/catherder/lang/zh_tw.json b/src/generated/resources/assets/catherder/lang/zh_tw.json index 5983f120..a02c75c5 100644 --- a/src/generated/resources/assets/catherder/lang/zh_tw.json +++ b/src/generated/resources/assets/catherder/lang/zh_tw.json @@ -193,7 +193,6 @@ "item.catherder.yarn": "Ball of Yarn", "itemGroup.catherder": "Cat Herder", "itemGroup.catherder.cattree": "Cat Tree Variants", - "itemGroup.catherder.petdoor": "Pet Door Variants", "modgui.catherder.config.catsettings": "Cat Behaviour Settings", "modgui.catherder.config.catsettings.tooltip": "Change certain behaviours of cats.", "modgui.catherder.config.general": "General Settings", diff --git a/src/generated/resources/assets/catherder/models/item/creative_radar.json b/src/generated/resources/assets/catherder/models/item/creative_radar.json index 9d61a22f..2be0538d 100644 --- a/src/generated/resources/assets/catherder/models/item/creative_radar.json +++ b/src/generated/resources/assets/catherder/models/item/creative_radar.json @@ -1,28 +1,21 @@ { "parent": "minecraft:item/generated", "display": { - "firstperson_lefthand": { - "scale": [ - 0.8, - 0.8, - 0.8 + "thirdperson_righthand": { + "rotation": [ + 0, + 0, + 55 ], "translation": [ - -3.13, - 3.2, - 1.13 - ] - }, - "firstperson_righthand": { - "scale": [ - 0.8, - 0.8, - 0.8 + 0, + 4, + 0.5 ], - "translation": [ - -3.13, - 3.2, - 1.13 + "scale": [ + 0.85, + 0.85, + 0.85 ] }, "thirdperson_lefthand": { @@ -31,32 +24,39 @@ 0, -55 ], - "scale": [ - 0.85, - 0.85, - 0.85 - ], "translation": [ 0, 4, 0.5 - ] - }, - "thirdperson_righthand": { - "rotation": [ - 0, - 0, - 55 ], "scale": [ 0.85, 0.85, 0.85 + ] + }, + "firstperson_righthand": { + "translation": [ + -3.13, + 3.2, + 1.13 ], + "scale": [ + 0.8, + 0.8, + 0.8 + ] + }, + "firstperson_lefthand": { "translation": [ - 0, - 4, - 0.5 + -3.13, + 3.2, + 1.13 + ], + "scale": [ + 0.8, + 0.8, + 0.8 ] } }, diff --git a/src/generated/resources/assets/catherder/models/item/radar.json b/src/generated/resources/assets/catherder/models/item/radar.json index ce90d919..b7960d93 100644 --- a/src/generated/resources/assets/catherder/models/item/radar.json +++ b/src/generated/resources/assets/catherder/models/item/radar.json @@ -1,28 +1,21 @@ { "parent": "minecraft:item/generated", "display": { - "firstperson_lefthand": { - "scale": [ - 0.8, - 0.8, - 0.8 + "thirdperson_righthand": { + "rotation": [ + 0, + 0, + 55 ], "translation": [ - -3.13, - 3.2, - 1.13 - ] - }, - "firstperson_righthand": { - "scale": [ - 0.8, - 0.8, - 0.8 + 0, + 4, + 0.5 ], - "translation": [ - -3.13, - 3.2, - 1.13 + "scale": [ + 0.85, + 0.85, + 0.85 ] }, "thirdperson_lefthand": { @@ -31,32 +24,39 @@ 0, -55 ], - "scale": [ - 0.85, - 0.85, - 0.85 - ], "translation": [ 0, 4, 0.5 - ] - }, - "thirdperson_righthand": { - "rotation": [ - 0, - 0, - 55 ], "scale": [ 0.85, 0.85, 0.85 + ] + }, + "firstperson_righthand": { + "translation": [ + -3.13, + 3.2, + 1.13 ], + "scale": [ + 0.8, + 0.8, + 0.8 + ] + }, + "firstperson_lefthand": { "translation": [ - 0, - 4, - 0.5 + -3.13, + 3.2, + 1.13 + ], + "scale": [ + 0.8, + 0.8, + 0.8 ] } }, diff --git a/src/generated/resources/data/catherder/advancements/main/cat_tree.json b/src/generated/resources/data/catherder/advancements/main/cat_tree.json index fb3da648..ff2a4820 100644 --- a/src/generated/resources/data/catherder/advancements/main/cat_tree.json +++ b/src/generated/resources/data/catherder/advancements/main/cat_tree.json @@ -1,27 +1,27 @@ { "parent": "catherder:main/tame_cat", - "criteria": { - "cat_tree": { - "conditions": { - "block": "catherder:cat_tree" - }, - "trigger": "minecraft:placed_block" - } - }, "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.cat_tree.description" - }, - "frame": "task", - "hidden": false, "icon": { "item": "catherder:cat_tree", - "nbt": "{catherder:{colorId:\"minecraft:black_wool\"}}" + "nbt": "{catherder:{colorId:\"minecraft:lime_wool\"}}" }, - "show_toast": true, "title": { "translate": "advancements.catherder.main.cat_tree.title" + }, + "description": { + "translate": "advancements.catherder.main.cat_tree.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "cat_tree": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "catherder:cat_tree" + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/change_owner.json b/src/generated/resources/data/catherder/advancements/main/change_owner.json index 99385288..e165cbef 100644 --- a/src/generated/resources/data/catherder/advancements/main/change_owner.json +++ b/src/generated/resources/data/catherder/advancements/main/change_owner.json @@ -1,39 +1,39 @@ { "parent": "catherder:main/tame_cat", + "display": { + "icon": { + "item": "catherder:owner_change" + }, + "title": { + "translate": "advancements.catherder.main.change_owner.title" + }, + "description": { + "translate": "advancements.catherder.main.change_owner.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, "criteria": { "change_owner": { + "trigger": "minecraft:using_item", "conditions": { - "item": { - "items": [ - "catherder:owner_change" - ] - }, "player": [ { "condition": "minecraft:entity_properties", - "entity": "this", "predicate": { "type": "catherder:cat" - } + }, + "entity": "this" } - ] - }, - "trigger": "minecraft:using_item" - } - }, - "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.change_owner.description" - }, - "frame": "task", - "hidden": false, - "icon": { - "item": "catherder:owner_change" - }, - "show_toast": true, - "title": { - "translate": "advancements.catherder.main.change_owner.title" + ], + "item": { + "items": [ + "catherder:owner_change" + ] + } + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/clean_litterbox.json b/src/generated/resources/data/catherder/advancements/main/clean_litterbox.json index e6a6bdc7..0b48e084 100644 --- a/src/generated/resources/data/catherder/advancements/main/clean_litterbox.json +++ b/src/generated/resources/data/catherder/advancements/main/clean_litterbox.json @@ -1,38 +1,40 @@ { "parent": "catherder:main/place_litterbox", + "display": { + "icon": { + "item": "catherder:litter_scoop", + "nbt": "{Damage:0}" + }, + "title": { + "translate": "advancements.catherder.main.clean_litterbox.title" + }, + "description": { + "translate": "advancements.catherder.main.clean_litterbox.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, "criteria": { "clean_litterbox": { + "trigger": "minecraft:using_item", "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "predicate": { + "catType": "catherder:litter_box" + }, + "entity": "this" + } + ], "item": { "items": [ "catherder:litter_scoop" ] - }, - "location": { - "block": { - "blocks": [ - "catherder:litter_box" - ] - } } - }, - "trigger": "minecraft:item_used_on_block" - } - }, - "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.clean_litterbox.description" - }, - "frame": "task", - "hidden": false, - "icon": { - "item": "catherder:litter_scoop", - "nbt": "{Damage:0}" - }, - "show_toast": true, - "title": { - "translate": "advancements.catherder.main.clean_litterbox.title" + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/craft_pet_door.json b/src/generated/resources/data/catherder/advancements/main/craft_pet_door.json index 1e43ff49..8d56e407 100644 --- a/src/generated/resources/data/catherder/advancements/main/craft_pet_door.json +++ b/src/generated/resources/data/catherder/advancements/main/craft_pet_door.json @@ -1,7 +1,24 @@ { "parent": "catherder:main/tame_cat", + "display": { + "icon": { + "item": "catherder:pet_door", + "nbt": "{catherder:{structureId:\"minecraft:birch_planks\"}}" + }, + "title": { + "translate": "advancements.catherder.main.craft_pet_door.title" + }, + "description": { + "translate": "advancements.catherder.main.craft_pet_door.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, "criteria": { "craft_pet_door": { + "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { @@ -10,24 +27,7 @@ ] } ] - }, - "trigger": "minecraft:inventory_changed" - } - }, - "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.craft_pet_door.description" - }, - "frame": "task", - "hidden": false, - "icon": { - "item": "catherder:pet_door", - "nbt": "{catherder:{structureId:\"minecraft:warped_planks\"}}" - }, - "show_toast": true, - "title": { - "translate": "advancements.catherder.main.craft_pet_door.title" + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/find_catnip.json b/src/generated/resources/data/catherder/advancements/main/find_catnip.json index 2de4e03b..91d6e763 100644 --- a/src/generated/resources/data/catherder/advancements/main/find_catnip.json +++ b/src/generated/resources/data/catherder/advancements/main/find_catnip.json @@ -1,25 +1,25 @@ { - "criteria": { - "find_catnip": { - "conditions": { - "block": "catherder:wild_catnip" - }, - "trigger": "minecraft:enter_block" - } - }, "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.find_catnip.description" - }, - "frame": "task", - "hidden": false, "icon": { "item": "catherder:wild_catnip" }, - "show_toast": true, "title": { "translate": "advancements.catherder.main.find_catnip.title" + }, + "description": { + "translate": "advancements.catherder.main.find_catnip.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "find_catnip": { + "trigger": "minecraft:enter_block", + "conditions": { + "block": "catherder:wild_catnip" + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/give_catnip.json b/src/generated/resources/data/catherder/advancements/main/give_catnip.json index 634ee6b5..7636ef95 100644 --- a/src/generated/resources/data/catherder/advancements/main/give_catnip.json +++ b/src/generated/resources/data/catherder/advancements/main/give_catnip.json @@ -1,39 +1,39 @@ { "parent": "catherder:main/tame_cat", + "display": { + "icon": { + "item": "catherder:catnip" + }, + "title": { + "translate": "advancements.catherder.main.give_catnip.title" + }, + "description": { + "translate": "advancements.catherder.main.give_catnip.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, "criteria": { "give_catnip": { + "trigger": "minecraft:using_item", "conditions": { - "item": { - "items": [ - "catherder:catnip" - ] - }, "player": [ { "condition": "minecraft:entity_properties", - "entity": "this", "predicate": { "type": "catherder:cat" - } + }, + "entity": "this" } - ] - }, - "trigger": "minecraft:using_item" - } - }, - "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.give_catnip.description" - }, - "frame": "task", - "hidden": false, - "icon": { - "item": "catherder:catnip" - }, - "show_toast": true, - "title": { - "translate": "advancements.catherder.main.give_catnip.title" + ], + "item": { + "items": [ + "catherder:catnip" + ] + } + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/place_cardboard_box.json b/src/generated/resources/data/catherder/advancements/main/place_cardboard_box.json index 6aa8ebc9..12e36a89 100644 --- a/src/generated/resources/data/catherder/advancements/main/place_cardboard_box.json +++ b/src/generated/resources/data/catherder/advancements/main/place_cardboard_box.json @@ -1,26 +1,26 @@ { "parent": "catherder:main/tame_cat", - "criteria": { - "place_cardboard_box": { - "conditions": { - "block": "catherder:cardboard_box" - }, - "trigger": "minecraft:placed_block" - } - }, "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.place_cardboard_box.description" - }, - "frame": "task", - "hidden": false, "icon": { "item": "catherder:cardboard_box" }, - "show_toast": true, "title": { "translate": "advancements.catherder.main.place_cardboard_box.title" + }, + "description": { + "translate": "advancements.catherder.main.place_cardboard_box.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "place_cardboard_box": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "catherder:cardboard_box" + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/place_litterbox.json b/src/generated/resources/data/catherder/advancements/main/place_litterbox.json index 9512b814..267e6d59 100644 --- a/src/generated/resources/data/catherder/advancements/main/place_litterbox.json +++ b/src/generated/resources/data/catherder/advancements/main/place_litterbox.json @@ -1,26 +1,26 @@ { "parent": "catherder:main/tame_cat", - "criteria": { - "place_litterbox": { - "conditions": { - "block": "catherder:litter_box" - }, - "trigger": "minecraft:placed_block" - } - }, "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.place_litterbox.description" - }, - "frame": "task", - "hidden": false, "icon": { "item": "catherder:litter_box" }, - "show_toast": true, "title": { "translate": "advancements.catherder.main.place_litterbox.title" + }, + "description": { + "translate": "advancements.catherder.main.place_litterbox.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "place_litterbox": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "catherder:litter_box" + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/place_mousetrap.json b/src/generated/resources/data/catherder/advancements/main/place_mousetrap.json index 1f211494..9d72d8c5 100644 --- a/src/generated/resources/data/catherder/advancements/main/place_mousetrap.json +++ b/src/generated/resources/data/catherder/advancements/main/place_mousetrap.json @@ -1,26 +1,26 @@ { "parent": "catherder:main/tame_cat", - "criteria": { - "place_mousetrap": { - "conditions": { - "block": "catherder:mouse_trap" - }, - "trigger": "minecraft:placed_block" - } - }, "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.place_mousetrap.description" - }, - "frame": "task", - "hidden": false, "icon": { "item": "catherder:mouse_trap" }, - "show_toast": true, "title": { "translate": "advancements.catherder.main.place_mousetrap.title" + }, + "description": { + "translate": "advancements.catherder.main.place_mousetrap.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "place_mousetrap": { + "trigger": "minecraft:placed_block", + "conditions": { + "block": "catherder:mouse_trap" + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/play_with_cat.json b/src/generated/resources/data/catherder/advancements/main/play_with_cat.json index d955a517..4a36a3a1 100644 --- a/src/generated/resources/data/catherder/advancements/main/play_with_cat.json +++ b/src/generated/resources/data/catherder/advancements/main/play_with_cat.json @@ -1,37 +1,37 @@ { "parent": "catherder:main/tame_cat", + "display": { + "icon": { + "item": "catherder:cat_toy" + }, + "title": { + "translate": "advancements.catherder.main.toy.title" + }, + "description": { + "translate": "advancements.catherder.main.toy.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, "criteria": { "play_with_cat": { + "trigger": "minecraft:thrown_item_picked_up_by_entity", "conditions": { + "item": { + "tag": "catherder:toys" + }, "entity": [ { "condition": "minecraft:entity_properties", - "entity": "this", "predicate": { "type": "catherder:cat" - } + }, + "entity": "this" } - ], - "item": { - "tag": "catherder:toys" - } - }, - "trigger": "minecraft:thrown_item_picked_up_by_entity" - } - }, - "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.toy.description" - }, - "frame": "task", - "hidden": false, - "icon": { - "item": "catherder:cat_toy" - }, - "show_toast": true, - "title": { - "translate": "advancements.catherder.main.toy.title" + ] + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/radio_collar.json b/src/generated/resources/data/catherder/advancements/main/radio_collar.json index 142020ea..24e1b4d8 100644 --- a/src/generated/resources/data/catherder/advancements/main/radio_collar.json +++ b/src/generated/resources/data/catherder/advancements/main/radio_collar.json @@ -1,39 +1,39 @@ { "parent": "catherder:main/tame_cat", + "display": { + "icon": { + "item": "catherder:radio_collar" + }, + "title": { + "translate": "advancements.catherder.main.radio_collar.title" + }, + "description": { + "translate": "advancements.catherder.main.radio_collar.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, "criteria": { "radio_collar": { + "trigger": "minecraft:using_item", "conditions": { - "item": { - "items": [ - "catherder:radio_collar" - ] - }, "player": [ { "condition": "minecraft:entity_properties", - "entity": "this", "predicate": { "type": "catherder:cat" - } + }, + "entity": "this" } - ] - }, - "trigger": "minecraft:using_item" - } - }, - "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.radio_collar.description" - }, - "frame": "task", - "hidden": false, - "icon": { - "item": "catherder:radio_collar" - }, - "show_toast": true, - "title": { - "translate": "advancements.catherder.main.radio_collar.title" + ], + "item": { + "items": [ + "catherder:radio_collar" + ] + } + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/sunglasses.json b/src/generated/resources/data/catherder/advancements/main/sunglasses.json index 25cdb621..016dc55a 100644 --- a/src/generated/resources/data/catherder/advancements/main/sunglasses.json +++ b/src/generated/resources/data/catherder/advancements/main/sunglasses.json @@ -1,39 +1,39 @@ { "parent": "catherder:main/tame_cat", + "display": { + "icon": { + "item": "catherder:sunglasses" + }, + "title": { + "translate": "advancements.catherder.main.sunglasses.title" + }, + "description": { + "translate": "advancements.catherder.main.sunglasses.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, "criteria": { "sunglasses": { + "trigger": "minecraft:using_item", "conditions": { - "item": { - "items": [ - "catherder:sunglasses" - ] - }, "player": [ { "condition": "minecraft:entity_properties", - "entity": "this", "predicate": { "type": "catherder:cat" - } + }, + "entity": "this" } - ] - }, - "trigger": "minecraft:using_item" - } - }, - "display": { - "announce_to_chat": true, - "description": { - "translate": "advancements.catherder.main.sunglasses.description" - }, - "frame": "task", - "hidden": false, - "icon": { - "item": "catherder:sunglasses" - }, - "show_toast": true, - "title": { - "translate": "advancements.catherder.main.sunglasses.title" + ], + "item": { + "items": [ + "catherder:sunglasses" + ] + } + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/main/tame_cat.json b/src/generated/resources/data/catherder/advancements/main/tame_cat.json index c83bc5df..05a409ee 100644 --- a/src/generated/resources/data/catherder/advancements/main/tame_cat.json +++ b/src/generated/resources/data/catherder/advancements/main/tame_cat.json @@ -1,34 +1,34 @@ { + "display": { + "icon": { + "item": "catherder:training_treat" + }, + "title": { + "translate": "advancements.catherder.main.train_cat.title" + }, + "description": { + "translate": "advancements.catherder.main.train_cat.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false, + "background": "minecraft:textures/gui/advancements/backgrounds/stone.png" + }, "criteria": { "tame_cat": { + "trigger": "minecraft:tame_animal", "conditions": { "entity": [ { "condition": "minecraft:entity_properties", - "entity": "this", "predicate": { "type": "catherder:cat" - } + }, + "entity": "this" } ] - }, - "trigger": "minecraft:tame_animal" - } - }, - "display": { - "announce_to_chat": true, - "background": "minecraft:textures/gui/advancements/backgrounds/stone.png", - "description": { - "translate": "advancements.catherder.main.train_cat.description" - }, - "frame": "task", - "hidden": false, - "icon": { - "item": "catherder:training_treat" - }, - "show_toast": true, - "title": { - "translate": "advancements.catherder.main.train_cat.title" + } } }, "requirements": [ diff --git a/src/generated/resources/data/catherder/advancements/recipes/decorations/cape.json b/src/generated/resources/data/catherder/advancements/recipes/decorations/cape.json deleted file mode 100644 index de9a979b..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/decorations/cape.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_leather": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:leather" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:cape" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_leather", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:cape" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/decorations/cardboard_box.json b/src/generated/resources/data/catherder/advancements/recipes/decorations/cardboard_box.json deleted file mode 100644 index 9141cfe4..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/decorations/cardboard_box.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_cardboard": { - "conditions": { - "items": [ - { - "items": [ - "catherder:cardboard" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:cardboard_box" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_cardboard", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:cardboard_box" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/decorations/cat_bowl.json b/src/generated/resources/data/catherder/advancements/recipes/decorations/cat_bowl.json deleted file mode 100644 index dbf96e79..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/decorations/cat_bowl.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_fishes": { - "conditions": { - "items": [ - { - "tag": "minecraft:fishes" - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_iron_ingot": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:iron_ingot" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:cat_bowl" - }, - "trigger": "minecraft:recipe_unlocked" - }, - "has_water": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:water_bucket" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - } - }, - "requirements": [ - [ - "has_iron_ingot", - "has_fishes", - "has_water", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:cat_bowl" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/decorations/litter_box.json b/src/generated/resources/data/catherder/advancements/recipes/decorations/litter_box.json deleted file mode 100644 index 50f53486..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/decorations/litter_box.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:iron_ingot" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_sand": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:sand" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:litter_box" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_sand", - "has_iron", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:litter_box" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/decorations/mouse_trap.json b/src/generated/resources/data/catherder/advancements/recipes/decorations/mouse_trap.json deleted file mode 100644 index f64d61ff..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/decorations/mouse_trap.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_cheese": { - "conditions": { - "items": [ - { - "items": [ - "catherder:cheese_wedge" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:iron_ingot" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_planks": { - "conditions": { - "items": [ - { - "tag": "minecraft:planks" - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:mouse_trap" - }, - "trigger": "minecraft:recipe_unlocked" - }, - "has_tripwire_hook": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:tripwire_hook" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - } - }, - "requirements": [ - [ - "has_cheese", - "has_iron", - "has_tripwire_hook", - "has_planks", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:mouse_trap" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/decorations/multicolored_collar.json b/src/generated/resources/data/catherder/advancements/recipes/decorations/multicolored_collar.json deleted file mode 100644 index a5e05c29..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/decorations/multicolored_collar.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_the_recipe": { - "conditions": { - "recipe": "catherder:multicolored_collar" - }, - "trigger": "minecraft:recipe_unlocked" - }, - "has_wool_collar": { - "conditions": { - "items": [ - { - "items": [ - "catherder:wool_collar" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - } - }, - "requirements": [ - [ - "has_wool_collar", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:multicolored_collar" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/decorations/radio_collar.json b/src/generated/resources/data/catherder/advancements/recipes/decorations/radio_collar.json deleted file mode 100644 index ee85d196..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/decorations/radio_collar.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_redstone": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:redstone" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:radio_collar" - }, - "trigger": "minecraft:recipe_unlocked" - }, - "has_wool_collar": { - "conditions": { - "items": [ - { - "items": [ - "catherder:wool_collar" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - } - }, - "requirements": [ - [ - "has_redstone", - "has_wool_collar", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:radio_collar" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/decorations/spotted_collar.json b/src/generated/resources/data/catherder/advancements/recipes/decorations/spotted_collar.json deleted file mode 100644 index fdd477ec..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/decorations/spotted_collar.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_the_recipe": { - "conditions": { - "recipe": "catherder:spotted_collar" - }, - "trigger": "minecraft:recipe_unlocked" - }, - "has_wool_collar": { - "conditions": { - "items": [ - { - "items": [ - "catherder:wool_collar" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - } - }, - "requirements": [ - [ - "has_wool_collar", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:spotted_collar" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/decorations/spotted_collar_alt.json b/src/generated/resources/data/catherder/advancements/recipes/decorations/spotted_collar_alt.json deleted file mode 100644 index 248d6785..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/decorations/spotted_collar_alt.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_the_recipe": { - "conditions": { - "recipe": "catherder:spotted_collar_alt" - }, - "trigger": "minecraft:recipe_unlocked" - }, - "has_wool_collar": { - "conditions": { - "items": [ - { - "items": [ - "catherder:wool_collar" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - } - }, - "requirements": [ - [ - "has_wool_collar", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:spotted_collar_alt" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/decorations/sunglasses.json b/src/generated/resources/data/catherder/advancements/recipes/decorations/sunglasses.json deleted file mode 100644 index 67942dd5..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/decorations/sunglasses.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_stick": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:stick" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_string": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:string" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:sunglasses" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_string", - "has_stick", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:sunglasses" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/decorations/wool_collar.json b/src/generated/resources/data/catherder/advancements/recipes/decorations/wool_collar.json deleted file mode 100644 index c670e521..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/decorations/wool_collar.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_stick": { - "conditions": { - "items": [ - { - "tag": "minecraft:wool" - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:wool_collar" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_stick", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:wool_collar" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/food/cheese_wheel.json b/src/generated/resources/data/catherder/advancements/recipes/food/cheese_wheel.json deleted file mode 100644 index bb3bac1b..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/food/cheese_wheel.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_bowl": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:bowl" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_milk": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:milk_bucket" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_slime": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:slime_ball" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:cheese_wheel" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_milk", - "has_slime", - "has_bowl", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:cheese_wheel" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/misc/big_catsizer.json b/src/generated/resources/data/catherder/advancements/recipes/misc/big_catsizer.json deleted file mode 100644 index 0853b978..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/misc/big_catsizer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_cake": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:cake" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_mushroom": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:red_mushroom" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:big_catsizer" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_mushroom", - "has_cake", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:big_catsizer" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/misc/breeding_treat.json b/src/generated/resources/data/catherder/advancements/recipes/misc/breeding_treat.json deleted file mode 100644 index b1e0f42f..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/misc/breeding_treat.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_cooked_porkchop": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:cooked_porkchop" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:breeding_treat" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_cooked_porkchop", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:breeding_treat" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/misc/cardboard.json b/src/generated/resources/data/catherder/advancements/recipes/misc/cardboard.json deleted file mode 100644 index 612724bb..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/misc/cardboard.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_paper": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:paper" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:cardboard" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_paper", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:cardboard" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/misc/cat_toy.json b/src/generated/resources/data/catherder/advancements/recipes/misc/cat_toy.json deleted file mode 100644 index 42a2d9bd..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/misc/cat_toy.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_catnip": { - "conditions": { - "items": [ - { - "items": [ - "catherder:catnip" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_sugar": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:sugar" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:cat_toy" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_sugar", - "has_catnip", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:cat_toy" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/misc/master_treat.json b/src/generated/resources/data/catherder/advancements/recipes/misc/master_treat.json deleted file mode 100644 index 959a3bb4..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/misc/master_treat.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_master_treat": { - "conditions": { - "items": [ - { - "items": [ - "catherder:super_treat" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:master_treat" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_master_treat", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:master_treat" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/misc/small_catsizer.json b/src/generated/resources/data/catherder/advancements/recipes/misc/small_catsizer.json deleted file mode 100644 index 03f67b89..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/misc/small_catsizer.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_mushroom": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:brown_mushroom" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_potion": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:potion" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:small_catsizer" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_potion", - "has_mushroom", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:small_catsizer" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/misc/super_treat.json b/src/generated/resources/data/catherder/advancements/recipes/misc/super_treat.json deleted file mode 100644 index 28b2009a..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/misc/super_treat.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_golden_apple": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:golden_apple" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:super_treat" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_golden_apple", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:super_treat" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/misc/training_treat.json b/src/generated/resources/data/catherder/advancements/recipes/misc/training_treat.json deleted file mode 100644 index 7d25a83d..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/misc/training_treat.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_catnip": { - "conditions": { - "items": [ - { - "items": [ - "catherder:catnip" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:training_treat" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_catnip", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:training_treat" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/misc/treat_bag.json b/src/generated/resources/data/catherder/advancements/recipes/misc/treat_bag.json deleted file mode 100644 index 7930ed5c..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/misc/treat_bag.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_leather": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:leather" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:treat_bag" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_leather", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:treat_bag" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/misc/wild_treat.json b/src/generated/resources/data/catherder/advancements/recipes/misc/wild_treat.json deleted file mode 100644 index 230c4be8..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/misc/wild_treat.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_master_treat": { - "conditions": { - "items": [ - { - "items": [ - "catherder:master_treat" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:wild_treat" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_master_treat", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:wild_treat" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/misc/yarn.json b/src/generated/resources/data/catherder/advancements/recipes/misc/yarn.json deleted file mode 100644 index f0f33b19..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/misc/yarn.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_the_recipe": { - "conditions": { - "recipe": "catherder:yarn" - }, - "trigger": "minecraft:recipe_unlocked" - }, - "has_wool": { - "conditions": { - "items": [ - { - "tag": "minecraft:wool" - } - ] - }, - "trigger": "minecraft:inventory_changed" - } - }, - "requirements": [ - [ - "has_wool", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:yarn" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/tools/collar_shears.json b/src/generated/resources/data/catherder/advancements/recipes/tools/collar_shears.json deleted file mode 100644 index aa1dab88..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/tools/collar_shears.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_shears": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:shears" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:collar_shears" - }, - "trigger": "minecraft:recipe_unlocked" - }, - "has_yarn": { - "conditions": { - "items": [ - { - "items": [ - "catherder:yarn" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - } - }, - "requirements": [ - [ - "has_shears", - "has_yarn", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:collar_shears" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/tools/litter_scoop.json b/src/generated/resources/data/catherder/advancements/recipes/tools/litter_scoop.json deleted file mode 100644 index b6bd7bcd..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/tools/litter_scoop.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_copper": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:sand" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_iron_bars": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:iron_bars" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:litter_scoop" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_copper", - "has_iron_bars", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:litter_scoop" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/advancements/recipes/tools/radar.json b/src/generated/resources/data/catherder/advancements/recipes/tools/radar.json deleted file mode 100644 index 017f055d..00000000 --- a/src/generated/resources/data/catherder/advancements/recipes/tools/radar.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_redstone": { - "conditions": { - "items": [ - { - "items": [ - "minecraft:redstone" - ] - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "catherder:radar" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_redstone", - "has_the_recipe" - ] - ], - "rewards": { - "recipes": [ - "catherder:radar" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/loot_tables/blocks/cardboard_box.json b/src/generated/resources/data/catherder/loot_tables/blocks/cardboard_box.json index d76c1d19..4edf62be 100644 --- a/src/generated/resources/data/catherder/loot_tables/blocks/cardboard_box.json +++ b/src/generated/resources/data/catherder/loot_tables/blocks/cardboard_box.json @@ -2,19 +2,19 @@ "type": "minecraft:block", "pools": [ { + "rolls": 1.0, "bonus_rolls": 0.0, - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ], "entries": [ { "type": "minecraft:item", "name": "catherder:cardboard_box" } ], - "rolls": 1.0 + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] } ] } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/loot_tables/blocks/cat_bowl.json b/src/generated/resources/data/catherder/loot_tables/blocks/cat_bowl.json index 3fc68f1a..1601961c 100644 --- a/src/generated/resources/data/catherder/loot_tables/blocks/cat_bowl.json +++ b/src/generated/resources/data/catherder/loot_tables/blocks/cat_bowl.json @@ -2,19 +2,19 @@ "type": "minecraft:block", "pools": [ { + "rolls": 1.0, "bonus_rolls": 0.0, - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ], "entries": [ { "type": "minecraft:item", "name": "catherder:cat_bowl" } ], - "rolls": 1.0 + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] } ] } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/loot_tables/blocks/cat_tree.json b/src/generated/resources/data/catherder/loot_tables/blocks/cat_tree.json index 4f415a3a..471cd4f7 100644 --- a/src/generated/resources/data/catherder/loot_tables/blocks/cat_tree.json +++ b/src/generated/resources/data/catherder/loot_tables/blocks/cat_tree.json @@ -2,47 +2,47 @@ "type": "minecraft:block", "pools": [ { + "rolls": 1.0, "bonus_rolls": 0.0, - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ], "entries": [ { "type": "minecraft:item", "functions": [ { "function": "minecraft:copy_nbt", + "source": "block_entity", "ops": [ { - "op": "replace", "source": "colorId", - "target": "catherder.colorId" + "target": "catherder.colorId", + "op": "replace" }, { - "op": "replace", "source": "ownerId", - "target": "catherder.ownerId" + "target": "catherder.ownerId", + "op": "replace" }, { - "op": "replace", "source": "name", - "target": "catherder.name" + "target": "catherder.name", + "op": "replace" }, { - "op": "replace", "source": "ownerName", - "target": "catherder.ownerName" + "target": "catherder.ownerName", + "op": "replace" } - ], - "source": "block_entity" + ] } ], "name": "catherder:cat_tree" } ], - "rolls": 1.0 + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] } ] } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/loot_tables/blocks/catnip.json b/src/generated/resources/data/catherder/loot_tables/blocks/catnip.json deleted file mode 100644 index e813c61c..00000000 --- a/src/generated/resources/data/catherder/loot_tables/blocks/catnip.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "type": "minecraft:block", - "functions": [ - { - "function": "minecraft:explosion_decay" - } - ], - "pools": [ - { - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "conditions": [ - { - "block": "catherder:catnip", - "condition": "minecraft:block_state_property", - "properties": { - "age": "5" - } - } - ], - "name": "catherder:catnip" - }, - { - "type": "minecraft:item", - "name": "catherder:catnip_seeds" - } - ] - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "conditions": [ - { - "block": "catherder:catnip", - "condition": "minecraft:block_state_property", - "properties": { - "age": "5" - } - } - ], - "entries": [ - { - "type": "minecraft:item", - "functions": [ - { - "enchantment": "minecraft:fortune", - "formula": "minecraft:binomial_with_bonus_count", - "function": "minecraft:apply_bonus", - "parameters": { - "extra": 3, - "probability": 0.5714286 - } - } - ], - "name": "catherder:catnip_seeds" - } - ], - "rolls": 1.0 - } - ] -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/loot_tables/blocks/cheese_wheel.json b/src/generated/resources/data/catherder/loot_tables/blocks/cheese_wheel.json index 3e696f40..c213b641 100644 --- a/src/generated/resources/data/catherder/loot_tables/blocks/cheese_wheel.json +++ b/src/generated/resources/data/catherder/loot_tables/blocks/cheese_wheel.json @@ -2,12 +2,8 @@ "type": "minecraft:block", "pools": [ { + "rolls": 1.0, "bonus_rolls": 0.0, - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ], "entries": [ { "type": "minecraft:alternatives", @@ -16,8 +12,8 @@ "type": "minecraft:item", "conditions": [ { - "block": "catherder:cheese_wheel", "condition": "minecraft:block_state_property", + "block": "catherder:cheese_wheel", "properties": { "servings": "1" } @@ -25,9 +21,9 @@ ], "functions": [ { - "add": false, + "function": "minecraft:set_count", "count": 1.0, - "function": "minecraft:set_count" + "add": false } ], "name": "catherder:cheese_wedge" @@ -36,8 +32,8 @@ "type": "minecraft:item", "conditions": [ { - "block": "catherder:cheese_wheel", "condition": "minecraft:block_state_property", + "block": "catherder:cheese_wheel", "properties": { "servings": "2" } @@ -45,9 +41,9 @@ ], "functions": [ { - "add": false, + "function": "minecraft:set_count", "count": 2.0, - "function": "minecraft:set_count" + "add": false } ], "name": "catherder:cheese_wedge" @@ -56,8 +52,8 @@ "type": "minecraft:item", "conditions": [ { - "block": "catherder:cheese_wheel", "condition": "minecraft:block_state_property", + "block": "catherder:cheese_wheel", "properties": { "servings": "3" } @@ -65,9 +61,9 @@ ], "functions": [ { - "add": false, + "function": "minecraft:set_count", "count": 3.0, - "function": "minecraft:set_count" + "add": false } ], "name": "catherder:cheese_wedge" @@ -76,8 +72,8 @@ "type": "minecraft:item", "conditions": [ { - "block": "catherder:cheese_wheel", "condition": "minecraft:block_state_property", + "block": "catherder:cheese_wheel", "properties": { "servings": "4" } @@ -85,9 +81,9 @@ ], "functions": [ { - "add": false, + "function": "minecraft:set_count", "count": 4.0, - "function": "minecraft:set_count" + "add": false } ], "name": "catherder:cheese_wedge" @@ -96,8 +92,8 @@ "type": "minecraft:item", "conditions": [ { - "block": "catherder:cheese_wheel", "condition": "minecraft:block_state_property", + "block": "catherder:cheese_wheel", "properties": { "servings": "5" } @@ -105,9 +101,9 @@ ], "functions": [ { - "add": false, + "function": "minecraft:set_count", "count": 5.0, - "function": "minecraft:set_count" + "add": false } ], "name": "catherder:cheese_wedge" @@ -116,8 +112,8 @@ "type": "minecraft:item", "conditions": [ { - "block": "catherder:cheese_wheel", "condition": "minecraft:block_state_property", + "block": "catherder:cheese_wheel", "properties": { "servings": "6" } @@ -125,9 +121,9 @@ ], "functions": [ { - "add": false, + "function": "minecraft:set_count", "count": 6.0, - "function": "minecraft:set_count" + "add": false } ], "name": "catherder:cheese_wedge" @@ -136,8 +132,8 @@ "type": "minecraft:item", "conditions": [ { - "block": "catherder:cheese_wheel", "condition": "minecraft:block_state_property", + "block": "catherder:cheese_wheel", "properties": { "servings": "7" } @@ -145,9 +141,9 @@ ], "functions": [ { - "add": false, + "function": "minecraft:set_count", "count": 7.0, - "function": "minecraft:set_count" + "add": false } ], "name": "catherder:cheese_wedge" @@ -156,8 +152,8 @@ "type": "minecraft:item", "conditions": [ { - "block": "catherder:cheese_wheel", "condition": "minecraft:block_state_property", + "block": "catherder:cheese_wheel", "properties": { "servings": "8" } @@ -165,9 +161,9 @@ ], "functions": [ { - "add": false, + "function": "minecraft:set_count", "count": 8.0, - "function": "minecraft:set_count" + "add": false } ], "name": "catherder:cheese_wedge" @@ -175,17 +171,21 @@ ] } ], - "rolls": 1.0 + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] }, { + "rolls": 1.0, "bonus_rolls": 0.0, "entries": [ { "type": "minecraft:item", "name": "minecraft:bowl" } - ], - "rolls": 1.0 + ] } ] } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/loot_tables/blocks/litter_box.json b/src/generated/resources/data/catherder/loot_tables/blocks/litter_box.json index 8d61d0fc..d6ee4ac3 100644 --- a/src/generated/resources/data/catherder/loot_tables/blocks/litter_box.json +++ b/src/generated/resources/data/catherder/loot_tables/blocks/litter_box.json @@ -2,19 +2,19 @@ "type": "minecraft:block", "pools": [ { + "rolls": 1.0, "bonus_rolls": 0.0, - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ], "entries": [ { "type": "minecraft:item", "name": "catherder:litter_box" } ], - "rolls": 1.0 + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] } ] } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/loot_tables/blocks/mouse_trap.json b/src/generated/resources/data/catherder/loot_tables/blocks/mouse_trap.json index bb91753a..b3f7d28a 100644 --- a/src/generated/resources/data/catherder/loot_tables/blocks/mouse_trap.json +++ b/src/generated/resources/data/catherder/loot_tables/blocks/mouse_trap.json @@ -2,19 +2,19 @@ "type": "minecraft:block", "pools": [ { + "rolls": 1.0, "bonus_rolls": 0.0, - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ], "entries": [ { "type": "minecraft:item", "name": "catherder:mouse_trap" } ], - "rolls": 1.0 + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] } ] } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/loot_tables/blocks/pet_door.json b/src/generated/resources/data/catherder/loot_tables/blocks/pet_door.json index 2583ec97..4982c657 100644 --- a/src/generated/resources/data/catherder/loot_tables/blocks/pet_door.json +++ b/src/generated/resources/data/catherder/loot_tables/blocks/pet_door.json @@ -2,32 +2,32 @@ "type": "minecraft:block", "pools": [ { + "rolls": 1.0, "bonus_rolls": 0.0, - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ], "entries": [ { "type": "minecraft:item", "functions": [ { "function": "minecraft:copy_nbt", + "source": "block_entity", "ops": [ { - "op": "replace", "source": "structureId", - "target": "catherder.structureId" + "target": "catherder.structureId", + "op": "replace" } - ], - "source": "block_entity" + ] } ], "name": "catherder:pet_door" } ], - "rolls": 1.0 + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] } ] } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/loot_tables/blocks/wild_catnip.json b/src/generated/resources/data/catherder/loot_tables/blocks/wild_catnip.json deleted file mode 100644 index f7df7142..00000000 --- a/src/generated/resources/data/catherder/loot_tables/blocks/wild_catnip.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "conditions": [ - { - "chance": 0.5, - "condition": "minecraft:random_chance" - }, - { - "condition": "minecraft:inverted", - "term": { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:shears" - ] - } - } - } - ], - "name": "catherder:catnip" - } - ], - "rolls": 1.0 - }, - { - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:inverted", - "term": { - "condition": "minecraft:match_tool", - "predicate": { - "items": [ - "minecraft:shears" - ] - } - } - } - ], - "name": "catherder:wild_catnip" - }, - { - "type": "minecraft:item", - "functions": [ - { - "enchantment": "minecraft:fortune", - "formula": "minecraft:uniform_bonus_count", - "function": "minecraft:apply_bonus", - "parameters": { - "bonusMultiplier": 2 - } - } - ], - "name": "catherder:catnip_seeds" - } - ] - } - ], - "rolls": 1.0 - } - ] -} \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/big_catsizer.json b/src/generated/resources/data/catherder/recipes/big_catsizer.json index 72ae9118..3bc02406 100644 --- a/src/generated/resources/data/catherder/recipes/big_catsizer.json +++ b/src/generated/resources/data/catherder/recipes/big_catsizer.json @@ -1,19 +1,17 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "MC" + ], "key": { - "C": { - "item": "minecraft:cake" - }, "M": { "item": "minecraft:red_mushroom" + }, + "C": { + "item": "minecraft:cake" } }, - "pattern": [ - "MC" - ], "result": { "item": "catherder:big_catsizer" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/breeding_treat.json b/src/generated/resources/data/catherder/recipes/breeding_treat.json index ddf511aa..69b42003 100644 --- a/src/generated/resources/data/catherder/recipes/breeding_treat.json +++ b/src/generated/resources/data/catherder/recipes/breeding_treat.json @@ -1,6 +1,5 @@ { "type": "minecraft:crafting_shapeless", - "category": "misc", "ingredients": [ { "item": "catherder:master_treat" @@ -19,7 +18,7 @@ } ], "result": { - "count": 2, - "item": "catherder:breeding_treat" + "item": "catherder:breeding_treat", + "count": 2 } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/cape.json b/src/generated/resources/data/catherder/recipes/cape.json index f8d29626..1d0e746b 100644 --- a/src/generated/resources/data/catherder/recipes/cape.json +++ b/src/generated/resources/data/catherder/recipes/cape.json @@ -1,6 +1,10 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "S S", + "LWL", + "WLW" + ], "key": { "L": { "item": "minecraft:leather" @@ -12,13 +16,7 @@ "tag": "minecraft:wool" } }, - "pattern": [ - "S S", - "LWL", - "WLW" - ], "result": { "item": "catherder:cape" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/cardboard.json b/src/generated/resources/data/catherder/recipes/cardboard.json index 7ba65cbe..c2380dd0 100644 --- a/src/generated/resources/data/catherder/recipes/cardboard.json +++ b/src/generated/resources/data/catherder/recipes/cardboard.json @@ -1,18 +1,16 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "PPP", + "PPP" + ], "key": { "P": { "item": "minecraft:paper" } }, - "pattern": [ - "PPP", - "PPP" - ], "result": { - "count": 9, - "item": "catherder:cardboard" - }, - "show_notification": true + "item": "catherder:cardboard", + "count": 9 + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/cardboard_box.json b/src/generated/resources/data/catherder/recipes/cardboard_box.json index d798488f..4d0c9432 100644 --- a/src/generated/resources/data/catherder/recipes/cardboard_box.json +++ b/src/generated/resources/data/catherder/recipes/cardboard_box.json @@ -1,18 +1,16 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "catherder:cardboard" - } - }, "pattern": [ "CCC", "C C", "CCC" ], + "key": { + "C": { + "item": "catherder:cardboard" + } + }, "result": { "item": "catherder:cardboard_box" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/cat_bowl.json b/src/generated/resources/data/catherder/recipes/cat_bowl.json index 3c405608..49b48c6e 100644 --- a/src/generated/resources/data/catherder/recipes/cat_bowl.json +++ b/src/generated/resources/data/catherder/recipes/cat_bowl.json @@ -1,23 +1,21 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "FXW", + "XXX" + ], "key": { + "X": { + "item": "minecraft:iron_ingot" + }, "F": { "tag": "minecraft:fishes" }, "W": { "item": "minecraft:water_bucket" - }, - "X": { - "item": "minecraft:iron_ingot" } }, - "pattern": [ - "FXW", - "XXX" - ], "result": { "item": "catherder:cat_bowl" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/cat_toy.json b/src/generated/resources/data/catherder/recipes/cat_toy.json index 967e4196..5bcffed1 100644 --- a/src/generated/resources/data/catherder/recipes/cat_toy.json +++ b/src/generated/resources/data/catherder/recipes/cat_toy.json @@ -1,20 +1,18 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "SW", + "WS" + ], "key": { - "S": { - "item": "minecraft:sugar" - }, "W": { "item": "catherder:catnip" + }, + "S": { + "item": "minecraft:sugar" } }, - "pattern": [ - "SW", - "WS" - ], "result": { "item": "catherder:cat_toy" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/cat_tree.json b/src/generated/resources/data/catherder/recipes/cat_tree.json index 6d470bdc..de61a975 100644 --- a/src/generated/resources/data/catherder/recipes/cat_tree.json +++ b/src/generated/resources/data/catherder/recipes/cat_tree.json @@ -1,4 +1,3 @@ { - "type": "catherder:cat_tree", - "category": "misc" + "type": "catherder:cat_tree" } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/cat_tree_dyed.json b/src/generated/resources/data/catherder/recipes/cat_tree_dyed.json index e9f252df..4376cf3e 100644 --- a/src/generated/resources/data/catherder/recipes/cat_tree_dyed.json +++ b/src/generated/resources/data/catherder/recipes/cat_tree_dyed.json @@ -1,4 +1,3 @@ { - "type": "catherder:cat_tree_dyed", - "category": "misc" + "type": "catherder:cat_tree_dyed" } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/cheese_wheel.json b/src/generated/resources/data/catherder/recipes/cheese_wheel.json index af5871fc..80f3e441 100644 --- a/src/generated/resources/data/catherder/recipes/cheese_wheel.json +++ b/src/generated/resources/data/catherder/recipes/cheese_wheel.json @@ -1,23 +1,21 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "MSM", + " B " + ], "key": { - "B": { - "item": "minecraft:bowl" - }, "M": { "item": "minecraft:milk_bucket" }, "S": { "item": "minecraft:slime_ball" + }, + "B": { + "item": "minecraft:bowl" } }, - "pattern": [ - "MSM", - " B " - ], "result": { "item": "catherder:cheese_wheel" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/collar_shears.json b/src/generated/resources/data/catherder/recipes/collar_shears.json index 38fba308..3bbdf1b2 100644 --- a/src/generated/resources/data/catherder/recipes/collar_shears.json +++ b/src/generated/resources/data/catherder/recipes/collar_shears.json @@ -1,6 +1,10 @@ { "type": "minecraft:crafting_shaped", - "category": "equipment", + "pattern": [ + " X ", + "XYX", + " X " + ], "key": { "X": { "item": "catherder:yarn" @@ -9,13 +13,7 @@ "item": "minecraft:shears" } }, - "pattern": [ - " X ", - "XYX", - " X " - ], "result": { "item": "catherder:collar_shears" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/litter_box.json b/src/generated/resources/data/catherder/recipes/litter_box.json index 3fe5af48..57ab7564 100644 --- a/src/generated/resources/data/catherder/recipes/litter_box.json +++ b/src/generated/resources/data/catherder/recipes/litter_box.json @@ -1,6 +1,9 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "ISI", + "III" + ], "key": { "I": { "item": "minecraft:iron_ingot" @@ -9,12 +12,7 @@ "item": "minecraft:sand" } }, - "pattern": [ - "ISI", - "III" - ], "result": { "item": "catherder:litter_box" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/litter_scoop.json b/src/generated/resources/data/catherder/recipes/litter_scoop.json index 322c931a..4cc8f172 100644 --- a/src/generated/resources/data/catherder/recipes/litter_scoop.json +++ b/src/generated/resources/data/catherder/recipes/litter_scoop.json @@ -1,6 +1,10 @@ { "type": "minecraft:crafting_shaped", - "category": "equipment", + "pattern": [ + "IWI", + "III", + " I " + ], "key": { "I": { "item": "minecraft:copper_ingot" @@ -9,13 +13,7 @@ "item": "minecraft:iron_bars" } }, - "pattern": [ - "IWI", - "III", - " I " - ], "result": { "item": "catherder:litter_scoop" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/master_treat.json b/src/generated/resources/data/catherder/recipes/master_treat.json index e5942e4f..637bd54b 100644 --- a/src/generated/resources/data/catherder/recipes/master_treat.json +++ b/src/generated/resources/data/catherder/recipes/master_treat.json @@ -1,6 +1,5 @@ { "type": "minecraft:crafting_shapeless", - "category": "misc", "ingredients": [ { "item": "catherder:super_treat" @@ -22,7 +21,7 @@ } ], "result": { - "count": 5, - "item": "catherder:master_treat" + "item": "catherder:master_treat", + "count": 5 } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/mouse_trap.json b/src/generated/resources/data/catherder/recipes/mouse_trap.json index f66efa2e..15d1dcb2 100644 --- a/src/generated/resources/data/catherder/recipes/mouse_trap.json +++ b/src/generated/resources/data/catherder/recipes/mouse_trap.json @@ -1,6 +1,9 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "CIT", + "PPP" + ], "key": { "C": { "item": "catherder:cheese_wedge" @@ -8,19 +11,14 @@ "I": { "item": "minecraft:iron_ingot" }, - "P": { - "tag": "minecraft:planks" - }, "T": { "item": "minecraft:tripwire_hook" + }, + "P": { + "tag": "minecraft:planks" } }, - "pattern": [ - "CIT", - "PPP" - ], "result": { "item": "catherder:mouse_trap" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/multicolored_collar.json b/src/generated/resources/data/catherder/recipes/multicolored_collar.json index 6e19bcc0..a9149541 100644 --- a/src/generated/resources/data/catherder/recipes/multicolored_collar.json +++ b/src/generated/resources/data/catherder/recipes/multicolored_collar.json @@ -1,6 +1,5 @@ { "type": "minecraft:crafting_shapeless", - "category": "misc", "ingredients": [ { "item": "catherder:wool_collar" diff --git a/src/generated/resources/data/catherder/recipes/pet_door.json b/src/generated/resources/data/catherder/recipes/pet_door.json index 3842091c..d417eede 100644 --- a/src/generated/resources/data/catherder/recipes/pet_door.json +++ b/src/generated/resources/data/catherder/recipes/pet_door.json @@ -1,4 +1,3 @@ { - "type": "catherder:pet_door", - "category": "misc" + "type": "catherder:pet_door" } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/radar.json b/src/generated/resources/data/catherder/recipes/radar.json index e212e0ac..159c3eec 100644 --- a/src/generated/resources/data/catherder/recipes/radar.json +++ b/src/generated/resources/data/catherder/recipes/radar.json @@ -1,6 +1,5 @@ { "type": "minecraft:crafting_shapeless", - "category": "equipment", "ingredients": [ { "item": "minecraft:map" diff --git a/src/generated/resources/data/catherder/recipes/radio_collar.json b/src/generated/resources/data/catherder/recipes/radio_collar.json index 9719d025..442dfe49 100644 --- a/src/generated/resources/data/catherder/recipes/radio_collar.json +++ b/src/generated/resources/data/catherder/recipes/radio_collar.json @@ -1,6 +1,5 @@ { "type": "minecraft:crafting_shapeless", - "category": "misc", "ingredients": [ { "item": "catherder:wool_collar" diff --git a/src/generated/resources/data/catherder/recipes/small_catsizer.json b/src/generated/resources/data/catherder/recipes/small_catsizer.json index 02df5889..6d42f72c 100644 --- a/src/generated/resources/data/catherder/recipes/small_catsizer.json +++ b/src/generated/resources/data/catherder/recipes/small_catsizer.json @@ -1,19 +1,17 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "WM" + ], "key": { - "M": { - "item": "minecraft:brown_mushroom" - }, "W": { "item": "minecraft:potion" + }, + "M": { + "item": "minecraft:brown_mushroom" } }, - "pattern": [ - "WM" - ], "result": { "item": "catherder:small_catsizer" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/spotted_collar.json b/src/generated/resources/data/catherder/recipes/spotted_collar.json index 782c5e59..4c26264f 100644 --- a/src/generated/resources/data/catherder/recipes/spotted_collar.json +++ b/src/generated/resources/data/catherder/recipes/spotted_collar.json @@ -1,27 +1,25 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "BWB", + "WCW", + "BSB" + ], "key": { - "B": { - "item": "minecraft:black_dye" - }, "C": { "item": "catherder:wool_collar" }, - "S": { - "tag": "minecraft:wool" + "B": { + "item": "minecraft:black_dye" }, "W": { "item": "minecraft:white_dye" + }, + "S": { + "tag": "minecraft:wool" } }, - "pattern": [ - "BWB", - "WCW", - "BSB" - ], "result": { "item": "catherder:spotted_collar" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/spotted_collar_alt.json b/src/generated/resources/data/catherder/recipes/spotted_collar_alt.json index 4e74eedb..96b4bd4a 100644 --- a/src/generated/resources/data/catherder/recipes/spotted_collar_alt.json +++ b/src/generated/resources/data/catherder/recipes/spotted_collar_alt.json @@ -1,27 +1,25 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "WBW", + "BCB", + "WSW" + ], "key": { - "B": { - "item": "minecraft:black_dye" - }, "C": { "item": "catherder:wool_collar" }, - "S": { - "tag": "minecraft:wool" + "B": { + "item": "minecraft:black_dye" }, "W": { "item": "minecraft:white_dye" + }, + "S": { + "tag": "minecraft:wool" } }, - "pattern": [ - "WBW", - "BCB", - "WSW" - ], "result": { "item": "catherder:spotted_collar" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/sunglasses.json b/src/generated/resources/data/catherder/recipes/sunglasses.json index d624295b..aa022534 100644 --- a/src/generated/resources/data/catherder/recipes/sunglasses.json +++ b/src/generated/resources/data/catherder/recipes/sunglasses.json @@ -1,24 +1,22 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + " s ", + "S S", + "GSG" + ], "key": { - "G": { - "item": "minecraft:glass_pane" + "s": { + "item": "minecraft:string" }, "S": { "item": "minecraft:stick" }, - "s": { - "item": "minecraft:string" + "G": { + "item": "minecraft:glass_pane" } }, - "pattern": [ - " s ", - "S S", - "GSG" - ], "result": { "item": "catherder:sunglasses" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/super_treat.json b/src/generated/resources/data/catherder/recipes/super_treat.json index 6c1fbd40..dee5114b 100644 --- a/src/generated/resources/data/catherder/recipes/super_treat.json +++ b/src/generated/resources/data/catherder/recipes/super_treat.json @@ -1,6 +1,5 @@ { "type": "minecraft:crafting_shapeless", - "category": "misc", "ingredients": [ { "item": "catherder:training_treat" @@ -22,7 +21,7 @@ } ], "result": { - "count": 5, - "item": "catherder:super_treat" + "item": "catherder:super_treat", + "count": 5 } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/training_treat.json b/src/generated/resources/data/catherder/recipes/training_treat.json index fcf019c1..539798ff 100644 --- a/src/generated/resources/data/catherder/recipes/training_treat.json +++ b/src/generated/resources/data/catherder/recipes/training_treat.json @@ -1,16 +1,20 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "TFR", + "XXX", + "YYY" + ], "key": { + "T": { + "item": "minecraft:string" + }, "F": { "tag": "minecraft:fishes" }, "R": { "item": "catherder:yarn" }, - "T": { - "item": "minecraft:string" - }, "X": { "item": "minecraft:sugar" }, @@ -18,13 +22,7 @@ "item": "catherder:catnip" } }, - "pattern": [ - "TFR", - "XXX", - "YYY" - ], "result": { "item": "catherder:training_treat" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/treat_bag.json b/src/generated/resources/data/catherder/recipes/treat_bag.json index dddac00c..a803f833 100644 --- a/src/generated/resources/data/catherder/recipes/treat_bag.json +++ b/src/generated/resources/data/catherder/recipes/treat_bag.json @@ -1,20 +1,18 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", + "pattern": [ + "LCL", + "LLL" + ], "key": { - "C": { - "item": "catherder:cat_toy" - }, "L": { "item": "minecraft:leather" + }, + "C": { + "item": "catherder:cat_toy" } }, - "pattern": [ - "LCL", - "LLL" - ], "result": { "item": "catherder:treat_bag" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/wild_treat.json b/src/generated/resources/data/catherder/recipes/wild_treat.json index ead23475..8a2257e9 100644 --- a/src/generated/resources/data/catherder/recipes/wild_treat.json +++ b/src/generated/resources/data/catherder/recipes/wild_treat.json @@ -1,6 +1,5 @@ { "type": "minecraft:crafting_shapeless", - "category": "misc", "ingredients": [ { "item": "catherder:master_treat" diff --git a/src/generated/resources/data/catherder/recipes/wool_collar.json b/src/generated/resources/data/catherder/recipes/wool_collar.json index f55e7624..112a0665 100644 --- a/src/generated/resources/data/catherder/recipes/wool_collar.json +++ b/src/generated/resources/data/catherder/recipes/wool_collar.json @@ -1,18 +1,16 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "S": { - "tag": "minecraft:wool" - } - }, "pattern": [ "SSS", "S S", "SSS" ], + "key": { + "S": { + "tag": "minecraft:wool" + } + }, "result": { "item": "catherder:wool_collar" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/recipes/yarn.json b/src/generated/resources/data/catherder/recipes/yarn.json index 0ef15398..c419fddc 100644 --- a/src/generated/resources/data/catherder/recipes/yarn.json +++ b/src/generated/resources/data/catherder/recipes/yarn.json @@ -1,18 +1,16 @@ { "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "W": { - "tag": "minecraft:wool" - } - }, "pattern": [ "WW ", "WW ", " W" ], + "key": { + "W": { + "tag": "minecraft:wool" + } + }, "result": { "item": "catherder:yarn" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/catherder/tags/blocks/wild_crops.json b/src/generated/resources/data/catherder/tags/blocks/wild_crops.json index 7cab18b6..b92e96c6 100644 --- a/src/generated/resources/data/catherder/tags/blocks/wild_crops.json +++ b/src/generated/resources/data/catherder/tags/blocks/wild_crops.json @@ -1,4 +1,5 @@ { + "replace": false, "values": [ "catherder:wild_catnip" ] diff --git a/src/generated/resources/data/catherder/tags/items/beg_items_tamed.json b/src/generated/resources/data/catherder/tags/items/beg_items_tamed.json index 0050aa44..b5e4aef0 100644 --- a/src/generated/resources/data/catherder/tags/items/beg_items_tamed.json +++ b/src/generated/resources/data/catherder/tags/items/beg_items_tamed.json @@ -1,4 +1,5 @@ { + "replace": false, "values": [ "catherder:breeding_treat", "catherder:cat_toy", diff --git a/src/generated/resources/data/catherder/tags/items/beg_items_untamed.json b/src/generated/resources/data/catherder/tags/items/beg_items_untamed.json index 3c689e8f..5630c66f 100644 --- a/src/generated/resources/data/catherder/tags/items/beg_items_untamed.json +++ b/src/generated/resources/data/catherder/tags/items/beg_items_untamed.json @@ -1,4 +1,5 @@ { + "replace": false, "values": [ "catherder:training_treat", "minecraft:string" diff --git a/src/generated/resources/data/catherder/tags/items/breeding_items.json b/src/generated/resources/data/catherder/tags/items/breeding_items.json index 8d2f4f2f..b86208ce 100644 --- a/src/generated/resources/data/catherder/tags/items/breeding_items.json +++ b/src/generated/resources/data/catherder/tags/items/breeding_items.json @@ -1,4 +1,5 @@ { + "replace": false, "values": [ "catherder:breeding_treat" ] diff --git a/src/generated/resources/data/catherder/tags/items/cat_trees.json b/src/generated/resources/data/catherder/tags/items/cat_trees.json index 388bf968..ba28786f 100644 --- a/src/generated/resources/data/catherder/tags/items/cat_trees.json +++ b/src/generated/resources/data/catherder/tags/items/cat_trees.json @@ -1,4 +1,5 @@ { + "replace": false, "values": [ "catherder:cat_tree" ] diff --git a/src/generated/resources/data/catherder/tags/items/meat.json b/src/generated/resources/data/catherder/tags/items/meat.json index 38d93da4..66915926 100644 --- a/src/generated/resources/data/catherder/tags/items/meat.json +++ b/src/generated/resources/data/catherder/tags/items/meat.json @@ -1,4 +1,5 @@ { + "replace": false, "values": [ "minecraft:beef", "minecraft:cooked_beef", diff --git a/src/generated/resources/data/catherder/tags/items/pack_cat_blacklist.json b/src/generated/resources/data/catherder/tags/items/pack_cat_blacklist.json index ac49368e..ee1b3b94 100644 --- a/src/generated/resources/data/catherder/tags/items/pack_cat_blacklist.json +++ b/src/generated/resources/data/catherder/tags/items/pack_cat_blacklist.json @@ -1,4 +1,5 @@ { + "replace": false, "values": [ "catherder:cat_toy" ] diff --git a/src/generated/resources/data/catherder/tags/items/toys.json b/src/generated/resources/data/catherder/tags/items/toys.json index 6b7bddc9..4da42e41 100644 --- a/src/generated/resources/data/catherder/tags/items/toys.json +++ b/src/generated/resources/data/catherder/tags/items/toys.json @@ -1,4 +1,5 @@ { + "replace": false, "values": [ "catherder:cat_toy", "catherder:yarn" diff --git a/src/generated/resources/data/catherder/tags/items/treats.json b/src/generated/resources/data/catherder/tags/items/treats.json index 42fe07df..31ea1e8a 100644 --- a/src/generated/resources/data/catherder/tags/items/treats.json +++ b/src/generated/resources/data/catherder/tags/items/treats.json @@ -1,4 +1,5 @@ { + "replace": false, "values": [ "catherder:training_treat", "catherder:super_treat", diff --git a/src/generated/resources/data/minecraft/tags/blocks/crops.json b/src/generated/resources/data/minecraft/tags/blocks/crops.json index 76cdcce8..7d693cc6 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/crops.json +++ b/src/generated/resources/data/minecraft/tags/blocks/crops.json @@ -1,4 +1,5 @@ { + "replace": false, "values": [ "catherder:catnip" ] diff --git a/src/generated/resources/data/minecraft/tags/blocks/small_flowers.json b/src/generated/resources/data/minecraft/tags/blocks/small_flowers.json index 7cab18b6..b92e96c6 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/small_flowers.json +++ b/src/generated/resources/data/minecraft/tags/blocks/small_flowers.json @@ -1,4 +1,5 @@ { + "replace": false, "values": [ "catherder:wild_catnip" ] diff --git a/src/main/java/com/sweetrpg/catherder/CatHerder.java b/src/main/java/com/sweetrpg/catherder/CatHerder.java index 076dc19f..8a848f74 100644 --- a/src/main/java/com/sweetrpg/catherder/CatHerder.java +++ b/src/main/java/com/sweetrpg/catherder/CatHerder.java @@ -11,14 +11,14 @@ import com.sweetrpg.catherder.common.event.EventHandler; import com.sweetrpg.catherder.common.lib.Constants; import com.sweetrpg.catherder.common.registry.*; +import com.sweetrpg.catherder.common.util.BackwardsComp; import com.sweetrpg.catherder.common.world.WildCropGeneration; import com.sweetrpg.catherder.data.*; import net.minecraft.data.DataGenerator; -import net.minecraft.data.PackOutput; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.RegisterCommandsEvent; +import net.minecraftforge.data.event.GatherDataEvent; import net.minecraftforge.event.server.ServerStartingEvent; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.DistExecutor; @@ -26,7 +26,6 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import net.minecraftforge.data.event.GatherDataEvent; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import org.apache.logging.log4j.LogManager; @@ -82,18 +81,15 @@ public CatHerder() { modEventBus.addListener(ModEntityTypes::addEntityAttributes); modEventBus.addListener(Capabilities::registerCaps); - modEventBus.addListener(ModItemGroups::onCreativeTabRegister); - IEventBus forgeEventBus = MinecraftForge.EVENT_BUS; forgeEventBus.addListener(this::serverStarting); - forgeEventBus.addListener(this::registerCommands); +// forgeEventBus.addListener(this::registerCommands); forgeEventBus.register(new EventHandler()); -// forgeEventBus.register(new BackwardsComp()); + forgeEventBus.register(new BackwardsComp()); // Client Events DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> { -// TODO modEventBus.addListener(ModKeybinds::registerKeyMapping); modEventBus.addListener(this::clientSetup); modEventBus.addListener(ModBlocks::registerBlockColours); modEventBus.addListener(ModItems::registerItemColours); @@ -102,8 +98,6 @@ public CatHerder() { modEventBus.addListener(ClientSetup::setupTileEntityRenderers); modEventBus.addListener(ClientSetup::setupEntityRenderers); modEventBus.addListener(ClientSetup::addClientReloadListeners); - // TODO modEventBus.addListener(ClientSetup::registerOverlay); - forgeEventBus.register(new ClientEventHandler()); forgeEventBus.addListener(BedFinderRenderer::onWorldRenderLast); }); @@ -120,10 +114,10 @@ public void serverStarting(final ServerStartingEvent event) { LOGGER.debug("Server starting"); } - public void registerCommands(final RegisterCommandsEvent event) { - LOGGER.debug("Register commands"); +// public void registerCommands(final RegisterCommandsEvent event) { +// LOGGER.debug("Register commands"); // CatRespawnCommand.register(event.getDispatcher()); - } +// } @OnlyIn(Dist.CLIENT) public void clientSetup(final FMLClientSetupEvent event) { @@ -147,14 +141,14 @@ private void gatherData(final GatherDataEvent event) { LOGGER.debug("Gather data: {}", event); DataGenerator gen = event.getGenerator(); - PackOutput packOutput = gen.getPackOutput(); + var packOutput = gen.getPackOutput(); var lookup = event.getLookupProvider(); var fileHelper = event.getExistingFileHelper(); if(event.includeClient()) { - CHBlockstateProvider blockstates = new CHBlockstateProvider(packOutput, fileHelper); + CHBlockstateProvider blockstates = new CHBlockstateProvider(packOutput, event.getExistingFileHelper()); gen.addProvider(true, blockstates); - gen.addProvider(true, new CHItemModelProvider(packOutput, fileHelper)); + gen.addProvider(true, new CHItemModelProvider(packOutput, blockstates.getExistingHelper())); gen.addProvider(true, new CHLangProvider(packOutput, Constants.LOCALE_EN_US)); gen.addProvider(true, new CHLangProvider(packOutput, Constants.LOCALE_EN_GB)); gen.addProvider(true, new CHLangProvider(packOutput, Constants.LOCALE_DE_DE)); @@ -170,7 +164,7 @@ private void gatherData(final GatherDataEvent event) { gen.addProvider(true, new CHAdvancements(packOutput, lookup, fileHelper)); CHBlockTagsProvider blockTagProvider = new CHBlockTagsProvider(packOutput, lookup, fileHelper); gen.addProvider(true, blockTagProvider); - gen.addProvider(true, new CHItemTagsProvider(packOutput, lookup, blockTagProvider, fileHelper)); + gen.addProvider(true, new CHItemTagsProvider(packOutput, lookup, blockTagProvider, event.getExistingFileHelper())); gen.addProvider(true, new CHRecipeProvider(packOutput)); gen.addProvider(true, new CHLootTableProvider(packOutput)); } diff --git a/src/main/java/com/sweetrpg/catherder/client/CatTextureManager.java b/src/main/java/com/sweetrpg/catherder/client/CatTextureManager.java index 73c2af7b..7c385cb6 100644 --- a/src/main/java/com/sweetrpg/catherder/client/CatTextureManager.java +++ b/src/main/java/com/sweetrpg/catherder/client/CatTextureManager.java @@ -23,7 +23,6 @@ import net.minecraft.server.packs.resources.SimplePreparableReloadListener; import net.minecraft.util.GsonHelper; import net.minecraft.util.profiling.ProfilerFiller; -import net.minecraft.world.entity.animal.CatVariant; import net.minecraftforge.network.PacketDistributor; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; @@ -45,20 +44,6 @@ public class CatTextureManager extends SimplePreparableReloadListener customSkinLoc = new ArrayList<>(20); private final Map hashToSkinRequest = Maps.newConcurrentMap(); - private final Map typeToVariantMap = net.minecraft.Util.make(Maps.newHashMap(), (m) -> { - m.put(0, CatVariant.TABBY.location()); - m.put(1, CatVariant.BLACK.location()); - m.put(2, CatVariant.RED.location()); - m.put(3, CatVariant.SIAMESE.location()); - m.put(4, CatVariant.BRITISH_SHORTHAIR.location()); - m.put(5, CatVariant.CALICO.location()); - m.put(6, CatVariant.PERSIAN.location()); - m.put(7, CatVariant.RAGDOLL.location()); - m.put(8, CatVariant.WHITE.location()); - m.put(9, CatVariant.JELLIE.location()); - m.put(10, CatVariant.ALL_BLACK.location()); - }); - public SkinRequest getRequestStatus(String hash) { return this.hashToSkinRequest.getOrDefault(hash, SkinRequest.UNREQUESTED); } @@ -126,24 +111,15 @@ public ResourceLocation getTexture(CatEntity cat) { return CatTextureManager.INSTANCE.getLocFromHashOrGet(hash, this::getCached); } - ResourceLocation texturePath; - CatVariant variant = cat.getVariant(); - if(variant == null) { - Integer originalBreed = cat.getOriginalBreed(); - ResourceLocation location = typeToVariantMap.get(originalBreed); - CatVariant actualVariant = BuiltInRegistries.CAT_VARIANT.get(location); - cat.setVariant(actualVariant); - - texturePath = actualVariant.texture(); - } - else { - texturePath = variant.texture(); - } - if(texturePath != null) { - return texturePath; - } +// Integer originalBreed = cat.getOriginalBreed(); +// ResourceLocation texturePath = Cat.TEXTURE_BY_TYPE.get(originalBreed); +// if(texturePath != null) { +// return texturePath; +// } - return Resources.ENTITY_VANILLA_CAT; +// return Resources.ENTITY_VANILLA_CAT; +// var resLoc = BuiltInRegistries.CAT_VARIANT.getKey(cat.getVariant()); + return cat.getVariant().texture(); } public AbstractTexture getOrLoadTexture(File baseFolder, String hash) { @@ -295,7 +271,6 @@ protected CatTextureManager.Preparations prepare(ResourceManager resourceManager this.loadOverrideData(prep, override); } catch (FileNotFoundException e) { - ; } catch (IOException | RuntimeException runtimeexception) { CatHerder.LOGGER.warn("Unable to parse cat skin override data: {}", runtimeexception); diff --git a/src/main/java/com/sweetrpg/catherder/client/ClientSetup.java b/src/main/java/com/sweetrpg/catherder/client/ClientSetup.java index 248f3ed5..9d709d9f 100644 --- a/src/main/java/com/sweetrpg/catherder/client/ClientSetup.java +++ b/src/main/java/com/sweetrpg/catherder/client/ClientSetup.java @@ -10,6 +10,7 @@ import com.sweetrpg.catherder.client.entity.render.CollarRenderManager; import com.sweetrpg.catherder.client.entity.render.CatScreenOverlays; import com.sweetrpg.catherder.client.entity.render.CatRenderer; +//import com.sweetrpg.catherder.client.entity.render.CatBeamRenderer; import com.sweetrpg.catherder.client.entity.render.layer.PackCatRenderer; import com.sweetrpg.catherder.client.entity.render.layer.RescueCatRenderer; import com.sweetrpg.catherder.client.entity.render.layer.accessory.ArmorAccessoryRenderer; diff --git a/src/main/java/com/sweetrpg/catherder/client/block/model/CatTreeModel.java b/src/main/java/com/sweetrpg/catherder/client/block/model/CatTreeModel.java index 9763ac7d..69a674a6 100644 --- a/src/main/java/com/sweetrpg/catherder/client/block/model/CatTreeModel.java +++ b/src/main/java/com/sweetrpg/catherder/client/block/model/CatTreeModel.java @@ -28,8 +28,8 @@ import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Random; +import java.util.Map; import java.util.function.Function; @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/com/sweetrpg/catherder/client/block/model/PetDoorModel.java b/src/main/java/com/sweetrpg/catherder/client/block/model/PetDoorModel.java index 67de6355..db9ba979 100644 --- a/src/main/java/com/sweetrpg/catherder/client/block/model/PetDoorModel.java +++ b/src/main/java/com/sweetrpg/catherder/client/block/model/PetDoorModel.java @@ -106,13 +106,11 @@ public BakedModel bakeModelVariant(@Nullable IStructureMaterial structureResourc newModel.name = this.model.name; newModel.parent = this.model.parent; - Either structureTexture = findStructureTexture(structureResource); // newModel.textureMap.put("bedding", findBeddingTexture(beddingResource)); newModel.textureMap.put("structure", structureTexture); newModel.textureMap.put("particle", structureTexture); -// return newModel.bake(this.modelLoader, newModel, ModelBakery.defaultTextureGetter(), getModelRotation(facing), createResourceVariant(structureResource, facing), true); return (new ModelBaker() { @Override diff --git a/src/main/java/com/sweetrpg/catherder/client/entity/render/CatBeamRenderer.java b/src/main/java/com/sweetrpg/catherder/client/entity/render/CatBeamRenderer.java index ff2d90b2..d521fbc0 100644 --- a/src/main/java/com/sweetrpg/catherder/client/entity/render/CatBeamRenderer.java +++ b/src/main/java/com/sweetrpg/catherder/client/entity/render/CatBeamRenderer.java @@ -43,7 +43,7 @@ public void render(T entityIn, float entityYaw, float partialTicks, PoseStack ma matrixStackIn.scale(this.scale, this.scale, this.scale); matrixStackIn.mulPose(this.entityRenderDispatcher.cameraOrientation()); matrixStackIn.mulPose(Axis.YP.rotationDegrees(180.0F)); - this.itemRenderer.renderStatic(new ItemStack(Items.SNOWBALL), ItemDisplayContext.GROUND, packedLightIn, OverlayTexture.NO_OVERLAY, matrixStackIn, bufferIn, entityIn.getLevel(), 0); + this.itemRenderer.renderStatic(new ItemStack(Items.SNOWBALL), ItemDisplayContext.GROUND, packedLightIn, OverlayTexture.NO_OVERLAY, matrixStackIn, bufferIn, null, entityIn.getId()); matrixStackIn.popPose(); super.render(entityIn, entityYaw, partialTicks, matrixStackIn, bufferIn, packedLightIn); } diff --git a/src/main/java/com/sweetrpg/catherder/client/entity/render/RenderUtil.java b/src/main/java/com/sweetrpg/catherder/client/entity/render/RenderUtil.java index 84f9cb9c..e95c90ae 100644 --- a/src/main/java/com/sweetrpg/catherder/client/entity/render/RenderUtil.java +++ b/src/main/java/com/sweetrpg/catherder/client/entity/render/RenderUtil.java @@ -11,7 +11,6 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.Entity; -import org.joml.Matrix4f; public class RenderUtil { @@ -32,12 +31,12 @@ public static void renderLabelWithScale(boolean flag, EntityRenderer renderer, E stack.translate(0.0D, yOffset, 0.0D); stack.mulPose(entityRenderDispatcher.cameraOrientation()); stack.scale(-scale, -scale, scale); - Matrix4f matrix4f = stack.last().pose(); + var matrix4f = stack.last().pose(); float f1 = Minecraft.getInstance().options.getBackgroundOpacity(0.25F); int j = (int) (f1 * 255.0F) << 24; Font fontrenderer = renderer.getFont(); float f2 = -fontrenderer.width(text) / 2F; - fontrenderer.drawInBatch(text, f2, 0, 553648127, false, matrix4f, buffer, Font.DisplayMode.NORMAL, j, packedLightIn); + fontrenderer.drawInBatch(text, f2, 0, 553648127, false, matrix4f, buffer, flag ? Font.DisplayMode.SEE_THROUGH : Font.DisplayMode.NORMAL, j, packedLightIn); if(flag) { fontrenderer.drawInBatch(text, f2, 0, -1, false, matrix4f, buffer, Font.DisplayMode.NORMAL, 0, packedLightIn); } diff --git a/src/main/java/com/sweetrpg/catherder/client/entity/render/layer/CatToyLayer.java b/src/main/java/com/sweetrpg/catherder/client/entity/render/layer/CatToyLayer.java index 47eec7da..168141e4 100644 --- a/src/main/java/com/sweetrpg/catherder/client/entity/render/layer/CatToyLayer.java +++ b/src/main/java/com/sweetrpg/catherder/client/entity/render/layer/CatToyLayer.java @@ -8,7 +8,6 @@ import com.sweetrpg.catherder.common.entity.CatEntity; import net.minecraft.client.renderer.ItemInHandRenderer; import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.client.renderer.block.model.ItemTransforms; import net.minecraft.client.renderer.entity.layers.RenderLayer; import net.minecraft.world.item.ItemDisplayContext; @@ -20,7 +19,6 @@ public CatToyLayer(CatRenderer catRendererIn, ItemInHandRenderer itemInHandRende super(catRendererIn); this.itemInHandRenderer = itemInHandRenderer; } - @Override public void render(PoseStack matrixStack, MultiBufferSource bufferSource, int packedLight, CatEntity cat, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { if (cat.hasToy()) { diff --git a/src/main/java/com/sweetrpg/catherder/client/entity/render/world/BedFinderRenderer.java b/src/main/java/com/sweetrpg/catherder/client/entity/render/world/BedFinderRenderer.java index 86931b42..207f19f8 100644 --- a/src/main/java/com/sweetrpg/catherder/client/entity/render/world/BedFinderRenderer.java +++ b/src/main/java/com/sweetrpg/catherder/client/entity/render/world/BedFinderRenderer.java @@ -59,6 +59,7 @@ public static void drawSelectionBox(PoseStack stack, AABB boundingBox) { BufferBuilder buf = Tesselator.getInstance().getBuilder(); buf.begin(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR_NORMAL); LevelRenderer.renderLineBox(stack, buf, boundingBox.move(-d0, -d1, -d2), 1F, 1F, 0, 1F); + buf.end(); BufferUploader.drawWithShader(buf.end()); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); diff --git a/src/main/java/com/sweetrpg/catherder/client/event/ClientEventHandler.java b/src/main/java/com/sweetrpg/catherder/client/event/ClientEventHandler.java index ec07b50f..2ca7b589 100644 --- a/src/main/java/com/sweetrpg/catherder/client/event/ClientEventHandler.java +++ b/src/main/java/com/sweetrpg/catherder/client/event/ClientEventHandler.java @@ -15,6 +15,7 @@ import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen; import net.minecraft.client.gui.screens.inventory.InventoryScreen; +import net.minecraft.client.gui.screens.recipebook.RecipeBookComponent; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.LevelRenderer; import net.minecraft.client.renderer.block.BlockModelShaper; @@ -108,6 +109,7 @@ public static void modifyBakedModels(final ModelEvent.ModifyBakingResult event) } } + @SubscribeEvent public void onInputEvent(final MovementInputUpdateEvent event) { if(event.getInput().jumping) { @@ -146,22 +148,22 @@ public void onScreenInit(final ScreenEvent.Init.Post event) { } } - @SubscribeEvent - public void onScreenDrawForeground(final ScreenEvent event) { - Screen screen = event.getScreen(); - if(screen instanceof InventoryScreen || screen instanceof CreativeModeInventoryScreen) { - boolean creative = screen instanceof CreativeModeInventoryScreen; - CatInventoryButton btn = null; - - //TODO just create a static variable in this class -// for (Widget widget : screen.renderables) { -// if (widget instanceof CatInventoryButton) { +// @SubscribeEvent +// public void onScreenDrawForeground(final ScreenEvent event) { +// Screen screen = event.getScreen(); +// if(screen instanceof InventoryScreen || screen instanceof CreativeModeInventoryScreen) { +// boolean creative = screen instanceof CreativeModeInventoryScreen; +// CatInventoryButton btn = null; +// +// //TODO just create a static variable in this class +// for(Widget widget : screen.renderables) { +// if(widget instanceof CatInventoryButton) { // btn = (CatInventoryButton) widget; // break; // } // } // -// if (btn.visible && btn.isHoveredOrFocused()) { +// if(btn.visible && btn.isHoveredOrFocused()) { // Minecraft mc = Minecraft.getInstance(); // int width = mc.getWindow().getGuiScaledWidth(); // int height = mc.getWindow().getGuiScaledHeight(); @@ -169,9 +171,9 @@ public void onScreenDrawForeground(final ScreenEvent event) { // int sizeY = creative ? 136 : 166; // int guiLeft = (width - sizeX) / 2; // int guiTop = (height - sizeY) / 2; -// if (!creative) { +// if(!creative) { // RecipeBookComponent recipeBook = ((InventoryScreen) screen).getRecipeBookComponent(); -// if (recipeBook.isVisible()) { +// if(recipeBook.isVisible()) { // guiLeft += 76; // } // } @@ -180,8 +182,8 @@ public void onScreenDrawForeground(final ScreenEvent event) { // btn.renderToolTip(event.getPoseStack(), event.getMouseX(), event.getMouseY()); // //event.getPoseStack().translate(guiLeft, guiTop, 0); // } - } - } +// } +// } // TODO Implement patrol item // @SubscribeEvent @@ -224,7 +226,7 @@ public void drawSelectionBox(PoseStack matrixStackIn, Player player, float parti //TODO Used when drawing outline of bounding box RenderSystem.lineWidth(2.0F); -// RenderSystem.disableTexture(); + //RenderSystem.disableTexture(); Vec3 vec3d = Minecraft.getInstance().gameRenderer.getMainCamera().getPosition(); double d0 = vec3d.x(); double d1 = vec3d.y(); @@ -236,7 +238,7 @@ public void drawSelectionBox(PoseStack matrixStackIn, Player player, float parti Tesselator.getInstance().end(); RenderSystem.setShaderColor(0.0F, 0.0F, 0.0F, 0.3F); RenderSystem.depthMask(true); -// RenderSystem.enableTexture(); + //RenderSystem.enableTexture(); RenderSystem.disableBlend(); //RenderSystem.enableAlphaTest(); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); diff --git a/src/main/java/com/sweetrpg/catherder/client/screen/widget/CatInventoryButton.java b/src/main/java/com/sweetrpg/catherder/client/screen/widget/CatInventoryButton.java index 5d4950a9..aedbca00 100644 --- a/src/main/java/com/sweetrpg/catherder/client/screen/widget/CatInventoryButton.java +++ b/src/main/java/com/sweetrpg/catherder/client/screen/widget/CatInventoryButton.java @@ -17,20 +17,24 @@ import net.minecraft.client.renderer.GameRenderer; import net.minecraft.network.chat.CommonComponents; import net.minecraft.network.chat.Component; -import net.minecraft.world.item.CreativeModeTab; import java.util.List; public class CatInventoryButton extends Button { private final Screen parent; -// private final int baseX; + private final int baseX; - private static final Tooltip ACTIVE = Tooltip.create(Component.translatable("container.catherder.cat_inventories.link")); - private static final Tooltip INACTIVE = Tooltip.create(Component.translatable("container.catherder.cat_inventories.link").withStyle(ChatFormatting.RED)); + private final Tooltip TOOLTIP_ACTIVE = + Tooltip.create(Component.translatable("container.catherder.cat_inventories.link")); + + private final Tooltip TOOLTIP_NO_ACTIVE = + Tooltip.create(Component.translatable("container.catherder.cat_inventories.link") + .withStyle(ChatFormatting.RED)); public CatInventoryButton(int x, int y, Screen parentIn, OnPress onPress) { super(x, y, 13, 10, CommonComponents.EMPTY, onPress, Button.DEFAULT_NARRATION); + this.baseX = x; this.parent = parentIn; } @@ -42,53 +46,56 @@ public void render(PoseStack stack, int mouseX, int mouseY, float partialTicks) this.active = this.visible; } -// if(this.parent instanceof InventoryScreen) { -// RecipeBookComponent recipeBook = ((InventoryScreen) this.parent).getRecipeBookComponent(); -// if(recipeBook.isVisible()) { -// this.setX(this.baseX + 77); -// } -// else { -// this.setX(this.baseX); -// } -// } + if(this.parent instanceof InventoryScreen) { + RecipeBookComponent recipeBook = ((InventoryScreen) this.parent).getRecipeBookComponent(); + if(recipeBook.isVisible()) { + this.setX(this.baseX + 77); + } + else { + this.setX(this.baseX); + } + } if(this.visible) { Minecraft mc = Minecraft.getInstance(); List cats = mc.level.getEntitiesOfClass(CatEntity.class, mc.player.getBoundingBox().inflate(12D, 12D, 12D), - (cat) -> cat.canInteract(mc.player) && PackCatTalent.hasInventory(cat) - ); + (cat) -> cat.canInteract(mc.player) && PackCatTalent.hasInventory(cat) + ); this.active = !cats.isEmpty(); - - // Set tooltip to be render by the super call. - this.setTooltip(this.active ? ACTIVE : INACTIVE); + if(this.active) { + this.setTooltip(TOOLTIP_ACTIVE); + } + else { + this.setTooltip(TOOLTIP_NO_ACTIVE); + } } super.render(stack, mouseX, mouseY, partialTicks); } -// @Override -// public void renderButton(PoseStack stack, int mouseX, int mouseY, float partialTicks) { -// RenderSystem.setShader(GameRenderer::getPositionTexShader); -// RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha); -// RenderSystem.setShaderTexture(0, Resources.SMALL_WIDGETS); -// Minecraft mc = Minecraft.getInstance(); -// int i = this.getYImage(this.isHoveredOrFocused()); -// RenderSystem.enableBlend(); -// RenderSystem.defaultBlendFunc(); -// RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); -// this.blit(stack, this.getX(), this.getY(), 0, 36 + i * 10, this.width, this.height); -// this.rrenderBg(stack, mc, mouseX, mouseY); -// } - @Override - public int getX() { - if (this.parent instanceof InventoryScreen inventoryScreen) { - RecipeBookComponent recipeBook = inventoryScreen.getRecipeBookComponent(); - if (recipeBook.isVisible()) { - return super.getX() + 77; - } + public void renderWidget(PoseStack stack, int mouseX, int mouseY, float partialTicks) { + RenderSystem.setShader(GameRenderer::getPositionTexShader); + RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha); + RenderSystem.setShaderTexture(0, Resources.SMALL_WIDGETS); + Minecraft mc = Minecraft.getInstance(); + int i = this.getTextureY(); + RenderSystem.enableBlend(); + RenderSystem.defaultBlendFunc(); + RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + this.blit(stack, this.getX(), this.getY(), 0, 36 + i * 10, this.width, this.height); +// this.renderBg(stack, mc, mouseX, mouseY); + } + + private int getTextureY() { + int i = 1; + if(!this.active) { + i = 0; + } + else if(this.isHoveredOrFocused()) { + i = 2; } - return super.getX(); + return i; } } diff --git a/src/main/java/com/sweetrpg/catherder/client/screen/widget/SmallButton.java b/src/main/java/com/sweetrpg/catherder/client/screen/widget/SmallButton.java index 761a8102..1cc2ac31 100644 --- a/src/main/java/com/sweetrpg/catherder/client/screen/widget/SmallButton.java +++ b/src/main/java/com/sweetrpg/catherder/client/screen/widget/SmallButton.java @@ -19,19 +19,19 @@ public SmallButton(int x, int y, Component text, OnPress onPress) { @Override public void renderWidget(PoseStack stack, int mouseX, int mouseY, float partialTicks) { - Minecraft mc = Minecraft.getInstance(); - Font font = mc.font; + Minecraft mc = Minecraft.getInstance(); + Font font = mc.font; RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha); RenderSystem.setShaderTexture(0, Resources.SMALL_WIDGETS); - int i = this.getTextureY(); - RenderSystem.enableBlend(); - RenderSystem.defaultBlendFunc(); - RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); - this.blit(stack, this.getX(), this.getY(), 0, i * 12, this.width, this.height); -// this.renderTexture(stack, mc, mouseX, mouseY); - int j = getFGColor(); - this.drawCenteredString(stack, font, this.getMessage(), this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, j | Mth.ceil(this.alpha * 255.0F) << 24); + int i = this.getTextureY(); + RenderSystem.enableBlend(); + RenderSystem.defaultBlendFunc(); + RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + this.blit(stack, this.getX(), this.getY(), 0, i * 12, this.width, this.height); +// this.renderBg(stack, mc, mouseX, mouseY); + int j = getFGColor(); + this.drawCenteredString(stack, font, this.getMessage(), this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, j | Mth.ceil(this.alpha * 255.0F) << 24); } private int getTextureY() { diff --git a/src/main/java/com/sweetrpg/catherder/common/CommonSetup.java b/src/main/java/com/sweetrpg/catherder/common/CommonSetup.java index 794574c0..6d1273c3 100644 --- a/src/main/java/com/sweetrpg/catherder/common/CommonSetup.java +++ b/src/main/java/com/sweetrpg/catherder/common/CommonSetup.java @@ -7,9 +7,9 @@ import com.sweetrpg.catherder.common.network.PacketHandler; import com.sweetrpg.catherder.common.registry.ModItems; import com.sweetrpg.catherder.common.talent.HappyEaterTalent; +import com.sweetrpg.catherder.common.world.WildCropGeneration; import net.minecraft.world.level.block.ComposterBlock; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; public class CommonSetup { public static void init(final FMLCommonSetupEvent event) { @@ -23,7 +23,7 @@ public static void init(final FMLCommonSetupEvent event) { // InteractHandler.registerHandler(new HelmetInteractHandler()); ConfigHandler.initTalentConfig(); -// CatRespawnCommand.registerSerilizers(FMLJavaModLoadingContext.get().getModEventBus()); +// CatRespawnCommand.registerSerilizers(); CatEntity.initDataParameters(); // WildCropGeneration.load(); diff --git a/src/main/java/com/sweetrpg/catherder/common/addon/Addon.java b/src/main/java/com/sweetrpg/catherder/common/addon/Addon.java index 9f484ace..f4cd21b5 100644 --- a/src/main/java/com/sweetrpg/catherder/common/addon/Addon.java +++ b/src/main/java/com/sweetrpg/catherder/common/addon/Addon.java @@ -9,18 +9,18 @@ public interface Addon { /** - * Called from the CH mod class constructor + * Called from the DT2 mod class constructor * - * @throws RuntimeException You should re-throw any exceptions as {@link RuntimeException} + * @throws RuntimeException You should re-throw any exceptions as {@link RuntimeException}, this are */ default void init() throws RuntimeException { } /** - * Called from the CH {@link InterModProcessEvent} + * Called from the DT2 {@link InterModProcessEvent} * - * @throws RuntimeException You should re-throw any exceptions as {@link RuntimeException} + * @throws RuntimeException You should re-throw any exceptions as {@link RuntimeException}, this are */ default void exec() throws RuntimeException { diff --git a/src/main/java/com/sweetrpg/catherder/common/block/entity/CatBowlBlockEntity.java b/src/main/java/com/sweetrpg/catherder/common/block/entity/CatBowlBlockEntity.java index be6a66da..60df2e40 100644 --- a/src/main/java/com/sweetrpg/catherder/common/block/entity/CatBowlBlockEntity.java +++ b/src/main/java/com/sweetrpg/catherder/common/block/entity/CatBowlBlockEntity.java @@ -20,8 +20,8 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.ItemStackHandler; import javax.annotation.Nonnull; @@ -95,7 +95,7 @@ public ItemStackHandler getInventory() { @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { + if(cap == ForgeCapabilities.ITEM_HANDLER) { return (LazyOptional) this.itemStackHandler; } return super.getCapability(cap, side); diff --git a/src/main/java/com/sweetrpg/catherder/common/block/entity/CatTreeBlockEntity.java b/src/main/java/com/sweetrpg/catherder/common/block/entity/CatTreeBlockEntity.java index 26bd632e..0099e286 100644 --- a/src/main/java/com/sweetrpg/catherder/common/block/entity/CatTreeBlockEntity.java +++ b/src/main/java/com/sweetrpg/catherder/common/block/entity/CatTreeBlockEntity.java @@ -90,7 +90,7 @@ public void load(CompoundTag compound) { public void saveAdditional(CompoundTag compound) { super.saveAdditional(compound); - NBTUtil.putRegistryValue(compound, "colorId", this.colorType, CatHerderAPI.COLOR_MATERIAL.get()); + NBTUtil.putRegistryValue(compound, "colorId", CatHerderAPI.COLOR_MATERIAL.get().getKey(this.colorType)); // NBTUtil.putRegistryValue(compound, "beddingId", this.beddingType); NBTUtil.putUniqueId(compound, "ownerId", this.catUUID); diff --git a/src/main/java/com/sweetrpg/catherder/common/block/entity/LitterboxBlockEntity.java b/src/main/java/com/sweetrpg/catherder/common/block/entity/LitterboxBlockEntity.java index 140c94c4..5e87a4e2 100644 --- a/src/main/java/com/sweetrpg/catherder/common/block/entity/LitterboxBlockEntity.java +++ b/src/main/java/com/sweetrpg/catherder/common/block/entity/LitterboxBlockEntity.java @@ -47,7 +47,7 @@ public static void tick(Level level, BlockPos pos, BlockState blockState, BlockE for(CatEntity cat : catList) { // TODO: make litterbox remember who placed and only their cats can attach to it UUID placerId = box.getPlacerId(); - if(placerId != null && placerId.equals(cat.getOwnerUUID()) /*&& !cat.getLitterboxPos().isPresent()*/) { + if(placerId != null && placerId.equals(cat.getOwnerUUID()) /* && !cat.getLitterboxPos().isPresent() */) { cat.setLitterboxPos(box.worldPosition); } } diff --git a/src/main/java/com/sweetrpg/catherder/common/block/entity/PetDoorBlockEntity.java b/src/main/java/com/sweetrpg/catherder/common/block/entity/PetDoorBlockEntity.java index d7182263..48983c15 100644 --- a/src/main/java/com/sweetrpg/catherder/common/block/entity/PetDoorBlockEntity.java +++ b/src/main/java/com/sweetrpg/catherder/common/block/entity/PetDoorBlockEntity.java @@ -8,8 +8,8 @@ import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.client.model.data.ModelProperty; import net.minecraftforge.client.model.data.ModelData; +import net.minecraftforge.client.model.data.ModelProperty; public class PetDoorBlockEntity extends PlacedBlockEntity { @@ -35,7 +35,7 @@ public void load(CompoundTag compound) { public void saveAdditional(CompoundTag compound) { super.saveAdditional(compound); - NBTUtil.putRegistryValue(compound, "structureId", this.structureType, CatHerderAPI.STRUCTURE_MATERIAL.get()); + NBTUtil.putRegistryValue(compound, "structureId",CatHerderAPI.STRUCTURE_MATERIAL.get().getKey(this.structureType)); } public void setStructure(IStructureMaterial structureType) { diff --git a/src/main/java/com/sweetrpg/catherder/common/command/CatRespawnCommand.java b/src/main/java/com/sweetrpg/catherder/common/command/CatRespawnCommand.java index 719a3c60..91b4c6ab 100644 --- a/src/main/java/com/sweetrpg/catherder/common/command/CatRespawnCommand.java +++ b/src/main/java/com/sweetrpg/catherder/common/command/CatRespawnCommand.java @@ -10,7 +10,6 @@ //import com.mojang.brigadier.suggestion.SuggestionProvider; //import com.mojang.brigadier.suggestion.Suggestions; //import com.mojang.brigadier.suggestion.SuggestionsBuilder; -//import com.sweetrpg.catherder.api.CatHerderAPI; //import com.sweetrpg.catherder.common.command.arguments.UUIDArgument; //import com.sweetrpg.catherder.common.entity.CatEntity; //import com.sweetrpg.catherder.common.item.RadarItem; @@ -19,16 +18,10 @@ //import net.minecraft.commands.CommandSourceStack; //import net.minecraft.commands.Commands; //import net.minecraft.commands.SharedSuggestionProvider; -//import net.minecraft.commands.synchronization.ArgumentTypeInfo; -//import net.minecraft.commands.synchronization.ArgumentTypeInfos; -//import net.minecraft.commands.synchronization.SingletonArgumentInfo; //import net.minecraft.network.chat.Component; //import net.minecraft.server.level.ServerLevel; //import net.minecraft.util.Mth; //import net.minecraft.world.entity.player.Player; -//import net.minecraftforge.eventbus.api.IEventBus; -//import net.minecraftforge.registries.DeferredRegister; -//import net.minecraftforge.registries.ForgeRegistries; // //import java.util.*; //import java.util.concurrent.CompletableFuture; @@ -75,10 +68,8 @@ // ); // } // -// private static final DeferredRegister> ARGUMENT_TYPES = DeferredRegister.create(ForgeRegistries.Keys.COMMAND_ARGUMENT_TYPES, CatHerderAPI.MOD_ID); -// public static void registerSerilizers(IEventBus modEventBus) { -// ARGUMENT_TYPES.register("uuid", () -> ArgumentTypeInfos.registerByClass(UUIDArgument.class, SingletonArgumentInfo.contextFree(UUIDArgument::uuid))); -// ARGUMENT_TYPES.register(modEventBus); +// public static void registerSerilizers() { +// ArgumentTypes.register(Util.getResourcePath("uuid"), UUIDArgument.class, new EmptyArgumentSerializer<>(UUIDArgument::uuid)); // } // // private static SuggestionProvider getOwnerIdSuggestionsLocate() { diff --git a/src/main/java/com/sweetrpg/catherder/common/config/ConfigHandler.java b/src/main/java/com/sweetrpg/catherder/common/config/ConfigHandler.java index 0eed8e83..392945ae 100644 --- a/src/main/java/com/sweetrpg/catherder/common/config/ConfigHandler.java +++ b/src/main/java/com/sweetrpg/catherder/common/config/ConfigHandler.java @@ -4,7 +4,6 @@ import com.sweetrpg.catherder.api.CatHerderAPI; import com.sweetrpg.catherder.api.registry.Talent; import com.sweetrpg.catherder.common.lib.Constants; -import net.minecraft.resources.ResourceLocation; import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.ModLoadingContext; @@ -79,7 +78,7 @@ public ClientConfig(ForgeConfigSpec.Builder builder) { } { - builder.push("Domestic"); + builder.push("Wandering"); MAX_ITEM_DISTANCE = builder.comment("Sets the maximum distance domestic items may be away from each other to be considered part of the cat's wandering area.").translation("catherder.config.client.domestic_item_max_distance").defineInRange("domestic_item_max_distance", 40, 20, 100); MAX_WANDER_DISTANCE = builder.comment("Sets the maximum distance a cat in wander mode will wander from its owner.").translation("catherder.config.client.wander_max_distance").defineInRange("wander_max_distance", 200, 20, 1000); @@ -134,7 +133,7 @@ public ServerConfig(ForgeConfigSpec.Builder builder) { { builder.push("Cat Constants"); - LITTERBOX = builder.comment("Enables litterbox maintenance").translation(Constants.TRANSLATION_KEY_CONFIG_ENABLE_LITTERBOX).define("enable_litterbox", false); + LITTERBOX = builder.comment("Enables litterbox maintenance").translation(Constants.TRANSLATION_KEY_CONFIG_ENABLE_LITTERBOX).define("enable_litterbox", true); DISABLE_HUNGER = builder.comment("Disable hunger mode for the cat").translation(Constants.TRANSLATION_KEY_CONFIG_DISABLE_HUNGER).define("disable_hunger", false); STARTING_ITEMS = builder.comment("When enabled you will spawn with a guide, Cat Charm and Command Emblem.").translation(Constants.TRANSLATION_KEY_CONFIG_ENABLE_STARTING_ITEMS).define("enable_starting_items", false); CAT_GENDER = builder.comment("When enabled, cats will be randomly assigned genders and will only mate and produce children with the opposite gender.").translation(Constants.TRANSLATION_KEY_CONFIG_ENABLE_GENDER).define("enable_gender", true); @@ -148,22 +147,21 @@ public ServerConfig(ForgeConfigSpec.Builder builder) { } public static class TalentConfig { - public Map DISABLED_TALENTS; + public Map DISABLED_TALENTS; public TalentConfig(ForgeConfigSpec.Builder builder) { builder.comment("Here you can disable talents.").push("Talents"); DISABLED_TALENTS = new HashMap<>(); - CatHerderAPI.TALENTS.get().forEach((talent) -> { - ResourceLocation loc = CatHerderAPI.TALENTS.get().getKey(talent); - DISABLED_TALENTS.put(loc, builder.define(CatHerderAPI.TALENTS.get().getKey(talent).toString(), true)); - }); + CatHerderAPI.TALENTS.get().forEach((loc) -> + DISABLED_TALENTS.put(loc, builder.define(loc.toString(), true)) + ); builder.pop(); } public boolean getFlag(Talent talent) { - ForgeConfigSpec.BooleanValue booleanValue = this.DISABLED_TALENTS.get(CatHerderAPI.TALENTS.get().getKey(talent)); + ForgeConfigSpec.BooleanValue booleanValue = this.DISABLED_TALENTS.get(talent); if (booleanValue == null) { return true; } diff --git a/src/main/java/com/sweetrpg/catherder/common/entity/CatBeamEntity.java b/src/main/java/com/sweetrpg/catherder/common/entity/CatBeamEntity.java index ef583c3f..4fcf99fb 100644 --- a/src/main/java/com/sweetrpg/catherder/common/entity/CatBeamEntity.java +++ b/src/main/java/com/sweetrpg/catherder/common/entity/CatBeamEntity.java @@ -69,7 +69,7 @@ protected void onHit(HitResult result) { @Override public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); + return (Packet) NetworkHooks.getEntitySpawningPacket(this); } @Override diff --git a/src/main/java/com/sweetrpg/catherder/common/entity/CatEntity.java b/src/main/java/com/sweetrpg/catherder/common/entity/CatEntity.java index 72455c36..63302da6 100644 --- a/src/main/java/com/sweetrpg/catherder/common/entity/CatEntity.java +++ b/src/main/java/com/sweetrpg/catherder/common/entity/CatEntity.java @@ -17,21 +17,18 @@ import com.sweetrpg.catherder.common.entity.ai.CatLieOnBedGoal; import com.sweetrpg.catherder.common.entity.ai.CatSitOnBlockGoal; import com.sweetrpg.catherder.common.entity.ai.*; +import com.sweetrpg.catherder.common.entity.ai.navigation.CatMoveControl; +import com.sweetrpg.catherder.common.entity.ai.navigation.CatPathNavigation; import com.sweetrpg.catherder.common.entity.misc.DimensionDependentArg; import com.sweetrpg.catherder.common.entity.stats.StatsTracker; import com.sweetrpg.catherder.common.lib.Constants; import com.sweetrpg.catherder.common.registry.*; import com.sweetrpg.catherder.common.storage.CatLocationStorage; import com.sweetrpg.catherder.common.storage.CatRespawnStorage; -import com.sweetrpg.catherder.common.util.Cache; -import com.sweetrpg.catherder.common.util.NBTUtil; -import com.sweetrpg.catherder.common.util.Util; -import com.sweetrpg.catherder.common.util.WorldUtil; +import com.sweetrpg.catherder.common.util.*; import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.core.Registry; -import net.minecraft.core.RegistryAccess; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; @@ -58,16 +55,16 @@ import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.damagesource.DamageType; -import net.minecraft.world.damagesource.DamageTypes; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.*; import net.minecraft.world.entity.ai.attributes.AttributeInstance; import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.entity.ai.control.MoveControl; import net.minecraft.world.entity.ai.goal.*; import net.minecraft.world.entity.ai.goal.target.NonTameRandomTargetGoal; +import net.minecraft.world.entity.ai.navigation.PathNavigation; import net.minecraft.world.entity.animal.Animal; import net.minecraft.world.entity.animal.Cat; import net.minecraft.world.entity.animal.CatVariant; @@ -99,10 +96,8 @@ import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.ITeleporter; import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fluids.FluidType; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.holdersets.HolderSetType; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -128,19 +123,21 @@ public class CatEntity extends AbstractCatEntity { private static final EntityDataAccessor RELAX_STATE_ONE = SynchedEntityData.defineId(CatEntity.class, EntityDataSerializers.BOOLEAN); // Use Cache.make to ensure static fields are not initialised too early (before Serializers have been registered) - private static final Cache>> ACCESSORIES = Cache.make(() -> SynchedEntityData.defineId(CatEntity.class, ModSerializers.ACCESSORY_SERIALIZER)); - private static final Cache>> TALENTS = Cache.make(() -> SynchedEntityData.defineId(CatEntity.class, ModSerializers.TALENT_SERIALIZER)); - private static final Cache> CAT_LEVEL = Cache.make(() -> SynchedEntityData.defineId(CatEntity.class, ModSerializers.CAT_LEVEL_SERIALIZER)); - private static final Cache> GENDER = Cache.make(() -> SynchedEntityData.defineId(CatEntity.class, ModSerializers.GENDER_SERIALIZER)); - private static final Cache> MODE = Cache.make(() -> SynchedEntityData.defineId(CatEntity.class, ModSerializers.MODE_SERIALIZER)); - private static final Cache>>> CAT_TREE_LOCATION = Cache.make(() -> SynchedEntityData.defineId(CatEntity.class, ModSerializers.CAT_TREE_LOC_SERIALIZER)); - private static final Cache>>> CAT_BOWL_LOCATION = Cache.make(() -> SynchedEntityData.defineId(CatEntity.class, ModSerializers.CAT_TREE_LOC_SERIALIZER)); - private static final Cache>>> LITTERBOX_LOCATION = Cache.make(() -> SynchedEntityData.defineId(CatEntity.class, ModSerializers.CAT_TREE_LOC_SERIALIZER)); - private static final Cache> ORIGINAL_BREED = Cache.make(() -> SynchedEntityData.defineId(CatEntity.class, ModSerializers.ORIGINAL_BREED_SERIALIZER)); + private static final Cache>> ACCESSORIES = Cache.make(() -> (EntityDataAccessor>) SynchedEntityData.defineId(CatEntity.class, ModSerializers.ACCESSORY_SERIALIZER)); + private static final Cache>> TALENTS = Cache.make(() -> (EntityDataAccessor>) SynchedEntityData.defineId(CatEntity.class, ModSerializers.TALENT_SERIALIZER)); + private static final Cache> CAT_LEVEL = Cache.make(() -> (EntityDataAccessor) SynchedEntityData.defineId(CatEntity.class, ModSerializers.CAT_LEVEL_SERIALIZER)); + private static final Cache> GENDER = Cache.make(() -> (EntityDataAccessor) SynchedEntityData.defineId(CatEntity.class, ModSerializers.GENDER_SERIALIZER)); + private static final Cache> MODE = Cache.make(() -> (EntityDataAccessor) SynchedEntityData.defineId(CatEntity.class, ModSerializers.MODE_SERIALIZER)); + private static final Cache>>> CAT_TREE_LOCATION = Cache.make(() -> (EntityDataAccessor>>) SynchedEntityData.defineId(CatEntity.class, ModSerializers.CAT_TREE_LOC_SERIALIZER)); + private static final Cache>>> CAT_BOWL_LOCATION = Cache.make(() -> (EntityDataAccessor>>) SynchedEntityData.defineId(CatEntity.class, ModSerializers.CAT_TREE_LOC_SERIALIZER)); + private static final Cache>>> LITTERBOX_LOCATION = Cache.make(() -> (EntityDataAccessor>>) SynchedEntityData.defineId(CatEntity.class, ModSerializers.CAT_TREE_LOC_SERIALIZER)); + private static final Cache> ORIGINAL_BREED = Cache.make(() -> (EntityDataAccessor) SynchedEntityData.defineId(CatEntity.class, ModSerializers.ORIGINAL_BREED_SERIALIZER)); private static final Cache> VARIANT = Cache.make(() -> SynchedEntityData.defineId(CatEntity.class, ModSerializers.VARIANT_SERIALIZER)); public final Map objects = new HashMap<>(); public final StatsTracker statsTracker = new StatsTracker(); + protected final PathNavigation defaultNavigation; + protected final MoveControl defaultMoveControl; // Cached values private final Cache spendablePoints = Cache.make(this::getSpendablePointsInternal); private final List alterations = new ArrayList<>(4); @@ -169,6 +166,12 @@ public CatEntity(EntityType type, Level worldIn) { super(type, worldIn); this.setTame(false); this.setGender(Gender.random(this.getRandom())); + + this.navigation = new CatPathNavigation(this, worldIn); + this.moveControl = new CatMoveControl(this); + + this.defaultNavigation = this.navigation; + this.defaultMoveControl = this.moveControl; } public void setRelaxStateOne(boolean p_28186_) { @@ -206,7 +209,7 @@ protected void defineSynchedData() { this.entityData.define(CAT_LEVEL.get(), new CatLevel(0, 0)); this.entityData.define(SIZE, (byte) 3); this.entityData.define(ORIGINAL_BREED_INT, 0); - this.entityData.define(VARIANT_STR, CatVariant.TABBY.toString()); + this.entityData.define(VARIANT_STR, BuiltInRegistries.CAT_VARIANT.get(CatVariant.TABBY).texture().getPath()); this.entityData.define(TOY_VARIANT, ItemStack.EMPTY); this.entityData.define(CAT_TREE_LOCATION.get(), new DimensionDependentArg<>(() -> EntityDataSerializers.OPTIONAL_BLOCK_POS)); this.entityData.define(CAT_BOWL_LOCATION.get(), new DimensionDependentArg<>(() -> EntityDataSerializers.OPTIONAL_BLOCK_POS)); @@ -234,15 +237,15 @@ protected void registerGoals() { this.goalSelector.addGoal(5, new SkittishModeGoal<>(this)); this.goalSelector.addGoal(6, new FetchGoal(this, 1.3D, 32.0F)); - this.goalSelector.addGoal(6, new CatDomesticWanderGoal(this, 1.0D, ConfigHandler.CLIENT.MAX_ITEM_DISTANCE.get())); - this.goalSelector.addGoal(6, new CatWanderGoal(this, 1.0D, ConfigHandler.CLIENT.MAX_WANDER_DISTANCE.get())); + this.goalSelector.addGoal(6, new CatDomesticWanderGoal(this, 1.0D)); +// this.goalSelector.addGoal(6, new CatWanderGoal(this, 1.0D, ConfigHandler.CLIENT.MAX_WANDER_DISTANCE.get())); this.goalSelector.addGoal(7, new CatFollowOwnerGoal(this, 1.0D, 20.0F, 4.0F)); this.goalSelector.addGoal(9, new CatLieOnBedGoal<>(this, 1.1F, 16)); this.goalSelector.addGoal(9, new CatSitOnBlockGoal<>(this, 0.8F)); - this.goalSelector.addGoal(10, new UseLitterboxGoal<>(this, 10)); + this.goalSelector.addGoal(10, new UseLitterboxGoal<>(this, 20)); this.goalSelector.addGoal(12, new BreedGoal(this, 1.0D)); @@ -457,12 +460,15 @@ else if((this.wetSource != null || this.isShaking) && this.isShaking) { } } + this.setMaxUpStep(this.isVehicle() ? 1f : 0.6f); + this.alterations.forEach((alter) -> alter.tick(this)); } @Override public void aiStep() { super.aiStep(); + if(!this.level.isClientSide && this.wetSource != null && !this.isShaking && !this.isPathFinding() && this.isOnGround()) { this.startShaking(); this.level.broadcastEntityEvent(this, Constants.EntityState.CAT_START_SHAKING); @@ -524,12 +530,20 @@ public void aiStep() { if(this.tickCount % 50 == 0) { ResourceKey dimKey = this.level.dimension(); Optional bowlPos = this.getBowlPos(dimKey); + Optional boxPos = this.getLitterboxPos(dimKey); + Optional treePos = this.getCatTreePos(dimKey); // If the cat has a cat bowl in this dimension then check if it is still there // Only check if the chunk it is in is loaded if(bowlPos.isPresent() && this.level.hasChunkAt(bowlPos.get()) && !this.level.getBlockState(bowlPos.get()).is(ModBlocks.CAT_BOWL.get())) { this.setBowlPos(dimKey, Optional.empty()); } + if(boxPos.isPresent() && this.level.hasChunkAt(boxPos.get()) && !this.level.getBlockState(boxPos.get()).is(ModBlocks.LITTERBOX.get())) { + this.setLitterboxPos(dimKey, Optional.empty()); + } + if(treePos.isPresent() && this.level.hasChunkAt(treePos.get()) && !this.level.getBlockState(treePos.get()).is(ModBlocks.CAT_TREE.get())) { + this.setCatTreePos(dimKey, Optional.empty()); + } } this.alterations.forEach((alter) -> alter.livingTick(this)); @@ -622,21 +636,18 @@ public InteractionResult mobInteract(Player player, InteractionHand hand) { } @Override - public boolean canBeRiddenUnderFluidType(FluidType fluidType, Entity rider) { - if(fluidType == ForgeMod.WATER_TYPE.get()) { - for(ICatAlteration alter : this.alterations) { - InteractionResult result = alter.canBeRiddenInWater(this, rider); + public boolean dismountsUnderwater() { + for (ICatAlteration alter : this.alterations) { + InteractionResult result = alter.canBeRiddenInWater(this); - if(result.shouldSwing()) { - return true; - } - else if(result == InteractionResult.FAIL) { - return false; - } + if (result.shouldSwing()) { + return false; + } else if (result == InteractionResult.FAIL) { + return true; } } - return super.canBeRiddenUnderFluidType(fluidType, rider); + return super.dismountsUnderwater(); } @Override @@ -702,26 +713,12 @@ public boolean causeFallDamage(float distance, float damageMultiplier, DamageSou // TODO @Override public int getMaxFallDistance() { - return super.getMaxFallDistance(); + return Integer.MAX_VALUE; } @Override protected int calculateFallDamage(float distance, float damageMultiplier) { return 0; -// MobEffectInstance effectInst = this.getEffect(MobEffects.JUMP); -// float f = effectInst == null ? 0.0F : effectInst.getAmplifier() + 1; -// distance -= f; -// -// for(ICatAlteration alter : this.alterations) { -// InteractionResultHolder result = alter.calculateFallDistance(this, distance); -// -// if(result.getResult().shouldSwing()) { -// distance = result.getObject(); -// break; -// } -// } -// -// return Mth.ceil((distance - 3.0F - f) * damageMultiplier); } @Override @@ -930,7 +927,7 @@ else if(result == InteractionResult.FAIL) { critModifiers.forEach(attackDamageInst::removeModifier); } - boolean flag = target.hurt(this.damageSources().generic(), damage); + boolean flag = target.hurt(this.damageSources().mobAttack(this), damage); if(flag) { this.doEnchantDamageEffects(this, target); this.statsTracker.increaseDamageDealt(damage); @@ -1321,7 +1318,11 @@ public void addAdditionalSaveData(CompoundTag compound) { compound.putInt("level_normal", this.getCatLevel().getLevel(Type.NORMAL)); compound.putInt("level_dire", this.getCatLevel().getLevel(Type.WILD)); compound.putInt("original_breed", this.getOriginalBreed()); - compound.putInt("cat_variant", this.getOriginalBreed()); + var variant = this.getVariant(); + if(variant != null) { + compound.putString("cat_variant", BuiltInRegistries.CAT_VARIANT.getKey(variant).getPath()); + } + NBTUtil.writeItemStack(compound, "fetchItem", this.getToyVariant()); DimensionDependentArg> bedsData = this.entityData.get(CAT_TREE_LOCATION.get()); @@ -1547,7 +1548,13 @@ public void readAdditionalSaveData(CompoundTag compound) { this.setCatSize(compound.getInt("catSize")); } this.setOriginalBreed(compound.getInt("original_breed")); - this.setVariant(BuiltInRegistries.CAT_VARIANT.get(new ResourceLocation(compound.getString("cat_variant")))); + if(compound.contains("cat_variant", Tag.TAG_STRING)) { + var variant = BuiltInRegistries.CAT_VARIANT.get(new ResourceLocation(compound.getString("cat_variant"))); + this.setVariant(variant); + } + else { + BackwardsComp.getCatVariant(compound, this::setVariant); + } } catch (Exception e) { CatHerder.LOGGER.error("Failed to load info: " + e.getMessage()); @@ -2323,11 +2330,9 @@ public void travel(Vec3 positionIn) { super.travel(positionIn); this.addMovementStat(this.getX() - this.xo, this.getY() - this.yo, this.getZ() - this.zo); } - -// @Override // public void travel(Vec3 positionIn) { // if(this.isAlive()) { -// if(this.isVehicle() && this.canRiderInteract()) { +// if(this.isVehicle() && this.canBeControlledByRider()) { // LivingEntity livingentity = (LivingEntity) this.getControllingPassenger(); // // // Face the cat in the direction of the controlling passenger @@ -2371,11 +2376,11 @@ public void travel(Vec3 positionIn) { // //this.playJumpSound(); // } // -// // Mark as unable to jump until reset +// // Mark as unable jump until reset // this.jumpPower = 0.0F; // } // -//// this.getFlyingSpeed()flyingSpeed = this.getSpeed() * 0.1F; +// this.flyingSpeed = this.getSpeed() * 0.1F; // if(this.isControlledByLocalInstance()) { // // Set the move speed and move the cat in the direction of the controlling entity // this.setSpeed((float) this.getAttribute(Attributes.MOVEMENT_SPEED).getValue() * 0.5F); @@ -2394,7 +2399,7 @@ public void travel(Vec3 positionIn) { // } // // // -//// this.animationSpeedOld = this.animationSpeed; +// this.animationSpeedOld = this.animationSpeed; // double changeX = this.getX() - this.xo; // double changeY = this.getZ() - this.zo; // float f4 = Mth.sqrt((float) (changeX * changeX + changeY * changeY)) * 4.0F; @@ -2403,8 +2408,8 @@ public void travel(Vec3 positionIn) { // f4 = 1.0F; // } // -//// this.animationSpeed += (f4 - this.animationSpeed) * 0.4F; -//// this.animationPosition += this.animationSpeed; +// this.animationSpeed += (f4 - this.animationSpeed) * 0.4F; +// this.animationPosition += this.animationSpeed; // // if(this.onClimbable()) { // this.fallDistance = 0.0F; @@ -2412,7 +2417,7 @@ public void travel(Vec3 positionIn) { // } // else { // this.maxUpStep = 0.5F; // Default -//// this.flyingSpeed = 0.02F; // Default +// this.flyingSpeed = 0.02F; // Default // super.travel(positionIn); // } // @@ -2496,6 +2501,29 @@ public List getFoodHandlers() { return this.foodHandlers; } + @Override + public void resetNavigation() { + this.setNavigation(this.defaultNavigation); + } + + @Override + public void resetMoveControl() { + this.setMoveControl(this.defaultMoveControl); + + } + + @Override + public boolean canSwimUnderwater() { + for (ICatAlteration alter : this.alterations) { + InteractionResult result = alter.canSwimUnderwater(this); + + if (result.shouldSwing()) { + return true; + } + } + return false; + } + public BlockPos getTargetBlock() { return this.targetBlock; } @@ -2513,43 +2541,28 @@ public void setOriginalBreed(int originalBreed) { } public CatVariant getVariant() { - try { - var data = this.entityData.get(VARIANT_STR); - return BuiltInRegistries.CAT_VARIANT.get(new ResourceLocation(data)); - } - catch (Exception e) { - CatHerder.LOGGER.warn(e.toString()); - } - - return null; -// -// if(data == null) { -// return BuiltInRegistries.CAT_VARIANT.get(CatVariant.ALL_BLACK); -// } -// // try { -// + var data = this.entityData.get(VARIANT_STR); + return BuiltInRegistries.CAT_VARIANT.get(new ResourceLocation(data)); // } -// catch(Exception e) { -// +// catch (Exception e) { +// CatHerder.LOGGER.warn(e.toString()); // } // -// return BuiltInRegistries.CAT_VARIANT.get(CatVariant.ALL_BLACK); +// return null; } public void setVariant(CatVariant variant) { var varResLoc = BuiltInRegistries.CAT_VARIANT.getKey(variant); - if(varResLoc != null) { +// if(varResLoc != null) { var path = varResLoc.getPath(); this.entityData.set(VARIANT_STR, path); - } - else { - CatHerder.LOGGER.error("Variant could not be found for parameter {}", variant); - } +// } +// else { +// CatHerder.LOGGER.error("Variant could not be found for parameter {}", variant); +// } } - public - static class CatRelaxOnOwnerGoal extends Goal { private final CatEntity cat; @Nullable diff --git a/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatDomesticWanderGoal.java b/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatDomesticWanderGoal.java index 8ca31410..5e7176ed 100644 --- a/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatDomesticWanderGoal.java +++ b/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatDomesticWanderGoal.java @@ -2,6 +2,7 @@ import com.sweetrpg.catherder.CatHerder; import com.sweetrpg.catherder.api.feature.Mode; +import com.sweetrpg.catherder.common.config.ConfigHandler; import com.sweetrpg.catherder.common.entity.CatEntity; import com.sweetrpg.catherder.common.util.MathUtil; import net.minecraft.core.BlockPos; @@ -21,17 +22,15 @@ public class CatDomesticWanderGoal extends Goal { protected final CatEntity cat; protected final double speed; - protected final float maxiumItemDistance; protected int executionChance; private final double NUM_BLOCKS_AWAY = 15; private final double BLOCK_SIZE = 12; private final double MAX_DISTANCE = NUM_BLOCKS_AWAY * BLOCK_SIZE; - public CatDomesticWanderGoal(CatEntity catIn, double speedIn, float maxiumItemDistance) { + public CatDomesticWanderGoal(CatEntity catIn, double speedIn) { this.cat = catIn; this.speed = speedIn; - this.maxiumItemDistance = maxiumItemDistance; this.executionChance = 60; this.setFlags(EnumSet.of(Flag.MOVE)); } @@ -61,7 +60,7 @@ public boolean canUse() { CatHerder.LOGGER.debug("A cat item is missing for domestic mode wander."); return false; } - final var blockDistance = this.maxiumItemDistance * 12; + final var blockDistance = ConfigHandler.CLIENT.MAX_ITEM_DISTANCE.get() * 12; if(itemPositions.a.get().distSqr(itemPositions.b.get()) > blockDistance) { CatHerder.LOGGER.debug("The distance between {}'s litter box and food bowl is greater than {}", this.cat, blockDistance); return false; @@ -85,39 +84,6 @@ public boolean canUse() { return true; } -// private Optional> closestDomesticItem() { -// Optional bowlPos = this.cat.getBowlPos(); -// Optional litterboxPos = this.cat.getLitterboxPos(); -// Optional treePos = this.cat.getCatTreePos(); -// -// if(bowlPos.isEmpty() || -// litterboxPos.isEmpty() || -// treePos.isEmpty()) { -// return Optional.empty(); -// } -// -// double closestDist = Double.MAX_VALUE; -// BlockPos closestPos = null; -// -// double bowlDist = bowlPos.get().distSqr(this.cat.blockPosition()); -// if(bowlDist < closestDist) { -// closestDist = bowlDist; -// closestPos = bowlPos.get(); -// } -// double litterboxDist = litterboxPos.get().distSqr(this.cat.blockPosition()); -// if(litterboxDist < closestDist) { -// closestDist = litterboxDist; -// closestPos = litterboxPos.get(); -// } -// double treeDist = treePos.get().distSqr(this.cat.blockPosition()); -// if(treeDist < closestDist) { -// closestDist = treeDist; -// closestPos = treePos.get(); -// } -// -// return Optional.of(new Tuple<>(closestPos, closestDist)); -// } - @Override public void tick() { if(this.cat.getNoActionTime() >= 100) { diff --git a/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatFollowOwnerGoal.java b/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatFollowOwnerGoal.java index e1a03699..b4b558c9 100644 --- a/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatFollowOwnerGoal.java +++ b/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatFollowOwnerGoal.java @@ -2,13 +2,13 @@ import com.sweetrpg.catherder.api.feature.Mode; import com.sweetrpg.catherder.api.inferface.IThrowableItem; +import com.sweetrpg.catherder.common.config.ConfigHandler; import com.sweetrpg.catherder.common.entity.CatEntity; import com.sweetrpg.catherder.common.util.EntityUtil; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.ai.goal.Goal; import net.minecraft.world.entity.ai.navigation.PathNavigation; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; import net.minecraft.world.level.pathfinder.BlockPathTypes; import java.util.EnumSet; @@ -17,10 +17,9 @@ public class CatFollowOwnerGoal extends Goal { private final CatEntity cat; private final PathNavigation navigator; - private final Level world; private final double followSpeed; - private final float stopDist; // If closer than stopDist stop moving towards owner - private final float startDist; // If further than startDist moving towards owner + private final float stopDist; // If closer than stopDist, stop moving towards owner + private final float startDist; // If further than startDist, start moving towards owner private LivingEntity owner; private int timeToRecalcPath; @@ -28,7 +27,6 @@ public class CatFollowOwnerGoal extends Goal { public CatFollowOwnerGoal(CatEntity catIn, double speedIn, float startMoveDist, float stopMoveDist) { this.cat = catIn; - this.world = catIn.level; this.followSpeed = speedIn; this.navigator = catIn.getNavigation(); this.startDist = startMoveDist; @@ -42,16 +40,23 @@ public boolean canUse() { if(owner == null) { return false; } - else if(this.cat.isMode(Mode.WANDERING, Mode.DOMESTIC)) { +// else if (this.cat.getMode() == Mode.PATROL) { +// return false; +// } + if(owner.isSpectator()) { return false; } - else if(owner.isSpectator()) { + + if(this.cat.isInSittingPose()) { return false; } - else if(this.cat.isInSittingPose()) { - return false; + + if(this.cat.isHungry()) { + this.owner = owner; + return true; } - else if(!this.cat.hasToy() && this.cat.distanceToSqr(owner) < this.getMinStartDistanceSq()) { + + if(!this.cat.hasToy() && (this.cat.distanceToSqr(owner) < this.getMinStartDistanceSq())) { return false; } @@ -64,11 +69,12 @@ public boolean canContinueToUse() { if(this.navigator.isDone()) { return false; } - else if(this.cat.isInSittingPose()) { + + if(this.cat.isInSittingPose()) { return false; } - return this.cat.distanceToSqr(this.owner) > this.stopDist * this.stopDist; + return this.cat.distanceToSqr(this.owner) > (this.stopDist * this.stopDist); } @Override @@ -82,7 +88,7 @@ public void start() { public void stop() { if(this.cat.hasToy()) { double distanceToOwner = this.owner.distanceToSqr(this.cat); - if(distanceToOwner <= this.stopDist * this.stopDist) { + if(distanceToOwner <= (this.stopDist * this.stopDist)) { IThrowableItem throwableItem = this.cat.getThrowableItem(); ItemStack fetchItem = throwableItem != null ? throwableItem.getReturnStack(this.cat.getToyVariant()) : this.cat.getToyVariant(); @@ -118,6 +124,11 @@ public float getMinStartDistanceSq() { return 4F; } + if(this.cat.isMode(Mode.WANDERING)) { + var maxDist = ConfigHandler.CLIENT.MAX_WANDER_DISTANCE.get(); + return maxDist * maxDist; + } + return this.startDist * this.startDist; } } diff --git a/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatWanderGoal.java b/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatWanderGoal.java index 7874864f..5f9b6cb0 100644 --- a/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatWanderGoal.java +++ b/src/main/java/com/sweetrpg/catherder/common/entity/ai/CatWanderGoal.java @@ -10,6 +10,7 @@ import javax.annotation.Nullable; import java.util.EnumSet; +import java.util.Random; public class CatWanderGoal extends Goal { @@ -19,14 +20,14 @@ public class CatWanderGoal extends Goal { protected final float maximumDistance; protected int executionChance; - private final double NUM_BLOCKS_AWAY = 15; - private final double BLOCK_SIZE = 12; - private final double MAX_DISTANCE = NUM_BLOCKS_AWAY * BLOCK_SIZE; +// private final double NUM_BLOCKS_AWAY = 15; +// private final double BLOCK_SIZE = 12; +// private final double MAX_DISTANCE = NUM_BLOCKS_AWAY * BLOCK_SIZE; - public CatWanderGoal(CatEntity catIn, double speedIn, float maxiumDistance) { + public CatWanderGoal(CatEntity catIn, double speedIn, float maximumDistance) { this.cat = catIn; this.speed = speedIn; - this.maximumDistance = maxiumDistance; + this.maximumDistance = maximumDistance; this.executionChance = 60; this.setFlags(EnumSet.of(Goal.Flag.MOVE)); } @@ -41,6 +42,10 @@ public boolean canUse() { return false; } + if(this.cat.isHungry()) { + return false; + } + if(!this.cat.isMode(Mode.WANDERING)) { return false; } diff --git a/src/main/java/com/sweetrpg/catherder/common/entity/ai/FetchGoal.java b/src/main/java/com/sweetrpg/catherder/common/entity/ai/FetchGoal.java index fde76bac..04a0ea34 100644 --- a/src/main/java/com/sweetrpg/catherder/common/entity/ai/FetchGoal.java +++ b/src/main/java/com/sweetrpg/catherder/common/entity/ai/FetchGoal.java @@ -20,7 +20,12 @@ public boolean canUse() { if(this.cat.isInSittingPose()) { return false; } - else if(this.cat.hasToy()) { + + if(this.cat.hasToy()) { + return false; + } + + if(this.cat.isHungry()) { return false; } diff --git a/src/main/java/com/sweetrpg/catherder/common/entity/ai/GuardModeGoal.java b/src/main/java/com/sweetrpg/catherder/common/entity/ai/GuardModeGoal.java index 2c1de59f..8354a8a0 100644 --- a/src/main/java/com/sweetrpg/catherder/common/entity/ai/GuardModeGoal.java +++ b/src/main/java/com/sweetrpg/catherder/common/entity/ai/GuardModeGoal.java @@ -12,29 +12,24 @@ public class GuardModeGoal extends NearestAttackableTargetGoal { private LivingEntity owner; public GuardModeGoal(CatEntity catIn, boolean checkSight) { - super(catIn, Monster.class, 0, checkSight, false, null); + super(catIn, Monster.class, 0, checkSight, true, null); this.cat = catIn; } @Override public boolean canUse() { LivingEntity owner = this.cat.getOwner(); - if (owner == null) { + if(owner == null) { return false; } - if (!this.cat.isMode(Mode.GUARD)) { + if(!this.cat.isMode(Mode.GUARD)) { return false; } this.owner = owner; - if (super.canUse()) { - this.owner = owner; - return true; - } - - return false; + return super.canUse(); } @Override @@ -44,6 +39,6 @@ protected double getFollowDistance() { @Override protected void findTarget() { - this.target = this.cat.level.getNearestEntity(this.targetType, this.targetConditions, this.cat, this.owner.getX(), this.owner.getEyeY(), this.owner.getZ(), this.getTargetSearchArea(this.getFollowDistance())); + this.target = this.cat.level.getNearestEntity(this.targetType, this.targetConditions, this.cat, this.owner.getX(), this.owner.getEyeY(), this.owner.getZ(), this.getTargetSearchArea(this.getFollowDistance())); } } diff --git a/src/main/java/com/sweetrpg/catherder/common/entity/ai/PlayInCardboardBoxGoal.java b/src/main/java/com/sweetrpg/catherder/common/entity/ai/PlayInCardboardBoxGoal.java index 091dd4ce..20241105 100644 --- a/src/main/java/com/sweetrpg/catherder/common/entity/ai/PlayInCardboardBoxGoal.java +++ b/src/main/java/com/sweetrpg/catherder/common/entity/ai/PlayInCardboardBoxGoal.java @@ -33,7 +33,7 @@ public PlayInCardboardBoxGoal(CatEntity cat, float speedModifier, int searchRang * method as well. */ public boolean canUse() { - return this.cat.isTame() && !this.cat.isOrderedToSit() && !this.cat.isLying() && super.canUse(); + return this.cat.isTame() && !this.cat.isOrderedToSit() && !this.cat.isLying() && !this.cat.isHungry() && super.canUse(); } /** @@ -127,5 +127,3 @@ protected boolean isValidTarget(LevelReader level, BlockPos pos) { return level.isEmptyBlock(pos.above()) && level.getBlockState(pos).is(ModBlocks.CARDBOARD_BOX.get()); } } - - diff --git a/src/main/java/com/sweetrpg/catherder/common/entity/ai/navigation/CatMoveControl.java b/src/main/java/com/sweetrpg/catherder/common/entity/ai/navigation/CatMoveControl.java new file mode 100644 index 00000000..1b0513ec --- /dev/null +++ b/src/main/java/com/sweetrpg/catherder/common/entity/ai/navigation/CatMoveControl.java @@ -0,0 +1,63 @@ +package com.sweetrpg.catherder.common.entity.ai.navigation; + +import com.sweetrpg.catherder.common.entity.CatEntity; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.tags.BlockTags; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.entity.ai.control.MoveControl; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.shapes.VoxelShape; + +public class CatMoveControl extends MoveControl { + + private CatEntity cat; + + public CatMoveControl(CatEntity cat) { + super(cat); + this.cat = cat; + } + + @Override + public void tick() { + double dy = 0; + if(this.hasWanted()) { + dy = Math.abs(this.getWantedY() - this.cat.getY()); + } + + if(this.operation == MoveControl.Operation.MOVE_TO && dy > 0.75) { + final float SNEAK_SPEED_1 = 0.35f; + final float SNEAK_SPEED_2 = 0.25f; + + this.operation = MoveControl.Operation.WAIT; + double d0 = this.wantedX - this.mob.getX(); + double d1 = this.wantedZ - this.mob.getZ(); + double d2 = this.wantedY - this.mob.getY(); + double d3 = d0 * d0 + d2 * d2 + d1 * d1; + if(d3 < (double) 2.5000003E-7F) { + this.mob.setZza(0.0F); + return; + } + + float f9 = (float) (Mth.atan2(d1, d0) * (double) (180F / (float) Math.PI)) - 90.0F; + this.mob.setYRot(this.rotlerp(this.mob.getYRot(), f9, 90.0F)); + float speed_cap = dy > 1.75 ? SNEAK_SPEED_2 : SNEAK_SPEED_1; + float speed = Math.min(speed_cap, + (float) (this.speedModifier * this.mob.getAttributeValue(Attributes.MOVEMENT_SPEED))); + this.mob.setSpeed(speed); + BlockPos blockpos = this.mob.blockPosition(); + BlockState blockstate = this.mob.level.getBlockState(blockpos); + VoxelShape voxelshape = blockstate.getCollisionShape(this.mob.level, blockpos); + if(d2 > (double) this.mob.getStepHeight() && d0 * d0 + d1 * d1 < (double) Math.max(1.0F, this.mob.getBbWidth()) || !voxelshape.isEmpty() && this.mob.getY() < voxelshape.max(Direction.Axis.Y) + (double) blockpos.getY() && !blockstate.is(BlockTags.DOORS) && !blockstate.is(BlockTags.FENCES)) { + this.mob.getJumpControl().jump(); + this.operation = MoveControl.Operation.JUMPING; + } + + return; + } + + super.tick(); + } + +} diff --git a/src/main/java/com/sweetrpg/catherder/common/entity/ai/navigation/CatPathNavigation.java b/src/main/java/com/sweetrpg/catherder/common/entity/ai/navigation/CatPathNavigation.java new file mode 100644 index 00000000..f8e09346 --- /dev/null +++ b/src/main/java/com/sweetrpg/catherder/common/entity/ai/navigation/CatPathNavigation.java @@ -0,0 +1,98 @@ +package com.sweetrpg.catherder.common.entity.ai.navigation; + +import com.sweetrpg.catherder.common.entity.CatEntity; +import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.ai.navigation.GroundPathNavigation; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.pathfinder.BlockPathTypes; +import net.minecraft.world.level.pathfinder.WalkNodeEvaluator; +import net.minecraft.world.phys.Vec3; + +public class CatPathNavigation extends GroundPathNavigation { + + private CatEntity cat; + + public CatPathNavigation(CatEntity cat, Level level) { + super(cat, level); + this.cat = cat; + } + + @Override + protected void followThePath() { + if (invalidateIfNextNodeIsTooHigh()) return; + + var currentPos = this.getTempMobPos(); + this.maxDistanceToWaypoint = + this.mob.getBbWidth() > 0.75F ? + this.mob.getBbWidth() / 2.0F + : 0.75F - this.mob.getBbWidth() / 2.0F; + + var nextPos = this.path.getNextNodePos(); + double dx = Math.abs(this.mob.getX() - ((double)nextPos.getX() + 0.5)); + double dy = Math.abs(this.mob.getY() - (double)nextPos.getY()); + double dz = Math.abs(this.mob.getZ() - ((double)nextPos.getZ() + 0.5)); + + boolean isCloseEnough = + dx <= (double)this.maxDistanceToWaypoint + && dy < 1.0D + && dz <= (double)this.maxDistanceToWaypoint; + boolean canCutCorner = + this.canCutCorner(this.path.getNextNode().type) + && this.shouldTargetNextNodeInDirection(currentPos); + + if (isCloseEnough || canCutCorner) { + this.path.advance(); + } + + this.doStuckDetection(currentPos); + } + + protected boolean invalidateIfNextNodeIsTooHigh() { + var path = this.path; + if (path == null) return true; + var nextPos = path.getNextNodePos(); + var dy = this.cat.getY() - (double)nextPos.getY(); + + if (dy < -1.75) { + this.stop(); + return true; + } + + var nextNode = path.getNextNode(); + if (cat.getPathfindingMalus(nextNode.type) < 0) { + this.stop(); + return true; + } + + return false; + } + + private boolean shouldTargetNextNodeInDirection(Vec3 current_pos) { + var path = this.path; + if (path == null) return false; + if (path.getNextNodeIndex() + 1 >= path.getNodeCount()) { + return false; + } + + var next_pos = Vec3.atBottomCenterOf(path.getNextNodePos()); + if (!current_pos.closerThan(next_pos, 2.0D)) { + return false; + } + + Vec3 next2th_node = Vec3.atBottomCenterOf(path.getNodePos(path.getNextNodeIndex() + 1)); + Vec3 v_next_next2th = next2th_node.subtract(next_pos); + Vec3 v_next_current = current_pos.subtract(next_pos); + //small alpha + if (v_next_next2th.dot(v_next_current) <= 0.0D) return false; + + Vec3 v_current_next2th = next2th_node.subtract(current_pos); + double v_current_next2th_lSqr = v_current_next2th.lengthSqr(); + if (v_current_next2th_lSqr < 1) return true; + Vec3 v_add = v_current_next2th.normalize(); + var check_b0 = BlockPos.containing(current_pos.add(v_add)); + var type = WalkNodeEvaluator + .getBlockPathTypeStatic(level, check_b0.mutable()); + return type == BlockPathTypes.WALKABLE; + } + +} diff --git a/src/main/java/com/sweetrpg/catherder/common/event/EventHandler.java b/src/main/java/com/sweetrpg/catherder/common/event/EventHandler.java index 58326040..68d6544e 100644 --- a/src/main/java/com/sweetrpg/catherder/common/event/EventHandler.java +++ b/src/main/java/com/sweetrpg/catherder/common/event/EventHandler.java @@ -17,10 +17,6 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.Biomes; -import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraftforge.common.world.BiomeGenerationSettingsBuilder; import net.minecraftforge.event.entity.EntityJoinLevelEvent; import net.minecraftforge.event.entity.living.LootingLevelEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; @@ -41,7 +37,7 @@ public void rightClickEntity(final PlayerInteractEvent.EntityInteract event) { if(target.getType() == EntityType.CAT && target instanceof TamableAnimal && stack.getItem() == ModItems.TRAINING_TREAT.get()) { event.setCanceled(true); - Cat vanillaCat = (Cat) target; + TamableAnimal vanillaCat = (TamableAnimal) target; Player player = event.getEntity(); @@ -57,8 +53,8 @@ public void rightClickEntity(final PlayerInteractEvent.EntityInteract event) { cat.setOrderedToSit(false); cat.setAge(vanillaCat.getAge()); cat.absMoveTo(vanillaCat.getX(), vanillaCat.getY(), vanillaCat.getZ(), vanillaCat.getYRot(), vanillaCat.getXRot()); -// cat.setOriginalBreed(vanillaCat.getUUID().variant()); - cat.setVariant(vanillaCat.getVariant()); + cat.setOriginalBreed(-1 /*((net.minecraft.world.entity.animal.Cat) vanillaCat).getCatType()*/); + cat.setVariant(((Cat)vanillaCat).getVariant()); world.addFreshEntity(cat); diff --git a/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/CatTreeRecipe.java b/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/CatTreeRecipe.java index fbccd70e..428754ad 100644 --- a/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/CatTreeRecipe.java +++ b/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/CatTreeRecipe.java @@ -21,8 +21,8 @@ public class CatTreeRecipe extends CustomRecipe implements IShapedRecipe { - public CatTreeRecipe(ResourceLocation resource, CraftingBookCategory craftingBookCategory) { - super(resource, craftingBookCategory); + public CatTreeRecipe(ResourceLocation resource, CraftingBookCategory p_249010_) { + super(resource, p_249010_); } @Override @@ -92,7 +92,7 @@ else if(row == 1 && col == 1) { } @Override - public ItemStack assemble(CraftingContainer inv, RegistryAccess access) { + public ItemStack assemble(CraftingContainer inv, RegistryAccess p_267165_) { IColorMaterial colorId = CatTreeUtil.getColorFromStack(CatHerderAPI.COLOR_MATERIAL.get(), inv.getItem(1)); // ICasingMaterial casingId = CattreeUtil.getCasingFromStack(CatHerderAPI.CASING_MATERIAL, inv.getItem(0)); diff --git a/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/CatTreeRecipeDyed.java b/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/CatTreeRecipeDyed.java index 4178b377..a0cf601d 100644 --- a/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/CatTreeRecipeDyed.java +++ b/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/CatTreeRecipeDyed.java @@ -20,8 +20,8 @@ public class CatTreeRecipeDyed extends CustomRecipe implements Recipe { - public CatTreeRecipeDyed(ResourceLocation resource, CraftingBookCategory craftingBookCategory) { - super(resource, craftingBookCategory); + public CatTreeRecipeDyed(ResourceLocation resource, CraftingBookCategory p_249010_) { + super(resource, p_249010_); } @Override @@ -62,7 +62,7 @@ public boolean matches(CraftingContainer inv, Level worldIn) { } @Override - public ItemStack assemble(CraftingContainer inv, RegistryAccess access) { + public ItemStack assemble(CraftingContainer inv, RegistryAccess p_267165_) { for (int col = 0; col < inv.getWidth(); col++) { for (int row = 0; row < inv.getHeight(); row++) { IDyeMaterial dye = CatTreeUtil.getDyeFromStack(CatHerderAPI.DYE_MATERIAL.get(), inv.getItem(row * inv.getWidth() + col)); diff --git a/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/PetDoorRecipe.java b/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/PetDoorRecipe.java index a800ab4f..9f7c483d 100644 --- a/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/PetDoorRecipe.java +++ b/src/main/java/com/sweetrpg/catherder/common/inventory/recipe/PetDoorRecipe.java @@ -19,8 +19,8 @@ public class PetDoorRecipe extends CustomRecipe implements IShapedRecipe { - public PetDoorRecipe(ResourceLocation resource, CraftingBookCategory craftingBookCategory) { - super(resource, craftingBookCategory); + public PetDoorRecipe(ResourceLocation resource, CraftingBookCategory p_249010_) { + super(resource, p_249010_); } @Override @@ -61,7 +61,7 @@ else if(structureId != id) { } @Override - public ItemStack assemble(CraftingContainer inv, RegistryAccess access) { + public ItemStack assemble(CraftingContainer inv, RegistryAccess p_267165_) { IStructureMaterial structureId = PetDoorUtil.getStructureFromStack(CatHerderAPI.STRUCTURE_MATERIAL.get(), inv.getItem(1)); return PetDoorUtil.createItemStack(structureId); diff --git a/src/main/java/com/sweetrpg/catherder/common/item/RadarItem.java b/src/main/java/com/sweetrpg/catherder/common/item/RadarItem.java index e31f4145..49e61cc9 100644 --- a/src/main/java/com/sweetrpg/catherder/common/item/RadarItem.java +++ b/src/main/java/com/sweetrpg/catherder/common/item/RadarItem.java @@ -4,7 +4,6 @@ import com.sweetrpg.catherder.common.storage.CatLocationData; import com.sweetrpg.catherder.common.storage.CatLocationStorage; import net.minecraft.Util; -import net.minecraft.network.chat.CommonComponents; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceKey; import net.minecraft.util.Mth; @@ -48,7 +47,7 @@ public InteractionResultHolder use(Level worldIn, Player playerIn, In ResourceKey dimCurr = playerIn.level.dimension(); - playerIn.sendSystemMessage(CommonComponents.EMPTY); + playerIn.sendSystemMessage(Component.literal("")); CatLocationStorage locationManager = CatLocationStorage.get(worldIn); List ownCats = locationManager.getCats(playerIn, dimCurr).collect(Collectors.toList()); diff --git a/src/main/java/com/sweetrpg/catherder/common/item/TreatBagItem.java b/src/main/java/com/sweetrpg/catherder/common/item/TreatBagItem.java index fabfa5f9..abb3bbe4 100644 --- a/src/main/java/com/sweetrpg/catherder/common/item/TreatBagItem.java +++ b/src/main/java/com/sweetrpg/catherder/common/item/TreatBagItem.java @@ -24,10 +24,10 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.wrapper.EmptyHandler; @@ -67,7 +67,7 @@ public InteractionResultHolder use(Level worldIn, Player playerIn, In public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List tooltip, TooltipFlag flagIn) { super.appendHoverText(stack, worldIn, tooltip, flagIn); - IItemHandler bagInventory = stack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(EmptyHandler.INSTANCE); + IItemHandler bagInventory = stack.getCapability(ForgeCapabilities.ITEM_HANDLER).orElse(EmptyHandler.INSTANCE); List condensedContents = ItemUtil.getContentOverview(bagInventory); condensedContents.forEach((food) -> { @@ -78,7 +78,7 @@ public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List LazyOptional getCapability(@Nonnull final Capability cap, final @Nullable Direction side) { - if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { + if (cap == ForgeCapabilities.ITEM_HANDLER) { return (LazyOptional) this.itemHandlerInstance; } return LazyOptional.empty(); @@ -113,7 +113,7 @@ public boolean canConsume(AbstractCatEntity catIn, ItemStack stackIn, Entity ent @Override public InteractionResult consume(AbstractCatEntity catIn, ItemStack stackIn, Entity entityIn) { - IItemHandlerModifiable treatBag = (IItemHandlerModifiable) stackIn.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(EmptyHandler.INSTANCE); + IItemHandlerModifiable treatBag = (IItemHandlerModifiable) stackIn.getCapability(ForgeCapabilities.ITEM_HANDLER).orElse(EmptyHandler.INSTANCE); return InventoryUtil.feedCatFrom(catIn, entityIn, treatBag); } } diff --git a/src/main/java/com/sweetrpg/catherder/common/lib/Constants.java b/src/main/java/com/sweetrpg/catherder/common/lib/Constants.java index 80af07fb..09590206 100644 --- a/src/main/java/com/sweetrpg/catherder/common/lib/Constants.java +++ b/src/main/java/com/sweetrpg/catherder/common/lib/Constants.java @@ -89,7 +89,6 @@ public class Constants { public static final String TRANSLATION_KEY_CONTAINER_INVENTORIES = "container.catherder.cat_inventories"; public static final String TRANSLATION_KEY_ITEMGROUP_MAIN = "itemGroup.catherder"; public static final String TRANSLATION_KEY_ITEMGROUP_CATTREE = "itemGroup.catherder.cattree"; - public static final String TRANSLATION_KEY_ITEMGROUP_PETDOOR = "itemGroup.catherder.petdoor"; public static final String TRANSLATION_KEY_WILD_TREAT_LOW_LEVEL = "treat.catherder.wild_treat.low_level"; public static final String TRANSLATION_KEY_WILD_TREAT_LEVEL_UP = "treat.catherder.wild_treat.level_up"; public static final String TRANSLATION_KEY_WILD_TREAT_TOO_YOUNG = "treat.catherder.wild_treat.too_young"; diff --git a/src/main/java/com/sweetrpg/catherder/common/network/packet/CatTalentPacket.java b/src/main/java/com/sweetrpg/catherder/common/network/packet/CatTalentPacket.java index dd3ed98d..b84b9b6b 100644 --- a/src/main/java/com/sweetrpg/catherder/common/network/packet/CatTalentPacket.java +++ b/src/main/java/com/sweetrpg/catherder/common/network/packet/CatTalentPacket.java @@ -37,7 +37,7 @@ public void handleCat(CatEntity catIn, CatTalentData data, Supplier ctx if(!ConfigHandler.TALENT.getFlag(data.talent)) { CatHerder.LOGGER.info("{} tried to adjust a disabled talent ({})", ctx.get().getSender().getGameProfile().getName(), - CatHerderAPI.TALENTS.get().getKey(data.talent)); + data.talent); return; } diff --git a/src/main/java/com/sweetrpg/catherder/common/registry/ModAccessories.java b/src/main/java/com/sweetrpg/catherder/common/registry/ModAccessories.java index 61141f30..c8ded00e 100644 --- a/src/main/java/com/sweetrpg/catherder/common/registry/ModAccessories.java +++ b/src/main/java/com/sweetrpg/catherder/common/registry/ModAccessories.java @@ -14,7 +14,7 @@ public class ModAccessories { - public static final DeferredRegister ACCESSORIES = DeferredRegister.create(CatHerderAPI.RegistryKeys.ACCESSORY_REGISTRY, CatHerderAPI.MOD_ID); + public static final DeferredRegister ACCESSORIES = DeferredRegister.create(ModRegistries.Keys.ACCESSORY_REGISTRY, CatHerderAPI.MOD_ID); public static final RegistryObject DYEABLE_COLLAR = register("dyeable_collar", () -> new DyeableAccessory(ModAccessoryTypes.COLLAR, ModItems.WOOL_COLLAR).setModelTexture(Resources.COLLAR_DEFAULT).setRenderer("DefaultAccessoryRenderer")); public static final RegistryObject GOLDEN_COLLAR = register("golden_collar", () -> new Collar(ModItems.CREATIVE_COLLAR).setModelTexture(Resources.COLLAR_GOLDEN).setRenderer("DefaultAccessoryRenderer")); diff --git a/src/main/java/com/sweetrpg/catherder/common/registry/ModAccessoryTypes.java b/src/main/java/com/sweetrpg/catherder/common/registry/ModAccessoryTypes.java index 237825e7..3526da5e 100644 --- a/src/main/java/com/sweetrpg/catherder/common/registry/ModAccessoryTypes.java +++ b/src/main/java/com/sweetrpg/catherder/common/registry/ModAccessoryTypes.java @@ -10,7 +10,7 @@ public class ModAccessoryTypes { - public static final DeferredRegister ACCESSORY_TYPES = DeferredRegister.create(CatHerderAPI.RegistryKeys.ACCESSORY_TYPE_REGISTRY, CatHerderAPI.MOD_ID); + public static final DeferredRegister ACCESSORY_TYPES = DeferredRegister.create(ModRegistries.Keys.ACCESSORY_TYPE_REGISTRY, CatHerderAPI.MOD_ID); public static final RegistryObject COLLAR = register("collar"); public static final RegistryObject CLOTHING = register("clothing"); diff --git a/src/main/java/com/sweetrpg/catherder/common/registry/ModBiomeModifiers.java b/src/main/java/com/sweetrpg/catherder/common/registry/ModBiomeModifiers.java index 82546209..46b301c4 100644 --- a/src/main/java/com/sweetrpg/catherder/common/registry/ModBiomeModifiers.java +++ b/src/main/java/com/sweetrpg/catherder/common/registry/ModBiomeModifiers.java @@ -14,18 +14,17 @@ import java.util.Optional; -public class ModBiomeModifiers -{ - public static DeferredRegister> BIOME_MODIFIER_SERIALIZERS = - DeferredRegister.create(ForgeRegistries.Keys.BIOME_MODIFIER_SERIALIZERS, CatHerderAPI.MOD_ID); +public class ModBiomeModifiers { + public static DeferredRegister> BIOME_MODIFIER_SERIALIZERS = + DeferredRegister.create(ForgeRegistries.Keys.BIOME_MODIFIER_SERIALIZERS, CatHerderAPI.MOD_ID); - public static RegistryObject> ADD_FEATURES_BY_FILTER = BIOME_MODIFIER_SERIALIZERS.register("add_features_by_filter", () -> - RecordCodecBuilder.create(builder -> builder.group( - Biome.LIST_CODEC.fieldOf("allowed_biomes").forGetter(AddFeaturesByFilterBiomeModifier::allowedBiomes), - Biome.LIST_CODEC.optionalFieldOf("denied_biomes").orElse(Optional.empty()).forGetter(AddFeaturesByFilterBiomeModifier::deniedBiomes), - Codec.FLOAT.optionalFieldOf("min_temperature").orElse(Optional.empty()).forGetter(AddFeaturesByFilterBiomeModifier::minimumTemperature), - Codec.FLOAT.optionalFieldOf("max_temperature").orElse(Optional.empty()).forGetter(AddFeaturesByFilterBiomeModifier::maximumTemperature), - PlacedFeature.LIST_CODEC.fieldOf("features").forGetter(AddFeaturesByFilterBiomeModifier::features), - GenerationStep.Decoration.CODEC.fieldOf("step").forGetter(AddFeaturesByFilterBiomeModifier::step) - ).apply(builder, AddFeaturesByFilterBiomeModifier::new))); + public static RegistryObject> ADD_FEATURES_BY_FILTER = BIOME_MODIFIER_SERIALIZERS.register("add_features_by_filter", () -> + RecordCodecBuilder.create(builder -> builder.group( + Biome.LIST_CODEC.fieldOf("allowed_biomes").forGetter(AddFeaturesByFilterBiomeModifier::allowedBiomes), + Biome.LIST_CODEC.optionalFieldOf("denied_biomes").orElse(Optional.empty()).forGetter(AddFeaturesByFilterBiomeModifier::deniedBiomes), + Codec.FLOAT.optionalFieldOf("min_temperature").orElse(Optional.empty()).forGetter(AddFeaturesByFilterBiomeModifier::minimumTemperature), + Codec.FLOAT.optionalFieldOf("max_temperature").orElse(Optional.empty()).forGetter(AddFeaturesByFilterBiomeModifier::maximumTemperature), + PlacedFeature.LIST_CODEC.fieldOf("features").forGetter(AddFeaturesByFilterBiomeModifier::features), + GenerationStep.Decoration.CODEC.fieldOf("step").forGetter(AddFeaturesByFilterBiomeModifier::step) + ).apply(builder, AddFeaturesByFilterBiomeModifier::new))); } diff --git a/src/main/java/com/sweetrpg/catherder/common/registry/ModBlocks.java b/src/main/java/com/sweetrpg/catherder/common/registry/ModBlocks.java index 23a60bce..b0636c6d 100644 --- a/src/main/java/com/sweetrpg/catherder/common/registry/ModBlocks.java +++ b/src/main/java/com/sweetrpg/catherder/common/registry/ModBlocks.java @@ -44,7 +44,7 @@ public class ModBlocks { () -> new CatnipBlock(Block.Properties.copy(Blocks.WHEAT))); private static Item.Properties createInitialProp() { - return new Item.Properties() /*.tab(ModItemGroups.GENERAL) */; + return new Item.Properties(); } private static BlockItem makeItemBlock(Block block) { diff --git a/src/main/java/com/sweetrpg/catherder/common/registry/ModItems.java b/src/main/java/com/sweetrpg/catherder/common/registry/ModItems.java index a257a20a..57ec72cb 100644 --- a/src/main/java/com/sweetrpg/catherder/common/registry/ModItems.java +++ b/src/main/java/com/sweetrpg/catherder/common/registry/ModItems.java @@ -25,9 +25,9 @@ public class ModItems { // public static final RegistryObject CAT_TREE = register("cat_tree", () -> new BlockItem(ModBlocks.CAT_TREE.get(), new Item.Properties().tab(ModItemGroups.GENERAL))); // catnip - public static final RegistryObject WILD_CATNIP = register("wild_catnip", () -> new BlockItem(ModBlocks.WILD_CATNIP.get(), new Item.Properties() /*.tab(ModItemGroups.GENERAL) */)); - public static final RegistryObject CATNIP = register("catnip", () -> new CatnipItem(new Item.Properties()/*.food(FoodValues.CATNIP).*/ /*.tab(ModItemGroups.GENERAL) */)); - public static final RegistryObject CATNIP_SEEDS = ITEMS.register("catnip_seeds", () -> new ItemNameBlockItem(ModBlocks.CATNIP_CROP.get(), new Item.Properties() /*.tab(ModItemGroups.GENERAL) */)); + public static final RegistryObject WILD_CATNIP = register("wild_catnip", () -> new BlockItem(ModBlocks.WILD_CATNIP.get(), new Item.Properties()/*.tab(ModItemGroups.GENERAL)*/)); + public static final RegistryObject CATNIP = register("catnip", () -> new CatnipItem(new Item.Properties()/*food(FoodValues.CATNIP).*//*.tab(ModItemGroups.GENERAL)*/)); + public static final RegistryObject CATNIP_SEEDS = ITEMS.register("catnip_seeds", () -> new ItemNameBlockItem(ModBlocks.CATNIP_CROP.get(), new Item.Properties()/*.tab(ModItemGroups.GENERAL)*/)); // toys public static final RegistryObject YARN = registerThrowToy("yarn"); @@ -39,7 +39,7 @@ public class ModItems { // food public static final RegistryObject CHEESE_WEDGE = register("cheese_wedge", - () -> new Item(new Item.Properties().food(FoodValues.CHEESE) /*.tab(ModItemGroups.GENERAL) */)); + () -> new Item(new Item.Properties().food(FoodValues.CHEESE))); // public static final RegistryObject LASAGNA = register("lasagna"); // treats @@ -58,7 +58,7 @@ public class ModItems { public static final RegistryObject CAT_SMALLERER = registerSizer("small_catsizer", CatSizerItem.Type.SMALL); public static final RegistryObject CAT_BIGGERER = registerSizer("big_catsizer", CatSizerItem.Type.BIG); public static final RegistryObject OWNER_CHANGE = registerWith("owner_change", ChangeOwnerItem::new, 1); - public static final RegistryObject LITTER_SCOOP = register("litter_scoop", () -> new LitterScoopItem(new Item.Properties().durability(64) /*.tab(ModItemGroups.GENERAL) */)); + public static final RegistryObject LITTER_SCOOP = register("litter_scoop", () -> new LitterScoopItem(new Item.Properties().durability(64))); //public static final RegistryObject PATROL = registerWith("patrol_item", PatrolItem::new, 1); // other items @@ -77,7 +77,7 @@ public class ModItems { // public static final RegistryObject LEATHER_JACKET = registerAccessory("leather_jacket", CatAccessories.LEATHER_JACKET_CLOTHING); private static Item.Properties createInitialProp() { - return new Item.Properties() /*.tab(ModItemGroups.GENERAL) */; + return new Item.Properties(); } private static RegistryObject registerThrowToy(final String name) { diff --git a/src/main/java/com/sweetrpg/catherder/common/registry/ModMaterials.java b/src/main/java/com/sweetrpg/catherder/common/registry/ModMaterials.java index 0f0f9948..ddec3817 100644 --- a/src/main/java/com/sweetrpg/catherder/common/registry/ModMaterials.java +++ b/src/main/java/com/sweetrpg/catherder/common/registry/ModMaterials.java @@ -1,6 +1,5 @@ package com.sweetrpg.catherder.common.registry; -import com.sweetrpg.catherder.api.CatHerderAPI; import com.sweetrpg.catherder.api.impl.DyeMaterial; import com.sweetrpg.catherder.api.impl.ColorMaterial; import com.sweetrpg.catherder.api.impl.StructureMaterial; @@ -20,9 +19,9 @@ public class ModMaterials { // material registries - public static final DeferredRegister STRUCTURES = DeferredRegister.create(CatHerderAPI.RegistryKeys.STRUCTURE_REGISTRY, Constants.VANILLA_ID); - public static final DeferredRegister COLORS = DeferredRegister.create(CatHerderAPI.RegistryKeys.COLOR_REGISTRY, Constants.VANILLA_ID); - public static final DeferredRegister DYES = DeferredRegister.create(CatHerderAPI.RegistryKeys.DYE_REGISTRY, Constants.VANILLA_ID); + public static final DeferredRegister STRUCTURES = DeferredRegister.create(ModRegistries.Keys.STRUCTURE_REGISTRY, Constants.VANILLA_ID); + public static final DeferredRegister COLORS = DeferredRegister.create(ModRegistries.Keys.COLOR_REGISTRY, Constants.VANILLA_ID); + public static final DeferredRegister DYES = DeferredRegister.create(ModRegistries.Keys.DYE_REGISTRY, Constants.VANILLA_ID); // structures public static final RegistryObject OAK_PLANKS = registerStructure(() -> Blocks.OAK_PLANKS); diff --git a/src/main/java/com/sweetrpg/catherder/common/registry/ModRecipeSerializers.java b/src/main/java/com/sweetrpg/catherder/common/registry/ModRecipeSerializers.java index 497acadb..02e900ff 100644 --- a/src/main/java/com/sweetrpg/catherder/common/registry/ModRecipeSerializers.java +++ b/src/main/java/com/sweetrpg/catherder/common/registry/ModRecipeSerializers.java @@ -21,14 +21,14 @@ public class ModRecipeSerializers { public static final DeferredRegister> RECIPE_SERIALIZERS = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, CatHerderAPI.MOD_ID); - public static final RegistryObject> CAT_TREE = register("cat_tree", CatTreeRecipe::new); - public static final RegistryObject> CAT_TREE_DYED = register("cat_tree_dyed", CatTreeRecipeDyed::new); - public static final RegistryObject> PET_DOOR = register("pet_door", PetDoorRecipe::new); + public static final RegistryObject> CAT_TREE = register("cat_tree", CatTreeRecipe::new); + public static final RegistryObject> CAT_TREE_DYED = register("cat_tree_dyed", CatTreeRecipeDyed::new); + public static final RegistryObject> PET_DOOR = register("pet_door", PetDoorRecipe::new); //// public static final RegistryObject> COLLAR_COLOURING = register("collar_colouring", CatCollarRecipe::new); //// public static final RegistryObject> CAPE_COLOURING = register("cape_colouring", CatCapeRecipe::new); - private static > RegistryObject> register(final String name, SimpleCraftingRecipeSerializer.Factory factory) { - return register(name, () -> new SimpleCraftingRecipeSerializer<>(factory)); + private static > RegistryObject> register(final String name, SimpleCraftingRecipeSerializer.Factory factory) { + return register(name, () -> new SimpleCraftingRecipeSerializer(factory)); } private static > RegistryObject register(final String name, final Supplier sup) { diff --git a/src/main/java/com/sweetrpg/catherder/common/registry/ModRegistries.java b/src/main/java/com/sweetrpg/catherder/common/registry/ModRegistries.java index 24e8a7af..a2adf9ed 100644 --- a/src/main/java/com/sweetrpg/catherder/common/registry/ModRegistries.java +++ b/src/main/java/com/sweetrpg/catherder/common/registry/ModRegistries.java @@ -13,13 +13,22 @@ public class ModRegistries { + protected class Keys { + public static final ResourceLocation TALENTS_REGISTRY = Util.getResource("talents"); + public static final ResourceLocation ACCESSORY_REGISTRY = Util.getResource("accessories"); + public static final ResourceLocation ACCESSORY_TYPE_REGISTRY = Util.getResource("accessory_type"); + public static final ResourceLocation STRUCTURE_REGISTRY = Util.getResource("structures"); + public static final ResourceLocation COLOR_REGISTRY = Util.getResource("colors"); + public static final ResourceLocation DYE_REGISTRY = Util.getResource("dyes"); + } + public static void newRegistry(NewRegistryEvent event) { - CatHerderAPI.TALENTS = event.create(makeRegistry(CatHerderAPI.RegistryKeys.TALENTS_REGISTRY, Talent.class)); - CatHerderAPI.ACCESSORIES = event.create(makeRegistry(CatHerderAPI.RegistryKeys.ACCESSORY_REGISTRY, Accessory.class)); - CatHerderAPI.ACCESSORY_TYPE = event.create(makeRegistry(CatHerderAPI.RegistryKeys.ACCESSORY_TYPE_REGISTRY, AccessoryType.class).disableSync()); - CatHerderAPI.STRUCTURE_MATERIAL = event.create(makeRegistry(CatHerderAPI.RegistryKeys.STRUCTURE_REGISTRY, IStructureMaterial.class).addCallback(StructureCallbacks.INSTANCE)); - CatHerderAPI.COLOR_MATERIAL = event.create(makeRegistry(CatHerderAPI.RegistryKeys.COLOR_REGISTRY, IColorMaterial.class).addCallback(ColorCallbacks.INSTANCE)); - CatHerderAPI.DYE_MATERIAL = event.create(makeRegistry(CatHerderAPI.RegistryKeys.DYE_REGISTRY, IDyeMaterial.class).addCallback(DyeCallbacks.INSTANCE)); + CatHerderAPI.TALENTS = event.create(makeRegistry(Keys.TALENTS_REGISTRY, Talent.class)); + CatHerderAPI.ACCESSORIES = event.create(makeRegistry(Keys.ACCESSORY_REGISTRY, Accessory.class)); + CatHerderAPI.ACCESSORY_TYPE = event.create(makeRegistry(Keys.ACCESSORY_TYPE_REGISTRY, AccessoryType.class).disableSync()); + CatHerderAPI.STRUCTURE_MATERIAL = event.create(makeRegistry(Keys.STRUCTURE_REGISTRY, IStructureMaterial.class).addCallback(StructureCallbacks.INSTANCE)); + CatHerderAPI.COLOR_MATERIAL = event.create(makeRegistry(Keys.COLOR_REGISTRY, IColorMaterial.class).addCallback(ColorCallbacks.INSTANCE)); + CatHerderAPI.DYE_MATERIAL = event.create(makeRegistry(Keys.DYE_REGISTRY, IDyeMaterial.class).addCallback(DyeCallbacks.INSTANCE)); } private static RegistryBuilder makeRegistry(final ResourceLocation rl, Class type) { diff --git a/src/main/java/com/sweetrpg/catherder/common/registry/ModSerializers.java b/src/main/java/com/sweetrpg/catherder/common/registry/ModSerializers.java index a878d0f9..9974ff55 100644 --- a/src/main/java/com/sweetrpg/catherder/common/registry/ModSerializers.java +++ b/src/main/java/com/sweetrpg/catherder/common/registry/ModSerializers.java @@ -15,7 +15,6 @@ import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; -import javax.swing.text.html.Option; import java.util.List; import java.util.Optional; import java.util.function.Supplier; @@ -47,5 +46,6 @@ private static RegistryObject register(final String name, register("cat_level", () -> CAT_LEVEL_SERIALIZER); register("cat_tree_location", () -> CAT_TREE_LOC_SERIALIZER); register("original_breed", () -> ORIGINAL_BREED_SERIALIZER); + register("cat_variant", () -> VARIANT_SERIALIZER); } } diff --git a/src/main/java/com/sweetrpg/catherder/common/registry/ModSounds.java b/src/main/java/com/sweetrpg/catherder/common/registry/ModSounds.java index 921b8975..44f617af 100644 --- a/src/main/java/com/sweetrpg/catherder/common/registry/ModSounds.java +++ b/src/main/java/com/sweetrpg/catherder/common/registry/ModSounds.java @@ -17,7 +17,8 @@ public class ModSounds { public static final DeferredRegister SOUNDS = DeferredRegister.create(ForgeRegistries.Keys.SOUND_EVENTS, CatHerderAPI.MOD_ID); private static RegistryObject register(final String name) { - return register(name, SoundEvent::createVariableRangeEvent); + //TODO 1.19.3 ?? + return register(name, () -> SoundEvent.createVariableRangeEvent(Util.getResource(name))); } private static RegistryObject register(final String name, final Function factory) { diff --git a/src/main/java/com/sweetrpg/catherder/common/registry/ModTalents.java b/src/main/java/com/sweetrpg/catherder/common/registry/ModTalents.java index a65fd0a2..26d2f2ac 100644 --- a/src/main/java/com/sweetrpg/catherder/common/registry/ModTalents.java +++ b/src/main/java/com/sweetrpg/catherder/common/registry/ModTalents.java @@ -12,7 +12,7 @@ public class ModTalents { - public static final DeferredRegister TALENTS = DeferredRegister.create(CatHerderAPI.RegistryKeys.TALENTS_REGISTRY, CatHerderAPI.MOD_ID); + public static final DeferredRegister TALENTS = DeferredRegister.create(ModRegistries.Keys.TALENTS_REGISTRY, CatHerderAPI.MOD_ID); public static final RegistryObject BED_FINDER = registerInst("bed_finder", BedFinderTalent::new); public static final RegistryObject CATLIKE_REFLEXES = registerInst("catlike_reflexes", CatlikeReflexesTalent::new); diff --git a/src/main/java/com/sweetrpg/catherder/common/storage/CatRespawnData.java b/src/main/java/com/sweetrpg/catherder/common/storage/CatRespawnData.java index 0b072761..327daed3 100644 --- a/src/main/java/com/sweetrpg/catherder/common/storage/CatRespawnData.java +++ b/src/main/java/com/sweetrpg/catherder/common/storage/CatRespawnData.java @@ -1,17 +1,16 @@ package com.sweetrpg.catherder.common.storage; import com.google.common.collect.Lists; -import com.sweetrpg.catherder.common.registry.ModEntityTypes; import com.sweetrpg.catherder.api.feature.Mode; -import com.sweetrpg.catherder.common.util.NBTUtil; import com.sweetrpg.catherder.common.entity.CatEntity; +import com.sweetrpg.catherder.common.registry.ModEntityTypes; +import com.sweetrpg.catherder.common.util.NBTUtil; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; import javax.annotation.Nullable; import java.util.List; @@ -62,7 +61,7 @@ public void populate(CatEntity catIn) { catIn.saveWithoutId(this.data); // Remove tags that don't need to be saved - for (String tag : TAGS_TO_REMOVE) { + for(String tag : TAGS_TO_REMOVE) { this.data.remove(tag); } @@ -72,10 +71,10 @@ public void populate(CatEntity catIn) { @Nullable public CatEntity respawn(ServerLevel worldIn, Player playerIn, BlockPos pos) { - CatEntity cat = ModEntityTypes.CAT.get().spawn(worldIn, (ItemStack) null, playerIn, pos, MobSpawnType.TRIGGERED, true, false); + CatEntity cat = ModEntityTypes.CAT.get().spawn(worldIn, null, playerIn, pos, MobSpawnType.TRIGGERED, true, false); // Failed for some reason - if (cat == null) { + if(cat == null) { return null; } diff --git a/src/main/java/com/sweetrpg/catherder/common/talent/HellBeastTalent.java b/src/main/java/com/sweetrpg/catherder/common/talent/HellBeastTalent.java index 745433a1..af521fae 100644 --- a/src/main/java/com/sweetrpg/catherder/common/talent/HellBeastTalent.java +++ b/src/main/java/com/sweetrpg/catherder/common/talent/HellBeastTalent.java @@ -3,10 +3,10 @@ import com.sweetrpg.catherder.api.inferface.AbstractCatEntity; import com.sweetrpg.catherder.api.registry.Talent; import com.sweetrpg.catherder.api.registry.TalentInstance; +import net.minecraft.tags.DamageTypeTags; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.damagesource.DamageTypes; import net.minecraft.world.entity.Entity; public class HellBeastTalent extends TalentInstance { @@ -27,7 +27,7 @@ public InteractionResult isImmuneToFire(AbstractCatEntity catIn) { @Override public InteractionResult isInvulnerableTo(AbstractCatEntity catIn, DamageSource source) { - if(source.is(DamageTypes.ON_FIRE)) { + if(source.is(DamageTypeTags.IS_FIRE)) { return this.level() >= 5 ? InteractionResult.SUCCESS : InteractionResult.PASS; } diff --git a/src/main/java/com/sweetrpg/catherder/common/talent/PestFighterTalent.java b/src/main/java/com/sweetrpg/catherder/common/talent/PestFighterTalent.java index 33c4a3d8..86b9f255 100644 --- a/src/main/java/com/sweetrpg/catherder/common/talent/PestFighterTalent.java +++ b/src/main/java/com/sweetrpg/catherder/common/talent/PestFighterTalent.java @@ -4,7 +4,6 @@ import com.sweetrpg.catherder.api.registry.Talent; import com.sweetrpg.catherder.api.registry.TalentInstance; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.damagesource.DamageTypes; import net.minecraft.world.entity.EntitySelector; import net.minecraft.world.entity.monster.Silverfish; @@ -34,7 +33,7 @@ public void livingTick(AbstractCatEntity catIn) { ); for(Silverfish silverfish : list) { if(catIn.getRandom().nextInt(10) == 0) { - silverfish.hurt(catIn.damageSources().generic(), damage); + silverfish.hurt(silverfish.damageSources().generic(), damage); } } } diff --git a/src/main/java/com/sweetrpg/catherder/common/util/BackwardsComp.java b/src/main/java/com/sweetrpg/catherder/common/util/BackwardsComp.java new file mode 100644 index 00000000..a4ffda5c --- /dev/null +++ b/src/main/java/com/sweetrpg/catherder/common/util/BackwardsComp.java @@ -0,0 +1,43 @@ +package com.sweetrpg.catherder.common.util; + +import com.google.common.collect.Maps; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.animal.CatVariant; + +import java.util.Map; +import java.util.Optional; +import java.util.function.Consumer; + +public class BackwardsComp { + + private static final Map typeToVariantMap = net.minecraft.Util.make(Maps.newHashMap(), (m) -> { + m.put(0, CatVariant.TABBY.location()); + m.put(1, CatVariant.BLACK.location()); + m.put(2, CatVariant.RED.location()); + m.put(3, CatVariant.SIAMESE.location()); + m.put(4, CatVariant.BRITISH_SHORTHAIR.location()); + m.put(5, CatVariant.CALICO.location()); + m.put(6, CatVariant.PERSIAN.location()); + m.put(7, CatVariant.RAGDOLL.location()); + m.put(8, CatVariant.WHITE.location()); + m.put(9, CatVariant.JELLIE.location()); + m.put(10, CatVariant.ALL_BLACK.location()); + }); + + public static void getCatVariant(CompoundTag compound, Consumer consumer) { + if(compound.contains("original_breed", Tag.TAG_ANY_NUMERIC)) { + var originalBreed = compound.getInt("original_breed"); + Optional.ofNullable(BackwardsComp.typeToVariantMap.get(originalBreed)).ifPresent((rl) -> { + var variant = BuiltInRegistries.CAT_VARIANT.get(rl); + consumer.accept(variant); + }); + } + } + + public static void init() { + + } +} diff --git a/src/main/java/com/sweetrpg/catherder/common/util/CatTreeUtil.java b/src/main/java/com/sweetrpg/catherder/common/util/CatTreeUtil.java index bb4128f4..98f0f694 100644 --- a/src/main/java/com/sweetrpg/catherder/common/util/CatTreeUtil.java +++ b/src/main/java/com/sweetrpg/catherder/common/util/CatTreeUtil.java @@ -44,7 +44,7 @@ public static ItemStack createItemStack(IColorMaterial colorId) { ItemStack stack = new ItemStack(ModBlocks.CAT_TREE.get(), 1); CompoundTag tag = stack.getOrCreateTagElement("catherder"); - NBTUtil.putRegistryValue(tag, "colorId", colorId, CatHerderAPI.COLOR_MATERIAL.get()); + NBTUtil.putRegistryValue(tag, "colorId", CatHerderAPI.COLOR_MATERIAL.get().getKey(colorId)); // NBTUtil.putRegistryValue(tag, "beddingId", beddingId); return stack; diff --git a/src/main/java/com/sweetrpg/catherder/common/util/MathUtil.java b/src/main/java/com/sweetrpg/catherder/common/util/MathUtil.java index 6997fe12..6f520a9f 100644 --- a/src/main/java/com/sweetrpg/catherder/common/util/MathUtil.java +++ b/src/main/java/com/sweetrpg/catherder/common/util/MathUtil.java @@ -1,6 +1,7 @@ package com.sweetrpg.catherder.common.util; import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.Block; public class MathUtil { diff --git a/src/main/java/com/sweetrpg/catherder/common/util/NBTUtil.java b/src/main/java/com/sweetrpg/catherder/common/util/NBTUtil.java index a9502840..7e966eeb 100644 --- a/src/main/java/com/sweetrpg/catherder/common/util/NBTUtil.java +++ b/src/main/java/com/sweetrpg/catherder/common/util/NBTUtil.java @@ -22,7 +22,7 @@ public class NBTUtil { * Writes the UUID to the CompoundNBT under the given key if it is not null */ public static void putUniqueId(CompoundTag compound, String key, @Nullable UUID uuid) { - if(uuid != null) { + if (uuid != null) { compound.putUUID(key, uuid); } } @@ -32,10 +32,9 @@ public static void putUniqueId(CompoundTag compound, String key, @Nullable UUID */ @Nullable public static UUID getUniqueId(CompoundTag compound, String key) { - if(compound.hasUUID(key)) { + if (compound.hasUUID(key)) { return compound.getUUID(key); - } - else if(NBTUtil.hasOldUniqueId(compound, key)) { + } else if (NBTUtil.hasOldUniqueId(compound, key)) { return NBTUtil.getOldUniqueId(compound, key); } @@ -56,14 +55,14 @@ public static void removeOldUniqueId(CompoundTag compound, String key) { } public static void putResourceLocation(CompoundTag compound, String key, @Nullable ResourceLocation rl) { - if(rl != null) { + if (rl != null) { compound.putString(key, rl.toString()); } } @Nullable public static ResourceLocation getResourceLocation(CompoundTag compound, String key) { - if(compound.contains(key, Tag.TAG_STRING)) { + if (compound.contains(key, Tag.TAG_STRING)) { return ResourceLocation.tryParse(compound.getString(key)); } @@ -72,7 +71,7 @@ public static ResourceLocation getResourceLocation(CompoundTag compound, String @Nullable public static void putVector3d(CompoundTag compound, @Nullable Vec3 vec3d) { - if(vec3d != null) { + if (vec3d != null) { compound.putDouble("x", vec3d.x()); compound.putDouble("y", vec3d.y()); compound.putDouble("z", vec3d.z()); @@ -81,7 +80,7 @@ public static void putVector3d(CompoundTag compound, @Nullable Vec3 vec3d) { @Nullable public static Vec3 getVector3d(CompoundTag compound) { - if(compound.contains("x", Tag.TAG_ANY_NUMERIC) && compound.contains("y", Tag.TAG_ANY_NUMERIC) && compound.contains("z", Tag.TAG_ANY_NUMERIC)) { + if (compound.contains("x", Tag.TAG_ANY_NUMERIC) && compound.contains("y", Tag.TAG_ANY_NUMERIC) && compound.contains("z", Tag.TAG_ANY_NUMERIC)) { return new Vec3(compound.getDouble("x"), compound.getDouble("y"), compound.getDouble("z")); } @@ -90,14 +89,14 @@ public static Vec3 getVector3d(CompoundTag compound) { public static void putTextComponent(CompoundTag compound, String key, @Nullable Component component) { - if(component != null) { + if (component != null) { compound.putString(key, Component.Serializer.toJson(component)); } } @Nullable public static Component getTextComponent(CompoundTag compound, String key) { - if(compound.contains(key, Tag.TAG_STRING)) { + if (compound.contains(key, Tag.TAG_STRING)) { return Component.Serializer.fromJson(compound.getString(key)); } @@ -107,15 +106,13 @@ public static Component getTextComponent(CompoundTag compound, String key) { @Nullable public static T getRegistryValue(CompoundTag compound, String key, IForgeRegistry registry) { ResourceLocation rl = NBTUtil.getResourceLocation(compound, key); - if(rl != null) { - if(registry.containsKey(rl)) { + if (rl != null) { + if (registry.containsKey(rl)) { return registry.getValue(rl); - } - else { + } else { CatHerder.LOGGER.warn("Unable to load registry value in registry {} with resource location {}", registry.getRegistryName(), rl); } - } - else { + } else { CatHerder.LOGGER.warn("Unable to load resource location in NBT:{}, for {} registry", key, registry.getRegistryName()); } @@ -146,14 +143,15 @@ public static void putRegistryValue(CompoundTag compound, String key, Holder NBTUtil.putResourceLocation(compound, key, value.key().location()); } } - public static void putRegistryValue(CompoundTag compound, String key, T value, IForgeRegistry registry) { + + public static void putRegistryValue(CompoundTag compound, String key, ResourceLocation value) { if (value != null) { - NBTUtil.putResourceLocation(compound, key, registry.getKey(value)); + NBTUtil.putResourceLocation(compound, key, value); } } public static void putBlockPos(CompoundTag compound, @Nullable BlockPos vec3d) { - if(vec3d != null) { + if (vec3d != null) { compound.putInt("x", vec3d.getX()); compound.putInt("y", vec3d.getY()); compound.putInt("z", vec3d.getZ()); @@ -162,7 +160,7 @@ public static void putBlockPos(CompoundTag compound, @Nullable BlockPos vec3d) { @Nullable public static BlockPos getBlockPos(CompoundTag compound) { - if(compound.contains("x", Tag.TAG_ANY_NUMERIC) && compound.contains("y", Tag.TAG_ANY_NUMERIC) && compound.contains("z", Tag.TAG_ANY_NUMERIC)) { + if (compound.contains("x", Tag.TAG_ANY_NUMERIC) && compound.contains("y", Tag.TAG_ANY_NUMERIC) && compound.contains("z", Tag.TAG_ANY_NUMERIC)) { return new BlockPos(compound.getInt("x"), compound.getInt("y"), compound.getInt("z")); } @@ -171,7 +169,7 @@ public static BlockPos getBlockPos(CompoundTag compound) { public static void putBlockPos(CompoundTag compound, String key, Optional vec3d) { - if(vec3d.isPresent()) { + if (vec3d.isPresent()) { CompoundTag posNBT = new CompoundTag(); putBlockPos(posNBT, vec3d.get()); compound.put(key, posNBT); @@ -179,7 +177,7 @@ public static void putBlockPos(CompoundTag compound, String key, Optional getBlockPos(CompoundTag compound, String key) { - if(compound.contains(key, Tag.TAG_COMPOUND)) { + if (compound.contains(key, Tag.TAG_COMPOUND)) { return Optional.of(getBlockPos(compound.getCompound(key))); } @@ -187,7 +185,7 @@ public static Optional getBlockPos(CompoundTag compound, String key) { } public static void putBlockPos(CompoundTag compound, String key, @Nullable BlockPos vec3d) { - if(vec3d != null) { + if (vec3d != null) { CompoundTag posNBT = new CompoundTag(); putBlockPos(posNBT, vec3d); compound.put(key, posNBT); @@ -204,14 +202,14 @@ public static void putBlockPos(CompoundTag compound, String key, @Nullable Block // } public static void writeItemStack(CompoundTag compound, String key, ItemStack stackIn) { - if(!stackIn.isEmpty()) { + if (!stackIn.isEmpty()) { compound.put(key, stackIn.save(new CompoundTag())); } } @Nonnull public static ItemStack readItemStack(CompoundTag compound, String key) { - if(compound.contains(key, Tag.TAG_COMPOUND)) { + if (compound.contains(key, Tag.TAG_COMPOUND)) { return ItemStack.of(compound.getCompound(key)); } diff --git a/src/main/java/com/sweetrpg/catherder/common/util/PetDoorUtil.java b/src/main/java/com/sweetrpg/catherder/common/util/PetDoorUtil.java index 6548ac74..db7fe05b 100644 --- a/src/main/java/com/sweetrpg/catherder/common/util/PetDoorUtil.java +++ b/src/main/java/com/sweetrpg/catherder/common/util/PetDoorUtil.java @@ -43,7 +43,7 @@ public static ItemStack createItemStack(IStructureMaterial structureId) { ItemStack stack = new ItemStack(ModBlocks.PET_DOOR.get(), 1); CompoundTag tag = stack.getOrCreateTagElement("catherder"); - NBTUtil.putRegistryValue(tag, "structureId", structureId, CatHerderAPI.STRUCTURE_MATERIAL.get()); + NBTUtil.putRegistryValue(tag, "structureId", CatHerderAPI.STRUCTURE_MATERIAL.get().getKey(structureId)); return stack; } diff --git a/src/main/java/com/sweetrpg/catherder/common/util/RadialCoordinateIterator.java b/src/main/java/com/sweetrpg/catherder/common/util/RadialCoordinateIterator.java index e7b53298..47de8256 100644 --- a/src/main/java/com/sweetrpg/catherder/common/util/RadialCoordinateIterator.java +++ b/src/main/java/com/sweetrpg/catherder/common/util/RadialCoordinateIterator.java @@ -39,27 +39,30 @@ public RadialCoordinateIterator(int startXIn, int startYIn, int startZIn, int en } public boolean hasNext() { - if (!this.started) { - if (this.oddX) { + if(!this.started) { + if(this.oddX) { this.x = this.startX + (this.endX - this.startX) / 2; this.radiusX = 0; - } else { + } + else { this.x = this.startX + (this.endX - this.startX - 1) / 2; this.radiusX = 1; } - if (this.oddY) { + if(this.oddY) { this.y = this.startY + (this.endY - this.startY - 1) / 2; this.radiusY = 0; - } else { + } + else { this.y = this.startY + (this.endY - this.startY - 1) / 2; this.radiusY = 1; } - if (this.oddZ) { + if(this.oddZ) { this.z = this.startZ + (this.endZ - this.startZ) / 2; this.radiusZ = 0; - } else { + } + else { this.z = this.startZ + (this.endZ - this.startZ - 1) / 2; this.radiusZ = 1; } @@ -69,22 +72,28 @@ public boolean hasNext() { this.centreZ = this.z; this.started = true; return true; - } else if (this.x == this.endX && this.y == this.endY && this.z == this.endZ) { + } + else if(this.x == this.endX && this.y == this.endY && this.z == this.endZ) { return false; - } else { + } + else { boolean xBoundary = this.x == this.centreX + this.radiusX; boolean yBoundary = this.y == this.centreY + this.radiusY; boolean zBoundary = this.z == this.centreZ + this.radiusZ; - if (this.x <= this.centreX + this.radiusX) { + if(this.x <= this.centreX + this.radiusX) { ++this.x; - } else if (this.z <= this.centreZ + this.radiusZ) { + } + else if(this.z <= this.centreZ + this.radiusZ) { ++this.z; - } else if (this.x >= this.centreX - this.radiusX) { + } + else if(this.x >= this.centreX - this.radiusX) { --this.x; - } else if (this.z >= this.centreZ - this.radiusZ) { + } + else if(this.z >= this.centreZ - this.radiusZ) { --this.z; - } else if (this.z < this.endZ) { + } + else if(this.z < this.endZ) { this.x = this.startX; this.y = this.startY; ++this.z; diff --git a/src/main/java/com/sweetrpg/catherder/common/util/Util.java b/src/main/java/com/sweetrpg/catherder/common/util/Util.java index 54b9f8f9..96c4a5c9 100644 --- a/src/main/java/com/sweetrpg/catherder/common/util/Util.java +++ b/src/main/java/com/sweetrpg/catherder/common/util/Util.java @@ -2,8 +2,8 @@ import com.google.common.collect.Lists; import com.sweetrpg.catherder.api.CatHerderAPI; +import com.sweetrpg.catherder.common.lib.Constants; import io.netty.buffer.Unpooled; -import net.minecraft.core.Holder; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.DyeColor; @@ -41,7 +41,7 @@ public static float[] rgbIntToFloatArray(int rgbInt) { int g = (rgbInt >> 8) & 255; int b = (rgbInt >> 0) & 255; - return new float[]{r / 255F, g / 255F, b / 255F}; + return new float[] {r / 255F, g / 255F, b / 255F}; } public static int[] rgbIntToIntArray(int rgbInt) { @@ -49,7 +49,7 @@ public static int[] rgbIntToIntArray(int rgbInt) { int g = (rgbInt >> 8) & 255; int b = (rgbInt >> 0) & 255; - return new int[]{r, g, b}; + return new int[] {r, g, b}; } public static int colorDye(int startColor, DyeColor dye) { @@ -62,7 +62,7 @@ public static int colorDye(int startColor, Collection dyes) { .mapToObj(Util::rgbIntToIntArray) .collect(Collectors.toList()); - if(startColor != -1) { + if (startColor != -1) { colors.add(0, rgbIntToIntArray(startColor)); } @@ -73,12 +73,12 @@ public static int colorDye(Collection colors) { int[] temp = new int[3]; int maxCompSum = 0; - for(int[] color : colors) { + for (int[] color : colors) { maxCompSum += Math.max(color[0], Math.max(color[1], color[2])); temp[0] += color[0]; temp[1] += color[1]; temp[2] += color[2]; - } + } int redAve = temp[0] / colors.size(); int greenAve = temp[1] / colors.size(); @@ -87,9 +87,9 @@ public static int colorDye(Collection colors) { float maxAve = (float) maxCompSum / (float) colors.size(); float max = Math.max(redAve, Math.max(greenAve, blueAve)); - redAve = (int) (redAve * maxAve / max); - greenAve = (int) (greenAve * maxAve / max); - blueAve = (int) (blueAve * maxAve / max); + redAve = (int)(redAve * maxAve / max); + greenAve = (int)(greenAve * maxAve / max); + blueAve = (int)(blueAve * maxAve / max); int finalColor = (redAve << 8) + greenAve; finalColor = (finalColor << 8) + blueAve; @@ -121,7 +121,7 @@ public static ResourceLocation mcLoc(String name) { /** * @param modId The namespace - * @param name The path + * @param name The path * @return The total path of the resource e.g "minecraft:air" */ public static String getResourcePath(String modId, String name) { @@ -145,10 +145,9 @@ public static T make(T object, Consumer consumer) { // From net.minecraft.util.Util but for RegistryObject public static RegistryObject acceptOrElse(RegistryObject opt, Consumer consumer, Runnable orElse) { - if(opt.isPresent()) { + if (opt.isPresent()) { consumer.accept(opt.get()); - } - else { + } else { orElse.run(); } @@ -156,10 +155,9 @@ public static RegistryObject acceptOrElse(RegistryObject opt, Consumer } public static Optional acceptOrElse(Optional opt, Consumer consumer, Runnable orElse) { - if(opt.isPresent()) { + if (opt.isPresent()) { consumer.accept(opt.get()); - } - else { + } else { orElse.run(); } @@ -168,8 +166,8 @@ public static Optional acceptOrElse(Optional opt, Consumer consumer public static boolean allMatch(Iterable input, Predicate matcher) { Objects.requireNonNull(matcher); - for(T e : input) { - if(!matcher.test(e)) { + for (T e : input) { + if (!matcher.test(e)) { return false; } } @@ -178,8 +176,8 @@ public static boolean allMatch(Iterable input, Predicate matcher) { public static boolean anyMatch(Iterable input, Predicate matcher) { Objects.requireNonNull(matcher); - for(T e : input) { - if(matcher.test(e)) { + for (T e : input) { + if (matcher.test(e)) { return true; } } @@ -191,21 +189,25 @@ public static boolean anyMatch(Iterable input, Predicate matcher) { * registry id of the object it is representing */ public static ResourceLocation getRegistryId(Object obj) { - if(obj instanceof ResourceLocation) { + if (obj instanceof ResourceLocation) { return (ResourceLocation) obj; } - if(obj instanceof String) { + if (obj instanceof String) { // Returns null when namespace or path contain invalid // characters return ResourceLocation.tryParse((String) obj); } - if(obj instanceof Holder.Reference) { - return ((Holder.Reference) obj).key().location(); - } +// if (obj instanceof IForgeRegistryEntry) { +// return ((IForgeRegistryEntry) obj).getRegistryName(); +// } +// +// if (obj instanceof IRegistryDelegate) { +// return ((IRegistryDelegate) obj).name(); +// } - if(obj instanceof RegistryObject) { + if (obj instanceof RegistryObject) { return ((RegistryObject) obj).getId(); } diff --git a/src/main/java/com/sweetrpg/catherder/common/world/WildCropGeneration.java b/src/main/java/com/sweetrpg/catherder/common/world/WildCropGeneration.java index 616d73d2..264244ec 100644 --- a/src/main/java/com/sweetrpg/catherder/common/world/WildCropGeneration.java +++ b/src/main/java/com/sweetrpg/catherder/common/world/WildCropGeneration.java @@ -1,45 +1,5 @@ package com.sweetrpg.catherder.common.world; -//import com.sweetrpg.catherder.common.config.ConfigHandler; -//import com.sweetrpg.catherder.common.registry.ModBlocks; -//import com.sweetrpg.catherder.common.util.Util; -//import net.minecraft.core.BlockPos; -//import net.minecraft.core.Registry; -//import net.minecraft.data.worldgen.placement.PlacementUtils; -//import net.minecraft.world.level.block.Block; -//import net.minecraft.world.level.block.Blocks; -//import net.minecraft.world.level.levelgen.blockpredicates.BlockPredicate; -//import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; -//import net.minecraft.world.level.levelgen.feature.Feature; -//import net.minecraft.world.level.levelgen.feature.configurations.RandomPatchConfiguration; -//import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration; -//import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider; -//import net.minecraft.world.level.levelgen.placement.BiomeFilter; -//import net.minecraft.world.level.levelgen.placement.InSquarePlacement; -//import net.minecraft.world.level.levelgen.placement.PlacedFeature; -//import net.minecraft.world.level.levelgen.placement.RarityFilter; -// -//import java.util.Arrays; -//import java.util.List; -// -//import net.minecraft.core.BlockPos; -//import net.minecraft.core.Holder; -//import net.minecraft.core.Registry; -//import net.minecraft.data.worldgen.features.FeatureUtils; -//import net.minecraft.data.worldgen.placement.PlacementUtils; -//import net.minecraft.resources.ResourceLocation; -//import net.minecraft.tags.BlockTags; -//import net.minecraft.world.level.block.Block; -//import net.minecraft.world.level.block.Blocks; -//import net.minecraft.world.level.levelgen.blockpredicates.BlockPredicate; -//import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; -//import net.minecraft.world.level.levelgen.feature.Feature; -//import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration; -//import net.minecraft.world.level.levelgen.feature.configurations.RandomPatchConfiguration; -//import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration; -//import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider; -//import net.minecraft.world.level.levelgen.placement.*; - import com.sweetrpg.catherder.api.CatHerderAPI; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceKey; @@ -53,54 +13,6 @@ public class WildCropGeneration { public static ResourceKey PATCH_WILD_CATNIP = ResourceKey.create(Registries.PLACED_FEATURE, new ResourceLocation(CatHerderAPI.MOD_ID, "patch_wild_catnip")); -// public static final BlockPos BLOCK_BELOW = new BlockPos(0, -1, 0); -// -// public static Holder> FEATURE_PATCH_WILD_CATNIP; -// public static Holder PATCH_WILD_CATNIP; -// -// public static RandomPatchConfiguration getWildCropConfiguration(Block block, int tries, int xzSpread, int ySpread, BlockPredicate plantedOn) { -// return new RandomPatchConfiguration(tries, xzSpread, ySpread, PlacementUtils.filtered( -// Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(BlockStateProvider.simple(block)), -// BlockPredicate.allOf(BlockPredicate.ONLY_IN_AIR_PREDICATE, plantedOn))); -// } -// -// static Holder registerPlacement(ResourceLocation id, Holder> feature, PlacementModifier... modifiers) { -// return BuiltinRegistries.register(BuiltinRegistries.PLACED_FEATURE, id, new PlacedFeature(Holder.hackyErase(feature), List.of(modifiers))); -// } -// -// protected static > Holder> register(ResourceLocation id, F feature, FC featureConfig) { -// return register(BuiltinRegistries.CONFIGURED_FEATURE, id, new ConfiguredFeature<>(feature, featureConfig)); -// } -// -// private static Holder register(Registry registry, ResourceLocation id, V value) { -// return (Holder) BuiltinRegistries.register(registry, id, value); -// } -// -// public static void registerWildCatnipGeneration() { -// FEATURE_PATCH_WILD_CATNIP = register(Util.modLoc("patch_wild_catnip"), -// Feature.RANDOM_PATCH, -// getWildCropConfiguration(ModBlocks.WILD_CATNIP.get(), -// 64, ConfigHandler.SERVER.WILD_CATNIP_SPREAD.get(), 3, -// BlockPredicate.matchesBlocks(Arrays.asList(Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL), BLOCK_BELOW))); -// -//// FEATURE_PATCH_WILD_CATNIP = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, -//// Util.modLoc("patch_wild_catnip"), -//// Feature.RANDOM_PATCH.configured(getWildCropConfiguration(ModBlocks.WILD_CATNIP.get(), 64, ConfigHandler.SERVER.WILD_CATNIP_SPREAD.get(), 3, -//// BlockPredicate.matchesBlocks(Arrays.asList(Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL), BLOCK_BELOW)))); -// -// PATCH_WILD_CATNIP = registerPlacement(Util.modLoc("patch_wild_catnip"), -// FEATURE_PATCH_WILD_CATNIP, -// RarityFilter.onAverageOnceEvery(ConfigHandler.SERVER.CHANCE_WILD_CATNIP.get()), -// InSquarePlacement.spread(), -// PlacementUtils.HEIGHTMAP, -// BiomeFilter.biome()); -// -//// PATCH_WILD_CATNIP = Registry.register(BuiltinRegistries.PLACED_FEATURE, -//// Util.modLoc("patch_wild_catnip"), -//// FEATURE_PATCH_WILD_CATNIP.placed(RarityFilter.onAverageOnceEvery(ConfigHandler.SERVER.CHANCE_WILD_CATNIP.get()), -//// InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP, BiomeFilter.biome())); -// } - public static void load() { } diff --git a/src/main/java/com/sweetrpg/catherder/data/CHAdvancementProvider.java b/src/main/java/com/sweetrpg/catherder/data/CHAdvancementProvider.java index 2f94ed13..6e8b4bbf 100644 --- a/src/main/java/com/sweetrpg/catherder/data/CHAdvancementProvider.java +++ b/src/main/java/com/sweetrpg/catherder/data/CHAdvancementProvider.java @@ -128,8 +128,8 @@ public void generate(HolderLookup.Provider registries, Consumer con .parent(trainCat) .display(DisplayInfoBuilder.create().icon(ModItems.CAT_TOY).frame(FrameType.TASK).translate("catherder.main.toy").build()) .addCriterion("play_with_cat", PickedUpItemTrigger.TriggerInstance.thrownItemPickedUpByEntity(EntityPredicate.Composite.ANY, - ItemPredicate.Builder.item().of(ModTags.TOYS).build(), - EntityPredicate.Composite.wrap(EntityPredicate.Builder.entity().entityType(EntityTypePredicate.of(ModEntityTypes.CAT.get())).build()))) + ItemPredicate.Builder.item().of(ModTags.TOYS).build(), + EntityPredicate.Composite.wrap(EntityPredicate.Builder.entity().entityType(EntityTypePredicate.of(ModEntityTypes.CAT.get())).build()))) .save(consumer, Util.getResourcePath("main/play_with_cat")); // Nermal diff --git a/src/main/java/com/sweetrpg/catherder/data/CHBlockTagsProvider.java b/src/main/java/com/sweetrpg/catherder/data/CHBlockTagsProvider.java index 5f53327a..7307b3e6 100644 --- a/src/main/java/com/sweetrpg/catherder/data/CHBlockTagsProvider.java +++ b/src/main/java/com/sweetrpg/catherder/data/CHBlockTagsProvider.java @@ -10,8 +10,8 @@ import net.minecraft.data.PackOutput; import net.minecraftforge.common.data.BlockTagsProvider; import net.minecraftforge.common.data.ExistingFileHelper; +import org.jetbrains.annotations.Nullable; -import javax.annotation.Nullable; import java.util.concurrent.CompletableFuture; public class CHBlockTagsProvider extends BlockTagsProvider { @@ -26,7 +26,7 @@ public String getName() { } @Override - protected void addTags(HolderLookup.Provider provider) { + protected void addTags(HolderLookup.Provider p_256380_) { this.registerModTags(); this.registerMinecraftTags(); this.registerForgeTags(); diff --git a/src/main/java/com/sweetrpg/catherder/data/CHBlockstateProvider.java b/src/main/java/com/sweetrpg/catherder/data/CHBlockstateProvider.java index de8b590f..426959cd 100644 --- a/src/main/java/com/sweetrpg/catherder/data/CHBlockstateProvider.java +++ b/src/main/java/com/sweetrpg/catherder/data/CHBlockstateProvider.java @@ -28,8 +28,8 @@ public class CHBlockstateProvider extends BlockStateProvider { // Applies texture to all faces and for the input face culls that direction private static final BiFunction.ElementBuilder.FaceBuilder>> cullFaceFactory = (texture, input) -> (d, b) -> b.texture(texture).cullface(d == input ? d : null); - public CHBlockstateProvider(PackOutput packOutput, ExistingFileHelper exFileHelper) { - super(packOutput, CatHerderAPI.MOD_ID, exFileHelper); + public CHBlockstateProvider(PackOutput output, ExistingFileHelper exFileHelper) { + super(output, CatHerderAPI.MOD_ID, exFileHelper); } public ExistingFileHelper getExistingHelper() { @@ -91,12 +91,12 @@ protected void cheeseWheelBlock(Block block, IntegerProperty suffixProperty) { protected void createFromShape(Supplier blockIn, AABB bb) { BlockModelBuilder model = this.models() - .getBuilder(name(blockIn)) + .getBuilder(name(blockIn.get())) .parent(this.models().getExistingFile(mcLoc(ModelProvider.BLOCK_FOLDER + "/block"))) - .texture("particle", extend(blockTexture(blockIn), "_bottom")) - .texture("bottom", extend(blockTexture(blockIn), "_bottom")) - .texture("top", extend(blockTexture(blockIn), "_top")) - .texture("side", extend(blockTexture(blockIn), "_side")); + .texture("particle", extend(blockTexture(blockIn.get()), "_bottom")) + .texture("bottom", extend(blockTexture(blockIn.get()), "_bottom")) + .texture("top", extend(blockTexture(blockIn.get()), "_top")) + .texture("side", extend(blockTexture(blockIn.get()), "_side")); model.element() .from((float) bb.minX, (float) bb.minY, (float) bb.minZ) @@ -195,17 +195,17 @@ public void customStageBlock(Block block, @Nullable ResourceLocation parent, Str }, ignored); } - private String name(Supplier block) { - return ForgeRegistries.BLOCKS.getKey(block.get()).getPath(); + private String name(Block block) { + return ForgeRegistries.BLOCKS.getKey(block).getPath(); } - private ResourceLocation blockTexture(Supplier block) { - ResourceLocation base = ForgeRegistries.BLOCKS.getKey(block.get()); + public ResourceLocation blockTexture(Block block) { + ResourceLocation base = ForgeRegistries.BLOCKS.getKey(block); return prextend(base, ModelProvider.BLOCK_FOLDER + "/"); } public ModelFile cross(Supplier block) { - return this.models().cross(name(block), blockTexture(block)); + return this.models().cross(name(block.get()), blockTexture(block.get())); } protected void makeSimple(Supplier blockIn) { diff --git a/src/main/java/com/sweetrpg/catherder/data/CHItemModelProvider.java b/src/main/java/com/sweetrpg/catherder/data/CHItemModelProvider.java index 16f6bd88..16b8c8da 100644 --- a/src/main/java/com/sweetrpg/catherder/data/CHItemModelProvider.java +++ b/src/main/java/com/sweetrpg/catherder/data/CHItemModelProvider.java @@ -14,13 +14,14 @@ import net.minecraftforge.client.model.generators.ModelFile.UncheckedModelFile; import net.minecraftforge.client.model.generators.ModelProvider; import net.minecraftforge.common.data.ExistingFileHelper; +import net.minecraftforge.registries.ForgeRegistries; import java.util.function.Supplier; public class CHItemModelProvider extends ItemModelProvider { - public CHItemModelProvider(PackOutput packOutput, ExistingFileHelper existingFileHelper) { - super(packOutput, CatHerderAPI.MOD_ID, existingFileHelper); + public CHItemModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) { + super(output, CatHerderAPI.MOD_ID, existingFileHelper); } @Override @@ -83,7 +84,7 @@ private ResourceLocation itemTexture(Supplier item) { } private String name(Supplier item) { - return item.get().asItem().toString(); + return ForgeRegistries.ITEMS.getKey(item.get().asItem()).getPath(); } private ItemModelBuilder blockItem(Supplier block) { diff --git a/src/main/java/com/sweetrpg/catherder/data/CHItemTagsProvider.java b/src/main/java/com/sweetrpg/catherder/data/CHItemTagsProvider.java index 9be79e74..73dd6b2a 100644 --- a/src/main/java/com/sweetrpg/catherder/data/CHItemTagsProvider.java +++ b/src/main/java/com/sweetrpg/catherder/data/CHItemTagsProvider.java @@ -35,7 +35,7 @@ public String getName() { @Override public void addTags(HolderLookup.Provider provider) { createTag(ModTags.BEG_ITEMS_TAMED, ModItems.BREEDING_TREAT, - ModItems.CAT_TOY, + ModItems.CAT_TOY, () -> Items.STRING); appendToTag(ModTags.TREATS); createTag(ModTags.BEG_ITEMS_UNTAMED, ModItems.TRAINING_TREAT, () -> Items.STRING); diff --git a/src/main/java/com/sweetrpg/catherder/data/CHLangProvider.java b/src/main/java/com/sweetrpg/catherder/data/CHLangProvider.java index d19e664b..1560c004 100644 --- a/src/main/java/com/sweetrpg/catherder/data/CHLangProvider.java +++ b/src/main/java/com/sweetrpg/catherder/data/CHLangProvider.java @@ -16,7 +16,7 @@ public CHLangProvider(PackOutput packOutput, String locale) { @Override public String getName() { - return "CatHerder Language Provider: " + this.locale; + return "CatHerder Language Provider"; } @Override @@ -150,7 +150,6 @@ private void processENUS() { add(Constants.TRANSLATION_KEY_GUI_PREVIOUS_PAGE, "Previous Page"); add(Constants.TRANSLATION_KEY_GUI_SPEED, "Speed:"); add(Constants.TRANSLATION_KEY_ITEMGROUP_CATTREE, "Cat Tree Variants"); - add(Constants.TRANSLATION_KEY_ITEMGROUP_PETDOOR, "Pet Door Variants"); add(Constants.TRANSLATION_KEY_ITEMGROUP_MAIN, "Cat Herder"); add(Constants.TRANSLATION_KEY_ITEM_CAT_GUT, "Cat Gut"); add(Constants.TRANSLATION_KEY_ITEM_BIG_CATSIZER, "Cat Enlarger"); @@ -435,7 +434,6 @@ private void processENGB() { add(Constants.TRANSLATION_KEY_GUI_PREVIOUS_PAGE, "Previous Page"); add(Constants.TRANSLATION_KEY_GUI_SPEED, "Speed:"); add(Constants.TRANSLATION_KEY_ITEMGROUP_CATTREE, "Cat Tree Variants"); - add(Constants.TRANSLATION_KEY_ITEMGROUP_PETDOOR, "Pet Door Variants"); add(Constants.TRANSLATION_KEY_ITEMGROUP_MAIN, "Cat Herder"); add(Constants.TRANSLATION_KEY_ITEM_CAT_GUT, "Cat Gut"); add(Constants.TRANSLATION_KEY_ITEM_BIG_CATSIZER, "Cat Enlarger"); @@ -719,7 +717,6 @@ private void processDEDE() { add(Constants.TRANSLATION_KEY_GUI_PREVIOUS_PAGE, "Previous Page"); add(Constants.TRANSLATION_KEY_GUI_SPEED, "Speed:"); add(Constants.TRANSLATION_KEY_ITEMGROUP_CATTREE, "Cat Tree Variants"); - add(Constants.TRANSLATION_KEY_ITEMGROUP_PETDOOR, "Pet Door Variants"); add(Constants.TRANSLATION_KEY_ITEMGROUP_MAIN, "Cat Herder"); add(Constants.TRANSLATION_KEY_ITEM_CAT_GUT, "Cat Gut"); add(Constants.TRANSLATION_KEY_ITEM_BIG_CATSIZER, "Cat Enlarger"); @@ -1003,7 +1000,6 @@ private void processKOKR() { add(Constants.TRANSLATION_KEY_GUI_PREVIOUS_PAGE, "Previous Page"); add(Constants.TRANSLATION_KEY_GUI_SPEED, "Speed:"); add(Constants.TRANSLATION_KEY_ITEMGROUP_CATTREE, "Cat Tree Variants"); - add(Constants.TRANSLATION_KEY_ITEMGROUP_PETDOOR, "Pet Door Variants"); add(Constants.TRANSLATION_KEY_ITEMGROUP_MAIN, "Cat Herder"); add(Constants.TRANSLATION_KEY_ITEM_CAT_GUT, "Cat Gut"); add(Constants.TRANSLATION_KEY_ITEM_BIG_CATSIZER, "Cat Enlarger"); @@ -1287,7 +1283,6 @@ private void processRURU() { add(Constants.TRANSLATION_KEY_GUI_PREVIOUS_PAGE, "Previous Page"); add(Constants.TRANSLATION_KEY_GUI_SPEED, "Speed:"); add(Constants.TRANSLATION_KEY_ITEMGROUP_CATTREE, "Cat Tree Variants"); - add(Constants.TRANSLATION_KEY_ITEMGROUP_PETDOOR, "Pet Door Variants"); add(Constants.TRANSLATION_KEY_ITEMGROUP_MAIN, "Cat Herder"); add(Constants.TRANSLATION_KEY_ITEM_CAT_GUT, "Cat Gut"); add(Constants.TRANSLATION_KEY_ITEM_BIG_CATSIZER, "Cat Enlarger"); @@ -1571,7 +1566,6 @@ private void processVIVN() { add(Constants.TRANSLATION_KEY_GUI_PREVIOUS_PAGE, "Previous Page"); add(Constants.TRANSLATION_KEY_GUI_SPEED, "Speed:"); add(Constants.TRANSLATION_KEY_ITEMGROUP_CATTREE, "Cat Tree Variants"); - add(Constants.TRANSLATION_KEY_ITEMGROUP_PETDOOR, "Pet Door Variants"); add(Constants.TRANSLATION_KEY_ITEMGROUP_MAIN, "Cat Herder"); add(Constants.TRANSLATION_KEY_ITEM_CAT_GUT, "Cat Gut"); add(Constants.TRANSLATION_KEY_ITEM_BIG_CATSIZER, "Cat Enlarger"); @@ -1855,7 +1849,6 @@ private void processZHCN() { add(Constants.TRANSLATION_KEY_GUI_PREVIOUS_PAGE, "Previous Page"); add(Constants.TRANSLATION_KEY_GUI_SPEED, "Speed:"); add(Constants.TRANSLATION_KEY_ITEMGROUP_CATTREE, "Cat Tree Variants"); - add(Constants.TRANSLATION_KEY_ITEMGROUP_PETDOOR, "Pet Door Variants"); add(Constants.TRANSLATION_KEY_ITEMGROUP_MAIN, "Cat Herder"); add(Constants.TRANSLATION_KEY_ITEM_CAT_GUT, "Cat Gut"); add(Constants.TRANSLATION_KEY_ITEM_BIG_CATSIZER, "Cat Enlarger"); @@ -2139,7 +2132,6 @@ private void processZHTW() { add(Constants.TRANSLATION_KEY_GUI_PREVIOUS_PAGE, "Previous Page"); add(Constants.TRANSLATION_KEY_GUI_SPEED, "Speed:"); add(Constants.TRANSLATION_KEY_ITEMGROUP_CATTREE, "Cat Tree Variants"); - add(Constants.TRANSLATION_KEY_ITEMGROUP_PETDOOR, "Pet Door Variants"); add(Constants.TRANSLATION_KEY_ITEMGROUP_MAIN, "Cat Herder"); add(Constants.TRANSLATION_KEY_ITEM_CAT_GUT, "Cat Gut"); add(Constants.TRANSLATION_KEY_ITEM_BIG_CATSIZER, "Cat Enlarger"); diff --git a/src/main/java/com/sweetrpg/catherder/data/CHLootTableProvider.java b/src/main/java/com/sweetrpg/catherder/data/CHLootTableProvider.java index 2204d250..d96dd207 100644 --- a/src/main/java/com/sweetrpg/catherder/data/CHLootTableProvider.java +++ b/src/main/java/com/sweetrpg/catherder/data/CHLootTableProvider.java @@ -1,12 +1,15 @@ package com.sweetrpg.catherder.data; +import com.google.common.collect.ImmutableList; +import com.mojang.datafixers.util.Pair; +import com.sweetrpg.catherder.common.block.CatTreeBlock; import com.sweetrpg.catherder.common.block.CheeseWheelBlock; import com.sweetrpg.catherder.common.registry.ModBlocks; import com.sweetrpg.catherder.common.registry.ModEntityTypes; import com.sweetrpg.catherder.common.registry.ModItems; -import net.minecraft.advancements.critereon.ItemPredicate; +import net.minecraft.advancements.critereon.EnchantmentPredicate; import net.minecraft.advancements.critereon.StatePropertiesPredicate; -import net.minecraft.commands.CommandFunction; +import net.minecraft.data.DataGenerator; import net.minecraft.data.PackOutput; import net.minecraft.data.loot.BlockLootSubProvider; import net.minecraft.data.loot.EntityLootSubProvider; @@ -14,292 +17,266 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EntityType; import net.minecraft.world.flag.FeatureFlags; +import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; -import net.minecraft.world.item.enchantment.Enchantments; +import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.properties.BlockStateProperties; -import net.minecraft.world.level.storage.loot.BuiltInLootTables; import net.minecraft.world.level.storage.loot.LootPool; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.ValidationContext; import net.minecraft.world.level.storage.loot.entries.AlternativesEntry; import net.minecraft.world.level.storage.loot.entries.LootItem; -import net.minecraft.world.level.storage.loot.functions.*; +import net.minecraft.world.level.storage.loot.functions.CopyNbtFunction; +import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction; +import net.minecraft.world.level.storage.loot.parameters.LootContextParamSet; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; import net.minecraft.world.level.storage.loot.predicates.LootItemBlockStatePropertyCondition; -import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition; -import net.minecraft.world.level.storage.loot.predicates.MatchTool; +import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; import net.minecraft.world.level.storage.loot.providers.nbt.ContextNbtProvider; +import net.minecraft.world.level.storage.loot.providers.number.BinomialDistributionGenerator; import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; +import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.function.BiConsumer; +import java.util.function.Consumer; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; public class CHLootTableProvider extends LootTableProvider { - public CHLootTableProvider(PackOutput packOutput) { - super(packOutput, BuiltInLootTables.all(), List.of(new LootTableProvider.SubProviderEntry(Blocks::new, LootContextParamSets.BLOCK), new LootTableProvider.SubProviderEntry(Entities::new, LootContextParamSets.ENTITY))); + public CHLootTableProvider(PackOutput p_254123_) { + super(p_254123_, Collections.emptySet(), + List.of( + new LootTableProvider.SubProviderEntry(Blocks::new, LootContextParamSets.BLOCK), + new LootTableProvider.SubProviderEntry(Entities::new, LootContextParamSets.ENTITY) + ) + ); } -// @Override -// public String getName() { -// return "CatHerder LootTables"; -// } - -// @Override -// protected List>>, LootContextParamSet>> getTables() { -// return ImmutableList.of(Pair.of(Blocks::new, LootContextParamSets.BLOCK), Pair.of(Entities::new, LootContextParamSets.ENTITY)); -// } - @Override protected void validate(Map map, ValidationContext validationTracker) { } - private static class Blocks extends BlockLootSubProvider { - - protected Blocks() { - super(Collections.emptySet(), FeatureFlags.REGISTRY.allFlags()); - } - - @Override - protected void generate() { - dropCatTree(ModBlocks.CAT_TREE); - dropsSelf(ModBlocks.CAT_BOWL); // Drop with the name of the cat bowl - dropsSelf(ModBlocks.LITTERBOX); - dropWildCatnip(ModBlocks.WILD_CATNIP); - dropsSelf(ModBlocks.CARDBOARD_BOX); - dropsCatnipCrop(ModBlocks.CATNIP_CROP); - dropsMouseTrap(ModBlocks.MOUSE_TRAP); - dropsCheeseWheel(ModBlocks.CHEESE_WHEEL); - dropPetDoor(ModBlocks.PET_DOOR); - } - - private void dropsCheeseWheel(Supplier block) { - LootTable.Builder lootTableBuilder = LootTable.lootTable() - .withPool(applyExplosionCondition(block.get(), - LootPool.lootPool().setRolls(ConstantValue.exactly(1))) - .setRolls(ConstantValue.exactly(1)) - .add(AlternativesEntry.alternatives( - LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) - .when(() -> { - return new LootItemBlockStatePropertyCondition.Builder(block.get()) - .setProperties(StatePropertiesPredicate.Builder.properties() - .hasProperty(CheeseWheelBlock.SERVINGS, 1)).build(); - }) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1))), - LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) - .when(() -> { - return new LootItemBlockStatePropertyCondition.Builder(block.get()) - .setProperties(StatePropertiesPredicate.Builder.properties() - .hasProperty(CheeseWheelBlock.SERVINGS, 2)).build(); - }) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(2))), - LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) - .when(() -> { - return new LootItemBlockStatePropertyCondition.Builder(block.get()) - .setProperties(StatePropertiesPredicate.Builder.properties() - .hasProperty(CheeseWheelBlock.SERVINGS, 3)).build(); - }) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(3))), - LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) - .when(() -> { - return new LootItemBlockStatePropertyCondition.Builder(block.get()) - .setProperties(StatePropertiesPredicate.Builder.properties() - .hasProperty(CheeseWheelBlock.SERVINGS, 4)).build(); - }) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(4))), - LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) - .when(() -> { - return new LootItemBlockStatePropertyCondition.Builder(block.get()) - .setProperties(StatePropertiesPredicate.Builder.properties() - .hasProperty(CheeseWheelBlock.SERVINGS, 5)).build(); - }) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(5))), - LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) - .when(() -> { - return new LootItemBlockStatePropertyCondition.Builder(block.get()) - .setProperties(StatePropertiesPredicate.Builder.properties() - .hasProperty(CheeseWheelBlock.SERVINGS, 6)).build(); - }) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(6))), - LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) - .when(() -> { - return new LootItemBlockStatePropertyCondition.Builder(block.get()) - .setProperties(StatePropertiesPredicate.Builder.properties() - .hasProperty(CheeseWheelBlock.SERVINGS, 7)).build(); - }) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(7))), - LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) - .when(() -> { - return new LootItemBlockStatePropertyCondition.Builder(block.get()) - .setProperties(StatePropertiesPredicate.Builder.properties() - .hasProperty(CheeseWheelBlock.SERVINGS, 8)).build(); - }) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(8))) - ))) - .withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1)) - .setRolls(ConstantValue.exactly(1)) - .add(LootItem.lootTableItem(Items.BOWL))); - - this.add(block.get(), lootTableBuilder); - } - - private void dropsMouseTrap(Supplier block) { - LootTable.Builder lootTableBuilder = LootTable.lootTable() + private static class Blocks extends BlockLootSubProvider { + + private static final Set EXPLOSION_RESISTANT = Stream.of(ModBlocks.CAT_TREE.get(), ModBlocks.PET_DOOR.get()).map(ItemLike::asItem).collect(Collectors.toSet()); + + protected Blocks() { + super(EXPLOSION_RESISTANT, FeatureFlags.VANILLA_SET); + //TODO Auto-generated constructor stub + } + + private void dropsCheeseWheel(Supplier block) { + LootTable.Builder lootTableBuilder = LootTable.lootTable() + .withPool(applyExplosionCondition(block.get(), + LootPool.lootPool().setRolls(ConstantValue.exactly(1))) + .setRolls(ConstantValue.exactly(1)) + .add(AlternativesEntry.alternatives( + LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) + .when(() -> { + return new LootItemBlockStatePropertyCondition.Builder(block.get()) + .setProperties(StatePropertiesPredicate.Builder.properties() + .hasProperty(CheeseWheelBlock.SERVINGS, 1)).build(); + }) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1))), + LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) + .when(() -> { + return new LootItemBlockStatePropertyCondition.Builder(block.get()) + .setProperties(StatePropertiesPredicate.Builder.properties() + .hasProperty(CheeseWheelBlock.SERVINGS, 2)).build(); + }) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(2))), + LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) + .when(() -> { + return new LootItemBlockStatePropertyCondition.Builder(block.get()) + .setProperties(StatePropertiesPredicate.Builder.properties() + .hasProperty(CheeseWheelBlock.SERVINGS, 3)).build(); + }) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(3))), + LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) + .when(() -> { + return new LootItemBlockStatePropertyCondition.Builder(block.get()) + .setProperties(StatePropertiesPredicate.Builder.properties() + .hasProperty(CheeseWheelBlock.SERVINGS, 4)).build(); + }) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(4))), + LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) + .when(() -> { + return new LootItemBlockStatePropertyCondition.Builder(block.get()) + .setProperties(StatePropertiesPredicate.Builder.properties() + .hasProperty(CheeseWheelBlock.SERVINGS, 5)).build(); + }) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(5))), + LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) + .when(() -> { + return new LootItemBlockStatePropertyCondition.Builder(block.get()) + .setProperties(StatePropertiesPredicate.Builder.properties() + .hasProperty(CheeseWheelBlock.SERVINGS, 6)).build(); + }) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(6))), + LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) + .when(() -> { + return new LootItemBlockStatePropertyCondition.Builder(block.get()) + .setProperties(StatePropertiesPredicate.Builder.properties() + .hasProperty(CheeseWheelBlock.SERVINGS, 7)).build(); + }) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(7))), + LootItem.lootTableItem(ModItems.CHEESE_WEDGE.get()) + .when(() -> { + return new LootItemBlockStatePropertyCondition.Builder(block.get()) + .setProperties(StatePropertiesPredicate.Builder.properties() + .hasProperty(CheeseWheelBlock.SERVINGS, 8)).build(); + }) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(8))) + ))) + .withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1)) + .setRolls(ConstantValue.exactly(1)) + .add(LootItem.lootTableItem(Items.BOWL))); + + this.add(block.get(), lootTableBuilder); + } + + private void dropsMouseTrap(Supplier block) { + LootTable.Builder lootTableBuilder = LootTable.lootTable() // .withPool(applyExplosionCondition(block.get(), // LootPool.lootPool().when(() -> { // BlockStateProperties.TRIGGERED.getValue() // })) // .add(LootItem.lootTableItem(ModBlocks.CHEESE_WHEEL.get()))) - .withPool(applyExplosionCondition(block.get(), - LootPool.lootPool().setRolls(ConstantValue.exactly(1))) - .add(LootItem.lootTableItem(block.get()))); - - this.add(block.get(), lootTableBuilder); - } + .withPool(applyExplosionCondition(block.get(), + LootPool.lootPool().setRolls(ConstantValue.exactly(1))) + .add(LootItem.lootTableItem(block.get()))); - private void dropsCatnipCrop(Supplier block) { -// dropsSelf(block); + this.add(block.get(), lootTableBuilder); + } - final var CATNIP_LOOTITEM = LootItem.lootTableItem(ModItems.CATNIP.get()) - .when(() -> { - return new LootItemBlockStatePropertyCondition.Builder(ModBlocks.CATNIP_CROP.get()) - .setProperties(StatePropertiesPredicate.Builder.properties().hasProperty(BlockStateProperties.AGE_5, "5")).build(); - }); - final var CATNIP_SEEDS_LOOTITEM = LootItem.lootTableItem(ModItems.CATNIP_SEEDS.get()); - final var NORMAL_POOL = LootPool.lootPool() - .setRolls(ConstantValue.exactly(1)) - .add(AlternativesEntry.alternatives(CATNIP_LOOTITEM, CATNIP_SEEDS_LOOTITEM)); - final var FORTUNE_POOL = LootPool.lootPool() - .setRolls(ConstantValue.exactly(1)) - .add(LootItem.lootTableItem(ModItems.CATNIP_SEEDS.get()).apply( - ApplyBonusCount.addBonusBinomialDistributionCount(Enchantments.BLOCK_FORTUNE, 0.5714286f, 3) - )) - .when(() -> { - return new LootItemBlockStatePropertyCondition.Builder(ModBlocks.CATNIP_CROP.get()) - .setProperties(StatePropertiesPredicate.Builder.properties().hasProperty(BlockStateProperties.AGE_5, "5")).build(); - }); - LootTable.Builder lootTableBuilder = LootTable.lootTable() - .withPool(NORMAL_POOL) - .withPool(FORTUNE_POOL) +// private void dropsWildCatnip(Supplier block) { +// LootTable.Builder lootTableBuilder = LootTable.lootTable() // .withPool(applyExplosionCondition(block.get(), // LootPool.lootPool().setRolls(UniformGenerator.between(0, 2))) -// .add(LootItem.lootTableItem(ModItems.CATNIP_SEEDS.get()))); +// .add(LootItem.lootTableItem(ModItems.CATNIP_SEEDS.get()))) +// .withPool(applyExplosionCondition(block.get(), +// LootPool.lootPool() +// .setRolls(ConstantValue.exactly(1)) +// .add(LootItem.lootTableItem(ModItems.CATNIP_SEEDS.get())) +// .apply(EnchantmentPredicate.Builder. +// BinomialDistributionGenerator.binomial(3, 0.5714286F) +// ) +// .when(() -> { +// return new LootItemBlockStatePropertyCondition.Builder(block.get()) +// .setProperties(StatePropertiesPredicate.Builder.properties() +// .hasProperty(BlockStateProperties.STAGE, "5")).build(); +// }))); // - .apply(ApplyExplosionDecay.explosionDecay()) - ; - - this.add(block.get(), lootTableBuilder); - } - - private void dropWildCatnip(Supplier block) { - final var CATNIP_LOOTPOOL = LootPool.lootPool() - .setRolls(ConstantValue.exactly(1)) - .add(LootItem.lootTableItem(ModItems.CATNIP.get()) - .when(() -> { - return LootItemRandomChanceCondition.randomChance(0.5f).build(); - }) - .when(() -> { - return MatchTool.toolMatches(ItemPredicate.Builder.item().of(Items.SHEARS)).invert().build(); - }) - ); - final var WILD_CATNIP_LOOTITEM = LootItem.lootTableItem(ModItems.WILD_CATNIP.get()) - .when(() -> { - return MatchTool.toolMatches(ItemPredicate.Builder.item().of(Items.SHEARS)).invert().build(); - }); - final var CATNIP_SEEDS_LOOTITEM = LootItem.lootTableItem(ModItems.CATNIP_SEEDS.get()) - .apply( - ApplyBonusCount.addUniformBonusCount(Enchantments.BLOCK_FORTUNE, 2) - ); - final var WILD_CATNIP_LOOTPOOL = LootPool.lootPool() - .setRolls(ConstantValue.exactly(1)) - .add(AlternativesEntry.alternatives(WILD_CATNIP_LOOTITEM, CATNIP_SEEDS_LOOTITEM)); - - LootTable.Builder builder = LootTable.lootTable() - .withPool(CATNIP_LOOTPOOL) - .withPool(WILD_CATNIP_LOOTPOOL); +// this.add(block.get(), lootTableBuilder); +// } - this.add(block.get(), builder); - } +// private void dropsCatnipCrop(Supplier block) { +// LootTable.Builder builder = LootTable.lootTable() +// .withPool(LootPool.lootPool() +// .setRolls(ConstantValue.exactly(1)) +// .add(LootItem.lootTableItem(ModItems.CATNIP_SEEDS.get())) +// .add(LootItem.lootTableItem(ModItems.CATNIP.get()) +// .when(() -> { return new LootItemBlockStatePropertyCondition.Builder(block.get()) +// .setProperties(StatePropertiesPredicate.Builder.properties() +// .hasProperty(BlockStateProperties.AGE_7)); }))) +// .withPool(LootPool.lootPool() +// .setRolls(ConstantValue.exactly(1)) +// .add(LootItem.lootTableItem(ModItems.CATNIP_SEEDS.get())) +// .apply(EnchantmentPredicate() +// BinomialDistributionGenerator.binomial(3, 0.5714286F) +// ) +// .when()); +// +// this.add(block.get(), builder); +// } - private void dropCatTree(Supplier block) { - LootTable.Builder lootTableBuilder = LootTable.lootTable() - .withPool(applyExplosionCondition(block.get(), - LootPool.lootPool().setRolls(ConstantValue.exactly(1))) - .add(LootItem.lootTableItem(block.get()) - .apply( - CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY) - .copy("colorId", "catherder.colorId") + private void dropCatTree(Supplier block) { + LootTable.Builder lootTableBuilder = LootTable.lootTable() + .withPool(applyExplosionCondition(block.get(), + LootPool.lootPool().setRolls(ConstantValue.exactly(1))) + .add(LootItem.lootTableItem(block.get()) + .apply( + CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY) + .copy("colorId", "catherder.colorId") // .copy("beddingId", "catherder.beddingId") - .copy("ownerId", "catherder.ownerId") - .copy("name", "catherder.name") - .copy("ownerName", "catherder.ownerName")))); - - this.add(block.get(), lootTableBuilder); - } - - private void dropPetDoor(Supplier block) { - LootTable.Builder lootTableBuilder = LootTable.lootTable() - .withPool(applyExplosionCondition(block.get(), - LootPool.lootPool().setRolls(ConstantValue.exactly(1))) - .add(LootItem.lootTableItem(block.get()) - .apply( - CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY) - .copy("structureId", "catherder.structureId")))); - - this.add(block.get(), lootTableBuilder); - } - - private void dropsSelf(Supplier block) { - dropSelf(block.get()); - } - - @Override - protected Iterable getKnownBlocks() { - return ModBlocks.BLOCKS.getEntries().stream().map(Supplier::get).collect(Collectors.toList()); - } + .copy("ownerId", "catherder.ownerId") + .copy("name", "catherder.name") + .copy("ownerName", "catherder.ownerName")))); + + this.add(block.get(), lootTableBuilder); + } + + private void dropPetDoor(Supplier block) { + LootTable.Builder lootTableBuilder = LootTable.lootTable() + .withPool(applyExplosionCondition(block.get(), + LootPool.lootPool().setRolls(ConstantValue.exactly(1))) + .add(LootItem.lootTableItem(block.get()) + .apply( + CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY) + .copy("structureId", "catherder.structureId")))); + + this.add(block.get(), lootTableBuilder); + } + + private void dropsSelf(Supplier block) { + dropSelf(block.get()); + } + + @Override + protected Iterable getKnownBlocks() { + return ModBlocks.BLOCKS.getEntries().stream().map(Supplier::get).collect(Collectors.toList()); + } + + @Override + protected void generate() { + dropCatTree(ModBlocks.CAT_TREE); + dropsSelf(ModBlocks.CAT_BOWL); // Drop with the name of the cat bowl + dropsSelf(ModBlocks.LITTERBOX); +// dropsWildCatnip(ModBlocks.WILD_CATNIP); + dropsSelf(ModBlocks.CARDBOARD_BOX); +// dropsCatnipCrop(ModBlocks.CATNIP_CROP); + dropsMouseTrap(ModBlocks.MOUSE_TRAP); + dropsCheeseWheel(ModBlocks.CHEESE_WHEEL); + dropPetDoor(ModBlocks.PET_DOOR); + } } private static class Entities extends EntityLootSubProvider { protected Entities() { - super(FeatureFlags.REGISTRY.allFlags()); + super(FeatureFlags.VANILLA_SET); } @Override public void generate() { this.registerNoLoot(ModEntityTypes.CAT); - } -// @Override -// protected void addTables() { -// -// // for(EntityType type : Arrays.asList(EntityType.CAT, EntityType.COW, EntityType.SHEEP, EntityType.HORSE, EntityType.LLAMA, EntityType.DONKEY, EntityType.GOAT, EntityType.MULE, EntityType.MOOSHROOM, EntityType.OCELOT, EntityType.PIG)) { // this.add(type, LootTable.lootTable() // .withPool(LootPool.lootPool() // .setRolls(ConstantValue.exactly(0.1F)) // .add(LootItem.lootTableItem(ModItems.CAT_GUT.get()) // .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))))); -//// this.add(ModEntityTypes.RODENT.get(), LootTable.lootTable() -//// .withPool(LootPool.lootPool() -//// .setRolls(ConstantValue.exactly(1.0F)) -//// .add(LootItem.lootTableItem(ModItems.RODENT.get()) -//// .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))))); +// this.add(ModEntityTypes.RODENT.get(), LootTable.lootTable() +// .withPool(LootPool.lootPool() +// .setRolls(ConstantValue.exactly(1.0F)) +// .add(LootItem.lootTableItem(ModItems.RODENT.get()) +// .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F)))))); // } -// } + } protected void registerNoLoot(Supplier> type) { this.add(type.get(), LootTable.lootTable()); } @Override - protected Stream> getKnownEntityTypes() { + protected java.util.stream.Stream> getKnownEntityTypes() { return ModEntityTypes.ENTITIES.getEntries().stream().map(Supplier::get); } } + } diff --git a/src/main/java/com/sweetrpg/catherder/data/DisplayInfoBuilder.java b/src/main/java/com/sweetrpg/catherder/data/DisplayInfoBuilder.java index 7a110ce5..b1bdd850 100644 --- a/src/main/java/com/sweetrpg/catherder/data/DisplayInfoBuilder.java +++ b/src/main/java/com/sweetrpg/catherder/data/DisplayInfoBuilder.java @@ -28,8 +28,8 @@ public DisplayInfoBuilder translate(ResourceLocation key) { } public DisplayInfoBuilder translate(String key) { - this.title(Component.translatable("advancements."+key+".title")); - this.description(Component.translatable("advancements."+key+".description")); + this.title(Component.translatable("advancements." + key + ".title")); + this.description(Component.translatable("advancements." + key + ".description")); return this; } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 098908d9..75ffbfc8 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -32,7 +32,7 @@ logoFile= "ch_logo.png" [[dependencies.catherder]] modId="configured" mandatory=false - versionRange="[2.1.1,)" + versionRange="[1.5.4,)" ordering="NONE" side="BOTH" diff --git a/src/main/resources/assets/catherder/models/block/catnip_stage0.json b/src/main/resources/assets/catherder/models/block/catnip_stage0.json deleted file mode 100644 index 620057e6..00000000 --- a/src/main/resources/assets/catherder/models/block/catnip_stage0.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "catherder:block/crop_cross", - "render_type": "minecraft:cutout", - "textures": { - "cross": "catherder:block/catnip_stage0" - } -} diff --git a/src/main/resources/assets/catherder/models/block/catnip_stage1.json b/src/main/resources/assets/catherder/models/block/catnip_stage1.json deleted file mode 100644 index 1a80b452..00000000 --- a/src/main/resources/assets/catherder/models/block/catnip_stage1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "catherder:block/crop_cross", - "render_type": "minecraft:cutout", - "textures": { - "cross": "catherder:block/catnip_stage1" - } -} diff --git a/src/main/resources/assets/catherder/models/block/catnip_stage2.json b/src/main/resources/assets/catherder/models/block/catnip_stage2.json deleted file mode 100644 index 40ec152a..00000000 --- a/src/main/resources/assets/catherder/models/block/catnip_stage2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "catherder:block/crop_cross", - "render_type": "minecraft:cutout", - "textures": { - "cross": "catherder:block/catnip_stage2" - } -} diff --git a/src/main/resources/assets/catherder/models/block/catnip_stage3.json b/src/main/resources/assets/catherder/models/block/catnip_stage3.json deleted file mode 100644 index c163761d..00000000 --- a/src/main/resources/assets/catherder/models/block/catnip_stage3.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "catherder:block/crop_cross", - "render_type": "minecraft:cutout", - "textures": { - "cross": "catherder:block/catnip_stage3" - } -} diff --git a/src/main/resources/assets/catherder/models/block/catnip_stage4.json b/src/main/resources/assets/catherder/models/block/catnip_stage4.json deleted file mode 100644 index 715a3b78..00000000 --- a/src/main/resources/assets/catherder/models/block/catnip_stage4.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "catherder:block/crop_cross", - "render_type": "minecraft:cutout", - "textures": { - "cross": "catherder:block/catnip_stage4" - } -} diff --git a/src/main/resources/assets/catherder/models/block/catnip_stage5.json b/src/main/resources/assets/catherder/models/block/catnip_stage5.json deleted file mode 100644 index 4485da4c..00000000 --- a/src/main/resources/assets/catherder/models/block/catnip_stage5.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "parent": "catherder:block/crop_cross", - "render_type": "minecraft:cutout", - "textures": { - "cross": "catherder:block/catnip_stage5" - } -} diff --git a/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/food/food_cat.json b/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/food/food_cat.json index 27221150..7c05566e 100644 --- a/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/food/food_cat.json +++ b/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/food/food_cat.json @@ -1,6 +1,6 @@ { "name": "Cat Food", - "icon": "catherder:salmon", + "icon": "minecraft:salmon", "category": "catherder:food", "pages": [ { diff --git a/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/food/food_people.json b/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/food/food_people.json index e59c8d51..0c2f44ee 100644 --- a/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/food/food_people.json +++ b/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/food/food_people.json @@ -1,6 +1,6 @@ { "name": "People Food", - "icon": "catherder:beef", + "icon": "minecraft:beef", "category": "catherder:food", "pages": [ { diff --git a/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/items/breeding.json b/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/items/breeding.json index d3d011db..b9c418d4 100644 --- a/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/items/breeding.json +++ b/src/main/resources/data/catherder/patchouli_books/cat_care/en_us/entries/items/breeding.json @@ -1,7 +1,7 @@ { "name": "Breeding", "icon": "catherder:breeding_treat", - "category": "catherder:misc", + "category": "catherder:items", "pages": [ { "type": "patchouli:text", diff --git a/src/main/resources/data/minecraft/loot_tables/entities/cat.json b/src/main/resources/data/minecraft/loot_tables/entities/cat.json new file mode 100644 index 00000000..d0ea88d2 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/cat.json @@ -0,0 +1,47 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 2.0 + }, + "add": false + } + ], + "name": "minecraft:string" + } + ] + }, + { + "rolls": 0.1, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + }, + "add": false + } + ], + "name": "catherder:cat_gut" + } + ] + } + ] +} diff --git a/src/main/resources/data/minecraft/loot_tables/entities/cow.json b/src/main/resources/data/minecraft/loot_tables/entities/cow.json new file mode 100644 index 00000000..cd518f64 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/cow.json @@ -0,0 +1,98 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 2.0 + }, + "add": false + }, + { + "function": "minecraft:looting_enchant", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ], + "name": "minecraft:leather" + } + ] + }, + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 3.0 + }, + "add": false + }, + { + "function": "minecraft:furnace_smelt", + "conditions": [ + { + "condition": "minecraft:entity_properties", + "predicate": { + "flags": { + "is_on_fire": true + } + }, + "entity": "this" + } + ] + }, + { + "function": "minecraft:looting_enchant", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ], + "name": "minecraft:beef" + } + ] + }, + { + "rolls": 0.1, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + }, + "add": false + } + ], + "name": "catherder:cat_gut" + } + ] + } + ] +} diff --git a/src/main/resources/data/minecraft/loot_tables/entities/donkey.json b/src/main/resources/data/minecraft/loot_tables/entities/donkey.json new file mode 100644 index 00000000..a5c62696 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/donkey.json @@ -0,0 +1,55 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 2.0 + }, + "add": false + }, + { + "function": "minecraft:looting_enchant", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ], + "name": "minecraft:leather" + } + ] + }, + { + "rolls": 0.1, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + }, + "add": false + } + ], + "name": "catherder:cat_gut" + } + ] + } + ] +} diff --git a/src/main/resources/data/minecraft/loot_tables/entities/goat.json b/src/main/resources/data/minecraft/loot_tables/entities/goat.json new file mode 100644 index 00000000..2b359218 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/goat.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 0.1, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + }, + "add": false + } + ], + "name": "catherder:cat_gut" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/loot_tables/entities/horse.json b/src/main/resources/data/minecraft/loot_tables/entities/horse.json new file mode 100644 index 00000000..a5c62696 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/horse.json @@ -0,0 +1,55 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 2.0 + }, + "add": false + }, + { + "function": "minecraft:looting_enchant", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ], + "name": "minecraft:leather" + } + ] + }, + { + "rolls": 0.1, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + }, + "add": false + } + ], + "name": "catherder:cat_gut" + } + ] + } + ] +} diff --git a/src/main/resources/data/minecraft/loot_tables/entities/llama.json b/src/main/resources/data/minecraft/loot_tables/entities/llama.json new file mode 100644 index 00000000..a5c62696 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/llama.json @@ -0,0 +1,55 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 2.0 + }, + "add": false + }, + { + "function": "minecraft:looting_enchant", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ], + "name": "minecraft:leather" + } + ] + }, + { + "rolls": 0.1, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + }, + "add": false + } + ], + "name": "catherder:cat_gut" + } + ] + } + ] +} diff --git a/src/main/resources/data/minecraft/loot_tables/entities/mooshroom.json b/src/main/resources/data/minecraft/loot_tables/entities/mooshroom.json new file mode 100644 index 00000000..cd518f64 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/mooshroom.json @@ -0,0 +1,98 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 2.0 + }, + "add": false + }, + { + "function": "minecraft:looting_enchant", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ], + "name": "minecraft:leather" + } + ] + }, + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 3.0 + }, + "add": false + }, + { + "function": "minecraft:furnace_smelt", + "conditions": [ + { + "condition": "minecraft:entity_properties", + "predicate": { + "flags": { + "is_on_fire": true + } + }, + "entity": "this" + } + ] + }, + { + "function": "minecraft:looting_enchant", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ], + "name": "minecraft:beef" + } + ] + }, + { + "rolls": 0.1, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + }, + "add": false + } + ], + "name": "catherder:cat_gut" + } + ] + } + ] +} diff --git a/src/main/resources/data/minecraft/loot_tables/entities/mule.json b/src/main/resources/data/minecraft/loot_tables/entities/mule.json new file mode 100644 index 00000000..a5c62696 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/mule.json @@ -0,0 +1,55 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 2.0 + }, + "add": false + }, + { + "function": "minecraft:looting_enchant", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ], + "name": "minecraft:leather" + } + ] + }, + { + "rolls": 0.1, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + }, + "add": false + } + ], + "name": "catherder:cat_gut" + } + ] + } + ] +} diff --git a/src/main/resources/data/minecraft/loot_tables/entities/ocelot.json b/src/main/resources/data/minecraft/loot_tables/entities/ocelot.json new file mode 100644 index 00000000..2b359218 --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/ocelot.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 0.1, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + }, + "add": false + } + ], + "name": "catherder:cat_gut" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/loot_tables/entities/pig.json b/src/main/resources/data/minecraft/loot_tables/entities/pig.json new file mode 100644 index 00000000..3fd4ad1a --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/pig.json @@ -0,0 +1,69 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 3.0 + }, + "add": false + }, + { + "function": "minecraft:furnace_smelt", + "conditions": [ + { + "condition": "minecraft:entity_properties", + "predicate": { + "flags": { + "is_on_fire": true + } + }, + "entity": "this" + } + ] + }, + { + "function": "minecraft:looting_enchant", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ], + "name": "minecraft:porkchop" + } + ] + }, + { + "rolls": 0.1, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + }, + "add": false + } + ], + "name": "catherder:cat_gut" + } + ] + } + ] +} diff --git a/src/main/resources/data/minecraft/loot_tables/entities/sheep.json b/src/main/resources/data/minecraft/loot_tables/entities/sheep.json new file mode 100644 index 00000000..43b628ae --- /dev/null +++ b/src/main/resources/data/minecraft/loot_tables/entities/sheep.json @@ -0,0 +1,69 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1.0, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1.0, + "max": 2.0 + }, + "add": false + }, + { + "function": "minecraft:furnace_smelt", + "conditions": [ + { + "condition": "minecraft:entity_properties", + "predicate": { + "flags": { + "is_on_fire": true + } + }, + "entity": "this" + } + ] + }, + { + "function": "minecraft:looting_enchant", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + } + } + ], + "name": "minecraft:mutton" + } + ] + }, + { + "rolls": 0.1, + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 0.0, + "max": 1.0 + }, + "add": false + } + ], + "name": "catherder:cat_gut" + } + ] + } + ] +} diff --git a/src/main/resources/data/minecraft/tags/entity_types/fall_damage_immune.json b/src/main/resources/data/minecraft/tags/entity_types/fall_damage_immune.json deleted file mode 100644 index f659442f..00000000 --- a/src/main/resources/data/minecraft/tags/entity_types/fall_damage_immune.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "replace": false, "values": [ - "catherder:cat" - ] -} diff --git a/src/test/java/com/sweetrpg/catherder/test/catherder/common/util/UtilTest.java b/src/test/java/com/sweetrpg/catherder/test/catherder/common/util/UtilTest.java index 848b0689..1b86e2a7 100644 --- a/src/test/java/com/sweetrpg/catherder/test/catherder/common/util/UtilTest.java +++ b/src/test/java/com/sweetrpg/catherder/test/catherder/common/util/UtilTest.java @@ -6,6 +6,8 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.Block; import net.minecraftforge.registries.RegistryObject; +import net.minecraftforge.registries.IForgeRegistryEntry; +import net.minecraftforge.registries.IRegistryDelegate; import org.junit.jupiter.api.Test; public class UtilTest { @@ -15,21 +17,21 @@ public void testGetRegistryId() { ResourceLocation dirtRL = new ResourceLocation("minecraft:dirt"); assertEquals(dirtRL, getRegistryId("minecraft:dirt")); assertEquals(dirtRL, getRegistryId(dirtRL)); -// assertEquals(dirtRL, getRegistryId(RegistryObject.of(dirtRL, Block.class, "dummy_mod"))); + assertEquals(dirtRL, getRegistryId(RegistryObject.of(dirtRL, Block.class, "dummy_mod"))); -// assertEquals(dirtRL, getRegistryId(new IRegistryDelegate() { -// @Override public ResourceLocation name() { return dirtRL; } -// // Methods should never be called -// @Override public Class type() { return Block.class; } -// @Override public Block get() { return null; } -// })); -// -// assertEquals(dirtRL, getRegistryId(new IForgeRegistryEntry() { -// @Override public ResourceLocation getRegistryName() { return dirtRL; } -// // Methods should never be called -// @Override public Class getRegistryType() { return Block.class; } -// @Override public Block setRegistryName(ResourceLocation name) { return null; } -// })); + assertEquals(dirtRL, getRegistryId(new IRegistryDelegate() { + @Override public ResourceLocation name() { return dirtRL; } + // Methods should never be called + @Override public Class type() { return Block.class; } + @Override public Block get() { return null; } + })); + + assertEquals(dirtRL, getRegistryId(new IForgeRegistryEntry() { + @Override public ResourceLocation getRegistryName() { return dirtRL; } + // Methods should never be called + @Override public Class getRegistryType() { return Block.class; } + @Override public Block setRegistryName(ResourceLocation name) { return null; } + })); assertNull(getRegistryId("name:space:invalid")); // invalid rl's should return null assertNull(getRegistryId(Integer.valueOf(0))); // other object types too