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
  • m00nl1ght

m00nl1ght

Members
 View Profile  See their activity
  • Content Count

    22
  • Joined

    December 19, 2017
  • Last visited

    September 27, 2019

 Content Type 

  • All Activity

Profiles

  • Status Updates
  • Status Replies

Forums

  • Topics
  • Posts

Calendar

  • Events

Posts posted by m00nl1ght

  1. [1.14.2] How to check for filler block in the End

    in Modder Support

    Posted July 6, 2019


    In your OreGeneration class, add a field that holds your own feature instance

    private static final YourOreFeature END_OREGEN = new YourOreFeature();

    And then use that instead of 

    Feature.ORE

    like this:

    Biomes.THE_END.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Biome.createDecoratedFeature(END_OREGEN, new OreFeatureConfig( ...
  2. [1.14.2] How to check for filler block in the End

    in Modder Support

    Posted July 6, 2019


    p_207803_1_

    is worldIn now, so

    if (worldIn.getBlockState(blockpos$mutableblockpos).getBlock() == Blocks.END_STONE)

    should work

  3. [1.14.2] How to check for filler block in the End

    in Modder Support

    Posted July 5, 2019


    Instead of 

    Feature.ORE

    pass in an instance of your own ore feature class.

  4. [1.14.2] MC Source Obfuscation

    in Modder Support

    Posted July 4, 2019 · Edited July 4, 2019 by m00nl1ght
    fix typo


    I have never used NetBeans before, so no idea how source attachments work there.

    However, there should be some way to specify the location of the sources.

    The file is called something like

    forge-1.14.2-26.0.13_mapped_snapshot_20190609-1.14.2-sources.jar

     

    Anyway, I recommend using an IDE with gradle integration (for example IntelliJ), because it can automatically attach the sources.

  5. [1.14.2] How to check for filler block in the End

    in Modder Support

    Posted July 4, 2019


    Unfortunately, because 

    FillerBlockType

    is an Enum, the only way to do this at the moment (or at least the only one I know) is to create your own class extending 

    OreFeature

    Then override 

    func_207803_a

    copy it and in there, replace 

    if (p_207803_3_.target.func_214738_b().test(p_207803_1_.getBlockState(blockpos$mutableblockpos))) { ...
    

    with something that checks for end stone, or whatever your ore should spawn in, like this:

    if (p_207803_1_.getBlockState(blockpos$mutableblockpos).getBlock() == Blocks.END_STONE) { ...
    
  6. [1.14.2] MC Source Obfuscation

    in Modder Support

    Posted July 4, 2019


    1. Normally you should never need to open a .class file, only .java files.

    2. How did you setup your workspace, what IDE are you using?

     

  7. [1.14.2] MC Source Obfuscation

    in Modder Support

    Posted July 4, 2019


    What do you mean by "compiled" code? The java bytecode? Why?

  8. [1.14.2] MC Source Obfuscation

    in Modder Support

    Posted July 4, 2019 · Edited July 4, 2019 by m00nl1ght


    Update to 1.14.3 and use the latest mcp snapshot to get up to date mappings. Also, it takes time until all the fields and methods get named, 1.14 is relatively new.

     

    Edit: And yes, Forge still uses MCP internally to provide names in development environment.

  9. Change forge library path

    in Modder Support

    Posted January 4, 2019


    Just add

    -g /.gradle

    to your gradle command, for example

    gradlew setupDecompWorkspace -g /.gradle

     

  10. An internal error occurred during: "Launching Client". null argument:

    in Modder Support

    Posted December 9, 2018


    After running 

    gradlew setupDecompWorkspace

    you need to run 

    gradlew eclipse

    to prepare the eclipse project.

  11. [1.12.2] Tileentity unable to be created

    in Modder Support

    Posted December 2, 2018


    You need an empty constructor in your TileEntity class.

    You currently only have

     

    public TileEntityNetIn(int maxTransfer) {
    	this.maxTrans = maxTransfer;
    }

     

    just add

    public TileEntityNetIn() {
    	
    }

     

  12. [1.9.4] Creating Advanced GUI with ListBox

    in Modder Support

    Posted November 30, 2018


    I created a simple GuiList for my mod some time ago, it is based on the vanilla Gui classes. Maybe it helps. github

    • Like 1
  13. Get's nickname of a player

    in Modder Support

    Posted November 4, 2018


    1. What do you mean by "using the command"? Are you trying to create a command?

    2. What do you mean by "a player who hits with his hand"? A player who is interacting with something?

    Please explain what you are trying to archieve.

  14. Is there a way to verify client-side mods from server-side by using JAR signing?

    in Modder Support

    Posted July 28, 2018


    https://mcforge.readthedocs.io/en/latest/concepts/jarsigning/

     

     

  15. Event That Fired When the Player Pickups An Arrow From Ground?

    in Modder Support

    Posted July 25, 2018


    You could create a pull request on Forge's github if you really need this hook/event. Here you can find information about pull requests.

  16. Event That Fired When the Player Pickups An Arrow From Ground?

    in Modder Support

    Posted July 25, 2018


    Unfortunately, there is no such event. The arrow is added to the players inventory directly in EntityArrow#onCollideWithPlayer.

     

  17. Prevent client event being sent to Server?

    in Modder Support

    Posted July 22, 2018


    So, if I understand correctly, you are creating a client-side only mod? And when you right click a block something should happen on the client, but the server should not be notified of the right click? This is actually not that easy, because the client will always send the interaction package even if the event has been cancelled (in PlayerControllerMP#processRightClickBlock) :

    if (event.isCanceled())
    {
    // Give the server a chance to fire event as well. That way server event is not dependant on client event.
    this.connection.sendPacket(new CPacketPlayerTryUseItemOnBlock(pos, direction, hand, f, f1, f2));
    return event.getCancellationResult();
    }

     

  18. Cascading Worldgen Lag

    in Modder Support

    Posted July 15, 2018


    An easy way to find the source of 'cascading generation lag' warnings is to set a breakpoint in Chunk#logCascadingWorldGeneration(). Then run Minecraft in debug mode and when the warning is logged, you can look at the stacktrace.

  19. Download File and add to Resource Location

    in Modder Support

    Posted June 17, 2018


    You can't add a file to your mod asset directory at runtime because it's located within the jar file. But you could save it somewhere else. What exacly are you trying to do? It seems like you are trying to download a texture and use it?

  20. Have a modblock break faster with shears, like wool?

    in Modder Support

    Posted May 19, 2018


    You can override the vanilla shears item and change the getDestroySpeed method.

    Just create a class that extends the minecraft shears class, set the registry name to "minecraft:shears" and register it.

    But be aware that this will cause issues when another mod also overrides vanilla shears.

  21. [1.12.2] Changing vanilla enchanting mechanich

    in Modder Support

    Posted April 7, 2018


    An event is fired when a GUI is opened: GuiOpenEvent. You can use the GuiOpenEvent#setGui method to open your own GUI instead. However, I don't know if that has any side effects.

  22. Structure Generation - Preventing Lag

    in Modder Support

    Posted February 6, 2018 · Edited June 3, 2018 by m00nl1ght
    updated github links


    While developing the structure generation system for my mod I had the same problem. I solved it with a pretty complex system involving a chunk cache.

    It is not really completed yet, but maybe it helps you anyway. My mod replaces the vanilla (overworld) ChunkProvider with a modified one.

    Source on github (my mod changes some other worldgen related things too, sorry if it is hard to read or understand the code)

     

    How it works:

    - Structure data is saved in NBT format (similiar to vanilla structures) and loaded on server start

    - When a chunk is generated, it checks for suitable positions based on the conditions saved in the NBT data, for example a block at a specific position in the structure needs to be grass or dirt. If all conditions match, it adds the position to my StructurePositionMap and generates it in the world later during chunk population, chunk by chunk. StructurePositionMap source

     

    The problem: What happens when the condition block that needs to be checked is in a chunk that is not generated yet?

    My solution:

    If the chunk that needs to be checked has not been generated yet, the ChunkProvider just 'pre-generates' it and stores it in a cache, like this (ChunkProviderDoomed.getChunk) :

     

    public Chunk getChunk(int x, int z) { // called when checking structure conditions
    		if (world.getChunkProvider().isChunkGeneratedAt(x, z)) { // if chunk is already generated, just retrieve it (vanilla)
    			return world.getChunkFromChunkCoords(x, z);
    		} else { 
    			long c = ChunkPos.asLong(x, z); // if not, try to get it from our own chunk cache
    			if (chunkCache.containsKey(c)) { 
    				return chunkCache.get(c); // if it is cached, return it
    			} else {
    				return this.preGenerate(x, z); // if not, pre-generate it and put it into the cache
    			}
    		}
    	}

     

    Then it performs the checks, and later when the chunk is actually generated by minecraft it just retrieves the chunk from the cache instead of generating it again:

    public Chunk generateChunk(int x, int z) { // (override: ChunkProvider)
    		Chunk cached = getChunkFromCache(x, z, true); 
    		if (cached!=null) { // if chunk has been pre-generated, we dont need to generate it again
    			this.createVanillaStructures(x, z, null); //create vanilla structure data, everything else is already done
    			this.createStructures(x, z);
    			return cached;
    		}
    		return this.generateChunk(x, z, false); // if not, generate it normally
    	}

     

    However, I cant tell if this causes problems with vanilla structure generation (not tested yet)

    But so far, it worked for me without any problems or lag.

     

    I hope it helps :)

     

     

     

    • Like 1
  • All Activity
  • Home
  • m00nl1ght
  • Theme

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