-
Posts
105 -
Joined
-
Last visited
Everything posted by Socratic_Phoenix
-
I've been doing some research into how to get items to have colors and to be dyeable - like leather armor (though I'm not making armor, just an item). I've discovered ItemColors, but my attempts to register a handler don't appear to be working, so I've got some questions: When should I register the color? preinit? init? Is there a registry event for it? How do I format the texture to get the color to apply, and are there any properties I need to add to the item class? I know that it will only affect layer0, but is there anything else I need to know? Thanks for any help provided! Registering like so at the moment (mod is in pre-testing phase; will be moved to proxy eventually, don't worry): @Mod.EventHandler @SideOnly(Side.CLIENT) public void onPreInit(FMLPreInitializationEvent ev) { Minecraft.getMinecraft().getItemColors().registerItemColorHandler((stack, tintIndex) -> { return Color.BLUE.getRGB(); }, BagItems.arcaneBag, BagItems.infiniteBag); }
-
[1.11.2] Armor action when hit
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
Thanks, that's exactly what I was looking for! -
[1.11.2] Armor action when hit
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
No, its not... My problem is that: a. Night vision with <= 200 ticks remaining flashes (I do not want flashing while the armor is on) b. I do not want the armor to leave 10 seconds of effect when removed c. There appears to be no way to detect if the armor has been de-equipped I don't think it's possible to use the armor update method to do these things... I can easily add night vision with enough ticks, but I cannot then remove it if the armor has been removed... -
[1.11.2] Armor action when hit
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
I think I'll just use LivingUpdateEvent... -
[1.11.2] Armor action when hit
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
Since night vision flashes at any seconds <= 10, or any ticks <= 200, the potion effect will persist for at least 10 seconds, or 200 ticks... that's the problem I'm having; I don't really want the effect to last at all when the armor is off... -
[1.11.2] Armor action when hit
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
So what I'm trying to do is give armor potion effects, when worn it will give positive effects and when an enemy hits it, the enemy gets negative effects. The LivingHurtEvent works for an enemy hitting someone with the armor, but I need to get the passive good effects working. They are properly applied, but I apply that at 20 seconds, because otherwise night vision would flash like crazy, so I need to then remove the effects once the armor is taken off. -
[1.11.2] Armor action when hit
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
Thanks, its working now! But I do have another question: Is there anyway to detect when the player/an entity stops wearing the armor? Like a "de equip" event or something? -
So basically I'm trying to do <something> to a living entity whenever it hits another entity with some special armor. Is the only way to do this through LivingHurtEvent? If so, how do I get the entity that is doing the attacking/hurting? I know I can get it from the damage source, but what if its an arrow? I'd need the shooter of the arrow... Is there a method in DamageSource to get that entity (is it DamageSource#getEntity?)? Thanks for any help provided!
-
Thank you, that works!
-
So I'm currently using the following to render an item: public void renderItem(ItemStack stack, int x, int y) { this.zLevel = 100.0F; this.itemRender.zLevel = 100.0F; GlStateManager.disableLighting(); GlStateManager.enableDepth(); this.getItem().renderItemAndEffectIntoGUI(this.mc.player, stack, x, y); this.getItem().renderItemOverlayIntoGUI(this.getFont(), stack, x, y, this.det(stack)); this.itemRender.zLevel = 0.0F; this.zLevel = 0.0F; } private String det(ItemStack stack) { return stack.getCount() == 1 ? "" : String.valueOf(stack.getCount()); } Although items render fine, Blocks appear to render much darker. See below for an example. Does anyone know how to fix this? (the method is based on GuiContainer's drawSlot method, and getItem returns the ItemRender) (Note that, although the gui appears to be have an inventory, it is in fact client-side only and does not have a connected inventory/container, nor can the items be clicked or hovered over, as such, I am using GUIScreen, not GUIContainer).
-
So there's this method in GUIScreen, drawScreen, that I'm using to draw my gui: public void drawScreen(int mouseX, int mouseY, float partialTicks) I'm trying to figure out how to have an animated screen that draws an fills in an arrow across the screen, like the furnace gui (though my gui is not a furnace, nor does it have a connected inventory or tile entity). So my question is, what exactly is partialTicks? Is it ticks since the previous drawScreen? Ticks since the opening of the gui? Or something else entirely? Thanks for any help provided!
-
I'd like to preface this by saying that I have no understanding of Minecraft's model system. All I know is I copy the .json files from minecraft, change some textures, and it works. Doing that has become a problem, as my mod adds 300 new materials, each with their various own recipes. Each item from the set of 300 has the same model, all pickaxes are the same, all axes are the same, etc., but the textures are different. Currently, I'm using a custom resource pack to provide the models, as .json files, but minecraft still has to load 5000+ models, from jsons, and despite them being small and simple, it is a strain on the game. Therefore, I was wondering if there was any way to customize the model for an item (or block). Ideally I would create 1 model, and change the texture depending on which item its modelling... is something like this possible? How do I do custom models for items anyway? Thanks for any responses.
-
[1.11.2] Getting A Changeable Resource
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
Yes; your code is indeed correct. The problem was that the program I was using to generate the .zip file (one I wrote myself, actually), was formatting the file in such a way that, although it could be read by the windows zip utility, it couldn't be read by minecraft... What a convoluted problem... thanks for the help everyone! -
[1.11.2] Getting A Changeable Resource
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
What do you mean by this? All of my ResourceLocations are paths to single files. I have tried using both getAllResources and getResource, neither of which appear to work. Furthermore, getAllResources does not appear to return all versions of the resources, according to my debugging. I will do additional debugging, but this is still unsolved -
[1.11.2] Getting A Changeable Resource
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
Yes, it was formatted exactly the same as my resources in the .jar (assets/id/whatevs), and those resources are still properly accessed... -
[1.11.2] Getting A Changeable Resource
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
But I tried that and it didn't work... -
I'm trying to add a custom resource which can be changed by resource packs. I am having trouble accessing this resource. How would I go about this? I really have no idea, at the moment, I'm doing this: public static IResource getResource(ResourceLocation location) throws IOException { IResourceManager manager = Minecraft.getMinecraft().getResourceManager(); List<IResource> resources = manager.getAllResources(location); return resources.get(resources.size() - 1); } Which, from what I can tell, should maybe work (but it's not), but I feel like there must be a better way to do this... Any help is appreciated...
-
[1.11.2] Prevent player timeout
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
From what I gather, the server and client send heartbeat packets (a packet every x seconds) to eachother to confirm a connection. If the client is preoccupied though, like if it's loading a new texture pack, the client could be timed out because it can't respond/send heartbeat packets. I want to find a way to prevent the disconnect. -
So... I haven't actually tried anything yet, as I want to verify that this is possible. So basically, is there any way to prevent a player from being kicked due to timeout. Can a disconnect event of this nature be cancelled? Is a disconnect event even fired?
-
Okay so this makes a ton of sense.... I had the textures named wrong... so it caused a cyclic model error, obviously. Anyway, it's fixed now... somehow
-
That's the entire stacktrace... after that it goes: 21:53:47] [Client thread/INFO] [FML]: Max texture size: 8192 [21:53:51] [Client thread/INFO]: Created: 4096x2048 textures-atlas [21:54:05] [Client thread/WARN]: Skipping bad option: lastServer: There's no caused-by clause either... If you want to try and delve through the log a bit more, here it is: https://gist.githubusercontent.com/SocraticPhoenix/fad2e2450d9f564763d7ad33e10b7d62/raw/d325a25a9d838d0f85947b0d00a6288ad6f8e90f/LogOfDoom.txt But I don't think anything helpful is in there.
-
https://gist.github.com/SocraticPhoenix/2a1a529eacd6f8e159d408a4e80210b2 (it's linked in the "this" in the main post) If you need more, I'll post more, I just was hesitant to post my entire log, since it contains 300 errors.... (There are 300 bow models)
-
So I'm attempting to implement a bow that has a wonderful animated texture, like any normal bow should, and I'm encountering this error. I've seen some other posts, (by which I mean exactly one post, for 1.9, by a certain @NovaViper), and the solutions they've found are not working for me... I am only registering one model, the main bow model. Below are my bow, pulling_0, pulling_1 and pulling_2 jsons, respectively: { "parent": "item/generated", "textures": { "layer0": "randores:items/randores.items.bow.0_standby" }, "display": { "thirdperson_righthand": { "rotation": [ -80, 260, -40 ], "translation": [ -1, -2, 2.5 ], "scale": [ 0.9, 0.9, 0.9 ] }, "thirdperson_lefthand": { "rotation": [ -80, -280, 40 ], "translation": [ -1, -2, 2.5 ], "scale": [ 0.9, 0.9, 0.9 ] }, "firstperson_righthand": { "rotation": [ 0, -90, 25 ], "translation": [ 1.13, 3.2, 1.13], "scale": [ 0.68, 0.68, 0.68 ] }, "firstperson_lefthand": { "rotation": [ 0, 90, -25 ], "translation": [ 1.13, 3.2, 1.13], "scale": [ 0.68, 0.68, 0.68 ] } }, "overrides": [ { "predicate": { "pulling": 1 }, "model": "randores:item/randores.items.bow.0_pulling_0" }, { "predicate": { "pulling": 1, "pull": 0.65 }, "model": "randores:item/randores.items.bow.0_pulling_1" }, { "predicate": { "pulling": 1, "pull": 0.9 }, "model": "randores:item/randores.items.bow.0_pulling_2" } ] } { "parent": "randores:item/randores.items.bow.0", "textures": { "layer0": "randores:items/randores.items.bow.0_pulling_0" } } { "parent": "randores:item/randores.items.bow.0", "textures": { "layer0": "randores:items/randores.items.bow.0_pulling_1" } } { "parent": "randores:item/randores.items.bow.0", "textures": { "layer0": "randores:items/randores.items.bow.0_pulling_2" } } I am doing some funky stuff with models, by which I mean I am generating them on the fly. The bulk of that logic can be seen here, but I don't think that's the problem. Furthermore, through debugging and lovely, lovely breakpoints, I have determined that the error progress like so: Attempt to load item/randores.item.bow.0.json Attempt to load item/randores.item.bow.0_pulling_X.json Attempt to load item/randores.item.bow.0.json Error thrown This is obviously because the standby bow model refers the the pulling model as an override, which refers to the standby bow model as the parent, and I get that that's the error. However, the above models are copied exactly from vanilla, so clearly I missing some way they're registered or something. Any help is appreciated!
-
[1.11.2] Blacklisting ingredients in JEI recipes
Socratic_Phoenix replied to Socratic_Phoenix's topic in Modder Support
Well that sucks.... perhaps I'll open an issue. -
Simple question, but I have yet to find the answer: I am attempting to add comparability with JEI to my mod, but I've come across a problem. I am unable to blacklist items from showing up in recipes, and, since my mod adds items which are obtainable depending on the world seed, this represents a significant problem. I need to blacklist the unobtainable items from the recipes. I am able to remove them from the ingredients list on the side of the inventory, but I am unable to remove them from recipes. Specifically, I want to remove these unobtainable items from the OreDictionary-compatible recipes, as the only reason one of the items is showing up is because it is registered as a "woodStick." Any help is appreciated!