Welcome, Guest. Please login or register

Author Topic: [1.4.5] SimpleGlass  (Read 32500 times)

0 Members and 1 Guest are viewing this topic.

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
[1.4.5] SimpleGlass
« on: August 20, 2012, 07:46:53 pm »
SimpleGlass
Brought to you by: Dries007
Need help? Join #dries007 on espernet
This mod adds clear and tainted glass and glass panes.
I always thought MC could use a nice colored glass, but mods make the glass look like individual blocks. With this you can make real windows.
(I tried making connection textures, but that didn't work too well. If someone has an idea on how to do this, I'd like to hear  :P)

Download!

This mod overrides 1 base class: BlockPane.
If someone can tell me how you can override a final method without just removing the 'final', that problem will be solved!

You can create border-less glass by right clicking on the clear glass and clear glass panes while sneaking.


Making stained glass:

You can place clear glass and then rightclick with a dye on the block, while sneaking. This will (re)color the glass.
« Last Edit: December 01, 2012, 04:20:03 pm by dries007 »
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

Offline DarkGuardsman

  • Forge Modder
  • Dragon Slayer
  • ***
  • Posts: 888
  • Karma: +63/-2
  • Thank You
  •   - Given: 7
  •   - Receive: 33
  • Gender: Male

  • "Too Many Mods"

    • View Profile
Re: SimpleGlass
« Reply #1 on: August 20, 2012, 11:40:39 pm »
made a mod like this once, not sure why i never updated it or released it. anyways do you override glass or do you just make an entire new block? If you don't i know a way to replace all current glass in world using block id with your block using the same id.

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
Re: SimpleGlass
« Reply #2 on: August 21, 2012, 12:36:42 am »
I make an own block (4 actually, 2 for the panes and 2 for the blocks)

The clear stuff needs a separate block, it gets rendered in the non-alpha layer so that the back of the block doesn't render. The colored stuff needs to be rendered in the alpha layer cause the texture is semi-transparent.

And of course  the panes and blocks need different blocks (the pane extends BlockPane, in witch the method gets overridden, the block extends Block)
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

Offline foreverblu

  • Creeper Killer
  • **
  • Posts: 168
  • Karma: +3/-4
  • Thank You
  •   - Given: 6
  •   - Receive: 1
  • Gender: Male

  • "Revealing the Future..."

    • View Profile
    • The Wiki for Our Team
Re: SimpleGlass
« Reply #3 on: August 21, 2012, 06:35:08 am »
Plz update the other mods. Thx!
Also. Nice mod!

Java, Hosting Servers and Videos...

Offline OvermindDL1

  • Administrator
  • World Shaper
  • *****
  • Posts: 1,317
  • Karma: +344/-20
  • Thank You
  •   - Given: 18
  •   - Receive: 142
    • View Profile
    • OvermindDL1's Empty Main Server
Re: SimpleGlass
« Reply #4 on: August 21, 2012, 07:21:15 am »
Why is it titled "SimpleCommands"?  And what 'final' method are you wanting to override?

Offline foreverblu

  • Creeper Killer
  • **
  • Posts: 168
  • Karma: +3/-4
  • Thank You
  •   - Given: 6
  •   - Receive: 1
  • Gender: Male

  • "Revealing the Future..."

    • View Profile
    • The Wiki for Our Team
Re: SimpleGlass
« Reply #5 on: August 21, 2012, 08:01:51 am »
Its not titled simplecommands?

Java, Hosting Servers and Videos...

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
Re: SimpleGlass
« Reply #6 on: August 21, 2012, 09:49:10 am »
I copy and paste a lot XD

About the method:
http://www.minecraftforge.net/forum/index.php/topic,1374.msg12119.html#msg12119

Edit:
I override the method because that way I can make panes connect to my blocks, even though they are not a solid cube. This is how panes connect to Vanilla glass, there is no list that I can add blockIDs to, so I figgured I could best make the method non-final and use @override to make my panes (that extend the BlockPane class) connect to clear/tainted panes and/or glass.
If I don't extend BlockPane and make my panes a regular block, I would have to write a separate render class, now I hijack the vanilla one  ;)
« Last Edit: August 21, 2012, 10:40:13 am by dries007 »
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

Offline OvermindDL1

  • Administrator
  • World Shaper
  • *****
  • Posts: 1,317
  • Karma: +344/-20
  • Thank You
  •   - Given: 18
  •   - Receive: 142
    • View Profile
    • OvermindDL1's Empty Main Server
