SHsuperCM
Members-
Posts
264 -
Joined
-
Last visited
-
Days Won
1
Everything posted by SHsuperCM
-
the block is from an for loop that i do to register: for(MTFBlock block : MTFBlock.values()){ and it loops through an enum that stores Blocks im creating and sets registryName and unlocalizedName to them.. i have the same thing but for items as well and it seems to simplify a whole bunch when adding items and blocks.. its set to register the items on a loop and register renders on a loop(of course processed only with the clientside)... thanks anyways guys!
-
Soooo... to everyone that want to know how idiot can a person be(btw its me) i just took a quick look at the Deprecated registerBlock and i think i actually found what i need.... @Deprecated public static Block registerBlock(Block block) { register(block); register(new ItemBlock(block).setRegistryName(block.getRegistryName())); return block; } and from my understanding its just doing what i want it to do and, well, its open source.. soo.. i can just use that... im sorry but im still not understanding the IForgeRegistryEntry and i think without the proxies i wouldnt even know what an interface is, im really new to all this.. can i get a confirmation that it is safe to use this: //block.modBlock.getBaseBlock() is returning a Block object.. GameRegistry.register(block.modBlock.getBaseBlock()); GameRegistry.register(new ItemBlock(block.modBlock.getBaseBlock()).setRegistryName(block.getModBlock().getBaseBlock().getRegistryName()));
-
thanks alot for the fast response but can someone please give a dumber working example that i would understand? me' brain iz stuck on that IForgeRegistryEntry or whatever...
-
Currently after a whole day of setting my new mod(2nd;but 1st was clientside mod) i finally managed to make a block exist in my mod; but, to register im using: GameRegistry.registerBlock(Block) and it seems that this method is deprecated which my understanding of deprecated is that this is not suppost to be in forge and it will get deleted eventually.... so, how can i register it without this method?
-
why wont you just take a look at the jump boost effect? that's what i would do if i needed that.... that's why the forge source is there isnt it?
-
Are there any humangos problems with coding in 1.10/1.10.2? Are there any bugs that cant be fixed that i should know before i start my mod? because this is an HUGE mod that i planned for a while and i dont want to run into errors midway...
-
[1.9.4][ClientMod] Problem with rendering strings
SHsuperCM replied to SHsuperCM's topic in Modder Support
this is another part of the GuiScreen extension and i did not put what it refered to because i wasn't focusing on that. thanks very much for letting me know, i wasn't aware that init is happening when i do that, i was thinking that init happend only once and thats why i did not think of clearing the list which seems to solve it, i knew i did something really dumb... i know that i could go without this. to do stuff with what im extending from but when i look at it, its a bit easier to understand for example, buttonList that belongs to this gui... and i know that i could clear alot of my mod with that kind of stuff but its not hurting anybody and i as the coder of this like to look at it like that..... thanks anyways... -
when i render my strings from a resource and resize the window it writes it all again in a diffrent location and keeps the lines from before as well... im probably missing something really really stupid... Part of code: public abstract class InfoGuiScreenMod extends GuiScreen { private static int lineHeight = 0; protected abstract String GetInfo(); protected abstract Object GetReturn(); private List<String> lines = new ArrayList<String>(); public void drawScreen(int mouseX, int mouseY, float f) { drawDefaultBackground(); GL11.glColor4f(1F, 1F, 0F, 1F); /// drawCenteredString(mc.fontRendererObj, "ElytraMC Enhancer Mod", width / 2, 30, 0xFF6600); drawCenteredString(mc.fontRendererObj, "by SHsuperCM", width / 2, 40, 0xFF6600); drawCenteredString(mc.fontRendererObj, "Info", width / 2, 60, 0xffffffff); /// lineHeight = 0; for(String strLine : lines){ drawCenteredString(fontRendererObj,strLine,width/2,75+(lineHeight*10),0xffffffff); lineHeight++; } /// super.drawScreen(mouseX, mouseY, f); DrawTooltipScreen(mouseX, mouseY); } public void initGui(){ this.buttonList.add(new GuiButton(200,width / 2 - 100,height - 30,"Back")); try { BufferedReader br = new BufferedReader(new InputStreamReader(mc.getResourceManager().getResource(new ResourceLocation(Reference.MOD_ID, "Info/" + GetInfo() + ".guiInfo")).getInputStream())); String strLine; while ((strLine = br.readLine()) != null){ lines.add(strLine); } }catch(Exception e){ e.printStackTrace(); } } } and i was also thinking that there is something to do with the onResize method that GuiScreen adds.. but i dont know what im doing wrong...
-
You cannot. It is not a file, it is an entry in a jar file. If you want it to be modifiable through a ResourcePack use Minecraft's resource manager loading system. Otherwise Class#getResource / Class#getResourceAsStream are your friends. so anything i want to access needs to be in the resources? i just need to add this file to another location within the resources.. i was hoping this file would be Fixed with no way to change it but i guess its ok inside the resources where its changable... btw can you explain the dumb ppl way how can i access the Class#getResourceAsStream because the # really confuses me....
-
[SOLVED] [ClientSide] How to make the player send command to chat
SHsuperCM replied to SHsuperCM's topic in Modder Support
they need a button that makes the topic solved.. or im just dumb and didnt see it? -
ok i understood it already.. i changed it to Integer.signum
-
oh these ones.. where do i use them? i just changed math to integer im dont think im using floats or doubles anywhere, am i?
-
oh oops.. tnx for letting me know... and what u mean by floating point?
-
so looked around java a bit online and realised how simple it is.. i just never used it... it compacted the code way more.. public void handleMouseInput() throws IOException{super.handleMouseInput(); recordsScroll += Math.signum(Mouse.getEventDWheel()); //note to self(signum returns +1 for positive numbers and -1 for negative numbers, 0 for 0..) }
-
just telling which side of the plate the number is? that's it? i wonder why mojang didnt use this.. in the source code it does then exactly what signum does..
-
ye i was going to make it go faster anyway.. i just took the base but wowowowow signum? wth is signum? i never even heard a word that is looking like this word.. i think i like the normal code instead, where its more spread out on the method.. so later when i look at it i know what it does easly... actually i do know signalum(http://ftbwiki.org/Signalum_Ingot) and it looks a bit like signum? rig;right? right?
-
Is there a way to edit Gui while game is open?
SHsuperCM replied to SHsuperCM's topic in Modder Support
i cant "like" a post, so ill just give a thank you.. -
thanks so much.. modified a bit the handleMouseInput from the GuiChat class. why didnt i think of looking at that i dont know.... public void handleMouseInput() throws IOException { super.handleMouseInput(); int i = Mouse.getEventDWheel(); if (i != 0) { if (i > 1) { i = 1; } if (i < -1) { i = -1; } recordsScroll += i; } } ill tweak it a bit more after that to limit and such...
-
yet again.. with my mod.... i now have a GUI that has a list of strings that i want to scroll around it.. the thing i need is something like: if(scroll up){ int -= 1 } and if(scroll down){ int += 1 }
-
Is there a way to edit Gui while game is open?
SHsuperCM replied to SHsuperCM's topic in Modder Support
Don't start an argument on whether idea is better than eclipse and vice versa. im assuming it happend to you or you saw it before? it really sounds like a bad idea now that i think about it... -
Is there a way to edit Gui while game is open?
SHsuperCM replied to SHsuperCM's topic in Modder Support
eclipse is annoying... im using idea, trust me, waay better..