Skip to content

Commit

Permalink
Fix Tater
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Nov 30, 2023
1 parent cf71a80 commit 7acef62
Show file tree
Hide file tree
Showing 49 changed files with 63 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.Resource;
Expand All @@ -15,10 +13,10 @@
import org.violetmoon.quark.addons.oddities.client.render.be.TinyPotatoRenderer;
import org.violetmoon.quark.base.Quark;
import org.violetmoon.quark.base.config.Config;
import org.violetmoon.quark.mixin.client.ModelManagerMixin;
import org.violetmoon.zeta.advancement.ManualTrigger;
import org.violetmoon.zeta.client.event.load.ZAddModels;
import org.violetmoon.zeta.client.event.load.ZClientSetup;
import org.violetmoon.zeta.client.event.load.ZModelBakingCompleted;
import org.violetmoon.zeta.event.bus.LoadEvent;
import org.violetmoon.zeta.event.load.ZRegister;
import org.violetmoon.zeta.module.ZetaLoadModule;
Expand Down Expand Up @@ -52,14 +50,10 @@ public final void register(ZRegister event) {

@ZetaLoadModule(clientReplacement = true)
public static class Client extends TinyPotatoModule {
@LoadEvent
public void modelBake(ZModelBakingCompleted event) {
ResourceLocation tinyPotato = new ModelResourceLocation(new ResourceLocation("quark", "tiny_potato"), "inventory");
Map<ResourceLocation, BakedModel> map = event.getModels();
BakedModel originalPotato = map.get(tinyPotato);
//fixme tater you fucker you crashed my game :c
//map.put(tinyPotato, new TinyPotatoModel(originalPotato));
}
/**
* Moved to {@link ModelManagerMixin}
*/
public void modelBake() { }

@LoadEvent
public void registerAdditionalModels(ZAddModels event) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.violetmoon.quark.mixin.client;

import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.client.resources.model.ModelManager;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.profiling.ProfilerFiller;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.violetmoon.quark.addons.oddities.client.model.TinyPotatoModel;
import org.violetmoon.quark.base.Quark;

import java.util.Map;

@Mixin(ModelManager.class)
public class ModelManagerMixin {
@Shadow
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/ModelManager$ReloadState;Lnet/minecraft/util/profiling/ProfilerFiller;)V")
private void onModelBake(ModelManager.ReloadState reloadState, ProfilerFiller profilerFiller, CallbackInfo ci) {
ModelResourceLocation key = new ModelResourceLocation(Quark.asResource("tiny_potato"), "inventory");
bakedRegistry.put(key, new TinyPotatoModel(bakedRegistry.get(key)));
}
}
3 changes: 2 additions & 1 deletion src/main/resources/META-INF/accesstransformer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ public-f net.minecraft.advancements.critereon.ItemUsedOnLocationTrigger$TriggerI
public-f net.minecraft.advancements.critereon.ContextAwarePredicate f_285622_ # conditions
public-f net.minecraft.advancements.critereon.ContextAwarePredicate f_285559_ # compositePredicates
public net.minecraft.core.RegistrySetBuilder$BuildState
public net.minecraft.core.RegistrySetBuilder m_254900_(Lnet/minecraft/core/RegistryAccess;)Lnet/minecraft/core/RegistrySetBuilder$BuildState; # createState
public net.minecraft.core.RegistrySetBuilder m_254900_(Lnet/minecraft/core/RegistryAccess;)Lnet/minecraft/core/RegistrySetBuilder$BuildState; # createState
public net.minecraft.client.resources.model.ModelManager$ReloadState
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/ace"
"all": "quark:block/tiny_potato/ace"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/agender"
"all": "quark:block/tiny_potato/agender"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/angry"
"all": "quark:block/tiny_potato/angry"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/aro"
"all": "quark:block/tiny_potato/aro"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/ace"
"all": "quark:block/tiny_potato/ace"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/aureylian"
"all": "quark:block/tiny_potato/aureylian"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/bi"
"all": "quark:block/tiny_potato/bi"
}
}
4 changes: 2 additions & 2 deletions src/main/resources/assets/quark/models/tiny_potato/bob.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"particle": "quark:model/tiny_potato/bob",
"all": "quark:model/tiny_potato/bob"
"particle": "quark:block/tiny_potato/bob",
"all": "quark:block/tiny_potato/bob"
},
"display": {
"firstperson_righthand": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/bosnia"
"all": "quark:block/tiny_potato/bosnia"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/default"
"all": "quark:block/tiny_potato/default"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/default"
"all": "quark:block/tiny_potato/default"
},
"display": {
"firstperson_righthand": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/wire"
"all": "quark:block/tiny_potato/wire"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/genderfluid"
"all": "quark:block/tiny_potato/genderfluid"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/gray"
"all": "quark:block/tiny_potato/gray"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/halloween"
"all": "quark:block/tiny_potato/halloween"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/default"
"all": "quark:block/tiny_potato/default"
},
"display": {
"firstperson_righthand": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/lesbian"
"all": "quark:block/tiny_potato/lesbian"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/default"
"all": "quark:block/tiny_potato/default"
},
"display": {
"firstperson_righthand": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/pan"
"all": "quark:block/tiny_potato/pan"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/pride"
"all": "quark:block/tiny_potato/pride"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/robo"
"all": "quark:block/tiny_potato/robo"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/default"
"all": "quark:block/tiny_potato/default"
},
"elements": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/default",
"glasses": "quark:model/tiny_potato/sus"
"all": "quark:block/tiny_potato/default",
"glasses": "quark:block/tiny_potato/sus"
},
"elements": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
},
"textures": {
"all": "quark:model/tiny_potato/tomato"
"all": "quark:block/tiny_potato/tomato"
},
"elements": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "quark:tiny_potato/base",
"textures": {
"all": "quark:model/tiny_potato/trans"
"all": "quark:block/tiny_potato/trans"
}
}
1 change: 1 addition & 0 deletions src/main/resources/quark.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"client.LoomScreenMixin",
"client.MinecartSoundInstanceMixin",
"client.MinecraftMixin",
"client.ModelManagerMixin",
"client.ParrotRendererMixin",
"client.PistonTileEntityRendererMixin",
"client.RenderBuffersMixin",
Expand Down

0 comments on commit 7acef62

Please sign in to comment.