Jump to content

Bregor

Members
  • Posts

    41
  • Joined

  • Last visited

Posts posted by Bregor

  1. 43 minutes ago, diesieben07 said:

    You can add as many listeners as you want.

    Is there a way to remove them on the server side? Because the removeListener method is ClientOnly.

    Or is there a scenario where more than one would get added, if I don't add them myself?

  2. I'm currently trying to understand the inner workings of containers, but there are some weird things i noticed:
     

    • Is it possible that a container has more than one listener? As there is one container per Player spawned the listeners array doesn't fit to well in that picture. (Also there is a removeListener method, which is ClientOnly and only called from the GuiRepair and GuiContainerCreative)
    • Is the detectAndSendChanges method only logical server side or both? (I got only server side calls that far).
  3. Hi,

    I'm trying to create a fluid which should be only usable in buckets, machines, etc. (No need for placing it in the world a block).

     

    I tried the following setup, which works fine if i use the standard vanilla water textures, but as soon as i try to use my own (as in the sample below) I only get the missing texture texture.

     

    I have the textures and the mcmeta files in the location assets/modid/textures/fluids/.

     

    Is there some need to register the texture sprites before using it in a fluid?

     

    public class CustomOilFluid extends Fluid {
    
    	public CustomOilFluid() {
    		super(
    			Constants.FluidNames.customOilFluid,
    			new ResourceLocation(Constants.modId, "fluids/custom_oil_still"),
    			new ResourceLocation(Constants.modId, "fluids/custom_oil_flow")
    		);
    	}
    }
    
    public class ModFluids {
    	public final static CustomOilFluid customOilFluid = new CustomOilFluid();
    	
    	public static final void registerFluids() {
    		
    		FluidRegistry.enableUniversalBucket();
    		
    		
    		FluidRegistry.registerFluid(customOilFluid);
    
    		FluidRegistry.addBucketForFluid(customOilFluid);
    	}
    }
    
    //In my mods class i have the following static initializer
    static {
    	ModFluids.registerFluids();
    }

     

  4. Hi,

    Currently i have a blockstate JSON to display a custom model if the block state (my_property) is set to true, in the false state it just displays the missing texture texture.

    Is it possible to state something like for the block state my_property = false, do not render anything (to create a block with toggle-able invisibility)?

    {
      "forge_marker": 1,
      "variants": {
        "normal": [{}],
        "inventory": [{}],
        "my_property": {
          "true": {
            "model": "myModId:my_model.obj"
          }
        }
      }
    }

     

  5. How can I have the API sources from a mod and the actual mod together into a development environment?

     

    The API source files are added to the project to be able to compile against the API, but if I add the mod itself for testing purposes to the run/mods folder I always get java.lang.NoSuchMethodError when something tries to use the API. Is there a way to have both at once in the dev environment - the API sources for compiling against and the mod itself for testing the stuff in the debugger?

  6. So far i found out that ActiveRenderInfo seems to contain the camera information.

     

    And rotationX, rotationXZ, rotationZ, rotationYZ and rotationXY seem to contain the camera orientation.

     

    Also Particle.renderParticle seems to do something similar to what I want.

     

     

    But I just can't figure out why the orientation is encoded in these five rotations (or if it is the orientation actually).

  7. I'm trying to render a billboard texture which is always facing to the player. I have found some methods other mods use for such things, like the following code:

     

    GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F);

     

    It seems to work for the normal view, but if changed to third person mode with F5 (especially in the frontal view), things get quite wrong (the texture is facing not at all to the camera).

     

    I suspect the actual camera/eye position is different than the player position (which seems to be the content of playerViewX and playerViewY). Is there a way to get the actual camera position (and possible the vector of the direction) instead of the player position only?

  8. Just add them as dependencies through Gradle. Your mod won't require them at runtime unless you use classes from them.

     

    You can also add them as

    deobfProvided

    /

    deobfCompile

    dependencies to have ForgeGradle deobfuscate them on-disk. See the MDK's build.gradle for more details.

     

    I have successfully added them this way.

     

    There are just two things I don't fully understand yet:

    • What is the difference between deobfProvided and deobfCompile (or can I even use runtime like in the jei example: runtime "mezz.jei:jei_${mcversion}:${jei_version}")?
    • It seems if I add a new mod dependency to build.grade, run setupDecompWorkspace, refresh all Gradle Projects in IntelliJ, run MC - I need to repeat this one or two times until the mod finally loads in the MC client.

  9. Is it possible to add other mods to the development environment via build.gradle from a maven repository, but not depend on them in the mod iteself.

     

    The reason for this is that I want to have some mods to test my blocks with in the dev environment, but they are no dependencies of the mod, more like development conveniences. Yet it would be nice if the mods have not to be manually restored everywhere i check out the mod repository.

  10. Ok now I am slightly confused, you mean I should use a EnergyStorage internally to store the power?

     

    But which interface is the correct one to actually receive power on my TileEntity? With IEnergyReceiver the only event I ever got is canConnectEnergy if some cable is placed beside it.

  11. Hi,

     

    I am trying to use the CoFH RedstoneFlux API to get my machine blocks powered (https://github.com/CoFH/RedstoneFlux-API). I did just put the files into /src/api/java/cofh/api/energy/*, hope this is correct.

     

    I implemented IEnergyReceiver on my machine blocks TileEntity but the only method ever getting called is "boolean canConnectEnergy(ForgeDirection from)" if I place a cable nearby. Do I have to register the block somehow to actually receive energy?

     

    Thanks

  12. Hi,

     

    i got a few questions about the lifetime of tile entities:

     

    • Is it possible to get another blocks tile entity if the target tile entities block is currently not in a loaded chunk?
    • On the server side is it possible to get an event if a tile entity is unloaded?

     

    Thanks

  13. Well I thought about something like the attuning to the master block too, but as there will be many slave nodes for each master I didn't want to force the user to update all nodes after the master node is placed somewhere else or is destroyed by something.

     

    And about the tile entity idea, may be worth investigating. Non ticking tile entities are not available before 1.8?

     

     

  14. Hi,

     

    I am looking for best practices for discovery of specific blocks in the neighborhood of another specific block.

     

    To be more specific the scenario I have in mind is a kind of wireless master-slave block relationship. For example if the master block is placed it searches for all slave blocks in a given radius (e.g. 32 blocks radius).

     

     

    Scanning the blocks in range seems to be a bad idea performance wise, as 32 blocks radius would require scanning 262k blocks in worst case.

     

    Is it a good idea to keep a global storage of all master blocks and slave blocks without a master block? Or is there a better way to achieve such a thing?

     

     

    Neither the master nor the slave blocks will be generated naturally, but there may be a lot of slave blocks.

     

    Thanks

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.