Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • MSpace-Dev

MSpace-Dev

Members
 View Profile  See their activity
  • Content Count

    180
  • Joined

    November 15, 2017
  • Last visited

    December 29, 2019
  • Days Won

    1

MSpace-Dev last won the day on November 14 2017

MSpace-Dev had the most liked content!

Community Reputation

13 Good

About MSpace-Dev

  • Rank
    Creeper Killer

Converted

  • Gender
    Male
  • URL
    https://mspacedev.github.io
  • Location
    South Africa

Recent Profile Visitors

1995 profile views
  • tuku747

    tuku747

    February 4, 2020

  • Seynox

    Seynox

    October 12, 2019

  • yas19sin

    yas19sin

    August 30, 2019

  • PhilipChonacky

    PhilipChonacky

    July 7, 2019

  • Rockhopper

    Rockhopper

    March 31, 2019

  1. MSpace-Dev

    [1.14.4] ASM causing issues with static initializers

    MSpace-Dev replied to MSpace-Dev's topic in Modder Support

    https://github.com/MSpaceDev/CustomChests/tree/1.14.4/src/main/java/com/mspacedev
    • November 23, 2019
    • 3 replies
  2. MSpace-Dev started following [1.12.2] Change texture for block at runtime, [1.14.4] ASM causing issues with static initializers, [1.14.4] Dynamic block/entity/item etc based on other mods and and 2 others November 23, 2019
  3. MSpace-Dev

    [1.14.4] ASM causing issues with static initializers

    MSpace-Dev posted a topic in Modder Support

    I have a class called FileManager that manages many things to do with my custom mod files. I'm trying to create a static constant that allows me to reference an array of files whenever I want. However, my program throws an ExceptionInInitializerError. I took a similar test to a basic static void main program, and the program compiled fine. I can't see what I'm doing wrong in my main program below. Here are the relevant files: Log: [11:26:14] [Client thread/ERROR] [ne.mi.fm.ja.FMLModContainer/]: Exception caught during firing event: null Index: 1 Listeners: 0: NORMAL 1: ASM: class com.mspacedev.ModEventSubscriber onRegisterBlocks(Lnet/minecraftforge/event/RegistryEvent$Register;)V 2: ASM: class com.mspacedev.ModEventSubscriber onRegisterItems(Lnet/minecraftforge/event/RegistryEvent$Register;)V java.lang.ExceptionInInitializerError at com.mspacedev.util.Data$Chests.getChestProperties(Data.java:16) at com.mspacedev.ModEventSubscriber.onRegisterBlocks(ModEventSubscriber.java:28) at net.minecraftforge.eventbus.ASMEventHandler_0_ModEventSubscriber_onRegisterBlocks_Register.invoke(.dynamic) at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80) FileManager: // Files public static final ArrayList<File> chestFiles = getFilesInPath("customchests/chests/"); private static ArrayList<File> getFilesInPath(final String pathName) { ArrayList<File> files = new ArrayList<>(); File folder = new File(pathName); for (final File fileEntry : folder.listFiles()) { if (fileEntry.isDirectory()) continue; files.add(new File(fileEntry.getName())); } return files; } I call this in my RegistryEvent.Register<Block> function: if (!FileManager.chestFiles.isEmpty()) And it returns a NullReferenceException because of the earlier ExceptionInInitializerError
    • November 23, 2019
    • 3 replies
  4. MSpace-Dev

    [1.14.4] Dynamic block/entity/item etc based on other mods

    MSpace-Dev replied to MSpace-Dev's topic in Modder Support

    Ah, thanks. I will look into it further tomorrow morning. I have to head off to sleep, but hope I can get something working. Forge 1.14 is a rather large step in the right direction from what I've seen so far!
    • November 19, 2019
    • 11 replies
  5. MSpace-Dev

    [1.14.4] Dynamic block/entity/item etc based on other mods

    MSpace-Dev replied to MSpace-Dev's topic in Modder Support

    How would I achieve something like that roughly? Any suggestions / resources I can look into?
    • November 19, 2019
    • 11 replies
  6. MSpace-Dev

    [1.14.4] Dynamic block/entity/item etc based on other mods

    MSpace-Dev replied to MSpace-Dev's topic in Modder Support

    I want to expand my mod's features lots in 1.14.4. I want users to be able to specify mobIDs from other mods in JSON to initialise a new item, block and entity for the specified id. To do this, I need to be able to dynamically create these objects. It would be perfect for my mod. You will be able to see that at a quick glance I think: https://www.curseforge.com/minecraft/mc-mods/monster-totems
    • November 19, 2019
    • 11 replies
  7. MSpace-Dev

    [1.14.4] Dynamic block/entity/item etc based on other mods

    MSpace-Dev replied to MSpace-Dev's topic in Modder Support

    So, creating new entity types based on other mods is impossible?
    • November 19, 2019
    • 11 replies
  8. MSpace-Dev

    [1.14.4] Dynamic block/entity/item etc based on other mods

    MSpace-Dev replied to MSpace-Dev's topic in Modder Support

    Well, that actually does not run. DeferredWorkQueue#runLater does not get called.
    • November 19, 2019
    • 11 replies
  9. MSpace-Dev

    [1.14.4] Dynamic block/entity/item etc based on other mods

    MSpace-Dev replied to MSpace-Dev's topic in Modder Support

    I've been doing some research. What are your thoughts on this method? @SubscribeEvent public static void onRegisterEntities(final RegistryEvent.Register<EntityType<?>> event) { DeferredWorkQueue.runLater(() -> { entityBuilder(event); }); } private static void entityBuilder(final RegistryEvent.Register<EntityType<?>> event) { ArrayList<EntityType<?>> all_entities; all_entities = (ArrayList<EntityType<?>>) event.getRegistry().getValues(); Main.LOGGER.debug("ALL LOADED ENTITIES:"); all_entities.forEach(p -> Main.LOGGER.debug(p)); } And will I be able to register new entities under new IDs using the methods within EntityType and ForgeRegistries.ENTITIES? (If I don't go with this method ^)
    • November 19, 2019
    • 11 replies
  10. MSpace-Dev

    [1.14.4] Dynamic block/entity/item etc based on other mods

    MSpace-Dev posted a topic in Modder Support

    Is it possible to get all loaded entities in the registry (from all other mods) at runtime, to then be able to spawn in said entity within my mod? I feel it might be possible now, with how structured the registry events are in 1.14. I am also trying to generate new entities at runtime based on this by using a builder pattern of sorts.
    • November 19, 2019
    • 11 replies
  11. MSpace-Dev

    [FG 3.0] replace() functions

    MSpace-Dev posted a topic in ForgeGradle

    In FG 2.3, there was a function called replace. It has now been removed / changed in 1.14.4. Here is the function in FG 2.3. /** * Add a source replacement mapping * * @param token The token to replace * @param replacement The value to replace with */ public void replace(Object token, Object replacement) { replacements.put(token.toString(), replacement); } /** * Add a map of source replacement mappings * * @param map A map of tokens -&gt; replacements */ public void replace(Map<Object, Object> map) { for (Entry<Object, Object> e : map.entrySet()) { replace(e.getKey(), e.getValue()); } } This was useful as it allowed me to edit my version in only gradle.properties replace "@VERSION@", project.version replaceIn "utils.Reference.java"
    • November 19, 2019
    • 1 reply
  12. MSpace-Dev

    [1.12.2] TE persists when shouldRefresh() returns false

    MSpace-Dev replied to MSpace-Dev's topic in Modder Support

    Ah, I see thanks. Got it working nicely like this @Override public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) { // Only refresh if new state is not an instance of BlockTotemBase return !(newState.getBlock() instanceof BlockTotemBase); }
    • November 17, 2019
    • 2 replies
  13. MSpace-Dev

    [1.12.2] TE persists when shouldRefresh() returns false

    MSpace-Dev posted a topic in Modder Support

    I've set TileEntity#shouldRefresh to false so that I can update the blockstate without it resetting its values. However, this makes the tile entity persist when its block is broken. I've added world.removeTileEntity(pos) in theBlock#blockBreak override function. However, the TE still persists. I can verify it is getting called. Am I missing something here? @Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { if (worldIn.getTileEntity(pos) != null) { if (worldIn.getTileEntity(pos) instanceof TileEntityTotemBase) { TileEntityTotemBase totemBase = (TileEntityTotemBase) worldIn.getTileEntity(pos); // Update totem on Client totemBase.setTotemProperties(); totemBase.sendUpdates(); } } } worldIn.removeTileEntity(pos); // Redundant as super() calls it anyways. Probably need some other calls to remove TE! super.breakBlock(worldIn, pos, state); }
    • November 17, 2019
    • 2 replies
  14. MSpace-Dev

    [1.12.2] Change texture for block at runtime

    MSpace-Dev replied to MSpace-Dev's topic in Modder Support

    Ah, alright, got it! Will stick to blockstates then
    • November 17, 2019
    • 4 replies
  15. MSpace-Dev

    [1.12.2] Change texture for block at runtime

    MSpace-Dev replied to MSpace-Dev's topic in Modder Support

    Yes, I saw it's using 2 entirely different blocks. Is that a recommended way to do it? Would I have to create a new Block class for every block where I want its texture to change at runtime?
    • November 17, 2019
    • 4 replies
  16. MSpace-Dev

    [1.12.2] Change texture for block at runtime

    MSpace-Dev posted a topic in Modder Support

    I have a custom tile entity that can switch between 2 states, simply with bool = !bool When this switch happens, I would like to change one of the texture references in the model.JSON to switch to another texture. How can I achieve this. (There are multiple textures in the single model) I noticed the furnace DOES NOT use blockstates for this. So, interested in how that was done. If not, I will end up using blockstates. Thanks
    • November 17, 2019
    • 4 replies
  • All Activity
  • Home
  • MSpace-Dev
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community