Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 30 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ plugins {
id 'maven-publish'
id 'net.minecraftforge.gradle' version '5.1.+'
id 'org.spongepowered.mixin' version '0.7.+'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
}

archivesBaseName = "cgm"
version = "1.3.7-1.19.4"
archivesBaseName = archive_base_name
version = "${mod_version}-${minecraft_version}"
group = "com.mrcrayfish"

java.toolchain.languageVersion = JavaLanguageVersion.of(17)

sourceSets.main.resources { srcDir 'src/generated/resources' }

mixin {
add sourceSets.main, "cgm.refmap.json"
config 'cgm.mixins.json'
add sourceSets.main, "${mod_id}.refmap.json"
config "${mod_id}.mixins.json"
}

minecraft {
mappings channel: 'official', version: '1.19.4'
mappings channel: mappings_channel, version: mappings_version

runs {
client {
Expand All @@ -41,7 +42,7 @@ minecraft {
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
arg '-mixin.config=cgm.mixins.json'
arg "-mixin.config=${mod_id}.mixins.json"
mods {
cgm {
source sourceSets.main
Expand All @@ -55,8 +56,8 @@ minecraft {
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
args '--mod', 'cgm', '--all', '--output', file('src/generated/resources/')
arg '-mixin.config=cgm.mixins.json'
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/')
arg '-mixin.config=${mod_id}.mixins.json'
mods {
cgm {
source sourceSets.main
Expand All @@ -66,14 +67,6 @@ minecraft {
}
}

//processResources {
// doLast {
// fileTree(dir: outputs.files.asPath, include: "**/*.json").each {
// File file -> file.text = JsonOutput.toJson(new JsonSlurper().parse(file))
// }
// }
//}

repositories {
mavenLocal()
maven {
Expand All @@ -86,29 +79,32 @@ repositories {
}

dependencies {
minecraft 'net.minecraftforge:forge:1.19.4-45.1.0'
implementation fg.deobf('curse.maven:framework-549225:4718249')
implementation fg.deobf('curse.maven:configured-457570:4462894')
implementation fg.deobf('curse.maven:catalogue-459701:4496718')
implementation fg.deobf('curse.maven:backpacked-352835:4510383')
compileOnly fg.deobf('curse.maven:controllable-317269:4511169')
compileOnly fg.deobf("mezz.jei:jei-1.19.4-common-api:13.1.0.11")
compileOnly fg.deobf("mezz.jei:jei-1.19.4-forge-api:13.1.0.11")
runtimeOnly fg.deobf("mezz.jei:jei-1.19.4-forge:13.1.0.11")
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
implementation fg.deobf("curse.maven:framework-549225:${framework_file_id}")
compileOnly fg.deobf("curse.maven:configured-457570:${configured_file_id}") // Configured for 1.20 is not released
implementation fg.deobf("curse.maven:catalogue-459701:${catalogue_file_id}")
implementation fg.deobf("curse.maven:backpacked-352835:${backpacked_file_id}")
implementation fg.deobf("curse.maven:sophisticated-core-618298:${sop_core_file_id}")
implementation fg.deobf("curse.maven:sophisticated-backpacks-422301:${sop_backpacks_file_id}")
implementation fg.deobf("curse.maven:travelers-backpack-321117:${travelers_backpack_file_id}")
compileOnly fg.deobf("curse.maven:controllable-317269:${controllable_file_id}")
compileOnly fg.deobf("mezz.jei:jei-1.20.1-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-1.20.1-forge-api:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-1.20.1-forge:${jei_version}")
annotationProcessor('org.spongepowered:mixin:0.8.5:processor')
}

jar {
manifest {
attributes([
"Specification-Title": "Gun Mod",
"Specification-Vendor": "MrCrayfish",
"Specification-Version": "1",
"Implementation-Title": "Gun Mod",
"Implementation-Version": project.version,
"Implementation-Vendor" : "MrCrayfish",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs": "cgm.mixins.json"
"Specification-Title": "Gun Mod",
"Specification-Vendor": "MrCrayfish",
"Specification-Version": "1",
"Implementation-Title": "Gun Mod",
"Implementation-Version": project.version,
"Implementation-Vendor" : "MrCrayfish",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs": "${mod_id}.mixins.json"
])
}
}
Expand All @@ -130,4 +126,4 @@ publishing {
url "file:///X:/localmaven/mcmods"
}
}
}
}
18 changes: 18 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,21 @@
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

mod_id=cgm
archive_base_name=cgm
mod_version=1.4.0
forge_version=47.1.3
minecraft_version=1.20.1
mappings_channel=parchment
mappings_version=2023.09.03-1.20.1

framework_file_id=4718251
configured_file_id=4462894
catalogue_file_id=4766090
backpacked_file_id=4725669
controllable_file_id=4598985
sop_core_file_id=4993651
sop_backpacks_file_id=4993659
travelers_backpack_file_id=4985852
jei_version=15.2.0.27
2 changes: 1 addition & 1 deletion src/main/java/com/mrcrayfish/guns/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public Gameplay(ForgeConfigSpec.Builder builder)
this.criticalDamageMultiplier = builder.comment("The value to multiply the damage by if projectile is a critical hit").defineInRange("criticalDamageMultiplier", 1.5, 1.0, Double.MAX_VALUE);
this.ignoreLeaves = builder.comment("If true, projectiles will ignore leaves when checking for collision").define("ignoreLeaves", true);
this.enableKnockback = builder.comment("If true, projectiles will cause knockback when an entity is hit. By default this is set to true to match the behaviour of Minecraft.").define("enableKnockback", true);
this.knockbackStrength = builder.comment("Sets the strengthof knockback when shot by a bullet projectile. Knockback must be enabled for this to take effect. If value is equal to zero, knockback will use default minecraft value").defineInRange("knockbackStrength", 0.15, 0.0, 1.0);
this.knockbackStrength = builder.comment("Sets the strength of knockback when shot by a bullet projectile. Knockback must be enabled for this to take effect. If value is equal to zero, knockback will use default minecraft value").defineInRange("knockbackStrength", 0.15, 0.0, 1.0);
this.improvedHitboxes = builder.comment("If true, improves the accuracy of weapons by considering the ping of the player. This has no affect on singleplayer. This will add a little overhead if enabled.").define("improvedHitboxes", false);
}
builder.pop();
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/mrcrayfish/guns/GunMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
import com.mrcrayfish.guns.common.NetworkGunManager;
import com.mrcrayfish.guns.common.ProjectileManager;
import com.mrcrayfish.guns.crafting.WorkbenchIngredient;
import com.mrcrayfish.guns.datagen.BlockTagGen;
import com.mrcrayfish.guns.datagen.GunGen;
import com.mrcrayfish.guns.datagen.ItemTagGen;
import com.mrcrayfish.guns.datagen.LootTableGen;
import com.mrcrayfish.guns.datagen.RecipeGen;
import com.mrcrayfish.guns.datagen.*;
import com.mrcrayfish.guns.entity.GrenadeEntity;
import com.mrcrayfish.guns.entity.MissileEntity;
import com.mrcrayfish.guns.init.*;
Expand Down Expand Up @@ -50,6 +46,8 @@ public class GunMod
public static boolean controllableLoaded = false;
public static boolean backpackedLoaded = false;
public static boolean playerReviveLoaded = false;
public static boolean sopLoaded = false;
public static boolean travelersBackpackLoaded = false;
public static final Logger LOGGER = LogManager.getLogger(Reference.MOD_ID);

public GunMod()
Expand All @@ -74,15 +72,17 @@ public GunMod()
bus.addListener(this::onGatherData);
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> {
FrameworkClientAPI.registerDataLoader(MetaLoader.getInstance());
ClientHandler.registerCreativeTab(bus);
bus.addListener(KeyBinds::registerKeyMappings);
bus.addListener(CrosshairHandler::onConfigReload);
bus.addListener(ClientHandler::onRegisterReloadListener);
bus.addListener(ClientHandler::onRegisterCreativeTab);
bus.addListener(ClientHandler::registerAdditional);
});
controllableLoaded = ModList.get().isLoaded("controllable");
backpackedLoaded = ModList.get().isLoaded("backpacked");
playerReviveLoaded = ModList.get().isLoaded("playerrevive");
sopLoaded = ModList.get().isLoaded("sophisticatedbackpacks");
travelersBackpackLoaded = ModList.get().isLoaded("travelersbackpack");
}

private void onCommonSetup(FMLCommonSetupEvent event)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/mrcrayfish/guns/client/BulletTrail.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void tick()
Entity shooter = this.getShooter();
if(shooter instanceof Player && ((Player) shooter).isLocalPlayer())
{
Level world = shooter.level;
Level world = shooter.level();
world.addAlwaysVisibleParticle(this.particleData, true, this.position.x(), this.position.y(), this.position.z(), this.motion.x, this.motion.y, this.motion.z);
}

Expand Down
Loading