Jump to content

Recommended Posts

Posted

I want to use the TileEntityItemStackRenderer for my weapons to use java models etc so I decided to go through the Forge docs. I'm confused a bit by it because I tried to follow it but I can't understand few things:

 

1) Is my implementation correct? (Atleast a bit?)

2) Do I need to implement the baked model on the item as I do or different way?

3) From my understanding I don't need anything else than setTileEntityItemStackRenderer, isBuiltinRenderer and getOverrides methods?

 

There is what I have tried for now:

  Reveal hidden contents

 

Also I decided to use the vanilla shield model for it now since I don't have the model yet. The TEISR class is copied from vanilla.

The code doesn't crash or anything like that, it doesn't do anything at all. Maybe that's because the ItemOverrideList is null. 

Posted
  On 11/3/2018 at 7:29 PM, Toma™ said:

public class PistolP92 extends GunBase implements IBakedModel

Expand  

Why is your Item an instance of IBakedModel? That makes no sense. First of all IBakedModel is client-only while items are common, this will crash the server. Second of all items are not models.

 

  On 11/3/2018 at 7:29 PM, Toma™ said:

public ItemOverrideList getOverrides() { return null; }

Expand  

You can't return null here, you need to return ItemOverrideList.NONE.

 

  On 11/3/2018 at 7:29 PM, Toma™ said:

@Override public TextureAtlasSprite getParticleTexture() { return null; }

Expand  

You can't return null here, you need to return a particle texture of some kind. At least a TextureMap#getMissingSprite.

 

  On 11/3/2018 at 7:29 PM, Toma™ said:

@Override public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) { return null; }

Expand  

You can't return null here, return a Collections.EMPTY_LIST.

 

  On 11/3/2018 at 7:29 PM, Toma™ said:

@Override public void setTileEntityItemStackRenderer(TileEntityItemStackRenderer teisr) { teisr = new WeaponTeisr(); }

Expand  

Well, good job. For whatever reason you've overridden the setter for a TEISR. It used to set the TEISR of the item to the one passed as it's parameter. Now it sets the local teisr variable to a new WeaponTeisr. Which gets discarded immediately because that's not how java works. And even if it somehow worked this way you are not even calling this method from anywhere.

 

And you have also provided no code responsible for registering the item's model. You need to do that too.

Posted

Okay so I have reworked it a bit the teisr is now at the item, however nothing is rendering except my normal item model.

I'm pretty sure that is because the ItemOverrideList is empty. I created my own model class which extends the Shield model and implements the baked model. I'm new to all this stuff so I might be making some terrible mistake somewhere... 

 

So there's the updated code:

The item class:

  Reveal hidden contents

 

The model class:

  Reveal hidden contents

 

