1.3 Merge

This commit is contained in:
Kam committed 2025-10-06 15:56:18 -04:00
commit 83bdfe0552
39 files changed
+4225 -34

No files matched your search

+1 -1
View File
@@ -4,5 +4,5 @@ plugins {
id 'com.gtnewhorizons.gtnhconvention'
}
version = "1.1"
version = "1.3"
group= "com.goodbird.npcgecko"
+2 -2
View File
@@ -37,6 +37,6 @@ dependencies {
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.5.4-GTNH:dev")
runtimeOnlyNonPublishable("curse.maven:Nashorn-374413:2924946")
implementation rfg.deobf(name: "CustomNPC-Plus-1.9.2")
implementation name: "geckolib-unofficial-1.7.10-1.0.1-dev"
implementation rfg.deobf(name: "CustomNPC-Plus-1.10.2-beta4")
implementation name: "geckolib3-1.0.4-beta"
}
+2 -2
View File
@@ -33,7 +33,7 @@ developmentEnvironmentUserName = Kam
# Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true
enableModernJavaSyntax = false
# Enables injecting missing generics into the decompiled source code for a better coding experience
# Turns most publicly visible List, Map, etc. into proper List<Type>, Map<K, V> types
@@ -157,4 +157,4 @@ disableCheckstyle = true
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be always native build.
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
# ideaOverrideBuildType = idea
#ideaOverrideBuildType = idea
Binary file not shown.
+1 -1
View File
@@ -17,5 +17,5 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.15'
}
@@ -4,10 +4,15 @@ import com.goodbird.npcgecko.api.AbstractGeckoAPI;
import com.goodbird.npcgecko.entity.EntityCustomModel;
import com.goodbird.npcgecko.handler.EventHandler;
import com.goodbird.npcgecko.network.NetworkHandler;
import com.goodbird.npcgecko.tile.TileEntityCustomModel;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import noppes.npcs.scripted.NpcAPI;
import software.bernie.example.block.tile.BotariumTileEntity;
public class CommonProxy {
@@ -18,6 +23,11 @@ public class CommonProxy {
public void init(FMLInitializationEvent ev){
NetworkHandler.init();
GameRegistry.registerTileEntity(TileEntityCustomModel.class, "custommodeltile");
NpcAPI.Instance().addGlobalObject("GeckoAPI", AbstractGeckoAPI.Instance());
}
public World getWorldById(int id){
return MinecraftServer.getServer().worldServers[id];
}
}
@@ -7,7 +7,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@Mod(modid = "npcgecko",
name = "CustomNPC+ Gecko Addon",
version = "1.1",
version = "1.3",
dependencies = "required-after:customnpcs;required-after:geckolib3")
public class CustomNpcPlusGecko {
@@ -1,10 +1,13 @@
package com.goodbird.npcgecko.api;
import com.goodbird.npcgecko.data.CustomItemModelData;
import cpw.mods.fml.common.Loader;
import net.minecraft.entity.player.EntityPlayerMP;
import noppes.npcs.api.block.IBlockScripted;
import noppes.npcs.api.entity.ICustomNpc;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.scripted.item.ScriptCustomItem;
import software.bernie.geckolib3.core.builder.AnimationBuilder;
public abstract class AbstractGeckoAPI {
@@ -32,6 +35,24 @@ public abstract class AbstractGeckoAPI {
public abstract AnimationBuilder createAnimationBuilder();
public abstract void setModel(ICustomNpc<EntityNPCInterface> npc, String model);
public abstract void setTexture(ICustomNpc<EntityNPCInterface> npc, String texture);
public abstract void setAnimationFile(ICustomNpc<EntityNPCInterface> npc, String animation);
public abstract void setIdleAnimation(ICustomNpc<EntityNPCInterface> npc, String animation);
public abstract void syncAnimForPlayer(ICustomNpc<EntityNPCInterface> npc, AnimationBuilder builder, IPlayer<EntityPlayerMP> player);
public abstract void syncAnimForAll(ICustomNpc<EntityNPCInterface> npc, AnimationBuilder builder);
public abstract void setModel(IBlockScripted scriptedBlock, String model);
public abstract void setTexture(IBlockScripted scriptedBlock, String texture);
public abstract void setAnimationFile(IBlockScripted scriptedBlock, String animation);
public abstract void setIdleAnimation(IBlockScripted scriptedBlock, String animation);
public abstract void syncAnimForPlayer(IBlockScripted scriptedBlock, AnimationBuilder builder, IPlayer<EntityPlayerMP> player);
public abstract void syncAnimForAll(IBlockScripted scriptedBlock, AnimationBuilder builder);
// TODO: Fix ScriptCustomItem
// public abstract void setModel(ScriptCustomItem item, String model);
// public abstract void setTexture(ScriptCustomItem item, String texture);
// public abstract void setAnimationFile(ScriptCustomItem item, String animation);
// public abstract void setIdleAnimation(ScriptCustomItem item, String animation);
}
@@ -1,13 +1,24 @@
package com.goodbird.npcgecko.api;
import com.goodbird.npcgecko.client.renderer.RenderTileCustomModel;
import com.goodbird.npcgecko.data.CustomItemModelData;
import com.goodbird.npcgecko.mixin.IDataDisplay;
import com.goodbird.npcgecko.mixin.IScriptCustomItem;
import com.goodbird.npcgecko.network.CPacketSyncManualAnim;
import com.goodbird.npcgecko.network.CPacketSyncTileManualAnim;
import com.goodbird.npcgecko.network.NetworkHandler;
import com.goodbird.npcgecko.tile.TileEntityCustomModel;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.ResourceLocation;
import noppes.npcs.api.block.IBlockScripted;
import noppes.npcs.api.entity.ICustomNpc;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.blocks.tiles.TileScripted;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.scripted.BlockScriptedWrapper;
import noppes.npcs.scripted.item.ScriptCustomItem;
import software.bernie.geckolib3.core.builder.AnimationBuilder;
public class GeckoAPI extends AbstractGeckoAPI {
@@ -27,6 +38,30 @@ public class GeckoAPI extends AbstractGeckoAPI {
return new AnimationBuilder();
}
@Override
public void setModel(ICustomNpc<EntityNPCInterface> npc, String model) {
((IDataDisplay)npc.getMCEntity().display).getCustomModelData().setModel(model);
npc.updateClient();
}
@Override
public void setTexture(ICustomNpc<EntityNPCInterface> npc, String texture) {
npc.getMCEntity().display.texture = texture;
npc.updateClient();
}
@Override
public void setAnimationFile(ICustomNpc<EntityNPCInterface> npc, String animation) {
((IDataDisplay)npc.getMCEntity().display).getCustomModelData().setAnimFile(animation);
npc.updateClient();
}
@Override
public void setIdleAnimation(ICustomNpc<EntityNPCInterface> npc, String animation) {
((IDataDisplay)npc.getMCEntity().display).getCustomModelData().setIdleAnim(animation);
npc.updateClient();
}
@Override
public void syncAnimForPlayer(ICustomNpc<EntityNPCInterface> npc, AnimationBuilder builder, IPlayer<EntityPlayerMP> player) {
NetworkHandler.sendToPlayer(new CPacketSyncManualAnim(npc.getMCEntity(),builder), player.getMCEntity());
@@ -36,4 +71,88 @@ public class GeckoAPI extends AbstractGeckoAPI {
public void syncAnimForAll(ICustomNpc<EntityNPCInterface> npc, AnimationBuilder builder) {
NetworkHandler.sendToAll(new CPacketSyncManualAnim(npc.getMCEntity(),builder));
}
private TileEntityCustomModel getOrCreateTECM(IBlockScripted scriptedBlock){
TileScripted tile = (TileScripted) scriptedBlock.getMCTileEntity();
if(!(tile.renderTile instanceof TileEntityCustomModel)){
tile.renderTile = new TileEntityCustomModel(tile);
}
return (TileEntityCustomModel) tile.renderTile;
}
@Override
public void setModel(IBlockScripted scriptedBlock, String model) {
TileEntityCustomModel geckoTile = getOrCreateTECM(scriptedBlock);
geckoTile.modelResLoc = new ResourceLocation(model);
((TileScripted) scriptedBlock.getMCTileEntity()).needsClientUpdate = true;
}
@Override
public void setTexture(IBlockScripted scriptedBlock, String texture) {
TileEntityCustomModel geckoTile = getOrCreateTECM(scriptedBlock);
geckoTile.textureResLoc = new ResourceLocation(texture);
((TileScripted) scriptedBlock.getMCTileEntity()).needsClientUpdate = true;
}
@Override
public void setAnimationFile(IBlockScripted scriptedBlock, String animation) {
TileEntityCustomModel geckoTile = getOrCreateTECM(scriptedBlock);
geckoTile.animResLoc = new ResourceLocation(animation);
((TileScripted) scriptedBlock.getMCTileEntity()).needsClientUpdate = true;
}
@Override
public void setIdleAnimation(IBlockScripted scriptedBlock, String animation) {
TileEntityCustomModel geckoTile = getOrCreateTECM(scriptedBlock);
geckoTile.idleAnimName = animation;
((TileScripted) scriptedBlock.getMCTileEntity()).needsClientUpdate = true;
}
@Override
public void syncAnimForPlayer(IBlockScripted scriptedBlock, AnimationBuilder builder, IPlayer<EntityPlayerMP> player) {
NetworkHandler.sendToPlayer(new CPacketSyncTileManualAnim(scriptedBlock.getMCTileEntity(), builder), player.getMCEntity());
}
@Override
public void syncAnimForAll(IBlockScripted scriptedBlock, AnimationBuilder builder) {
NetworkHandler.sendToAll(new CPacketSyncTileManualAnim(scriptedBlock.getMCTileEntity(), builder));
}
// private CustomItemModelData getOrCreateCIMD(ScriptCustomItem item){
// IScriptCustomItem scriptCustomItem = (IScriptCustomItem) item;
// if(!scriptCustomItem.hasCustomModel()){
// scriptCustomItem.setCustomModelData(new CustomItemModelData());
// }
// return scriptCustomItem.getCustomModelData();
// }
//
// @Override
// public void setModel(ScriptCustomItem item, String model) {
// CustomItemModelData data = getOrCreateCIMD(item);
// data.setModel(model);
// item.saveItemData();
// }
//
// @Override
// public void setTexture(ScriptCustomItem item, String texture) {
// CustomItemModelData data = getOrCreateCIMD(item);
// data.setTexture(texture);
// item.saveItemData();
// }
//
// @Override
// public void setAnimationFile(ScriptCustomItem item, String animation) {
// CustomItemModelData data = getOrCreateCIMD(item);
// data.setAnimFile(animation);
// item.saveItemData();
// }
//
// @Override
// public void setIdleAnimation(ScriptCustomItem item, String animation) {
// CustomItemModelData data = getOrCreateCIMD(item);
// data.setIdleAnim(animation);
// item.saveItemData();
// }
}
@@ -2,9 +2,14 @@ package com.goodbird.npcgecko.client;
import com.goodbird.npcgecko.CommonProxy;
import com.goodbird.npcgecko.client.renderer.RenderCustomModel;
import com.goodbird.npcgecko.client.renderer.RenderTileCustomModel;
import com.goodbird.npcgecko.entity.EntityCustomModel;
import com.goodbird.npcgecko.tile.TileEntityCustomModel;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.world.World;
public class ClientProxy extends CommonProxy {
@@ -13,6 +18,10 @@ public class ClientProxy extends CommonProxy {
public void preInit(FMLPreInitializationEvent ev) {
super.preInit(ev);
RenderingRegistry.registerEntityRenderingHandler(EntityCustomModel.class, new RenderCustomModel());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCustomModel.class, new RenderTileCustomModel());
}
public World getWorldById(int id){
return Minecraft.getMinecraft().theWorld;
}
}
@@ -0,0 +1,57 @@
package com.goodbird.npcgecko.client.gui;
import com.goodbird.npcgecko.data.CustomModelData;
import com.goodbird.npcgecko.mixin.IDataDisplay;
import net.minecraft.client.gui.GuiButton;
import noppes.npcs.client.gui.util.*;
import noppes.npcs.entity.EntityNPCInterface;
public class SubGuiModelExtras extends SubGuiInterface implements ITextfieldListener, ISubGuiListener {
public SubGuiModelExtras(EntityNPCInterface npc){
this.npc = npc;
closeOnEsc = true;
}
@Override
public void initGui() {
super.initGui();
int y = guiTop + 44;
addLabel(new GuiNpcLabel(1,"Head Bone Name", guiLeft - 85, y + 5,0xffffff));
addTextField(new GuiNpcTextField(1,this, fontRendererObj, guiLeft + 50, y, 200, 20, getModelData(npc).getHeadBoneName()));
y+=23;
addLabel(new GuiNpcLabel(2,"Transition Length (ticks)", guiLeft - 85, y + 5,0xffffff));
GuiNpcTextField transitionLength = new GuiNpcTextField(2,this, fontRendererObj, guiLeft + 50, y,
200, 20, ""+getModelData(npc).getTransitionLengthTicks());
transitionLength.setIntegersOnly();
transitionLength.setMinMaxDefault(0, Integer.MAX_VALUE, getModelData(npc).getTransitionLengthTicks());
addTextField(transitionLength);
addButton(new GuiNpcButton(670, width - 22, 2, 20, 20, "X"));
}
public CustomModelData getModelData(EntityNPCInterface npc){
return ((IDataDisplay)npc.display).getCustomModelData();
}
@Override
protected void actionPerformed(GuiButton button) {
super.actionPerformed(button);
if(button.id == 670){
close();
}
}
@Override
public void unFocused(GuiNpcTextField textfield) {
if(textfield.id == 1){
getModelData(npc).setHeadBoneName(textfield.getText());
}
if(textfield.id == 2){
getModelData(npc).setTransitionLengthTicks(textfield.getInteger());
}
}
@Override
public void subGuiClosed(SubGuiInterface subGuiInterface) {
initGui();
}
}
@@ -0,0 +1,53 @@
// TODO: Fix ScriptCustomItem
//package com.goodbird.npcgecko.client.model;
//
//import com.goodbird.npcgecko.data.CustomItemModelData;
//import com.goodbird.npcgecko.mixin.IScriptCustomItem;
//import net.minecraft.util.ResourceLocation;
//import noppes.npcs.api.item.IItemStack;
//import noppes.npcs.scripted.NpcAPI;
//import noppes.npcs.scripted.item.ScriptCustomItem;
//import software.bernie.geckolib3.resource.GeckoLibCache;
//
//public class ItemModelCustom extends AnimatedGeoModel<AnimatableStackWrapper> {
//
// private CustomItemModelData getModelData(AnimatableStackWrapper animatable){
// IItemStack istack = NpcAPI.Instance().getIItemStack(animatable.getStack());
// if(!(istack instanceof ScriptCustomItem)) return null;
// return ((IScriptCustomItem)istack).getCustomModelData();
// }
//
// @Override
// public ResourceLocation getAnimationFileLocation(AnimatableStackWrapper animatable) {
// CustomItemModelData data = getModelData(animatable);
// if(data==null || !GeckoLibCache.getInstance().getAnimations().containsKey(new ResourceLocation(data.getAnimFile()))){
// return new ResourceLocation("npcgecko","animations/none.animations.json");
// }
// return new ResourceLocation(data.getAnimFile());
// }
//
// @Override
// public ResourceLocation getModelLocation(AnimatableStackWrapper animatable) {
// CustomItemModelData data = getModelData(animatable);
// if(data==null || !GeckoLibCache.getInstance().getGeoModels().containsKey(new ResourceLocation(data.getModel()))){
// return new ResourceLocation("npcgecko","geo/modelnotfound.geo.json");
// }
// if(!GeckoLibCache.getInstance().getAnimations().containsKey(new ResourceLocation(data.getAnimFile()))){
// return new ResourceLocation("npcgecko","geo/animfilenotfound.geo.json");
// }
// return new ResourceLocation(data.getModel());
// }
//
// @Override
// public ResourceLocation getTextureLocation(AnimatableStackWrapper animatable) {
// CustomItemModelData data = getModelData(animatable);
// if(data==null || !GeckoLibCache.getInstance().getGeoModels().containsKey(new ResourceLocation(data.getModel()))){
// return new ResourceLocation("npcgecko","textures/model/alphabet.png");
// }
// if(!GeckoLibCache.getInstance().getAnimations().containsKey(new ResourceLocation(data.getAnimFile()))){
// return new ResourceLocation("npcgecko","textures/model/alphabet.png");
// }
// return new ResourceLocation(data.getTexture());
// }
//}
@@ -2,21 +2,54 @@ package com.goodbird.npcgecko.client.model;
import com.goodbird.npcgecko.entity.EntityCustomModel;
import net.minecraft.util.ResourceLocation;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.processor.IBone;
import software.bernie.geckolib3.model.AnimatedGeoModel;
import software.bernie.geckolib3.model.provider.data.EntityModelData;
import software.bernie.geckolib3.resource.GeckoLibCache;
public class ModelCustom extends AnimatedGeoModel<EntityCustomModel> {
@Override
public ResourceLocation getAnimationFileLocation(EntityCustomModel entity) {
if(!GeckoLibCache.getInstance().getAnimations().containsKey(entity.animResLoc)){
return new ResourceLocation("npcgecko","animations/none.animations.json");
}
return entity.animResLoc;
}
@Override
public ResourceLocation getModelLocation(EntityCustomModel entity) {
if(!GeckoLibCache.getInstance().getGeoModels().containsKey(entity.modelResLoc)){
return new ResourceLocation("npcgecko","geo/modelnotfound.geo.json");
}
if(!GeckoLibCache.getInstance().getAnimations().containsKey(entity.animResLoc)){
return new ResourceLocation("npcgecko","geo/animfilenotfound.geo.json");
}
return entity.modelResLoc;
}
@Override
public ResourceLocation getTextureLocation(EntityCustomModel entity) {
if(!GeckoLibCache.getInstance().getGeoModels().containsKey(entity.modelResLoc)){
return new ResourceLocation("npcgecko","textures/model/alphabet.png");
}
if(!GeckoLibCache.getInstance().getAnimations().containsKey(entity.animResLoc)){
return new ResourceLocation("npcgecko","textures/model/alphabet.png");
}
return entity.textureResLoc;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void setLivingAnimations(EntityCustomModel entity, Integer uniqueID, AnimationEvent animationEvent) {
super.setLivingAnimations(entity, uniqueID, animationEvent); //We call the super-function
IBone head = this.getAnimationProcessor().getBone(entity.headBoneName); //Then we take the head bone
if(head!=null) {
//We get the model data for an entity
EntityModelData extraData = (EntityModelData) animationEvent.getExtraDataOfType(EntityModelData.class).get(0);
//And we set the head bone rotation to the interpolated pitch and yaw rotations of an entity
head.setRotationX((extraData.headPitch) * ((float) Math.PI / 180F));
head.setRotationY((extraData.netHeadYaw) * ((float) Math.PI / 180F));
}
}
}
@@ -0,0 +1,38 @@
package com.goodbird.npcgecko.client.model;
import com.goodbird.npcgecko.tile.TileEntityCustomModel;
import net.minecraft.util.ResourceLocation;
import software.bernie.geckolib3.model.AnimatedGeoModel;
import software.bernie.geckolib3.resource.GeckoLibCache;
public class TileModelCustom extends AnimatedGeoModel<TileEntityCustomModel> {
@Override
public ResourceLocation getAnimationFileLocation(TileEntityCustomModel entity) {
if(!GeckoLibCache.getInstance().getAnimations().containsKey(entity.animResLoc)){
return new ResourceLocation("npcgecko","animations/none.animations.json");
}
return entity.animResLoc;
}
@Override
public ResourceLocation getModelLocation(TileEntityCustomModel animatable) {
if(!GeckoLibCache.getInstance().getGeoModels().containsKey(animatable.modelResLoc)){
return new ResourceLocation("npcgecko","geo/modelnotfound.geo.json");
}
if(!GeckoLibCache.getInstance().getAnimations().containsKey(animatable.animResLoc)){
return new ResourceLocation("npcgecko","geo/animfilenotfound.geo.json");
}
return animatable.modelResLoc;
}
@Override
public ResourceLocation getTextureLocation(TileEntityCustomModel entity) {
if(!GeckoLibCache.getInstance().getGeoModels().containsKey(entity.modelResLoc)){
return new ResourceLocation("npcgecko","textures/model/alphabet.png");
}
if(!GeckoLibCache.getInstance().getAnimations().containsKey(entity.animResLoc)){
return new ResourceLocation("npcgecko","textures/model/alphabet.png");
}
return entity.textureResLoc;
}
}
@@ -2,8 +2,12 @@ package com.goodbird.npcgecko.client.renderer;
import com.goodbird.npcgecko.client.model.ModelCustom;
import com.goodbird.npcgecko.entity.EntityCustomModel;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.geckominecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import software.bernie.geckolib3.core.util.Color;
@@ -30,6 +34,26 @@ public class RenderCustomModel extends GeoEntityRenderer<EntityCustomModel> {
}
}
protected void applyRotations(EntityCustomModel entityLiving, float ageInTicks, float rotationYaw, float partialTicks) {
if (!entityLiving.isPlayerSleeping()) {
GlStateManager.rotate(-180, 0.0F, 1.0F, 0.0F);
}
if (entityLiving.deathTime > 0) {
float f = ((float)entityLiving.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
f = net.minecraft.util.MathHelper.sqrt_float(f);
if (f > 1.0F) {
f = 1.0F;
}
GlStateManager.rotate(f * this.getDeathMaxRotation(entityLiving), 0.0F, 0.0F, 1.0F);
} else if (entityLiving.hasCustomNameTag()) {
String s = ChatFormatting.stripFormatting(entityLiving.getCommandSenderName());
if (("Dinnerbone".equals(s) || "Grumm".equals(s))) {
GlStateManager.translate(0.0, entityLiving.height + 0.1F, 0.0);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
}
}
}
public GeoBone[] getPathFromRoot(GeoBone bone) {
ArrayList<GeoBone> bones;
for(bones = new ArrayList<>(); bone != null; bone = bone.parent) {
@@ -117,4 +141,9 @@ public class RenderCustomModel extends GeoEntityRenderer<EntityCustomModel> {
public boolean isBoneRenderOverriden(EntityCustomModel entity, GeoBone bone) {
return bone.name.equals("held_item") || bone.name.equals("left_held_item");
}
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return super.getTextureLocation((EntityCustomModel) p_110775_1_);
}
}
@@ -0,0 +1,19 @@
package com.goodbird.npcgecko.client.renderer;
import com.goodbird.npcgecko.client.model.TileModelCustom;
import com.goodbird.npcgecko.tile.TileEntityCustomModel;
import net.minecraft.tileentity.TileEntity;
import software.bernie.example.client.model.tile.BotariumModel;
import software.bernie.geckolib3.renderers.geo.GeoBlockRenderer;
public class RenderTileCustomModel extends GeoBlockRenderer<TileEntityCustomModel> {
public RenderTileCustomModel() {
super(new TileModelCustom());
}
@Override
public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) {
// TODO: FIX RenderTileEntityAt
}
}
@@ -0,0 +1,75 @@
package com.goodbird.npcgecko.data;
import net.minecraft.nbt.NBTTagCompound;
public class CustomItemModelData {
private String model = "geckolib3:geo/npc.geo.json";
private String animFile = "custom:geo_npc.animation.json";
private String texture = "geckolib3:textures/item/jack.png";
private String idleAnim = "";
private int transitionLengthTicks = 10;
public CustomItemModelData() {
}
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
nbttagcompound.setString("Model", model);
nbttagcompound.setString("AnimFile", animFile);
nbttagcompound.setString("IdleAnim", idleAnim);
nbttagcompound.setString("Texture", texture);
nbttagcompound.setInteger("TransitionLengthTicks", transitionLengthTicks);
return nbttagcompound;
}
public void readFromNBT(NBTTagCompound nbttagcompound) {
if(nbttagcompound.hasKey("Model")) {
model = nbttagcompound.getString("Model");
animFile = nbttagcompound.getString("AnimFile");
idleAnim = nbttagcompound.getString("IdleAnim");
texture = nbttagcompound.getString("Texture");
if(nbttagcompound.hasKey("TransitionLengthTicks")){
transitionLengthTicks = nbttagcompound.getInteger("TransitionLengthTicks");
}
}
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getAnimFile() {
return animFile;
}
public void setAnimFile(String animFile) {
this.animFile = animFile;
}
public String getIdleAnim() {
return idleAnim;
}
public void setIdleAnim(String idleAnim) {
this.idleAnim = idleAnim;
}
public int getTransitionLengthTicks() {
return transitionLengthTicks;
}
public void setTransitionLengthTicks(int transitionLengthTicks) {
this.transitionLengthTicks = transitionLengthTicks;
}
public String getTexture() {
return texture;
}
public void setTexture(String texture) {
this.texture = texture;
}
}
@@ -4,13 +4,14 @@ import net.minecraft.nbt.NBTTagCompound;
public class CustomModelData {
private String model = "geckolib3:geo/npc.geo.json";
private String animFile = "custom:geo_npc.animation.json";
private String animFile = "npcgecko:animations/geo_npc.animation.json";
private String idleAnim = "";
private String walkAnim = "";
private String meleeAttackAnim = "";
private String hurtAnim = "";
private String rangedAttackAnim = "";
private String headBoneName = "head";
private int transitionLengthTicks = 10;
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
nbttagcompound.setString("Model", model);
nbttagcompound.setString("AnimFile", animFile);
@@ -19,6 +20,8 @@ public class CustomModelData {
nbttagcompound.setString("MeleeAttackAnim", meleeAttackAnim);
nbttagcompound.setString("RangedAttackAnim", rangedAttackAnim);
nbttagcompound.setString("HurtAnim", hurtAnim);
nbttagcompound.setString("HeadBoneName", headBoneName);
nbttagcompound.setInteger("TransitionLengthTicks", transitionLengthTicks);
return nbttagcompound;
}
@@ -31,6 +34,10 @@ public class CustomModelData {
hurtAnim = nbttagcompound.getString("HurtAnim");
meleeAttackAnim = nbttagcompound.getString("MeleeAttackAnim");
rangedAttackAnim = nbttagcompound.getString("RangedAttackAnim");
headBoneName = nbttagcompound.getString("HeadBoneName");
if(nbttagcompound.hasKey("TransitionLengthTicks")){
transitionLengthTicks = nbttagcompound.getInteger("TransitionLengthTicks");
}
}
}
@@ -89,4 +96,20 @@ public class CustomModelData {
public void setRangedAttackAnim(String rangedAttackAnim) {
this.rangedAttackAnim = rangedAttackAnim;
}
public String getHeadBoneName() {
return headBoneName;
}
public void setHeadBoneName(String headBoneName) {
this.headBoneName = headBoneName;
}
public int getTransitionLengthTicks() {
return transitionLengthTicks;
}
public void setTransitionLengthTicks(int transitionLengthTicks) {
this.transitionLengthTicks = transitionLengthTicks;
}
}
@@ -21,13 +21,14 @@ import software.bernie.geckolib3.core.manager.AnimationFactory;
public class EntityCustomModel extends EntityCreature implements IAnimatable, IAnimationTickable {
private final AnimationFactory factory = new AnimationFactory(this);
public ResourceLocation modelResLoc = new ResourceLocation("geckolib3", "geo/npc.geo.json");
public ResourceLocation animResLoc = new ResourceLocation("custom", "geo_npc.animation.json");
public ResourceLocation animResLoc = new ResourceLocation("npcgecko", "animations/geo_npc.animation.json");
public ResourceLocation textureResLoc = new ResourceLocation("geckolib3", "textures/model/entity/geo_npc.png");
public String idleAnimName = "";
public String walkAnimName = "";
public String hurtAnimName = "";
public String meleeAttackAnimName = "";
public String rangedAttackAnimName = "";
public String headBoneName = "head";
public AnimationBuilder dialogAnim = null;
public AnimationBuilder manualAnim = null;
public AnimationBuilder attackAnim = null;
@@ -38,7 +39,7 @@ public class EntityCustomModel extends EntityCreature implements IAnimatable, IA
private <E extends IAnimatable> PlayState predicateMovement(AnimationEvent<E> event) {
if (manualAnim != null) {
if (event.getController().getAnimationState() == AnimationState.Stopped) {
if (event.getController().currentAnimationBuilder == manualAnim && event.getController().getAnimationState() == AnimationState.Stopped) {
manualAnim = null;
} else {
if (event.getController().currentAnimationBuilder != manualAnim) {
@@ -49,7 +50,7 @@ public class EntityCustomModel extends EntityCreature implements IAnimatable, IA
}
}
if (dialogAnim != null) {
if (event.getController().getAnimationState() == AnimationState.Stopped) {
if (event.getController().currentAnimationBuilder == dialogAnim && event.getController().getAnimationState() == AnimationState.Stopped) {
dialogAnim = null;
} else {
if (event.getController().currentAnimationBuilder != dialogAnim) {
@@ -97,26 +98,21 @@ public class EntityCustomModel extends EntityCreature implements IAnimatable, IA
dialogAnim = new AnimationBuilder().playOnce(name);
}
public void activateReceivedAnim(EnumSyncAutoAnim type) {
switch (type) {
case HURT -> {
if(!hurtAnimName.isEmpty())
hurtAnim = new AnimationBuilder().playOnce(hurtAnimName);
}
case MELEE_ATTACK -> {
if(!meleeAttackAnimName.isEmpty())
attackAnim = new AnimationBuilder().playOnce(meleeAttackAnimName);
}
case RANGED_ATTACK -> {
if(!rangedAttackAnimName.isEmpty())
attackAnim = new AnimationBuilder().playOnce(rangedAttackAnimName);
}
if(type == EnumSyncAutoAnim.HURT){
if(!hurtAnimName.isEmpty())
hurtAnim = new AnimationBuilder().playOnce(hurtAnimName);
}else if(type == EnumSyncAutoAnim.MELEE_ATTACK){
if(!meleeAttackAnimName.isEmpty())
attackAnim = new AnimationBuilder().playOnce(meleeAttackAnimName);
}else if(type == EnumSyncAutoAnim.RANGED_ATTACK){
if(!rangedAttackAnimName.isEmpty())
attackAnim = new AnimationBuilder().playOnce(rangedAttackAnimName);
}
}
public EntityCustomModel(World worldIn) {
super(worldIn);
this.ignoreFrustumCheck = true;
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.setSize(0.7F, 2F);
}
@@ -0,0 +1,23 @@
package com.goodbird.npcgecko.item;
import com.goodbird.npcgecko.mixin.IScriptCustomItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import noppes.npcs.api.item.IItemStack;
import noppes.npcs.scripted.NpcAPI;
import noppes.npcs.scripted.item.ScriptCustomItem;
import software.bernie.geckolib3.core.IAnimatable;
import software.bernie.geckolib3.core.PlayState;
import software.bernie.geckolib3.core.builder.AnimationBuilder;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
public class ItemCustomModelPredicate {
public static <P extends Item & IAnimatable> PlayState predicate(AnimationEvent<P> event) {
ItemStack stack = (ItemStack) event.getExtraData().get(0);
IItemStack istack = NpcAPI.Instance().getIItemStack(stack);
if(!(istack instanceof ScriptCustomItem)) return PlayState.STOP;
IScriptCustomItem item = (IScriptCustomItem)istack;
event.getController().setAnimation(new AnimationBuilder().loop(item.getCustomModelData().getIdleAnim()));
return PlayState.CONTINUE;
}
}
@@ -0,0 +1,11 @@
package com.goodbird.npcgecko.mixin;
import com.goodbird.npcgecko.data.CustomItemModelData;
public interface IScriptCustomItem {
CustomItemModelData getCustomModelData();
void setCustomModelData(CustomItemModelData data);
boolean hasCustomModel();
}
@@ -0,0 +1,66 @@
package com.goodbird.npcgecko.mixin.impl;
import com.goodbird.npcgecko.tile.TileEntityCustomModel;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.MinecraftForgeClient;
import noppes.npcs.blocks.tiles.TileScripted;
import noppes.npcs.client.renderer.blocks.BlockScriptedRenderer;
import org.lwjgl.opengl.GL11;
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.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import software.bernie.geckolib3.renderers.geo.RenderBlockItem;
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.ENTITY;
@Mixin(BlockScriptedRenderer.class)
public abstract class MixinBlockScriptedRenderer {
@Inject(method = "renderTileEntityAt", at = @At(value = "INVOKE", target = "Lnoppes/npcs/client/renderer/blocks/BlockScriptedRenderer;renderItem(Lnet/minecraft/tileentity/TileEntity;Lnet/minecraft/item/ItemStack;)V", remap = false))
public void geckoModelRendering(TileEntity te, double x, double y, double z, float partialTicks, CallbackInfo ci) {
if(!(te instanceof TileScripted)) return;
TileScripted tileScripted = (TileScripted) te;
if(tileScripted.itemModel == null) return;
if(!(MinecraftForgeClient.getItemRenderer(tileScripted.itemModel, ENTITY) instanceof RenderBlockItem) || BlockScriptedRenderer.overrideModel()) return;
GL11.glTranslated(0, -0.5, 0);
GL11.glScaled(2, 2, 2);
}
@Inject(method = "renderWorldBlock", at = @At(value = "HEAD"), cancellable = true, remap = false)
public void renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer, CallbackInfoReturnable<Boolean> cir) {
if (BlockScriptedRenderer.overrideModel()) return;
TileEntity te = world.getTileEntity(x, y, z);
if (!(te instanceof TileScripted)) return;
TileScripted tileScripted = (TileScripted) te;
if (!(tileScripted.renderTile instanceof TileEntityCustomModel)) return;
cir.setReturnValue(true);
cir.cancel();
}
@Inject(method = "renderTileEntityAt", at = @At(value = "HEAD"), cancellable = true)
public void customGeckoModelRendering(TileEntity te, double x, double y, double z, float partialTicks, CallbackInfo ci) {
if(BlockScriptedRenderer.overrideModel()) return;
if(!(te instanceof TileScripted)) return;
TileScripted tileScripted = (TileScripted) te;
if(!(tileScripted.renderTile instanceof TileEntityCustomModel)) return;
GL11.glPushMatrix();
GL11.glTranslated(x,y,z);
GL11.glTranslated(0.5,0.5, 0.5);
GL11.glRotatef((float)tileScripted.rotationY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef((float)tileScripted.rotationX, 1.0F, 0.0F, 0.0F);
GL11.glRotatef((float)tileScripted.rotationZ, 0.0F, 0.0F, 1.0F);
GL11.glScalef(tileScripted.scaleX, tileScripted.scaleY, tileScripted.scaleZ);
GL11.glTranslated(-0.5,-0.5/tileScripted.scaleY, -0.5);
GL11.glTranslated(-x,-y,-z);
TileEntityRendererDispatcher.instance.renderTileEntityAt(tileScripted.renderTile, x, y, z, partialTicks);
GL11.glPopMatrix();
ci.cancel();
}
}
@@ -0,0 +1,54 @@
// TODO: Fix ScriptCustomItem
//package com.goodbird.npcgecko.mixin.impl;
//
//import com.goodbird.npcgecko.client.model.ItemModelCustom;
//import com.goodbird.npcgecko.mixin.IScriptCustomItem;
//import net.minecraft.entity.EntityLivingBase;
//import net.minecraft.entity.item.EntityItem;
//import net.minecraft.item.ItemStack;
//import noppes.npcs.client.renderer.items.CustomItemRenderer;
//import noppes.npcs.scripted.item.ScriptCustomItem;
//import org.lwjgl.opengl.GL11;
//import org.spongepowered.asm.mixin.Mixin;
//import org.spongepowered.asm.mixin.Unique;
//import org.spongepowered.asm.mixin.injection.At;
//import org.spongepowered.asm.mixin.injection.Inject;
//import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
//import software.bernie.geckolib3.item.AnimatableStackWrapper;
//import software.bernie.geckolib3.renderers.geo.GeoItemStackRenderer;
//
//@Mixin(CustomItemRenderer.class)
//public class MixinCustomItemRenderer {
// @Unique
// private static GeoItemStackRenderer renderer = new GeoItemStackRenderer(new ItemModelCustom());
//
// @Inject(method = "renderEntityCustomItem", cancellable = true, at=@At("HEAD"), remap = false)
// public void renderEntityCustomItem(ScriptCustomItem scriptCustomItem, ItemStack itemStack, EntityItem entityItem, CallbackInfo ci) {
// if(((IScriptCustomItem)scriptCustomItem).hasCustomModel()){
// renderer.render(AnimatableStackWrapper.wrapItemStack(itemStack), itemStack);
// ci.cancel();
// }
// }
//
// @Inject(method = "renderInventoryCustomItem", cancellable = true, at=@At("HEAD"), remap = false)
// public void renderInventoryCustomItem(ScriptCustomItem scriptCustomItem, CallbackInfo ci){
// if(((IScriptCustomItem)scriptCustomItem).hasCustomModel()){
// GL11.glPushMatrix();
// GL11.glTranslated(-1.0, -1.0, 0.0);
// GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
// renderer.render(AnimatableStackWrapper.wrapItemStack(scriptCustomItem.item), scriptCustomItem.item);
// GL11.glPopMatrix();
// ci.cancel();
// }
// }
//
// @Inject(method = "renderItem3d", cancellable = true, at=@At("HEAD"), remap = false)
// public void renderItem3d(ScriptCustomItem scriptCustomItem, EntityLivingBase entityLivingBase, ItemStack itemStack, CallbackInfo ci) {
// if(((IScriptCustomItem)scriptCustomItem).hasCustomModel()){
// renderer.render(AnimatableStackWrapper.wrapItemStack(itemStack), itemStack);
// ci.cancel();
// }
// }
//
//}
@@ -3,13 +3,15 @@ package com.goodbird.npcgecko.mixin.impl;
import com.goodbird.npcgecko.entity.EntityCustomModel;
import com.goodbird.npcgecko.mixin.IDataDisplay;
import com.goodbird.npcgecko.utils.NpcTextureUtils;
import kamkeel.npcs.addon.GeckoAddon;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
import kamkeel.addon.GeckoAddon;
import noppes.npcs.entity.EntityNPCInterface;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import software.bernie.geckolib3.core.controller.AnimationController;
import software.bernie.geckolib3.core.manager.AnimationData;
@Mixin(GeckoAddon.class)
public class MixinGeckoAddon {
@@ -25,7 +27,9 @@ public class MixinGeckoAddon {
if(!supportEnabled)
return;
if (entity instanceof EntityCustomModel modelEntity && copied instanceof EntityNPCInterface npc) {
if (entity instanceof EntityCustomModel && copied instanceof EntityNPCInterface) {
EntityCustomModel modelEntity = (EntityCustomModel) entity;
EntityNPCInterface npc = (EntityNPCInterface) copied;
IDataDisplay display = (IDataDisplay) npc.display;
modelEntity.textureResLoc = NpcTextureUtils.getNpcTexture((EntityNPCInterface) copied);
modelEntity.modelResLoc = new ResourceLocation(display.getCustomModelData().getModel());
@@ -39,6 +43,11 @@ public class MixinGeckoAddon {
modelEntity.hurtTime = npc.hurtTime;
modelEntity.deathTime = npc.deathTime;
modelEntity.tintData = npc.display.tintData;
modelEntity.headBoneName = display.getCustomModelData().getHeadBoneName();
AnimationData animationData = modelEntity.getFactory().getOrCreateAnimationData(modelEntity.getUniqueID().hashCode());
for(AnimationController controller : animationData.getAnimationControllers().values()){
controller.transitionLengthTicks = display.getCustomModelData().getTransitionLengthTicks();
}
}
}
}
@@ -2,13 +2,13 @@ package com.goodbird.npcgecko.mixin.impl;
import com.goodbird.npcgecko.client.gui.GuiStringSelection;
import com.goodbird.npcgecko.client.gui.SubGuiModelAnimation;
import com.goodbird.npcgecko.client.gui.SubGuiModelExtras;
import com.goodbird.npcgecko.entity.EntityCustomModel;
import com.goodbird.npcgecko.mixin.IDataDisplay;
import kamkeel.addon.client.GeckoAddonClient;
import kamkeel.npcs.addon.client.GeckoAddonClient;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
import noppes.npcs.client.gui.model.GuiCreationScreen;
@@ -42,6 +42,7 @@ public class MixinGeckoAddonClient {
if(entity instanceof EntityCustomModel){
creationScreen.addButton(new GuiNpcButton(202, creationScreen.guiLeft-60, creationScreen.guiTop+40, 180, 20, ((IDataDisplay)creationScreen.npc.display).getCustomModelData().getModel()));
creationScreen.addButton(new GuiNpcButton(203, creationScreen.guiLeft-60, creationScreen.guiTop+62, 180, 20, "Extras"));
}
}
@@ -64,6 +65,9 @@ public class MixinGeckoAddonClient {
creationScreen.getButton(202).setDisplayText(name);
}));
}
if(button.id == 203){
creationScreen.setSubGui(new SubGuiModelExtras(creationScreen.npc));
}
}
/**
@@ -120,7 +124,6 @@ public class MixinGeckoAddonClient {
GL11.glRotatef(180, 1,0,0);
GL11.glTranslated(0, -1.5,0);
(mainModel).entity.renderYawOffset = (mainModel).entity.prevRenderYawOffset = 0;
if (!npc.isInvisible())
{
if(mainModel.entity instanceof EntityCustomModel){
@@ -0,0 +1,30 @@
package com.goodbird.npcgecko.mixin.impl;
import com.goodbird.npcgecko.item.ItemCustomModelPredicate;
import net.minecraft.item.Item;
import noppes.npcs.items.ItemScripted;
import org.spongepowered.asm.mixin.Implements;
import org.spongepowered.asm.mixin.Interface;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import software.bernie.geckolib3.core.IAnimatable;
import software.bernie.geckolib3.core.controller.AnimationController;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;
@Mixin(ItemScripted.class)
@Implements(value = @Interface(iface = IAnimatable.class, prefix = "customNPC_Gecko_Addon$"))
public abstract class MixinItemScripted extends Item implements IAnimatable {
@Unique
public AnimationFactory customNPC_Gecko_Addon$factory = new AnimationFactory(this);
@Unique
public void customNPC_Gecko_Addon$registerControllers(AnimationData data) {
data.addAnimationController(new AnimationController<>(this, "controller", 20, ItemCustomModelPredicate::predicate));
}
@Unique
public AnimationFactory customNPC_Gecko_Addon$getFactory() {
return this.customNPC_Gecko_Addon$factory;
}
}
@@ -0,0 +1,52 @@
// TODO: Fix ScriptCustomItem
//package com.goodbird.npcgecko.mixin.impl;
//
//import com.goodbird.npcgecko.data.CustomItemModelData;
//import com.goodbird.npcgecko.mixin.IScriptCustomItem;
//import net.minecraft.nbt.NBTTagCompound;
//import noppes.npcs.scripted.item.ScriptCustomItem;
//import org.spongepowered.asm.mixin.Mixin;
//import org.spongepowered.asm.mixin.Unique;
//import org.spongepowered.asm.mixin.injection.At;
//import org.spongepowered.asm.mixin.injection.Inject;
//import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
//import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
//
//@Mixin(ScriptCustomItem.class)
//public class MixinScriptCustomItem implements IScriptCustomItem {
// @Unique
// private CustomItemModelData customNPC_Gecko_Addon$customModelData;
//
// @Inject(method = "getItemNBT", at = @At("HEAD"), remap = false)
// public void writeToNBT(NBTTagCompound nbttagcompound, CallbackInfoReturnable<NBTTagCompound> cir) {
// if(customNPC_Gecko_Addon$customModelData!=null){
// NBTTagCompound modelDataTag = new NBTTagCompound();
// customNPC_Gecko_Addon$customModelData.writeToNBT(modelDataTag);
// nbttagcompound.setTag("GeckoModelData", modelDataTag);
// }
// }
//
// @Inject(method = "setItemNBT", at = @At("HEAD"), remap = false)
// public void readFromNBT(NBTTagCompound nbttagcompound, CallbackInfo ci){
// if(nbttagcompound.hasKey("GeckoModelData")){
// customNPC_Gecko_Addon$customModelData = new CustomItemModelData();
// customNPC_Gecko_Addon$customModelData.readFromNBT(nbttagcompound.getCompoundTag("GeckoModelData"));
// }
// }
//
// @Unique
// public CustomItemModelData getCustomModelData(){
// return customNPC_Gecko_Addon$customModelData;
// }
//
// @Override
// public void setCustomModelData(CustomItemModelData data) {
// customNPC_Gecko_Addon$customModelData = data;
// }
//
// @Unique
// public boolean hasCustomModel() {
// return customNPC_Gecko_Addon$customModelData!=null;
// }
//}
@@ -0,0 +1,47 @@
package com.goodbird.npcgecko.mixin.impl;
import com.goodbird.npcgecko.CustomNpcPlusGecko;
import com.goodbird.npcgecko.tile.TileEntityCustomModel;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import noppes.npcs.blocks.tiles.TileScripted;
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;
@Mixin(TileScripted.class)
public class TileScriptedMixin {
@Shadow(remap = false)
public TileEntity renderTile;
@Inject(method = "setDisplayNBT", at = @At("TAIL"), remap = false)
public void setDisplayNBT(NBTTagCompound compound, CallbackInfo ci) {
if(compound.hasKey("renderTileTag")){
renderTile = new TileEntityCustomModel();
NBTTagCompound saveTag = compound.getCompoundTag("renderTileTag");
if(saveTag.hasKey("dimID")){
renderTile.setWorldObj(CustomNpcPlusGecko.proxy.getWorldById(saveTag.getInteger("dimID")));
}else{
renderTile.setWorldObj(CustomNpcPlusGecko.proxy.getWorldById(0));
}
renderTile.readFromNBT(saveTag);
}
}
@Inject(method = "getDisplayNBT", at = @At("TAIL"), remap = false)
public void getDisplayNBT(NBTTagCompound compound, CallbackInfo ci) {
if(renderTile!=null) {
NBTTagCompound saveTag = new NBTTagCompound();
renderTile.writeToNBT(saveTag);
if(renderTile.getWorldObj()!=null && renderTile.getWorldObj().provider!=null)
saveTag.setInteger("dimID", renderTile.getWorldObj().provider.dimensionId);
compound.setTag("renderTileTag", saveTag);
}
}
}
@@ -5,6 +5,7 @@ import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
import kamkeel.npcs.util.ByteBufUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
@@ -59,12 +60,12 @@ public final class CPacketSyncManualAnim implements IMessage, IMessageHandler<CP
animList.appendTag(animTag);
}
compound.setTag("anims",animList);
Server.writeNBT(buffer,compound);
ByteBufUtils.writeNBT(buffer,compound);
}
public static AnimationBuilder readAnimBuilder(ByteBuf buffer) throws IOException {
AnimationBuilder builder = new AnimationBuilder();
NBTTagCompound compound = Server.readNBT(buffer);
NBTTagCompound compound = ByteBufUtils.readNBT(buffer);
NBTTagList animList = compound.getTagList("anims",10);
for(int i=0;i<animList.tagCount();i++){
NBTTagCompound animTag = animList.getCompoundTagAt(i);
@@ -0,0 +1,101 @@
package com.goodbird.npcgecko.network;
import com.goodbird.npcgecko.entity.EntityCustomModel;
import com.goodbird.npcgecko.tile.TileEntityCustomModel;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
import kamkeel.npcs.util.ByteBufUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import noppes.npcs.Server;
import noppes.npcs.blocks.tiles.TileScripted;
import noppes.npcs.entity.EntityCustomNpc;
import noppes.npcs.entity.EntityNPCInterface;
import software.bernie.geckolib3.core.builder.AnimationBuilder;
import software.bernie.geckolib3.core.builder.ILoopType;
import software.bernie.geckolib3.core.builder.RawAnimation;
import java.io.IOException;
public class CPacketSyncTileManualAnim implements IMessage, IMessageHandler<CPacketSyncTileManualAnim, IMessage> {
public AnimationBuilder builder;
public int x, y, z;
public CPacketSyncTileManualAnim(){
}
public CPacketSyncTileManualAnim(TileEntity tile, AnimationBuilder builder) {
this.builder = builder;
this.x = tile.xCoord;
this.y = tile.yCoord;
this.z = tile.zCoord;
}
@Override
public void toBytes(ByteBuf buf) {
try {
writeAnimBuilder(buf, builder);
}catch (Exception ignored){ }
buf.writeInt(x);
buf.writeInt(y);
buf.writeInt(z);
}
@Override
public void fromBytes(ByteBuf buf) {
try {
builder = readAnimBuilder(buf);
}catch (Exception ignored){ }
x = buf.readInt();
y = buf.readInt();
z = buf.readInt();
}
public static void writeAnimBuilder(ByteBuf buffer, AnimationBuilder builder) throws IOException {
NBTTagCompound compound = new NBTTagCompound();
NBTTagList animList = new NBTTagList();
for(RawAnimation anim: builder.getRawAnimationList()){
NBTTagCompound animTag = new NBTTagCompound();
animTag.setString("name", anim.animationName);
if(anim.loopType!=null) {
animTag.setInteger("loop", ((ILoopType.EDefaultLoopTypes) anim.loopType).ordinal());
}else{
animTag.setInteger("loop",1);
}
animList.appendTag(animTag);
}
compound.setTag("anims",animList);
ByteBufUtils.writeNBT(buffer,compound);
}
public static AnimationBuilder readAnimBuilder(ByteBuf buffer) throws IOException {
AnimationBuilder builder = new AnimationBuilder();
NBTTagCompound compound = ByteBufUtils.readNBT(buffer);
NBTTagList animList = compound.getTagList("anims",10);
for(int i=0;i<animList.tagCount();i++){
NBTTagCompound animTag = animList.getCompoundTagAt(i);
builder.addAnimation(animTag.getString("name"),
ILoopType.EDefaultLoopTypes.values()[animTag.getInteger("loop")]);
}
return builder;
}
@Override
public IMessage onMessage(CPacketSyncTileManualAnim message, MessageContext ctx) {
TileEntity entity = Minecraft.getMinecraft().theWorld.getTileEntity(message.x, message.y, message.z);
if(!(entity instanceof TileScripted)) return null;
TileScripted tile = (TileScripted) entity;
if(tile.renderTile==null){
tile.renderTile = new TileEntityCustomModel();
}
TileEntityCustomModel geckoTile = (TileEntityCustomModel) tile.renderTile;
geckoTile.manualAnim = message.builder;
return null;
}
}
@@ -14,6 +14,7 @@ public final class NetworkHandler {
public static void init() {
wrapper.registerMessage(CPacketSyncAutoAnim.class, CPacketSyncAutoAnim.class, 0, Side.CLIENT);
wrapper.registerMessage(CPacketSyncManualAnim.class, CPacketSyncManualAnim.class, 1, Side.CLIENT);
wrapper.registerMessage(CPacketSyncTileManualAnim.class, CPacketSyncTileManualAnim.class, 2, Side.CLIENT);
}
public static void sendToPlayer(IMessage message, EntityPlayer player) {
@@ -0,0 +1,81 @@
package com.goodbird.npcgecko.tile;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import software.bernie.geckolib3.GeckoLib;
import software.bernie.geckolib3.core.AnimationState;
import software.bernie.geckolib3.core.IAnimatable;
import software.bernie.geckolib3.core.PlayState;
import software.bernie.geckolib3.core.builder.AnimationBuilder;
import software.bernie.geckolib3.core.controller.AnimationController;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;
public class TileEntityCustomModel extends TileEntity implements IAnimatable {
private final AnimationFactory factory = new AnimationFactory(this);
public ResourceLocation modelResLoc = new ResourceLocation(GeckoLib.ModID, "geo/botarium.geo.json");
public ResourceLocation animResLoc = new ResourceLocation(GeckoLib.ModID, "animations/botarium.animation.json");
public ResourceLocation textureResLoc = new ResourceLocation(GeckoLib.ModID, "textures/block/botarium.png");
public String idleAnimName = "";
public AnimationBuilder manualAnim = null;
public TileEntityCustomModel(){
}
public TileEntityCustomModel(TileEntity other){
setWorldObj(other.getWorldObj());
xCoord = other.xCoord;
yCoord = other.yCoord;
zCoord = other.zCoord;
}
private <E extends TileEntity & IAnimatable> PlayState predicate(AnimationEvent<E> event) {
if (manualAnim != null) {
if (event.getController().currentAnimationBuilder == manualAnim && event.getController().getAnimationState() == AnimationState.Stopped) {
manualAnim = null;
} else {
if (event.getController().currentAnimationBuilder != manualAnim) {
event.getController().markNeedsReload();
}
event.getController().setAnimation(manualAnim);
return PlayState.CONTINUE;
}
}
if (!idleAnimName.isEmpty()) {
event.getController().setAnimation(new AnimationBuilder().loop(idleAnimName));
} else {
return PlayState.STOP;
}
return PlayState.CONTINUE;
}
@Override
public void registerControllers(AnimationData data) {
data.addAnimationController(new AnimationController<>(this, "controller", 0, this::predicate));
}
@Override
public AnimationFactory getFactory() {
return factory;
}
@Override
public void writeToNBT(NBTTagCompound compound) {
super.writeToNBT(compound);
compound.setString("modelResLoc", modelResLoc.toString());
compound.setString("animResLoc", animResLoc.toString());
compound.setString("textureResLoc", textureResLoc.toString());
compound.setString("idleAnimName", idleAnimName);
}
@Override
public void readFromNBT(NBTTagCompound compound) {
super.readFromNBT(compound);
modelResLoc = new ResourceLocation(compound.getString("modelResLoc"));
animResLoc = new ResourceLocation(compound.getString("animResLoc"));
textureResLoc = new ResourceLocation(compound.getString("textureResLoc"));
idleAnimName = compound.getString("idleAnimName");
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,6 @@
{
"format_version": "1.8.0",
"animations": {
},
"geckolib_format_version": 2
}
@@ -0,0 +1,400 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.unknown",
"texture_width": 3000,
"texture_height": 960,
"visible_bounds_width": 4,
"visible_bounds_height": 2.5,
"visible_bounds_offset": [0, 0.75, 0]
},
"bones": [
{
"name": "animation_file_not_found",
"pivot": [-13, 2, 0]
},
{
"name": "animation",
"parent": "animation_file_not_found",
"pivot": [18.212, 7.7834, 0]
},
{
"name": "a2",
"parent": "animation",
"pivot": [18.212, 7.7834, 0],
"cubes": [
{
"origin": [-12.4492, 7.967, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [0, 66], "uv_size": [84, 120]},
"south": {"uv": [84, 66], "uv_size": [-84, 120]},
"up": {"uv": [0, 0], "uv_size": [84, 66]},
"down": {"uv": [0, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "n2",
"parent": "animation",
"pivot": [18.212, 7.7834, 0],
"cubes": [
{
"origin": [-9.5116, 7.967, 0.6902],
"size": [2.9376, 3.672, 0.017],
"uv": {
"north": {"uv": [1266, 66], "uv_size": [96, 120]},
"south": {"uv": [1362, 66], "uv_size": [-96, 120]},
"up": {"uv": [1266, 0], "uv_size": [96, 66]},
"down": {"uv": [1266, 186], "uv_size": [96, 66]}
}
}
]
},
{
"name": "i2",
"parent": "animation",
"pivot": [18.212, 7.7834, 0],
"cubes": [
{
"origin": [-6.2068, 7.967, 0.6902],
"size": [1.1016, 3.672, 0.017],
"uv": {
"north": {"uv": [810, 66], "uv_size": [36, 120]},
"south": {"uv": [846, 66], "uv_size": [-36, 120]},
"up": {"uv": [810, 0], "uv_size": [36, 66]},
"down": {"uv": [810, 186], "uv_size": [36, 66]}
}
}
]
},
{
"name": "m",
"parent": "animation",
"pivot": [18.212, 7.7834, 0],
"cubes": [
{
"origin": [-4.738, 7.967, 0.6902],
"size": [3.672, 3.672, 0.017],
"uv": {
"north": {"uv": [1110, 66], "uv_size": [120, 120]},
"east": {"uv": [6, 804], "uv_size": [3, -6]},
"south": {"uv": [1230, 66], "uv_size": [-120, 120]},
"west": {"uv": [6, 804], "uv_size": [3, -6]},
"up": {"uv": [1110, 0], "uv_size": [120, 66]},
"down": {"uv": [1110, 186], "uv_size": [120, 66]}
}
}
]
},
{
"name": "a",
"parent": "animation",
"pivot": [18.212, 7.7834, 0],
"cubes": [
{
"origin": [-0.6988, 7.967, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [90, 66], "uv_size": [84, 120]},
"south": {"uv": [174, 66], "uv_size": [-84, 120]},
"up": {"uv": [90, 0], "uv_size": [84, 66]},
"down": {"uv": [90, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "t2",
"parent": "animation",
"pivot": [18.212, 7.7834, 0],
"cubes": [
{
"origin": [2.2388, 7.967, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [1830, 66], "uv_size": [84, 120]},
"south": {"uv": [1914, 66], "uv_size": [-84, 120]},
"up": {"uv": [1830, 0], "uv_size": [84, 66]},
"down": {"uv": [1830, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "i3",
"parent": "animation",
"pivot": [18.212, 7.7834, 0],
"cubes": [
{
"origin": [5.1764, 7.967, 0.6902],
"size": [1.1016, 3.672, 0.017],
"uv": {
"north": {"uv": [810, 66], "uv_size": [36, 120]},
"south": {"uv": [846, 66], "uv_size": [-36, 120]},
"up": {"uv": [810, 0], "uv_size": [36, 66]},
"down": {"uv": [810, 186], "uv_size": [36, 66]}
}
}
]
},
{
"name": "o2",
"parent": "animation",
"pivot": [18.212, 7.7834, 0],
"cubes": [
{
"origin": [6.6452, 7.967, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [1368, 66], "uv_size": [84, 120]},
"south": {"uv": [1452, 66], "uv_size": [-84, 120]},
"up": {"uv": [1368, 0], "uv_size": [84, 66]},
"down": {"uv": [1368, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "n3",
"parent": "animation",
"pivot": [18.212, 7.7834, 0],
"cubes": [
{
"origin": [9.5828, 7.967, 0.6902],
"size": [2.9376, 3.672, 0.017],
"uv": {
"north": {"uv": [1266, 66], "uv_size": [96, 120]},
"south": {"uv": [1362, 66], "uv_size": [-96, 120]},
"up": {"uv": [1266, 0], "uv_size": [96, 66]},
"down": {"uv": [1266, 186], "uv_size": [96, 66]}
}
}
]
},
{
"name": "file",
"parent": "animation_file_not_found",
"pivot": [-13, 2, 0]
},
{
"name": "f2",
"parent": "file",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [-17.59, 2.1836, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [540, 66], "uv_size": [84, 120]},
"south": {"uv": [624, 66], "uv_size": [-84, 120]},
"up": {"uv": [540, 0], "uv_size": [84, 66]},
"down": {"uv": [540, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "i",
"parent": "file",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [-14.6524, 2.1836, 0.6902],
"size": [1.1016, 3.672, 0.017],
"uv": {
"north": {"uv": [810, 66], "uv_size": [36, 120]},
"south": {"uv": [846, 66], "uv_size": [-36, 120]},
"up": {"uv": [810, 0], "uv_size": [36, 66]},
"down": {"uv": [810, 186], "uv_size": [36, 66]}
}
}
]
},
{
"name": "l",
"parent": "file",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [-13.1836, 2.1836, 0.6902],
"size": [2.2032, 3.672, 0.017],
"uv": {
"north": {"uv": [1032, 66], "uv_size": [72, 120]},
"south": {"uv": [1104, 66], "uv_size": [-72, 120]},
"up": {"uv": [1032, 0], "uv_size": [72, 66]},
"down": {"uv": [1032, 186], "uv_size": [72, 66]}
}
}
]
},
{
"name": "e",
"parent": "file",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [-10.6132, 2.1836, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [450, 66], "uv_size": [84, 120]},
"south": {"uv": [534, 66], "uv_size": [-84, 120]},
"up": {"uv": [450, 0], "uv_size": [84, 66]},
"down": {"uv": [450, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "not",
"parent": "animation_file_not_found",
"pivot": [-13, 2, 0]
},
{
"name": "n4",
"parent": "not",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [-6.9412, 2.1836, 0.6902],
"size": [2.9376, 3.672, 0.017],
"uv": {
"north": {"uv": [1266, 66], "uv_size": [96, 120]},
"south": {"uv": [1362, 66], "uv_size": [-96, 120]},
"up": {"uv": [1266, 0], "uv_size": [96, 66]},
"down": {"uv": [1266, 186], "uv_size": [96, 66]}
}
}
]
},
{
"name": "o3",
"parent": "not",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [-3.6364, 2.1836, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [1368, 66], "uv_size": [84, 120]},
"south": {"uv": [1452, 66], "uv_size": [-84, 120]},
"up": {"uv": [1368, 0], "uv_size": [84, 66]},
"down": {"uv": [1368, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "t",
"parent": "not",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [-0.6988, 2.1836, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [1830, 66], "uv_size": [84, 120]},
"south": {"uv": [1914, 66], "uv_size": [-84, 120]},
"up": {"uv": [1830, 0], "uv_size": [84, 66]},
"down": {"uv": [1830, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "found",
"parent": "animation_file_not_found",
"pivot": [-13, 2, 0]
},
{
"name": "f",
"parent": "found",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [2.9732, 2.1836, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [540, 66], "uv_size": [84, 120]},
"south": {"uv": [624, 66], "uv_size": [-84, 120]},
"up": {"uv": [540, 0], "uv_size": [84, 66]},
"down": {"uv": [540, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "o",
"parent": "found",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [5.9108, 2.1836, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [1368, 66], "uv_size": [84, 120]},
"south": {"uv": [1452, 66], "uv_size": [-84, 120]},
"up": {"uv": [1368, 0], "uv_size": [84, 66]},
"down": {"uv": [1368, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "u",
"parent": "found",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [8.8484, 2.1836, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [1920, 66], "uv_size": [84, 120]},
"south": {"uv": [2004, 66], "uv_size": [-84, 120]},
"up": {"uv": [1920, 0], "uv_size": [84, 66]},
"down": {"uv": [1920, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "n",
"parent": "found",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [11.786, 2.1836, 0.6902],
"size": [2.9376, 3.672, 0.017],
"uv": {
"north": {"uv": [1266, 66], "uv_size": [96, 120]},
"south": {"uv": [1362, 66], "uv_size": [-96, 120]},
"up": {"uv": [1266, 0], "uv_size": [96, 66]},
"down": {"uv": [1266, 186], "uv_size": [96, 66]}
}
}
]
},
{
"name": "d",
"parent": "found",
"pivot": [-13, 2, 0],
"cubes": [
{
"origin": [15.0908, 2.1836, 0.6902],
"size": [2.5704, 3.672, 0.017],
"uv": {
"north": {"uv": [360, 66], "uv_size": [84, 120]},
"south": {"uv": [444, 66], "uv_size": [-84, 120]},
"up": {"uv": [360, 0], "uv_size": [84, 66]},
"down": {"uv": [360, 186], "uv_size": [84, 66]}
}
}
]
}
]
}
]
}
@@ -0,0 +1,259 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.unknown",
"texture_width": 3000,
"texture_height": 960,
"visible_bounds_width": 3,
"visible_bounds_height": 2.5,
"visible_bounds_offset": [0, 0.75, 0]
},
"bones": [
{
"name": "model_not_found",
"pivot": [-8, 3, 0]
},
{
"name": "model",
"parent": "model_not_found",
"pivot": [11.323, 8.301, 0]
},
{
"name": "m",
"parent": "model",
"pivot": [11.323, 8.301, 0],
"cubes": [
{
"origin": [-7.658, 8.472, -0.0595],
"size": [3.42, 3.42, 0.05],
"uv": {
"north": {"uv": [1110, 66], "uv_size": [120, 120]},
"east": {"uv": [6, 804], "uv_size": [3, -6]},
"south": {"uv": [1230, 66], "uv_size": [-120, 120]},
"west": {"uv": [6, 804], "uv_size": [3, -6]},
"up": {"uv": [1110, 0], "uv_size": [120, 66]},
"down": {"uv": [1110, 186], "uv_size": [120, 66]}
}
}
]
},
{
"name": "o2",
"parent": "model",
"pivot": [11.323, 8.301, 0],
"cubes": [
{
"origin": [-3.896, 8.472, -0.0595],
"size": [2.394, 3.42, 0.05],
"uv": {
"north": {"uv": [1368, 66], "uv_size": [84, 120]},
"south": {"uv": [1452, 66], "uv_size": [-84, 120]},
"up": {"uv": [1368, 0], "uv_size": [84, 66]},
"down": {"uv": [1368, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "d2",
"parent": "model",
"pivot": [11.323, 8.301, 0],
"cubes": [
{
"origin": [-1.16, 8.472, -0.0595],
"size": [2.394, 3.42, 0.05],
"uv": {
"north": {"uv": [360, 66], "uv_size": [84, 120]},
"south": {"uv": [444, 66], "uv_size": [-84, 120]},
"up": {"uv": [360, 0], "uv_size": [84, 66]},
"down": {"uv": [360, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "e",
"parent": "model",
"pivot": [11.323, 8.301, 0],
"cubes": [
{
"origin": [1.576, 8.472, -0.0595],
"size": [2.394, 3.42, 0.05],
"uv": {
"north": {"uv": [450, 66], "uv_size": [84, 120]},
"south": {"uv": [534, 66], "uv_size": [-84, 120]},
"up": {"uv": [450, 0], "uv_size": [84, 66]},
"down": {"uv": [450, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "l",
"parent": "model",
"pivot": [11.323, 8.301, 0],
"cubes": [
{
"origin": [4.312, 8.472, -0.0595],
"size": [2.052, 3.42, 0.05],
"uv": {
"north": {"uv": [1032, 66], "uv_size": [72, 120]},
"south": {"uv": [1104, 66], "uv_size": [-72, 120]},
"up": {"uv": [1032, 0], "uv_size": [72, 66]},
"down": {"uv": [1032, 186], "uv_size": [72, 66]}
}
}
]
},
{
"name": "not",
"parent": "model_not_found",
"pivot": [-8, 3, 0]
},
{
"name": "n2",
"parent": "not",
"pivot": [-8, 3, 0],
"cubes": [
{
"origin": [-11.933, 3.171, -0.0595],
"size": [2.736, 3.42, 0.05],
"uv": {
"north": {"uv": [1266, 66], "uv_size": [96, 120]},
"south": {"uv": [1362, 66], "uv_size": [-96, 120]},
"up": {"uv": [1266, 0], "uv_size": [96, 66]},
"down": {"uv": [1266, 186], "uv_size": [96, 66]}
}
}
]
},
{
"name": "o3",
"parent": "not",
"pivot": [-8, 3, 0],
"cubes": [
{
"origin": [-8.855, 3.171, -0.0595],
"size": [2.394, 3.42, 0.05],
"uv": {
"north": {"uv": [1368, 66], "uv_size": [84, 120]},
"south": {"uv": [1452, 66], "uv_size": [-84, 120]},
"up": {"uv": [1368, 0], "uv_size": [84, 66]},
"down": {"uv": [1368, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "t",
"parent": "not",
"pivot": [-8, 3, 0],
"cubes": [
{
"origin": [-6.119, 3.171, -0.0595],
"size": [2.394, 3.42, 0.05],
"uv": {
"north": {"uv": [1830, 66], "uv_size": [84, 120]},
"south": {"uv": [1914, 66], "uv_size": [-84, 120]},
"up": {"uv": [1830, 0], "uv_size": [84, 66]},
"down": {"uv": [1830, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "found",
"parent": "model_not_found",
"pivot": [-8, 3, 0]
},
{
"name": "f",
"parent": "found",
"pivot": [-8, 3, 0],
"cubes": [
{
"origin": [-2.699, 3.171, -0.0595],
"size": [2.394, 3.42, 0.05],
"uv": {
"north": {"uv": [540, 66], "uv_size": [84, 120]},
"south": {"uv": [624, 66], "uv_size": [-84, 120]},
"up": {"uv": [540, 0], "uv_size": [84, 66]},
"down": {"uv": [540, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "o",
"parent": "found",
"pivot": [-8, 3, 0],
"cubes": [
{
"origin": [0.037, 3.171, -0.0595],
"size": [2.394, 3.42, 0.05],
"uv": {
"north": {"uv": [1368, 66], "uv_size": [84, 120]},
"south": {"uv": [1452, 66], "uv_size": [-84, 120]},
"up": {"uv": [1368, 0], "uv_size": [84, 66]},
"down": {"uv": [1368, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "u",
"parent": "found",
"pivot": [-8, 3, 0],
"cubes": [
{
"origin": [2.773, 3.171, -0.0595],
"size": [2.394, 3.42, 0.05],
"uv": {
"north": {"uv": [1920, 66], "uv_size": [84, 120]},
"south": {"uv": [2004, 66], "uv_size": [-84, 120]},
"up": {"uv": [1920, 0], "uv_size": [84, 66]},
"down": {"uv": [1920, 186], "uv_size": [84, 66]}
}
}
]
},
{
"name": "n",
"parent": "found",
"pivot": [-8, 3, 0],
"cubes": [
{
"origin": [5.509, 3.171, -0.0595],
"size": [2.736, 3.42, 0.05],
"uv": {
"north": {"uv": [1266, 66], "uv_size": [96, 120]},
"south": {"uv": [1362, 66], "uv_size": [-96, 120]},
"up": {"uv": [1266, 0], "uv_size": [96, 66]},
"down": {"uv": [1266, 186], "uv_size": [96, 66]}
}
}
]
},
{
"name": "d",
"parent": "found",
"pivot": [-8, 3, 0],
"cubes": [
{
"origin": [8.587, 3.171, -0.0595],
"size": [2.394, 3.42, 0.05],
"uv": {
"north": {"uv": [360, 66], "uv_size": [84, 120]},
"south": {"uv": [444, 66], "uv_size": [-84, 120]},
"up": {"uv": [360, 0], "uv_size": [84, 66]},
"down": {"uv": [360, 186], "uv_size": [84, 66]}
}
}
]
}
]
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

+3 -1
View File
@@ -7,9 +7,11 @@
"compatibilityLevel": "JAVA_8",
"mixins": [
"MixinDataDisplay",
"MixinGeckoAddon"
"MixinGeckoAddon",
"TileScriptedMixin"
],
"client": [
"MixinBlockScriptedRenderer",
"MixinGeckoAddonClient"
],
"server": []