Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/28/19 in all areas

  1. public void tick(IBlockState state, World worldIn, BlockPos pos, Random random) { super.tick(state, worldIn, pos, random); Map<BlockPos, IBlockState> blockStates = new HashMap(); blockStates.put(pos.north(), worldIn.getBlockState(pos.north())); blockStates.put(pos.south(), worldIn.getBlockState(pos.south())); blockStates.put(pos.east(), worldIn.getBlockState(pos.east())); blockStates.put(pos.west(), worldIn.getBlockState(pos.west())); for(Map.Entry<BlockPos, IBlockState> blockState : blockStates.entrySet()) { Block block = blockState.getValue().getBlock(); if(block instanceof BlockCrops && block != BlockList.weeds && random.nextInt(4) == 0) { worldIn.setBlockState(blockState.getKey(), BlockList.weeds.getDefaultState()); } } } what is that do it like so public void tick(IBlockState state, World worldIn, BlockPos pos, Random random) { super.tick(state, worldIn, pos, random); for (EnumFacing facing : EnumFacing.HORIZONTALS){ BlockPos offSet = pos.offset(facing); IBlockState blockState = worldIn.getBlockState(offSet); Block block = blockState.getBlock(); if(block instanceof BlockCrops && block != BlockList.weeds && random.nextInt(4) == 0) { worldIn.setBlockState(blockState.getKey(), BlockList.weeds.getDefaultState()); } } }
    1 point
  2. So, a lot of people still try to get the Jar-in-Jar system in their mod working and it seems there is no documentation available. This wont be a guide (its most likely not the optimal way to do it), but it might help you to get started. Forge allows you to specify the ContainedDep manifest attribute. This attribute is a space separated list of file names (jar files) which will be extracted from your jar and then loaded into the mod-class loader (at the time of writing, those mods are not examined for coremods, so you will need to package your mod into the coremod jar. This works just fine for APIs and other libraries though! See https://github.com/MinecraftForge/MinecraftForge/pull/4081) The following gradle code will build 2 additional jars: An API jar (which could also be a coremod jar or whatever else) and the Mainmod Jar without the API code. The Mainmod jar will include the API jar, allowing for easy distribution. CPW said its just 2 lines in your build.gradle to setup jar-in-jar distribution... So it seems I'm missing a feature in forge gradle. If you have a more clean gradle script for this, please post it! // at the end of your build.gradle // Create API library zip // Warning: This jar will be reobfuscated! Its only used to package it with the universal jar task apiJar(type: Jar) { from(sourceSets.main.output) { // only include the classes from our API packages include "**/api/**" } classifier = 'obfapi' includeEmptyDirs = false } // task to create a jar containing all classes from the main sourceSet output and the api.jar // also sets up the manifest attribute 'ContainedDeps' which fml uses to extract the api jar at runtime task packedJar(type: Jar, dependsOn: 'reobfApiJar') { manifest { attributes 'ContainedDeps': "${archivesBaseName}-${version}-obfapi.jar" } from(sourceSets.main.output) { // exclude the API classes, those will be included as their own jar exclude('**/api/**') } from("${buildDir}/libs") { include("*-${version}-obfapi.jar") } classifier = 'universal' } // tell forge gradle to reobfuscate our jars reobf { apiJar { } packedJar { } }
    1 point
  3. they exist inside the normal Minecraft jar (found at .minecraft/versions/) inside the assets folder
    1 point
  4. What mapping version are you using? I can't find these methods in the Packet class(es) in any mappings i've tried(default supplied, latest, stable). A fully qualified name of that Packet class would also help since there are 4 and none of them match your description of them. If I were to guess based on this line then it's the size of the internal backing array of the ByteBuffer
    1 point
  5. Oh ok cool. He started trying the twitch app for the mods, he seems to be working it out he is 10. Mum (me) is trying to act like I can help him haha, I have passed on the commemts here and he is loving the mods! Will let him know about the profiles.
    1 point
  6. You can also use the twitch app (was called curse app before), it has it's own section for modded minecraft and it's directly linked to the curse website. You can then setup multiple profiles and install mods from in the app. The app install's the right mod for the version you want and it comes directly from the Original site. I suggest you search on YouTube how to install twitch for minecraft and how to use it. It's pretty easy to use. Me, family and friends are using it too. There are also other apps that will probebly do the same. I prefer the twitch app and as far as i know, it is the only offcial app for this.
    1 point
×
×
  • Create New...

Important Information

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