Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Faboslav committed Oct 12, 2023
1 parent f5a8dac commit dbec69f
Show file tree
Hide file tree
Showing 41 changed files with 1,811 additions and 130 deletions.
1 change: 1 addition & 0 deletions blockbench/rascal/Rascal.bbmodel

Large diffs are not rendered by default.

215 changes: 215 additions & 0 deletions blockbench/rascal/rascal.animation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
{
"format_version": "1.8.0",
"animations": {
"give_reward": {
"animation_length": 1.54167,
"bones": {
"head": {
"rotation": {
"0.0": {
"vector": [0, 0, 0]
},
"0.375": {
"vector": [-7.5, -50, 0],
"easing": "linear"
},
"0.4583": {
"vector": [-7.5, -40, 0]
},
"0.6667": {
"vector": [0, 0, 0]
},
"0.8333": {
"vector": [15, 0, 0]
},
"0.9583": {
"vector": [15, 0, 0]
},
"1.0833": {
"vector": [0, 0, 0]
},
"1.25": {
"vector": [0, 0, 0]
},
"1.5417": {
"vector": [0, 0, 0]
}
}
},
"rightArm": {
"rotation": {
"0.0": {
"vector": [0, 0, 0]
},
"0.125": {
"vector": [-37.5, 0, -20]
},
"0.4583": {
"vector": [-170, 0, -20],
"easing": "easeInElastic"
},
"0.5417": {
"vector": [-170, 0, -20],
"easing": "easeInElastic"
},
"0.625": {
"vector": [-60, 0, 0]
},
"0.75": {
"vector": [-60, 20, 0]
},
"1.0833": {
"vector": [-60, 20, 0]
},
"1.25": {
"vector": [-60, 20, 0]
},
"1.5417": {
"vector": [0, 0, 0]
}
},
"position": {
"0.625": {
"vector": [0, 0, 0]
},
"0.75": {
"vector": [0, -2, -1]
},
"1.0833": {
"vector": [0, -2, -1]
},
"1.25": {
"vector": [0, -2, -1]
},
"1.5417": {
"vector": [0, 0, 0]
}
}
},
"bag": {
"rotation": {
"0.4583": {
"vector": [0, 0, 0]
},
"0.5417": {
"vector": [5, 0, 0]
},
"0.625": {
"vector": [0, 90, 0]
},
"0.75": {
"vector": [-30, 180, 0]
},
"0.8333": {
"vector": [-30, 180, 0]
},
"1.0833": {
"vector": [-30, 180, 0]
},
"1.25": {
"vector": [-30, 180, 0]
},
"1.375": {
"vector": [0, 90, 0]
},
"1.4583": {
"vector": [5, 0, 0]
},
"1.5417": {
"vector": [0, 0, 0]
}
},
"position": {
"0.4583": {
"vector": [0, 0, 0]
},
"0.625": {
"vector": [7, 0, -6]
},
"0.75": {
"vector": [-3, -7, -12]
},
"1.0833": {
"vector": [-3, -7, -12]
},
"1.25": {
"vector": [-3, -7, -12]
},
"1.375": {
"vector": [7, 0, -6]
},
"1.5417": {
"vector": [0, 0, 0]
}
}
},
"leftArm": {
"rotation": {
"0.75": {
"vector": [0, 0, 0]
},
"0.8333": {
"vector": [-52.5, 0, 0]
},
"0.9167": {
"vector": [-65, -30, 0]
},
"1.0833": {
"vector": [-90, 0, 0]
},
"1.25": {
"vector": [-90, 0, 0]
},
"1.5417": {
"vector": [0, 0, 0]
}
},
"position": {
"0.4583": {
"vector": [0, 0, 0]
},
"0.5833": {
"vector": [0, -0.25, 0],
"easing": "linear"
},
"0.6667": {
"vector": [0, 0, 0]
},
"0.75": {
"vector": [0, 0, 0]
},
"0.8333": {
"vector": [0, -2, -1]
},
"1.25": {
"vector": [0, -2, -1]
},
"1.5417": {
"vector": [0, 0, 0]
}
}
},
"body": {
"position": {
"0.4583": {
"vector": [0, 0, 0]
},
"0.5833": {
"vector": [0, -0.25, 0],
"easing": "linear"
},
"0.6667": {
"vector": [0, 0, 0]
},
"1.0833": {
"vector": [0, 0, 0]
},
"1.5": {
"vector": [0, 0, 0]
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package com.faboslav.friendsandfoes.advancements.criterion;

import com.faboslav.friendsandfoes.FriendsAndFoes;
import com.faboslav.friendsandfoes.entity.RascalEntity;
import com.google.gson.JsonObject;
import net.minecraft.advancement.criterion.AbstractCriterion;
import net.minecraft.advancement.criterion.AbstractCriterionConditions;
import net.minecraft.loot.context.LootContext;
import net.minecraft.predicate.entity.AdvancementEntityPredicateDeserializer;
import net.minecraft.predicate.entity.AdvancementEntityPredicateSerializer;
import net.minecraft.predicate.entity.EntityPredicate;
import net.minecraft.predicate.entity.LootContextPredicate;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Identifier;

public final class CompleteHideAndSeekGameCriterion extends AbstractCriterion<CompleteHideAndSeekGameCriterion.Conditions>
{
static final Identifier ID = FriendsAndFoes.makeID("complete_hide_and_seek_game");

public CompleteHideAndSeekGameCriterion() {
}

public Identifier getId() {
return ID;
}

public CompleteHideAndSeekGameCriterion.Conditions conditionsFromJson(
JsonObject jsonObject,
LootContextPredicate extended,
AdvancementEntityPredicateDeserializer advancementEntityPredicateDeserializer
) {
LootContextPredicate extended2 = EntityPredicate.contextPredicateFromJson(jsonObject, "rascal", advancementEntityPredicateDeserializer);

return new CompleteHideAndSeekGameCriterion.Conditions(extended, extended2);
}

public void trigger(ServerPlayerEntity player, RascalEntity entity) {
LootContext lootContext = EntityPredicate.createAdvancementEntityLootContext(player, entity);
this.trigger(player, (conditions) -> {
return conditions.matches(lootContext);
});
}

public static class Conditions extends AbstractCriterionConditions
{
private final LootContextPredicate entity;

public Conditions(LootContextPredicate player, LootContextPredicate entity) {
super(CompleteHideAndSeekGameCriterion.ID, player);
this.entity = entity;
}

public static CompleteHideAndSeekGameCriterion.Conditions any() {
return new CompleteHideAndSeekGameCriterion.Conditions(LootContextPredicate.EMPTY, LootContextPredicate.EMPTY);
}

public static CompleteHideAndSeekGameCriterion.Conditions create(EntityPredicate entity) {
return new CompleteHideAndSeekGameCriterion.Conditions(LootContextPredicate.EMPTY, EntityPredicate.asLootContextPredicate(entity));
}

public boolean matches(LootContext entityContext) {
return this.entity.test(entityContext);
}

public JsonObject toJson(AdvancementEntityPredicateSerializer predicateSerializer) {
JsonObject jsonObject = super.toJson(predicateSerializer);
jsonObject.add("entity", this.entity.toJson(predicateSerializer));
return jsonObject;
}
}
}
Loading

0 comments on commit dbec69f

Please sign in to comment.