2018-12-22 17:59:13 +00:00
|
|
|
package net.shadowfacts.simplemultipart.mixin.client;
|
|
|
|
|
|
|
|
import net.minecraft.client.render.model.BakedModel;
|
|
|
|
import net.minecraft.client.render.model.ModelLoader;
|
|
|
|
import net.minecraft.client.texture.SpriteAtlasTexture;
|
|
|
|
import net.minecraft.client.util.ModelIdentifier;
|
|
|
|
import net.minecraft.resource.ResourceManager;
|
|
|
|
import net.minecraft.util.Identifier;
|
|
|
|
import net.shadowfacts.simplemultipart.client.MultipartContainerBakedModel;
|
2018-12-24 16:29:06 +00:00
|
|
|
import net.shadowfacts.simplemultipart.client.SimpleMultipartClient;
|
2018-12-22 17:59:13 +00:00
|
|
|
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 java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author shadowfacts
|
|
|
|
*/
|
|
|
|
@Mixin(ModelLoader.class)
|
2018-12-24 16:29:06 +00:00
|
|
|
public abstract class MixinModelLoader {
|
2018-12-22 17:59:13 +00:00
|
|
|
|
|
|
|
@Shadow
|
|
|
|
private Map<Identifier, BakedModel> bakedModels;
|
|
|
|
|
|
|
|
@Inject(method = "<init>", at = @At("RETURN"))
|
|
|
|
public void addMultipartModel(ResourceManager manager, SpriteAtlasTexture texture, CallbackInfo info) {
|
|
|
|
bakedModels.put(new ModelIdentifier("simplemultipart:container#"), new MultipartContainerBakedModel());
|
2018-12-28 02:44:50 +00:00
|
|
|
bakedModels.put(new ModelIdentifier("simplemultipart:tickable_container#"), new MultipartContainerBakedModel());
|
2018-12-22 17:59:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|