successfully building!! fixed a bunch of EMI stuff
This commit is contained in:
parent
e70d2edb22
commit
31ff708d80
13 changed files with 27 additions and 27 deletions
|
@ -20,7 +20,6 @@ import at.petrak.hexcasting.datagen.recipe.builders.CompatIngredientValue;
|
|||
import at.petrak.hexcasting.datagen.recipe.builders.CreateCrushingRecipeBuilder;
|
||||
import at.petrak.hexcasting.datagen.recipe.builders.FarmersDelightCuttingRecipeBuilder;
|
||||
import at.petrak.paucal.api.datagen.PaucalRecipeProvider;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.data.recipes.*;
|
||||
|
@ -61,7 +60,7 @@ public class HexplatRecipes extends PaucalRecipeProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void buildRecipes(Consumer<FinishedRecipe> recipes) {
|
||||
public void buildRecipes(Consumer<FinishedRecipe> recipes) {
|
||||
specialRecipe(recipes, SealThingsRecipe.FOCUS_SERIALIZER);
|
||||
specialRecipe(recipes, SealThingsRecipe.SPELLBOOK_SERIALIZER);
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package at.petrak.hexcasting.fabric.cc;
|
|||
import at.petrak.hexcasting.api.player.FlightAbility;
|
||||
import at.petrak.hexcasting.api.utils.HexUtils;
|
||||
import dev.onyxstudios.cca.api.v3.component.Component;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
@ -43,7 +43,7 @@ public class CCFlight implements Component {
|
|||
this.flight = null;
|
||||
} else {
|
||||
var timeLeft = tag.getInt(TAG_TIME_LEFT);
|
||||
var dim = ResourceKey.create(Registry.DIMENSION_REGISTRY,
|
||||
var dim = ResourceKey.create(Registries.DIMENSION,
|
||||
new ResourceLocation(tag.getString(TAG_DIMENSION)));
|
||||
var origin = HexUtils.vecFromNBT(tag.getLongArray(TAG_ORIGIN));
|
||||
var radius = tag.getDouble(TAG_RADIUS);
|
||||
|
|
|
@ -4,7 +4,7 @@ import at.petrak.hexcasting.api.player.Sentinel;
|
|||
import at.petrak.hexcasting.api.utils.HexUtils;
|
||||
import dev.onyxstudios.cca.api.v3.component.Component;
|
||||
import dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
@ -41,7 +41,7 @@ public class CCSentinel implements Component, AutoSyncedComponent {
|
|||
if (hasSentinel) {
|
||||
var extendsRange = tag.getBoolean(TAG_EXTENDS_RANGE);
|
||||
var position = HexUtils.vecFromNBT(tag.getLongArray(TAG_POSITION));
|
||||
var dim = ResourceKey.create(Registry.DIMENSION_REGISTRY,
|
||||
var dim = ResourceKey.create(Registries.DIMENSION,
|
||||
new ResourceLocation(tag.getString(TAG_DIMENSION)));
|
||||
this.sentinel = new Sentinel(extendsRange, position, dim);
|
||||
} else {
|
||||
|
|
|
@ -25,7 +25,7 @@ public class CCStaffcastImage implements Component {
|
|||
public CastingVM getVM(InteractionHand hand) {
|
||||
var img = this.lazyLoadedTag.isEmpty()
|
||||
? new CastingImage()
|
||||
: CastingImage.loadFromNbt(this.lazyLoadedTag, this.owner.getLevel());
|
||||
: CastingImage.loadFromNbt(this.lazyLoadedTag, this.owner.serverLevel());
|
||||
var env = new StaffCastEnv(this.owner, hand);
|
||||
return new CastingVM(img, env);
|
||||
}
|
||||
|
|
|
@ -51,11 +51,11 @@ public record EmiBrainsweepRecipe(EmiIngredient blockInput,
|
|||
@Override
|
||||
public void addWidgets(WidgetHolder widgets) {
|
||||
widgets.addTexture(OVERLAY, 0, 0, getDisplayWidth(), getDisplayHeight(), 0, 0, getDisplayWidth(), getDisplayHeight(), 128, 128);
|
||||
widgets.addSlot(blockInput, 11, 34).drawBack(false).custom(null, 0, 0, 19, 19);
|
||||
widgets.addSlot(blockInput, 11, 34).drawBack(false).customBackground(null, 0, 0, 19, 19);
|
||||
|
||||
widgets.add(new TheCoolerSlotWidget(villagerInput, 37, 19, 2.75f).useOffset(false).customShift(-8.5f, 2.485f))
|
||||
.drawBack(false).custom(null, 0, 0, 27, 49);
|
||||
.drawBack(false).customBackground(null, 0, 0, 27, 49);
|
||||
|
||||
widgets.addSlot(output, 86, 34).drawBack(false).output(true).recipeContext(this).custom(null, 0, 0, 19, 19);
|
||||
widgets.addSlot(output, 86, 34).drawBack(false).large(true).recipeContext(this).customBackground(null, 0, 0, 19, 19);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,11 +77,11 @@ public class EmiEdifyRecipe implements EmiRecipe {
|
|||
@Override
|
||||
public void addWidgets(WidgetHolder widgets) {
|
||||
widgets.addTexture(OVERLAY, 0, 0, getDisplayWidth(), getDisplayHeight(), 0, 0, getDisplayWidth(), getDisplayHeight(), 128, 128);
|
||||
widgets.addSlot(saplings, 11, 21).drawBack(false).custom(null, 0, 0, 19, 19);
|
||||
widgets.addSlot(saplings, 11, 21).drawBack(false).customBackground(null, 0, 0, 19, 19);
|
||||
widgets.addGeneratedSlot(r -> {
|
||||
var stacks = leaves.getEmiStacks();
|
||||
return stacks.get(r.nextInt(stacks.size()));
|
||||
}, 0, 50, 9).drawBack(false).recipeContext(this).custom(null, 0, 0, 19, 19);
|
||||
widgets.addSlot(log, 50, 34).drawBack(false).recipeContext(this).custom(null, 0, 0, 19, 19);
|
||||
}, 0, 50, 9).drawBack(false).recipeContext(this).customBackground(null, 0, 0, 19, 19);
|
||||
widgets.addSlot(log, 50, 34).drawBack(false).recipeContext(this).customBackground(null, 0, 0, 19, 19);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,11 +74,11 @@ public class EmiPhialRecipe implements EmiRecipe {
|
|||
widgets.addGeneratedSlot((r) -> {
|
||||
var stacks = inputs.getEmiStacks();
|
||||
return stacks.get(r.nextInt(stacks.size()));
|
||||
}, uniq, 11, 11).drawBack(false).custom(null, 0, 0, 19, 19);
|
||||
widgets.addSlot(bottle, 46, 11).drawBack(false).custom(null, 0, 0, 19, 19);
|
||||
}, uniq, 11, 11).drawBack(false).customBackground(null, 0, 0, 19, 19);
|
||||
widgets.addSlot(bottle, 46, 11).drawBack(false).customBackground(null, 0, 0, 19, 19);
|
||||
widgets.addGeneratedSlot((r) -> {
|
||||
var stacks = outputs.getEmiStacks();
|
||||
return stacks.get(r.nextInt(stacks.size()));
|
||||
}, uniq, 84, 11).drawBack(false).recipeContext(this).custom(null, 0, 0, 19, 19);
|
||||
}, uniq, 84, 11).drawBack(false).recipeContext(this).customBackground(null, 0, 0, 19, 19);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import dev.emi.trinkets.api.TrinketsApi;
|
|||
import dev.emi.trinkets.api.client.TrinketRendererRegistry;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.ai.attributes.Attribute;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
|
@ -23,7 +23,7 @@ import java.util.UUID;
|
|||
|
||||
public class TrinketsApiInterop {
|
||||
public static void init() {
|
||||
Registry.ITEM.stream().forEach(item -> {
|
||||
BuiltInRegistries.ITEM.stream().forEach(item -> {
|
||||
if (item instanceof HexBaubleItem bauble) {
|
||||
TrinketsApi.registerTrinket(item, new Trinket() {
|
||||
@Override
|
||||
|
|
|
@ -26,7 +26,7 @@ public class FabricLivingEntityMixin {
|
|||
float dist = (float) Mth.ceil(entity.fallDistance - 3.0F);
|
||||
double e = Math.min(0.2F + dist / 15.0F, 2.5D);
|
||||
int i = (int)(150.0D * e);
|
||||
if (forgeLike.addLandingEffects(state, (ServerLevel) entity.level, pos, entity, i)) {
|
||||
if (forgeLike.addLandingEffects(state, (ServerLevel) entity.level(), pos, entity, i)) {
|
||||
hex$cachedParticleState = state;
|
||||
return Blocks.AIR.defaultBlockState();
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ import at.petrak.hexcasting.fabric.loot.FabricHexLootModJankery;
|
|||
import at.petrak.hexcasting.mixin.accessor.AccessorLootTable;
|
||||
import net.minecraft.server.ReloadableServerResources;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.storage.loot.LootDataId;
|
||||
import net.minecraft.world.level.storage.loot.LootDataType;
|
||||
import net.minecraft.world.level.storage.loot.functions.LootItemFunctions;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
@ -20,11 +22,11 @@ public class FabricMixinReloadableServerResources {
|
|||
@Inject(method = "loadResources", at = @At("RETURN"), cancellable = true)
|
||||
private static void onLoadResources(CallbackInfoReturnable<CompletableFuture<ReloadableServerResources>> cir) {
|
||||
cir.setReturnValue(cir.getReturnValue().thenApply((rsr) -> {
|
||||
var amethystTable = rsr.getLootTables().get(Blocks.AMETHYST_CLUSTER.getLootTable());
|
||||
var amethystTable = rsr.getLootData().getLootTable(Blocks.AMETHYST_CLUSTER.getLootTable());
|
||||
var theCoolerAmethystTable = (AccessorLootTable) amethystTable;
|
||||
var oldFuncs = theCoolerAmethystTable.hex$getFunctions();
|
||||
var newFuncs = Arrays.copyOf(oldFuncs, oldFuncs.length + 1);
|
||||
var shardReducer = rsr.getItemModifierManager().get(FabricHexLootModJankery.FUNC_AMETHYST_SHARD_REDUCER);
|
||||
var shardReducer = rsr.getLootData().getElement(new LootDataId<>(LootDataType.MODIFIER, FabricHexLootModJankery.FUNC_AMETHYST_SHARD_REDUCER));
|
||||
if (shardReducer != null) {
|
||||
newFuncs[newFuncs.length - 1] = shardReducer;
|
||||
theCoolerAmethystTable.hex$setFunctions(newFuncs);
|
||||
|
|
|
@ -22,9 +22,9 @@ public class FabricModelManagerMixin {
|
|||
private Map<ResourceLocation, BakedModel> bakedRegistry;
|
||||
|
||||
@Inject(at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/client/resources/model/ModelBakery;" +
|
||||
"getBakedTopLevelModels()Ljava/util/Map;", shift = At.Shift.AFTER), method = "apply(Lnet/minecraft/client" +
|
||||
"/resources/model/ModelBakery;Lnet/minecraft/server/packs/resources/ResourceManager;" +
|
||||
"Lnet/minecraft/util/profiling/ProfilerFiller;)V")
|
||||
"getBakedTopLevelModels()Ljava/util/Map;", shift = At.Shift.AFTER), method = "Lnet/minecraft/client/" +
|
||||
"resources/model/ModelManager;apply(Lnet/minecraft/client/resources/model/ModelManager$ReloadState;" +
|
||||
"Lnet/minecraft/util/profiling/ProfilerFiller;)V")
|
||||
private void onModelBake(ModelBakery modelLoader, ResourceManager resourceManager, ProfilerFiller profiler,
|
||||
CallbackInfo ci) {
|
||||
RegisterClientStuff.onModelBake(modelLoader, this.bakedRegistry);
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.google.gson.JsonElement;
|
|||
import com.google.gson.JsonObject;
|
||||
import io.github.tropheusj.serialization_hooks.ingredient.BaseCustomIngredient;
|
||||
import io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -56,7 +56,7 @@ public class FabricUnsealedIngredient extends BaseCustomIngredient {
|
|||
public @NotNull JsonElement toJson() {
|
||||
JsonObject json = new JsonObject();
|
||||
json.addProperty("type", Objects.toString(ID));
|
||||
json.addProperty("item", Objects.toString(Registry.ITEM.getKey(this.stack.getItem())));
|
||||
json.addProperty("item", Objects.toString(BuiltInRegistries.ITEM.getKey(this.stack.getItem())));
|
||||
return json;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
"refmap": "hexcasting.mixins.refmap.json",
|
||||
"package": "at.petrak.hexcasting.forge.mixin",
|
||||
"mixins": [
|
||||
"ForgeAccessorRegistry",
|
||||
"ForgeMixinCursedRecipeSerializerBase"
|
||||
],
|
||||
"client": [
|
||||
|
|
Loading…
Reference in a new issue