Re: SimpleGlass
« Reply #7 on: August 21, 2012, 10:39:30 am »
Ah, that would make sense yes, wait until Lex sees it.  He might either have a better idea or will fix it.

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
Re: SimpleGlass
« Reply #8 on: August 21, 2012, 10:41:30 am »
Well 2 lists would be nice too, that way modders can add there block to a connect or not connect list.
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

Offline OvermindDL1

  • Administrator
  • World Shaper
  • *****
  • Posts: 1,317
  • Karma: +344/-20
  • Thank You
  •   - Given: 18
  •   - Receive: 142
    • View Profile
    • OvermindDL1's Empty Main Server
Re: SimpleGlass
« Reply #9 on: August 21, 2012, 10:43:44 am »
Submit a pull request.

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
Re: SimpleGlass
« Reply #10 on: August 21, 2012, 10:47:51 am »
If I get it done, I'll make an attempt  :P
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
Re: SimpleGlass
« Reply #11 on: August 21, 2012, 02:21:18 pm »
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

Offline keepcalm

  • Forge Modder
  • Diamond Finder
  • ***
  • Posts: 276
  • Karma: +89/-2
  • Thank You
  •   - Given: 0
  •   - Receive: 66

  • "MCPatcher is pure evil"

    • View Profile
Re: SimpleGlass
« Reply #12 on: October 29, 2012, 10:25:25 am »
This mod overrides 1 base class: BlockPane.
If someone can tell me how you can override a final method without just removing the 'final', that problem will be solved!

If you have an accesstransformer set up, you can use 'public-f whatever' rather than just public whatever - this might help: http://minecraftforge.net/wiki/Using_Access_Transformers?

And it doesn't need any forge changes ;)
Protip: try and find answers yourself before asking on the forum.
It's pretty likely that there is an answer.

Was I helpful? Give me a thank you!
Hidden

Tired of waiting for mods to port to bukkit?
use BukkitForge! (now with a working version of WorldEdit!)

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
Re: SimpleGlass
« Reply #13 on: October 29, 2012, 12:44:35 pm »
I haven't updated this mod in a while, I'll make it for 1.4 when I get the time. (should be this week)
Thanks for the tip!
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

Offline BStramke

  • Newbie
  • *
  • Posts: 10
  • Karma: +1/-0
  • Thank You
  •   - Given: 0
  •   - Receive: 1

  • "I am new!"

    • View Profile