And also you wanted the registry code (I don't know if I need to rewrite it, but most likely I will have to since a lot of the code is old and I was following some registry tutorials for this)

  Reveal hidden contents

 

Posted
  On 11/3/2018 at 9:01 PM, Toma™ said:

public class ModelP92 extends ModelShield implements IBakedModel

Expand  

This makes no sense. ModelShield is a BipedModel which has nothing to do with baked models. You don't even need to extend ModelShield here at all.

 

  On 11/3/2018 at 9:01 PM, Toma™ said:

I'm pretty sure that is because the ItemOverrideList is empty.

Expand  

First of all the ItemOverrideList has nothing to do with a TEISR. Second of all most models have empty ItemOverrideLists and work just fine.

 

  On 11/3/2018 at 9:01 PM, Toma™ said:

this.setTileEntityItemStackRenderer(new WeaponTeisr());

Expand  

You can't do this in the item's constructor because this method is client-side only. It will crash the server.

 

  On 11/3/2018 at 9:01 PM, Toma™ said:

also you wanted the registry code

Expand  

No I didn't. 

  On 11/3/2018 at 8:17 PM, V0idWa1k3r said:

you have also provided no code responsible for registering the item's model. You need to do that too.

Expand  

I told you that you need to register your IBakedModel as the item's new model using either a custom ICustomModelLoader implementation or a ModelBakeEvent. But now when I see your registry...

 

  On 11/3/2018 at 9:01 PM, Toma™ said:

event.getRegistry().registerAll(PMCItems.ITEMS.toArray(new Item[0]));

Expand  

Don't ever use static initializers. Instantinate your things directly in the registry event.

 

  On 11/3/2018 at 9:01 PM, Toma™ said:

if(item instanceof IModItem) { ((IModItem)item).registerModels(); }

Expand  

IHasModel is stupid and yes, this is a renamed IHasModel. All items need models, no exception and nothing about model registration requires access to private/protected data of the item. Register your models in the ModelRegistryEvent directly.

Posted

Okay, thanks for your time, I see I have lot of pretty stupid code here. 

One last question regarding setting the teisr. When or where am I supposed to set it? 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Same issue without the mod batsgalore?
    • so i am making a modpack for some friends and myself and everything was good until i tried to figure out shaders and was trying to download java 17 and it just got to confusing so i gave up and was going to wait for one of my friends that has history of messing with shaders as i dont and i went back to curse forge and started my modpack up to keep working on other things like the quest line im making and now im getting this error pop up right before it says "ERROR DURING MOD LOADING"it closes back into the Laucher and gives this error code     https://paste.ee/d/WkxbmvcX  
    • Add crash-reports with sites like https://mclo.gs/ Make a test without any mods - just Forge If this works, add the mods in groups   Or use a pre-configured modpack as working base and add new mods one by one
    • Groovy Mod Loader Balanced Flight Ring Ferritcore immediatelyfast modernfix Supplementaries (by MehVahdJukaar) MrCrayfish's Furniture Mod: Refurbished (by MrCrayfish) Essential Mod (by SparkUniverse_) Create: Power Loader (by Lysine) Create: Estrogen (by Mayaqq) MrCrayfish's Furniture Mod (Legacy) (by MrCrayfish) Another Furniture (by Starfish_Studios) Create Slice & Dice (by possible_triangle) Create Big Cannons (by rbasamoyai) Curios API (Forge/NeoForge) (by TheIllusiveC4) Towns and Towers (by Biban_Auriu) Biomes O' Plenty (by Forstride) Mekanism Tools (by bradyaidanc) FramedBlocks (by XFactHD) EMI Trades (Villager Trading EMI Plugin) (by fzzyhmstrs) Just Enough Effect Descriptions (JEED) (by MehVahdJukaar) EMI Ores (by Abbie34) EMI Loot (by fzzyhmstrs) YUNG's Menu Tweaks (Forge) (by YUNGNICKYOUNG) ReForgedPlay [replay mod on (neo)forge] (by Ferri_Arnus) Framework (by MrCrayfish) Create : New Furnitures (by arginou57) SuperMartijn642's Core Lib (by SuperMartijn642) Create: Interiors (by syslev) Cristel Lib (by Cristelknight) Entity Culling Fabric/Forge (by tr7zw) Create Chunkloading (by embeddedt) Create Deco (by talrey) Traveler's Backpack (by Tiviacz1337) Create: The Factory Must Grow (by Dr_Mango_Tea) Valkyrien Skies (Forge/Fabric) (by triode_) Mouse Tweaks (by YaLTeR) AddonsLib (by Samlegamer_) GeckoLib (by Gecko) Eureka! Ships! for Valkyrien Skies (Forge/Fabric) (by rubydesic) GraveStone Mod (by henkelmax) Storage Drawers (by Texelsaur) Create Central Kitchen (by DragonsPlus) Roughly Enough Resources (by theorbagain) Ad Astra Extra (by NotTouchedGrass) Immersive Engineering (by BluSunrize) AppleSkin (by squeek502) Create Crafts & Additions (by MRHminer) EMI (by EmilyPloszaj) Create: Balanced Flight (Angel Ring) (by Txni) Mekanism (by bradyaidanc) Create Sifting (by oierbravo_mc) FTB Ultimine (Forge) (by FTB) Create Railways Navigator (by MrJulsen) Just Enough Professions (JEP) (by Mrbysco) Motschen's Better Leaves (by Motschen) Tom's Simple Storage Mod (by tom54541) Carry On (by Tschipp) SuperMartijn642's Config Lib (by SuperMartijn642) Create Sabers (by Leroidesafk) Architectury API (by shedaniel) Create: Connected (by Lysine) Quark (by Vazkii) Just Enough Mekanism Multiblocks (by gisellevonbingen) Roughly Enough Professions (REP) (by Mrbysco) Quark Oddities (by Vazkii) Oculus (by Asek3) Macaw's Paths and Pavings (by sketch_macaw) FTB Quests (Forge) (by FTB) Midnighttigger's Default Connected Textures (by Midnighttigger) Just Enough Resources (JER) (by way2muchnoise) TerraBlender (Forge) (by TheAdubbz) Jade Addons (Neo/Forge) (by Snownee) Create: Copycats+ (by Lysine) Midnighttigger's Default Connected Textures Addons (by Midnighttigger) Chipped (by terrariumearth) Macaw's Stairs (by sketch_macaw) Immersive UI (by SSKirillSS) Fzzy Config (by fzzyhmstrs) Petrolpark Library (by Petrolpark) CreativeCore (by CreativeMD) EMIffect (Status Effects EMI Plugin) (by fzzyhmstrs) M.R.U (by IMB11) Xaero's World Map (by xaero96) Applied Energistics 2 (by thetechnici4n) Farmer's Delight (by vectorwing) YUNG's Better Jungle Temples (Forge) (by YUNGNICKYOUNG) Macaw's Doors (by sketch_macaw) Moderately Enough Effect Descriptions (MEED) (by NeonCranberries) Fusion (Connected Textures) (by SuperMartijn642) Dynamic Trees (by MaxHyper) [ARCHIVED] Create: Design n' Decor (by MilkyFur) Cosmic Horizons (by Cosmic_Horizons_or_DEATH_or_Manya) Nosiphus Furniture Mod (by Nosiphus) Just Enough Items (JEI) (by mezz) Zeta (by Vazkii) Skin Layers 3D (Fabric/Forge) (by tr7zw) Create (by simibubi) Create Jetpack (by possible_triangle) Not Enough Recipe Book [NERB] (by SSKirillSS) Immersive Paintings [Fabric/Forge] (by Conczin) Macaw's Lights and Lamps (by sketch_macaw) Ad Astra: Giselle Addon (by gisellevonbingen) Immersive Aircraft [Fabric/Forge] (by Conczin) FTB Teams (Forge) (by FTB) Ad Astra (by AlexNijjar) Athena (by CodexAdrian) AmbientSounds 6 (by CreativeMD) Distant Horizons: A Level of Detail mod (by James_Seibel) ModernFix (by embeddedt) Macaw's Quark (by Samlegamer_) Falling Leaves (NeoForge/Forge) (by Cheaterpaul) [ETF] Entity Texture Features - [Fabric & Forge] (by Traben) YUNG's Extras (Forge) (by YUNGNICKYOUNG) EMI: Create Schematics (by LiukRast) Ad Astra: Rocketed (by celsiusqc) Macaw's Holidays (by sketch_macaw) Destroy (by Petrolpark) Create: Broken Bad (by jetpacker06) Balm (by BlayTheNinth) Complementary Shaders - Reimagined (by EminGT) YUNG's Better Desert Temples (Forge) (by YUNGNICKYOUNG) Petrol's Parts (Create add-on) (by Petrolpark) Grappling Hook Mod (by yyonne) Create Questing (by ElocinDev) Nature's Compass (by Chaosyr) YUNG's Better Dungeons (Forge) (by YUNGNICKYOUNG) EMI Enchanting (by fzzyhmstrs) Macaw's Furniture (by sketch_macaw) Resourceful Config (by ThatGravyBoat) Sophisticated Backpacks (by P3pp3rF1y) Rechiseled: Create (by SuperMartijn642) Cloth Config API (Fabric/Forge/NeoForge) (by shedaniel) Searchables (by Jaredlll08) Paladin's Furniture (by UnlikePaladin) Enchantment Descriptions (by DarkhaxDev) Waystones (by BlayTheNinth) Immersive Melodies [Fabric/Forge] (by Conczin) Sound Physics Remastered (by henkelmax) Jade 🔍 (by Snownee) YUNG's Better Mineshafts (Forge) (by YUNGNICKYOUNG) Create: Bells & Whistles (by syslev) Complementary Shaders - Unbound (by EminGT) GroovyModLoader (GML) (by matyrobbrt) Moonlight Lib (by MehVahdJukaar) Simple Planes (Forge) (by przemykomo) GlitchCore (by TheAdubbz) Sounds (by IMB11) Sophisticated Core (by P3pp3rF1y) Simple Voice Chat (by henkelmax) Macaw's Fences and Walls (by sketch_macaw) YUNG's Better Witch Huts (Forge) (by YUNGNICKYOUNG) Creeper Overhaul (by joosh_7889) Mantle (by mDiyo) Macaw's Trapdoors (by sketch_macaw) Clumps (by Jaredlll08) YUNG's Better Ocean Monuments (Forge) (by YUNGNICKYOUNG) Freecam (by hashalite) YUNG's API (Forge) (by YUNGNICKYOUNG) Create Stuff & Additions (by Furti_Two) Controlling (by Jaredlll08) Fresh Animations Extensions (by FreshLX) Macaw's Bridges (by sketch_macaw) [EMF] Entity Model Features [Fabric & Forge] (by Traben) Xaero's Minimap (by xaero96) Create: New Age (by nullBlade) Mekanism Generators (by bradyaidanc) YUNG's Bridges (Forge) (by YUNGNICKYOUNG) Create: Dynamic Village (by syslev) ImmediatelyFast (by RaphiMC) Supplementaries Squared (by plantspookable) Create Ore Excavation (by tom54541) Macaw's Biomes O' Plenty (by Samlegamer_) Fancy Crops (by bebebea_loste) YUNG's Better Nether Fortresses (Forge) (by YUNGNICKYOUNG) OctoLib (by SSKirillSS) Clockwork: Create x Valkyrien Skies (by rubydesic) Fresh Animations (by FreshLX) BSL Shaders (by capttatsu) Not Enough Crashes (Forge) (by NatanFudge) Guard Villagers (by almightytallestred) Create: Numismatics (by IThundxr) FerriteCore ((Neo)Forge) (by malte0811) Kotlin for Forge (by thedarkcolour) YUNG's Cave Biomes (Forge) (by YUNGNICKYOUNG) Do a Barrel Roll (by enjarai) [DISCONTINUED] Macaw's Fences - Biomes O' Plenty (by Samlegamer_) Create Recycle Everything (by nocubeyt) Eating Animation [Neo/Forge] (by matyrobbrt) Roughly Enough Items Fabric/Forge/NeoForge (REI) (by shedaniel) YUNG's Better End Island (Forge) (by YUNGNICKYOUNG) Create: Steam 'n' Rails (by IThundxr) [DISCONTINUED] Macaw's Furnitures - Biomes O' Plenty (by Samlegamer_) Amendments (by plantspookable) Botarium (by CodexAdrian) YUNG's Better Strongholds (Forge) (by YUNGNICKYOUNG) Tinkers Construct (by mDiyo) Macaw's Paintings (by sketch_macaw) Create Enchantment Industry (by DragonsPlus) EMI Enchants (by mephodio) FTB Library (Forge) (by FTB) Xaero's Minimap & World Map - Waystones Compatibility [Forge] (by ArcaneAlloy) MakeUp - Ultra Fast | Shaders (by XavierFST) Create Confectionery (by Furti_Two) Create : Creating Space (by RealAntEngineer) Macaw's Roofs (by sketch_macaw) Bookshelf (by DarkhaxDev) Resourceful Lib (by ThatGravyBoat) Rechiseled (by SuperMartijn642) Macaw's Windows (by sketch_macaw) AutoRegLib (by Vazkii)  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.