Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help everyone out #224

Closed
wants to merge 1 commit into from
Closed

Help everyone out #224

wants to merge 1 commit into from

Conversation

T145
Copy link

@T145 T145 commented Oct 1, 2014

🌴

- Make a lot of the constant methods for AEBaseBlock public so other mods can easily edit them
@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

and why would you want to overwrite these methods? final methods are generally intended in these cases cause the base class handles that.

@T145
Copy link
Author

T145 commented Oct 1, 2014

I'm trying to override the sky chest class to create a hungry version of it for Magistics, but run into some problems based on how AE2 sets everything up. I have to use the "createTileEntity" method in place of the default, and get errors since AE2 doesn't recognize the feature.

@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

uh you are not supposed to use the AEBaseBlock class from your mod. Use the API if you need anything, everything else needs to be implemented from your own mod.

missread

use tileEntityType and set it there

@T145
Copy link
Author

T145 commented Oct 1, 2014

Now I'm getting a duplicate ID error w/ BlockSkyChest. How do I properly set an ID?

@Cisien
Copy link
Contributor

Cisien commented Oct 1, 2014

I'm not entirely comfortable with opening these methods up in the core classes?

What do you gain from this that you can't do with the API?

@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

Please dont tell me you extend AEBaseBlock then I did not missunderstand

@T145
Copy link
Author

T145 commented Oct 1, 2014

So basically no other mod can expand off of what is in AE2 then, correct? At least not w/out making an entirely custom implementation.

@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

Ok, the problem is, that if we change anything in our base code any mod would break if they do that.

@thatsIch thatsIch closed this Oct 1, 2014
@T145
Copy link
Author

T145 commented Oct 1, 2014

Not necessarily, since all I really need to do this correctly is set an ID properly. If you make something like that, then other people will be able to do what I'm doing w/out breaking anything. There are a lot ways you can approach this w/out breaking anything.

@MrMetric
Copy link
Contributor

MrMetric commented Oct 1, 2014

@thatsIch It's the mod author's decision to risk that

@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

Ok, again.
The API is there cause its supposed the static change, it will rarely change and does what the JavaDoc tells you. If you start extending BaseClasses which are only legit within AE2, and we for example rename it, and people use latest AE2 with your Mod, your mod would crash.

Since we did the rename but it does not affect us in any way and we did not change the API it is not supposed to break other addons.

End of argument, what you doing is bad.

@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

@iloveportalz0r if its the mod authors decision to risk that, then they can use ASM and reflection to open the methods up. We set it final because we dont want people to override these methods, cause this will mess up the internal logic and behavior.

Other than that, he still can extend the class and do what ever he wants with it.

@T145
Copy link
Author

T145 commented Oct 1, 2014

Ok, so you're saying that what I'm doing is bad yet I can still do it somehow? How am I supposed to accomplish what I want to then? Should I just go ahead and make an entirely separate, ordinary chest?

@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

did you try using the setTileEntity in the constructor to set your own TileEntity?

@T145
Copy link
Author

T145 commented Oct 1, 2014

Yes, but then that's when I got that ID error, as stated previously.

@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

Maybe more detailed error log?

@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

Also next time come into IRC, such chats are not meant for GitHub

@T145
Copy link
Author

T145 commented Oct 1, 2014

Where's the IRC? And also, why would GitHub have this feature anyway? You should see the discussions for node.js and Ruby on Rails!

---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!

Time: 10/1/14 2:40 PM
Description: There was a severe problem during mod loading that has caused the game to fail

cpw.mods.fml.common.LoaderException: java.lang.ExceptionInInitializerError
    at cpw.mods.fml.common.LoadController.transition(LoadController.java:162)
    at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:515)
    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:239)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:522)
    at net.minecraft.client.Minecraft.run(Minecraft.java:931)
    at net.minecraft.client.main.Main.main(Main.java:164)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at GradleStart.bounce(GradleStart.java:107)
    at GradleStart.startClient(GradleStart.java:100)
    at GradleStart.main(GradleStart.java:55)
Caused by: java.lang.ExceptionInInitializerError
    at T145.magistics.common.Magistics.preInit(Magistics.java:44)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
    at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513)
    ... 17 more
