RANKSHANK
Members-
Posts
305 -
Joined
-
Last visited
Everything posted by RANKSHANK
-
Hello all, I've been writing up a PR for 2 @Cancelable Events that are fired when the glint effect is rendered onto an ItemStack/ over the armor layer, respectively, and I'm looking for some suggestions for adding things to the events before finalizing and submitting. Currently it passes: Both int glintValue : The integer that represents the color. This is formatted in aaaarrrrggggbbbb in the RenderItem#renderEffect, and I've translated this to the LayerArmorBase's equivalent function ItemStack theStack : The ItemStack getting rendered (ItemArmor for the armor) ItemStacks IBakedModel theModel : The itemstack's baked model Armor ModelBase theModel : The armor's ModelBase int armorSlot : The slot that the armor is in I've also added methods into Forge section of the Item class public int getItemGlintColor(ItemStack stack): returns int value for the itemstack glint public int getArmorGlintColor(ItemStack stack, int armorSlot): returns int value for the armor glint Being cancelable you can cancel rendering the vanilla effect entirely, and with the models past to you, you can render your own overlays onto the model (ie instead have a fire effect on fire enchanted weapons). The glintValue in the event is also used so that you can manipulate the colors in the event if you desire. Working example of using event to change potion item & boot armor to a red glint: https://www.dropbox.com/s/24tenlcwhmqsgyd/Screenshot%202016-02-08%2020.33.53.png?dl=1[/img] Patched Classes
-
The over switching thing is more of an efficiency thing especially if you're rendering a few of these things, and readabilitywise the code boxes on here only go so far haha. Much easier to read through on git(my code gets to be an eyesore at points) That said could you add a temporary check to make sure it's not a world error @Override public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { int meta = world.getBlockMetadata(x, y, z); TileEntity te = world.getTileEntity(x, y, z); if(meta==12) System.out.println(te.getClass() + '@' + x +',' + y + ',' + z ); Sometimes you can change a value and corrupt your test world's save data and it looks like an error on your end
-
Why allocate it to a variable as opposed to return icons[((TileEntityFissionController)te).formed ? (((TileEntityFissionController)te).active ? 3 : 2) : 1]; And don't run unnecessary switches. case 15: switch (side){ return icons[9][side != 4 ? 0 : (TileEntityFissionPort)te).input ? 1 : 2; ]; break; } Aside from that it's tough reading through the switch web you have there... Do you have a git or anything easier on the eyes?
-
[1.8]how would I run a command with my mod
RANKSHANK replied to BoonieQuafter-CrAfTeR's topic in Modder Support
1) Cut a hole in the box 2) Put your BoonieQuafter-CrAfTeR in that box 3) Make her open the box And that's the way you do it -
[1.8.8/1.8.9] Help with Forge blockstate transforms
RANKSHANK replied to Choonster's topic in Modder Support
I'm not 100% sure if this will apply to your scenario but I've got an ISmartItemModel that feeds from a blockstate file and I point it to a model file instead of a texture. It got rid of the wonky translations I had previously. -
Yes you'd handle it similarly to how fence textures link together.
-
Nope you should be perfectly fine rendering a standard block with just an extended block state and your ISmartBlockModel cache
-
Sorry about the delay. I'm actually familiarizing myself to the whole process atm so I can't provide a step by step tutorial. However good references would be TGG's MinecraftByExample Git and also his outline of the model pipeling I can say from what I've done you'll likely want to grab the tank model itself and the cache its list of quads, as well as adding quads baked with the corresponding fluid textures. I've done this with items using a similar approach to the DynBucket, but instead 'rebaking' the original bottle model so that I end up with a Map of fluid names > baked models with the fluid textures included. It's not a difficult process it's just learning the new methodology.
-
No you need a mod instance @Instance Public YourMod instance; Forge will populate that for you so don't instantiate it. Use that instead of EntityRegistry.instance();
-
Is your @mod the EntityRegistry? Because you need to be using the @Instance instance of your @Mod class that forge populates for you
-
You won't be using WorldRenderer/Tessellator with this method, you'll be using BakedQuads that you assign liquid textures. This means you'll have pre baked models per level of liquid per liquid cached.
-
Yuppers, it applies the texture atlas to a specific set of quads.
-
Mods get their own Entity ID sets. start at 0 and count up like it says. you don't need to initialize anything for the registry calls
-
[1.8.9] [SOLVED] Registering a new mob entity?
RANKSHANK replied to DragonessAtHeart's topic in Modder Support
It's actually not too bad, the error handling just gunks it up a bit Basically I'm working off the principle that all of my renderers are in rankshank/pikmine/client/render/entity/ and follow the naming format Render{EntityName}.class, their corresponding entity classes just need to follow the naming format Entity{EntityName}.class. Using the known package and transforming the Entity prefix to the Render prefix, I then have a string handle for my Render class. Then using that string handle I query the ClassLoader for the class object which I then create and instance of it using the Render(RenderManager) constructor, which is a consistent constructor throughout my render classes. I then use that as the return value of my RenderFactory which registers the renderer. It all runs off the expectation that I'll continue to follow the same format. I may have to switch to using hard coded strings so that I can subpackage my render folder. -
[1.8.9] [SOLVED] Registering a new mob entity?
RANKSHANK replied to DragonessAtHeart's topic in Modder Support
Well I am pretty lazy with my registry so I literally dump all my classes through a Proxy method: @Override public void sidedEntityRegistry(Class<? extends Entity> c){ try { final Class cc = (Class<? extends Render>) c.getClassLoader().loadClass("rankshank/pikmine/client/render/entity/" + c.getName().substring(c.getName().lastIndexOf("Entity")).replace("Entity", "Render")); RenderingRegistry.registerEntityRenderingHandler(c, new IRenderFactory<Entity>(){ @Override public Render createRenderFor(RenderManager rm) { try { return (Render) cc.getConstructor(RenderManager.class).newInstance(rm); } catch(Exception e){ e.printStackTrace(); return null;}}}); } catch (Exception e) { e.printStackTrace(); } } Works a treat though since I follow a set naming standard. You can just do direct class references if iteration is too 'scary' -
[1.8.9] [SOLVED] Registering a new mob entity?
RANKSHANK replied to DragonessAtHeart's topic in Modder Support
It's literally an interface to return a RenderEntity instance. Just allows the rendermanager to be passed to each entity renderer -
[1.8.9] Keep an item in the inventory on player death [Solved]
RANKSHANK replied to Darkmainiac's topic in Modder Support
Using events listen for the player's death so that you can store a copy of the stack, and then when the player respawns (event) give them the itemstack -
Take a look at Forge's DynBucket. Pre-baking the tanks with the various fluids and levels would be comparably quite efficient.
-
[1.8] Drawing enchantment glint over a regular quad
RANKSHANK replied to TheNuclearDuck's topic in Modder Support
[/img] Got this from snagging RenderItem.renderEffect(IBakedModel) and replacing model rendering with Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0,0,0,0,scaledWidth, scaledHeight); and it worked fine as far as speed and such goes.... So comparing against this and looking at your code I *think* I see the culprit: this.drawTexturedGlintRect(left + this.left, this.top, (int) uv.x, (int) uv.y, 5, 9); your UV is set to a specific slot... try forcing it to use the full Glint texture instead of a portion of it. -
Sounds like dead AI to me... You're going to need to write your entity wrapper to either take over logic or feed updates to the contained entity...
-
I'm not even 100% sure what you're trying to access here... Though from what I see I'm guessing you'll want to look into the RenderPlayerEvent
-
Not near my IDE atm but I'm pretty sure the Stitcher class has nested classes Holder and Slot which backs this as an example of packaging neatness
-
GlStateManager.translate(x, y, z); renderModel(t, t.getWorld, t.getPos.getX, t.getPos.getY, t.getPos.getZ, TKBlocks.fountain); Why are you translating if you've got the location sent to your draw method...?
-
you'll want to unset the isDead flag (dunno the exact boolean for it) on the client side when you deserialize the entity
-
[1.8] Drawing enchantment glint over a regular quad
RANKSHANK replied to TheNuclearDuck's topic in Modder Support
I couldn't tell you with certainty, but if you're seeing the artifacts of the texture then it's likely a uv scaling/ timing issue... do you mind showing where/how you're invoking this?