Skip to content

Commit

Permalink
Petrock Port to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
manmaed committed Jun 21, 2024
1 parent aab2b31 commit df37637
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// 1.21 2024-06-14T23:23:39.2121767 Recipes
// 1.21 2024-06-21T20:49:36.9937092 Recipes
37aa550eff3ff5e3640cfeaa5f354a5e36e15eb0 data/petslow/advancement/recipes/building_blocks/clay_brew.json
7ee6ebea87336457c400ea09b9eb30e872c101c8 data/petslow/advancement/recipes/building_blocks/mug.json
0d6249234f492a9dc195a6ceba29b994248e1ee9 data/petslow/advancement/recipes/building_blocks/mug_lava.json
af4589d64d63d1559efd8d58ba5a3a0830c90e0c data/petslow/advancement/recipes/building_blocks/mug_milk.json
d2b3e9ffa53fcf7e37d3bb0aabd822ebe42b35fd data/petslow/advancement/recipes/building_blocks/mug_water.json
1a0d2eb21230501dd4a51894e5455c4e63b2461e data/petslow/advancement/recipes/building_blocks/slow_brew.json
6972bfa85e32ce46ac94287e9cccbda7ddc3c597 data/petslow/advancement/recipes/building_blocks/slow_doll.json
4aab9a4076782ed40cdb5361df2ea8f512e4e524 data/petslow/recipe/clay_brew.json
5a36bbb09c6834edbbe80b02969f8ebede96dd7e data/petslow/recipe/clay_brew.json
a2d0977ad2bf6a62a4ffeb5334e77cf76c324f87 data/petslow/recipe/mug.json
78b757f61ac5ee7e08793ed0ca9b20a16d33b7e6 data/petslow/recipe/mug_lava.json
4433d42cb7051d81545d7473ff1ce78117fc8ec1 data/petslow/recipe/mug_milk.json
50a2bfb57d81a1d9e7ae5a2a68b0c73ac36b2d2d data/petslow/recipe/mug_water.json
efb705ff38fcf6919e6b1b102950a2dfa3e4558a data/petslow/recipe/slow_brew.json
9e38629d66052d6f6cafd365afa07b912242a902 data/petslow/recipe/slow_doll.json
88bb36bde1fc060146c291f8acd8c9d6d69e18f6 data/petslow/recipe/slow_doll.json
2 changes: 1 addition & 1 deletion src/generated/resources/data/petslow/recipe/clay_brew.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"category": "building",
"key": {
"c": {
"item": "minecraft:clay"
"item": "minecraft:clay_ball"
},
"w": {
"item": "petslow:mug_water"
Expand Down
2 changes: 1 addition & 1 deletion src/generated/resources/data/petslow/recipe/slow_doll.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"category": "building",
"key": {
"c": {
"item": "minecraft:clay"
"item": "minecraft:clay_ball"
},
"f": {
"item": "minecraft:rotten_flesh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@ public void render(EntityPetSlow p_115455_, float p_115456_, float p_115457_, Po
poseStack.popPose();
}

private ResourceLocation getloc(String filename){
return ResourceLocation.fromNamespaceAndPath(PetSlow.MOD_ID, "textures/entity/" + filename + ".png");
}

@Override
public ResourceLocation getTextureLocation(EntityPetSlow entityPetSlow) {
return SLOWPOKE;
String name = String.valueOf(entityPetSlow.getCustomName());
if (name.contains("manmaed")) {
return getloc("manmaed");
} else return getloc("slowpoke");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected static void makeMugs(RecipeOutput consumer) {

//Mug Clay
ShapedRecipeBuilder.shaped(category, PSItems.CLAY_BREW, 1)
.define('c', Ingredient.of(Items.CLAY))
.define('c', Ingredient.of(Items.CLAY_BALL))
.define('w', Ingredient.of(PSItems.MUG_WATER))
.pattern("ccc")
.pattern("cwc")
Expand All @@ -79,7 +79,7 @@ protected static void makeMugs(RecipeOutput consumer) {

protected static void makeSlowDoll(RecipeOutput consumer) {
ShapedRecipeBuilder.shaped(category, PSItems.SLOW_DOLL, 1)
.define('c', Ingredient.of(Items.CLAY))
.define('c', Ingredient.of(Items.CLAY_BALL))
.define('f', Ingredient.of(Items.ROTTEN_FLESH))
.define('s', Ingredient.of(Items.SUGAR))
.define('t', Ingredient.of(Items.TORCH))
Expand Down
24 changes: 19 additions & 5 deletions src/main/java/net/manmaed/petslow/entity/EntityPetSlow.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ private void spawnBos(Level world, BlockPos pos) {
tag.putInt("Variant", Parrot.Variant.GREEN.getId());
entity.load(tag);
world.gameEvent(this, GameEvent.ENTITY_PLACE, entity.position());
usedMagicAbility();
}
}
}
Expand Down Expand Up @@ -346,20 +347,33 @@ public void setMagicAbility(boolean usedMagicAbility){
this.entityData.set(MAGIC_ABILITY, usedMagicAbility);
}

public void useMagicAbility(Level level, BlockPos pos){
if (!getMagicAbility()) {
String name = String.valueOf(this.getCustomName());
if (name.contains("Jake_Evans")) {
spawnBos(level, pos);
/*usedMagicAbility();*/
}
/*if (name.contains("Slowpoke101")) {
spawnClay(level, pos);
usedMagicAbility();
}*/
/*if (name.contains("manmaed")) {
usedMagicAbility();
}*/
}
}

@Override
public void tick() {
super.tick();
Level level = this.level();
//LogHelper.info("STAY_COOLDOWN: " + this.entityData.get(STAY_COOLDOWN) + " : RETURN_COOLDOWN: " + this.entityData.get(RETURN_COOLDOWN));
addtorch(level, this.getOnPos());
//useMagicAbility(level, this.getOnPos());
useMagicAbility(level, this.getOnPos());
isAway();
chooseafk(level);
shouldafk(level);
countdown(level);
/*if (this.getOwnerUUID().toString().equals("manmaedsuuid")) {
this.setInvulnerable(true);
this.setTorchCount(Integer.MAX_VALUE);
}*/
}
}
5 changes: 4 additions & 1 deletion src/main/java/net/manmaed/petslow/entity/PSEntityTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ public class PSEntityTypes {
//TODO: Add Main Part of the mod
public static DeferredRegister<EntityType<?>> ENTITY_TYPES = DeferredRegister.create(Registries.ENTITY_TYPE, PetSlow.MOD_ID);

public static final DeferredHolder<EntityType<?>, EntityType<EntityPetSlow>> SLOWPOKE = ENTITY_TYPES.register("petslow", () -> EntityType.Builder.of(EntityPetSlow::new, MobCategory.MISC).sized(0.5f, 1.0f).build("petslow"));
public static final DeferredHolder<EntityType<?>, EntityType<EntityPetSlow>> SLOWPOKE = ENTITY_TYPES.register("petslow", () -> EntityType.Builder.of(EntityPetSlow::new, MobCategory.MISC)
.sized(0.5f, 1.0f)
.nameTagOffset(2f)
.build("petslow"));
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit df37637

Please sign in to comment.