Caused by: java.lang.IllegalArgumentException: Duplicate id: BlockSkyChest
    at net.minecraft.tileentity.TileEntity.addMapping(TileEntity.java:50)
    at cpw.mods.fml.common.registry.GameRegistry.registerTileEntity(GameRegistry.java:275)
    at appeng.block.AEBaseBlock.setTileEntiy(AEBaseBlock.java:179)
    at T145.magistics.common.blocks.BlockChestHungrySky.<init>(BlockChestHungrySky.java:14)
    at T145.magistics.common.config.MagisticsConfig.<clinit>(MagisticsConfig.java:61)
    ... 44 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
    Minecraft Version: 1.7.10
    Operating System: Mac OS X (x86_64) version 10.9.5
    Java Version: 1.8.0_20, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 842653856 bytes (803 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP v9.05 FML v7.10.84.1217 Minecraft Forge 10.13.1.1217 21 mods loaded, 21 mods active
    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized
    FML{7.10.84.1217} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.1.1217.jar) Unloaded->Constructed->Pre-initialized
    Forge{10.13.1.1217} [Minecraft Forge] (forgeSrc-1.7.10-10.13.1.1217.jar) Unloaded->Constructed->Pre-initialized
    appliedenergistics2-core{rv1-stable-1} [AppliedEnergistics2 Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized
    CodeChickenCore{1.0.3.26} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized
    NotEnoughItems{1.0.3.56} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.3.56-dev.jar) Unloaded->Constructed->Pre-initialized
    Baubles{1.0.1.8} [Baubles] (Baubles-deobf-1.7.10-1.0.1.8.jar) Unloaded->Constructed->Pre-initialized
    Thaumcraft{4.2.1.0.B1} [Thaumcraft] (Thaumcraft-deobf-1.7.10-4.2.1.0.B1.jar) Unloaded->Constructed->Pre-initialized
    Magistics{0.6.1} [Magistics] (bin) Unloaded->Constructed->Errored
    BuildCraft|Core{6.0.18} [BuildCraft] (buildcraft-6.0.18-dev.jar) Unloaded->Constructed->Pre-initialized
    BuildCraft|Builders{6.0.18} [BC Builders] (buildcraft-6.0.18-dev.jar) Unloaded->Constructed->Pre-initialized
    BuildCraft|Energy{6.0.18} [BC Energy] (buildcraft-6.0.18-dev.jar) Unloaded->Constructed->Pre-initialized
    BuildCraft|Factory{6.0.18} [BC Factory] (buildcraft-6.0.18-dev.jar) Unloaded->Constructed->Pre-initialized
    BuildCraft|Transport{6.0.18} [BC Transport] (buildcraft-6.0.18-dev.jar) Unloaded->Constructed->Pre-initialized
    BuildCraft|Silicon{6.0.18} [BC Silicon] (buildcraft-6.0.18-dev.jar) Unloaded->Constructed->Pre-initialized
    EnderStorage{1.4.5.24} [EnderStorage] (EnderStorage-1.7.10-1.4.5.24-dev.jar) Unloaded->Constructed->Pre-initialized
    IronChest{6.0.62.742} [Iron Chest] (ironchest-1.7.10-6.0.62.742-deobf.jar) Unloaded->Constructed->Pre-initialized
    appliedenergistics2{rv1-stable-1} [Applied Energistics 2] (appliedenergistics2-rv1-stable-1-dev.jar) Unloaded->Constructed->Errored
    ForgeMultipart{1.1.0.310} [Forge Multipart] (ForgeMultipart-1.7.10-1.1.0.310-dev.jar) Unloaded->Constructed->Pre-initialized
    McMultipart{1.1.0.310} [Minecraft Multipart Plugin] (ForgeMultipart-1.7.10-1.1.0.310-dev.jar) Unloaded->Constructed->Pre-initialized
    ForgeMicroblock{1.1.0.310} [Forge Microblocks] (ForgeMultipart-1.7.10-1.1.0.310-dev.jar) Unloaded->Constructed->Pre-initialized
    AE2 Version: stable rv1-stable-1 for Forge 10.13.0.1187

@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

Because this is not a discussion anymore but a help thread. And using that is unresponsive.

@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

How do you register your Block? You basically have to use GameRegistry.registerBlock somewhere, and obviously you using the same blockname than the skystone chest.

@T145
Copy link
Author

T145 commented Oct 1, 2014

That's what I always use to register my blocks, and I registered it w/ the block name "sky_hungry_chest".

@thatsIch
Copy link
Member

thatsIch commented Oct 1, 2014

After digging deeper it seems AE2 is using so-called feature to determine everything, for you, you need to overwrite setFeature. Look into the constructor of BlockSkyChest for more information.

@PlasmaPower
Copy link

"feature"

@T145
Copy link
Author

T145 commented Oct 1, 2014

That would be great if I could. The function is protected, so I cannot access it from my constructor.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants