Jump to content

DBLouis

Members
  • Posts

    74
  • Joined

  • Last visited

Posts posted by DBLouis

  1. The vanilla way is a pain, that was what I was using before, I had hundreds of files, and it took me a lot of time to generate all blockstate files correctly.

     

    You say "they don't add together" but on one line, like that : "facing=west,half=top,shape=straight": { "x": 180, "y": 180 }

    It works (even with vanilla file) so why not on separate lines? Shouldn't be so difficult to implement.

  2. Hi,

     

    I have a problem with the stairs in my mod: when placed upside down (except when facing east) it display the bottom east model instead of the corresponding one.

    But, the properties are correctly set, as I see it when looking at the block with 'F3' enabled. So the bug have to come from the blockstate files right?

    If someone could have a look at those, here, it would be great.

     

    Thanks in advance :)

  3. It's tricky simply because there is no clean way to intercept that the integrated server has been opened to LAN. I searched for a few minutes and saw nothing: The IntegratedServer#shareToLAN method is called from the button or the command, but I didn't see any way to "register a listener" or something like that.

    Like you said, it's simpler to always send it. The client can just ignore it.

  4. This is different.

    Some blocks can be deactivated from the config file. If they are, so are the associated recipes. If a dedicated server deactivate blocks, the connected client should also deactivate them, because if not, the recipes will still show, but the result cannot be obtain. This is ugly.

    There might be other issues I'm not thinking about, but with this, the client is always configured the same way as a dedicated server, except for client only settings but there is only one for now.

  5. Thank you!

     

    Should I edit the existing patch file ? Or make a new one beside? I'm not really comfortable with those.

    Also if I rename the variables (iblockstate1,2,3...) should I do it in the patch file or there is a place for it?

    I'm asking because I saw the processing of Minecraft sources is very ordered and complex.

  6. It's kinda working, here's what I've done:

     

     

     

    private BlockPos pos;
    private boolean hasChanged = false;
    private UBBiome currentBiome; // UB stones biomes, not minecraft biomes!
    
    @SubscribeEvent
    public void initMapGen(InitMapGenEvent event) {
    if (event.getType() == EventType.VILLAGE) {
    	event.setNewGen(new MapGenVillage() {
    		@Override
    		public StructureStart getStructureStart(int chunkX, int chunkZ) {
    			LOGGER.debug("Village start in chunk: " + chunkX + ";" + chunkZ);
    			pos = new BlockPos(chunkX * 16, 0, chunkZ * 16);
    			hasChanged = true;
    			return super.getStructureStart(chunkX, chunkZ);
    		}
    	});
    	event.setResult(Result.DENY);
    }
    }
    
    @SubscribeEvent
    public void onVillageSelectBlock(GetVillageBlockID event) {
    IBlockState originalState = event.getOriginal();
    Block originalBlock = originalState.getBlock();
    
    if (hasChanged) {
    	currentBiome = // getting the biome at pos...
    	hasChanged = false;
    }
    
    // replace blocks
    if (originalBlock == Blocks.COBBLESTONE) {
    	event.setReplacement(...);
    	event.setResult(Result.DENY);
    }
    // ...
    }
    

     

     

     

    The problem is that Minecraft don't call StructureVillagePieces.Village#getBiomeSpecificBlockState for all block of the structures.

    For example in StructureVillagePieces.Church#addComponentParts:

    IBlockState iblockstate = Blocks.COBBLESTONE.getDefaultState(); // Cobble is not replaced for Churches
    IBlockState iblockstate1 = this.getBiomeSpecificBlockState(Blocks.STONE_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, numFacing.NORTH));
    IBlockState iblockstate2 = this.getBiomeSpecificBlockState(Blocks.STONE_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, EnumFacing.WEST));
    IBlockState iblockstate3 = this.getBiomeSpecificBlockState(Blocks.STONE_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, EnumFacing.EAST));
    

     

    I think Forge should just patch this by replacing the first line like the ones below it, It won't break anything.

    If not I will use reflection but I may need some help.

  7. Hi!

     

    Is there any tutorial about mod config file ? I would like to know how to make a GUI for the config, which can be translated with a lang file (I think I saw this functionality in Forge source).

     

    Also, is there a clean way to set the categories order? Instead of prefix them with 1, 2, 3 ...

     

    Thanks in advance

×
×
  • Create New...

Important Information

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