Re: SimpleGlass
« Reply #14 on: October 30, 2012, 12:39:20 pm »
Should Access-Transformer be added to the Mod itself or is it possible to move it to a separate coremod?
Check out my Mod, NetherStuffs (http://netherstuffs.wikispaces.com/)! Its goal is to enrich the Nether to more use than "Giant Lava source". (Currently Work in Progress)

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
Re: SimpleGlass
« Reply #15 on: October 30, 2012, 12:52:05 pm »
I'm working on it now, I'll see. It might need SimpleCore
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

Offline BStramke

  • Newbie
  • *
  • Posts: 10
  • Karma: +1/-0
  • Thank You
  •   - Given: 0
  •   - Receive: 1

  • "I am new!"

    • View Profile
Re: SimpleGlass
« Reply #16 on: October 30, 2012, 02:32:38 pm »
I tried it and i get an error with my own mods (need this fix for the File too). This only happens if i add my Mod to the Mods folder (Coremod loads pretty well). My Config only includes this:
# BlockPane
public-f ale.e(I)Z # canThisPaneConnectToThisBlockID(int BlockId)

But if i include my own mod and coremod than i get the error that i override "final method e.(I)Z" (Errorlog Attached to this Post, Sourcecode of the mod and coremod available here: https://github.com/BStramke/NetherStuffs )

But even then (works when testing with eclipse), the normal GlassPanes wont connect to new ones. Is there a way to overwrite the Function inside BlockPane? (As normal GlassPanes also dont connect to new Glass Blocks)

Check out my Mod, NetherStuffs (http://netherstuffs.wikispaces.com/)! Its goal is to enrich the Nether to more use than "Giant Lava source". (Currently Work in Progress)

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
Re: SimpleGlass
« Reply #17 on: October 30, 2012, 03:22:40 pm »
Yes you can override it by editing the class file and making the mod override it on load (Thats what I do in the SimpelMods). I'll probably end up make it check to see if the material is glass.
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

Offline BStramke

  • Newbie
  • *
  • Posts: 10
  • Karma: +1/-0
  • Thank You
  •   - Given: 0
  •   - Receive: 1

  • "I am new!"

    • View Profile
Re: SimpleGlass
« Reply #18 on: October 30, 2012, 03:34:04 pm »
Wouldn't editing the class file make it a inside minecraft.jar mod?
Check out my Mod, NetherStuffs (http://netherstuffs.wikispaces.com/)! Its goal is to enrich the Nether to more use than "Giant Lava source". (Currently Work in Progress)

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
Re: SimpleGlass
« Reply #19 on: October 30, 2012, 03:38:15 pm »
Not if you do it in a clever way ;)

I need to do that for SimpleRegions and SimpleCore
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

Offline BStramke

  • Newbie
  • *
  • Posts: 10
  • Karma: +1/-0
  • Thank You
  •   - Given: 0
  •   - Receive: 1

  • "I am new!"

    • View Profile
Re: SimpleGlass
« Reply #20 on: October 30, 2012, 04:42:59 pm »
Gotta look at that i think. Also, im looking for 3 hours now to get my code running, it still doesnt work and i got no idea why as i followed the wiki tutorial...
Check out my Mod, NetherStuffs (http://netherstuffs.wikispaces.com/)! Its goal is to enrich the Nether to more use than "Giant Lava source". (Currently Work in Progress)

Offline BStramke

  • Newbie
  • *
  • Posts: 10
  • Karma: +1/-0
  • Thank You
  •   - Given: 0
  •   - Receive: 1

  • "I am new!"

    • View Profile
Re: SimpleGlass
« Reply #21 on: October 30, 2012, 08:18:08 pm »
I activated debug inside AccessTransformer.java to see if something happens: I then get this line in the Log (along with other transforms):

2012-10-30 20:43:01 [INFO] [STDOUT] Method: ale.e(I)Z 0000000000010001 -> 0000000000010001

It should remove the final modifier on this Method, but it doesnt look like that happens (it should be 0000000000000001 i think). My cfg file has this line:

public-f ale.e(I)Z # canThisPaneConnectToThisBlockID(int BlockId)

And i also found the Issue: AccessTransformer.java Line 242:
if (target.changeFinal && target.desc == "")

Where target.desc is (I)Z for the stuff i want... (This may mean that you currently cant public-f on methods?) If i remove the target.desc check my mod suddenly works...
Check out my Mod, NetherStuffs (http://netherstuffs.wikispaces.com/)! Its goal is to enrich the Nether to more use than "Giant Lava source". (Currently Work in Progress)

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
Re: SimpleGlass
« Reply #22 on: October 31, 2012, 09:03:49 am »
I'll fiddle around with the access transformer, but I don't/havent used it. I just overwrote the entire class. I don't know If you can only override a certain line or method (Thats what I want to be able to do)
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

Offline BStramke

  • Newbie
  • *
  • Posts: 10
  • Karma: +1/-0
  • Thank You
  •   - Given: 0
  •   - Receive: 1

  • "I am new!"

    • View Profile
Re: SimpleGlass
« Reply #23 on: October 31, 2012, 09:19:41 am »
I'll fiddle around with the access transformer, but I don't/havent used it. I just overwrote the entire class. I don't know If you can only override a certain line or method (Thats what I want to be able to do)

I'd also like to overwrite just one method, but i think thats not possible as it would mess around with the obfuscator (at least, it would no be simple). By the way, i looked at your code and understood it (NEI also has some similar stuff as i seen) and it works when i completely change that class, thank you for doing opensource :)
Check out my Mod, NetherStuffs (http://netherstuffs.wikispaces.com/)! Its goal is to enrich the Nether to more use than "Giant Lava source". (Currently Work in Progress)

Offline dries007

  • Moderator
  • Diamond Finder
  • *****
  • Posts: 305
  • Karma: +10/-0
  • Thank You
  •   - Given: 1
  •   - Receive: 1
  • Gender: Male

  • "Hehe ;)"

    • View Profile
    • Dries007.net
Re: SimpleGlass
« Reply #24 on: October 31, 2012, 11:36:56 am »
I like open source just for that reason.
Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
Close
Please register or Login to join in on the community!