Skip to content

Commit

Permalink
Attempt to merge equipment overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
Desoroxxx committed Jul 19, 2023
2 parents 1467a1e + e5d9ffe commit 4991cb3
Show file tree
Hide file tree
Showing 1,034 changed files with 17,246 additions and 21,117 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ build
npm-debug.log*
yarn-debug.log*
yarn-error.log*

42 changes: 30 additions & 12 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project follows to [Ragnarök Versioning Convention](https://gist.githu

**If you are upgrading from either Vic's Modern Warfare or Modern Warfare Cubed Version 0.1-Dev-6 or under all Modern Warfare related items, blocks weapons, etc... will disappear from your save either back up your world or start a new one.**

**When updating to this version from an existing world all tan variants of every back as well as the F5 Switchblade will disappear, they aren't being removed then just changed internally**

**When updating to this version from an existing world all equipment placed in the equipment inventory will disappear

### Highlight

### Added
Expand All @@ -34,19 +38,20 @@ and this project follows to [Ragnarök Versioning Convention](https://gist.githu
- Weapon system version to weapon tooltips
- Added the Workbench and the Ammo Press to the Creative Tab
- Translations for Chinese, Spanish, and Turkish languages
- GitHub URL in `mcmod.info`
- GitHub URL in `MCmod.info`
- Proning in single player mode (**Note: Currently unanimated; player will appear standing**)
- Shells life got increased to 1606 with no performance impact in extreme cases
- Custom Death Messages when shot with a gun
- Custom death Messages when shot with a gun

### Changed

- Overhauled textures of AAC Honey Badger, Bushmaster ACR, Beowulf, HK 417, M16A1, 100rnd 5.56x45mm NATO STANAG Drum Magazine and the pink camo skin
- Overhauled animations and sound effects of the M40A6 and Uzi
- Overhauled the texture of the Leupold Scope, EOTech Holographic A65 Sight, Aim Point Comp M5 Sight, OKP-7 Sight, Bijia Reflex Sight, RMR Sight, and Eotech Hybrid HHS™ II Sight
- Overhauled animations and sound effects of the M40A6 and Uzi
- Sidearms can now be carried in backpacks
- Added keybindings to switching cameras on the tablet
- Reworked the config system:
- Old XML config has been removed, and all configs have been consolidated into a new JSON config. Issues with some non-functioning configs have been resolved
- Adjusted craftingmappings.json to now only override recipes, rather than removing all recipes
- Adjusted `craftingmappings.json` to now only override recipes, rather than removing all recipes
- Temporarily nerfed all vests as a part of vest problem mitigation
- Nerfed XP gains from smelting ores
- Reloading now only stops once the gun is fully reloaded or no compatible ammunition remains in inventory
Expand All @@ -66,20 +71,30 @@ and this project follows to [Ragnarök Versioning Convention](https://gist.githu
- Redstone Repeaters
- Cactus
- Cake
- Bullets collision has been enhanced to work compatibly with mods
- Updated `mcmod.info` description and credits
- Bullets collision has been enhanced to work better with mods
- Updated `MCmod.info` description and credits
- Migrated the config setting for bullets breaking glass into the new config file (ModernWarfareCubed.cfg)
- Forge configuration `Emissive Item Rendering` is now forced to be off (This does not influence Optifine emissive item rendering)
- OptiFine configuration `Fast Render` is now forced to be off
- Changed categories of some weapons
- Magazines are created empty
- Shells life go increased 1606% no performance impact in extreme cases
- The position of the bullet when shooting is now centered when aiming
- Explosive projectiles are now linked to the player who launched them meaning that the kill message will say who killed whom
- Explosive projectiles are now linked to the player who launched them, meaning that the kill message will say who killed whom
- Renamed `Armor` creative tab to `Equipment`
- Renamed `Ammunition` creative tab to `Ammunition & Magazines`
- Renamed `Grenades` creative tab to `Throwables`
- Renamed `MWC Camera` and `MWC Tablet` to `Camera` and `Tablet`
- When a thrown camera hits the ground it now only drops the camera item if the thrower is not in creative mode
- Merged the Gadget creative tab into the `Equipment` creative tab
- Debug commands are now only accessible to oped players (Oped of level 4)
- Rewritten the rendering system, items are now positions correctly everywhere

### Fixed

- Fixed entity generation issue (now modifying the entity's health and generation rate requires restarting the game)
- Fixed Minecraft armor making you invulnerable to bullets (less realistic but they aren't anyway lol)
- Fixed Minecraft armor making you invulnerable to bullet (less realistic, but they aren't anyway lol)
- Fixed soldiers and terrorists spawning with Minecraft armor
- Fixed issue with config for bullets breaking glass being ignored
- Fixed bullet's being able to penetrate:
- Glass
Expand All @@ -97,7 +112,7 @@ and this project follows to [Ragnarök Versioning Convention](https://gist.githu
- Fixed 3rd person hovering weapons such as the MP7, CZ-805 Bren, and Python and Taurus revolvers
- Fixed m249 accessories floating
- Fixed P90 magazine with Terminator conversion
- Fixed visual bugs for weapons like FN F2000 when aiming the gun, M4A1 with "M16 Stock", Malyuk and M40A6 with grip accessories, beowulf50Cal with m38 front sight, revolver-related accessories and general bipod adjustments on weapons
- Fixed visual bugs for weapons like FN F2000 when aiming the gun, M4A1 with M16 Stock, Malyuk and M40A6 with grip accessories, beowulf50Cal with m38 front sight, revolver-related accessories and general bipod adjustments on weapons
- Fixed the attachment of the Long Deagle
- Fixed prop hitboxes not lining up with their models:
- Fridge (open/closed)
Expand All @@ -118,6 +133,7 @@ and this project follows to [Ragnarök Versioning Convention](https://gist.githu
- Office Chair 2
- Home Chair
- White Desk Middle
- Fixed position of the backpacks in inventory

### Removed

Expand All @@ -131,8 +147,10 @@ and this project follows to [Ragnarök Versioning Convention](https://gist.githu

### Optimization

- As a result of a BIG code cleanup MWC as a whole should now be slightly faster, load slightly faster and use slightly less resources
- Losslessly compressed assets as a result the jar size decreased (35.3MB -> 27.57MB)
- As a result of a BIG code cleanup, MWC as a whole should now be slightly faster, load slightly faster and use slightly less resources
- As a result of the equipment overhaul, MWC should use less ram and lag less when rendering equipment
- As a result of networking improvements, MWC should use less bandwidth and consume less resources as well as have less latency
- Losslessly compressed assets as a result, the jar size decreased (35.3MB -> 27.57MB)
- Improved ShaderLoader
- Reduced overhead due to the removal of most of the compatibility layer leading to increased performance

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/modrinth_vector.svg">
</a>

<a href="https://www.curseforge.com/minecraft/mc-mods/modern-warfare-cubed">
<a href="https://www.curseforge.com/minecraft/MC-mods/modern-warfare-cubed">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/curseforge_vector.svg">
</a>

Expand Down
1 change: 1 addition & 0 deletions assets/equipment/belts/MagazineBelt.bbmodel

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ plugins {
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
id 'com.gtnewhorizons.retrofuturagradle' version '1.+'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'me.champeau.jmh' version '0.7.1'
id 'io.freefair.lombok' version '8.1.0'
}

// Add version to the jar name
Expand All @@ -32,7 +34,7 @@ minecraft {

username = 'Desoroxxx'

extraRunJvmArguments.addAll('-Xmx4G', '-Xms4G', '-Dforge.logging.console.level=debug', '-Dmixin.hotSwap=true', '-Dmixin.checks.interfaces=true', '-Dmixin.debug.export=true')
extraRunJvmArguments.addAll('-Xmx4G', '-Xms4G', '-Dforge.logging.console.level=debug', '-Dmixin.hotSwap=true', '-Dmixin.checks.interfaces=true', '-Dmixin.debug.export=true', '-Dfml.coreMods.load=com.paneedag.mwc.asm.MWCPlugin')

injectedTags.put('ID', project.id)
injectedTags.put('VERSION', project.version)
Expand Down Expand Up @@ -65,17 +67,26 @@ repositories {
}

dependencies {
implementation 'Red-Studio-Ragnarok:Red-Core:0.2'
sources 'Red-Studio-Ragnarok:Red-Core:0.2:sources@jar'
implementation 'Red-Studio-Ragnarok:Red-Core:0.3.1'
sources 'Red-Studio-Ragnarok:Red-Core:0.3.1:sources@jar'

String mixin = modUtils.enableMixins('zone.rong:mixinbooter:8.3', "mixins.${project.id}.refmap.json")
jmh 'org.openjdk.jmh:jmh-core:1.36'
jmh 'org.openjdk.jmh:jmh-generator-annprocess:1.36'

final String mixin = modUtils.enableMixins('zone.rong:mixinbooter:8.3', "mixins.${project.id}.refmap.json")
api (mixin) { transitive = false }
annotationProcessor 'org.ow2.asm:asm-debug-all:5.2'
annotationProcessor 'com.google.guava:guava:24.1.1-jre'
annotationProcessor 'com.google.code.gson:gson:2.8.6'
annotationProcessor (mixin) { transitive = false }
}

jmh {
warmupIterations = 5
iterations = 10
fork = 1
}

def at = project.files("src/main/resources/META-INF/${project.id}_at.cfg")

tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at)
Expand Down Expand Up @@ -108,7 +119,7 @@ jar {
manifest.attributes([
'ModSide': 'BOTH',
'FMLAT': "${project.id}_at.cfg",
'FMLCorePlugin': "com.paneedah.weaponlib.core.WeaponlibCorePlugin",
'FMLCorePlugin': "com.paneedah.mwc.asm.MWCPlugin",
'FMLCorePluginContainsFMLMod': 'true',
'ForceLoadAsMod': 'true'
])
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ org.gradle.caching = true
# Mod Constants
# Versioning must follow Ragnarök versioning convention: https://shor.cz/ragnarok_versioning_convention
id = mwc
version = 0.1-Dev-14
version = 0.1-Dev-15
8 changes: 8 additions & 0 deletions src/jmh/java/com/paneedah/mwc/RandomBenchmark.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.paneedah.mwc;

import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;

@State(Scope.Benchmark)
public class RandomBenchmark {
}
15 changes: 8 additions & 7 deletions src/main/java/com/paneedah/mwc/CustomSpawnEggs.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.paneedah.mwc;

import com.paneedah.mwc.proxies.CommonProxy;
import com.paneedah.mwc.utils.ModReference;
import com.paneedah.weaponlib.HighIQSpawnEgg;

import static com.paneedah.mwc.utils.ModReference.ID;

public class CustomSpawnEggs {

public static HighIQSpawnEgg TURRET_EGG;
Expand All @@ -15,24 +16,24 @@ public static void init(Object mod, CommonProxy proxy) {
.withID(1)
.withItemName("turret")
.withEntitySpawnName("turret")
.withBlockPredicate(b -> b.getRegistryName().toString().equals(ModReference.ID + ":turret_base"))
.withCreativeTab(MWC.ASSAULT_RIFLES_TAB)
.withBlockPredicate(b -> b.getRegistryName().toString().equals(ID + ":turret_base"))
.withCreativeTab(MWC.WEAPONS_TAB)
.build();

TURRETUPGRADED_EGG = new HighIQSpawnEgg.Builder()
.withID(2)
.withItemName("turretupgraded")
.withEntitySpawnName("turretupgraded")
.withBlockPredicate(b -> b.getRegistryName().toString().equals(ModReference.ID + ":turret_base"))
.withCreativeTab(MWC.ASSAULT_RIFLES_TAB)
.withBlockPredicate(b -> b.getRegistryName().toString().equals(ID + ":turret_base"))
.withCreativeTab(MWC.WEAPONS_TAB)
.build();

TURRETSILENCED_EGG = new HighIQSpawnEgg.Builder()
.withID(3)
.withItemName("turretsilenced")
.withEntitySpawnName("turretsilenced")
.withBlockPredicate(b -> b.getRegistryName().toString().equals(ModReference.ID + ":turret_base"))
.withCreativeTab(MWC.ASSAULT_RIFLES_TAB)
.withBlockPredicate(b -> b.getRegistryName().toString().equals(ID + ":turret_base"))
.withCreativeTab(MWC.WEAPONS_TAB)
.build();
}
}
48 changes: 30 additions & 18 deletions src/main/java/com/paneedah/mwc/MWC.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package com.paneedah.mwc;

import com.paneedah.mwc.creativetab.*;
import com.paneedah.mwc.handlers.ClientEventHandler;
import com.paneedah.mwc.init.MWCRecipes;
import com.paneedah.mwc.proxies.CommonProxy;
import com.paneedah.mwc.utils.ModReference;
import com.paneedah.mwc.utils.OptiNotFine;
import com.paneedah.weaponlib.ModContext;
import com.paneedah.weaponlib.command.BalancePackCommand;
import com.paneedah.weaponlib.command.CraftingFileCommand;
import com.paneedah.weaponlib.config.BalancePackManager;
import com.paneedah.weaponlib.crafting.CraftingFileManager;
import io.redstudioragnarok.redcore.RedCore;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
Expand All @@ -22,6 +21,11 @@
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import static com.paneedah.mwc.utils.ModReference.ID;
import static com.paneedah.mwc.utils.ModReference.NAME;
import static com.paneedah.mwc.utils.ModReference.VERSION;

// /$$ /$$ /$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$ /$$
// | $$$ /$$$ | $$ | $$ /$ | $$ /$$__ $$ /$$__ $$ | $$ | $$
Expand All @@ -31,19 +35,18 @@
// | $$\ $ | $$| $$ | $$| $$ | $$| $$_____/| $$ | $$ | $$ | $$$/ \ $$$ /$$__ $$| $$ | $$ /$$__ $$| $$ | $$_____/ | $$ $$| $$ | $$| $$ | $$| $$_____/| $$ | $$
// | $$ \/ | $$| $$$$$$/| $$$$$$$| $$$$$$$| $$ | $$ | $$ | $$/ \ $$| $$$$$$$| $$ | $$ | $$$$$$$| $$ | $$$$$$$ | $$$$$$/| $$$$$$/| $$$$$$$/| $$$$$$$| $$$$$$$
// |__/ |__/ \______/ \_______/ \_______/|__/ |__/ |__/ |__/ \__/ \_______/|__/ |__/ \_______/|__/ \_______/ \______/ \______/ |_______/ \_______/ \_______/
@Mod(modid = ModReference.ID, name = ModReference.NAME, version = ModReference.VERSION, dependencies = "required-after:redcore@[0.2,);", guiFactory = "com.paneedah.weaponlib.config.ConfigGUIFactory", updateJSON = "https://raw.githubusercontent.com/Cubed-Development/Modern-Warfare-Cubed/master/update.json")
@Mod(modid = ID, name = NAME, version = VERSION, dependencies = "required-after:redcore@[0.3.1,);", guiFactory = "com.paneedah.weaponlib.config.ConfigGUIFactory", updateJSON = "https://raw.githubusercontent.com/Cubed-Development/Modern-Warfare-Cubed/master/update.json")
public final class MWC {

public static final SimpleNetworkWrapper CHANNEL = NetworkRegistry.INSTANCE.newSimpleChannel(ModReference.ID);
public static final SimpleNetworkWrapper CHANNEL = NetworkRegistry.INSTANCE.newSimpleChannel(ID);

public static final CreativeTabs ARMOR_TAB = new ArmorTab(CreativeTabs.getNextID(), "ArmorTab");
public static final CreativeTabs ASSAULT_RIFLES_TAB = new AssaultRiflesTab(CreativeTabs.getNextID(), "AssaultRifles_tab");
public static final CreativeTabs AMMO_TAB = new AmmoTab(CreativeTabs.getNextID(), "AmmoTab");
public static final CreativeTabs ATTACHMENTS_TAB = new AttachmentsTab(CreativeTabs.getNextID(), "AttachmentsTab");
public static final CreativeTabs GRENADES_TAB = new GrenadesTab(CreativeTabs.getNextID(), "GrenadesTab");
public static final CreativeTabs GADGETS_TAB = new GadgetsTab(CreativeTabs.getNextID(), "GadgetsTab");
public static final CreativeTabs PROPS_TAB = new PropsTab(CreativeTabs.getNextID(), "props_tab");
public static final CreativeTabs BLOCKS_TAB = new BlocksTab(CreativeTabs.getNextID(), "BlocksTab");
public static final CreativeTabs EQUIPMENT_TAB = new ArmorTab(CreativeTabs.getNextID(), "equipment");
public static final CreativeTabs WEAPONS_TAB = new AssaultRiflesTab(CreativeTabs.getNextID(), "weapons");
public static final CreativeTabs AMMUNITION_AND_MAGAZINES_TAB = new AmmoTab(CreativeTabs.getNextID(), "ammunitionAndMagazines");
public static final CreativeTabs ATTACHMENTS_TAB = new AttachmentsTab(CreativeTabs.getNextID(), "attachments");
public static final CreativeTabs THROWABLES_TAB = new GrenadesTab(CreativeTabs.getNextID(), "throwables");
public static final CreativeTabs PROPS_TAB = new PropsTab(CreativeTabs.getNextID(), "props");
public static final CreativeTabs BLOCKS_AND_INGOTS_TAB = new BlocksTab(CreativeTabs.getNextID(), "blocksAndIngots");

// Todo: Make this configurable via the future YAML config system from FBP, or Valkyrie integration, the later would be best.
public static int bulletHitParticleMult = 6;
Expand All @@ -54,23 +57,32 @@ public final class MWC {
@SidedProxy(serverSide = "com.paneedah.mwc.proxies.CommonProxy", clientSide = "com.paneedah.mwc.proxies.ClientProxy")
public static CommonProxy commonProxy;

@EventHandler
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent preInitializationEvent) {
if (preInitializationEvent.getSide().isClient())
MinecraftForge.EVENT_BUS.register(ClientEventHandler.class);

commonProxy.preInit(this);
}

@EventHandler
@Mod.EventHandler
public void init(FMLInitializationEvent initializationEvent) {
MWCRecipes.register();
commonProxy.init(this);
}

@EventHandler
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent postInitializationEvent) {
commonProxy.postInit(this, postInitializationEvent);
}

@EventHandler

@Mod.EventHandler
@SideOnly(Side.CLIENT)
public void postInitClient(FMLPostInitializationEvent postInitializationEvent) {
RedCore.forceOptiFineFastRenderOff();
}

@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent serverStartingEvent) {
serverStartingEvent.registerServerCommand(new BalancePackCommand());
serverStartingEvent.registerServerCommand(new CraftingFileCommand());
Expand Down
34 changes: 34 additions & 0 deletions src/main/java/com/paneedah/mwc/asm/MWCPlugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.paneedah.mwc.asm;

import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;

import javax.annotation.Nullable;
import java.util.Map;

public class MWCPlugin implements IFMLLoadingPlugin {
@Override
public String[] getASMTransformerClass() {
return new String[0];
}

@Override
public String getModContainerClass() {
return null;
}

@Nullable
@Override
public String getSetupClass() {
return null;
}

@Override
public void injectData(Map<String, Object> data) {

}

@Override
public String getAccessTransformerClass() {
return null;
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/paneedah/mwc/bases/BlockBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public BlockBase(String registryName) {
setHardness(6F);
setResistance(15F);
setHarvestLevel("pickaxe", 2);
setCreativeTab(MWC.BLOCKS_TAB);
setCreativeTab(MWC.BLOCKS_AND_INGOTS_TAB);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/paneedah/mwc/bases/ItemBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public ItemBase(String registryName) {

setMaxStackSize(stackSize);
// Might want to change that?
setCreativeTab(MWC.BLOCKS_TAB);
setCreativeTab(MWC.BLOCKS_AND_INGOTS_TAB);
}

public void setStackSize(int stackSize) {
Expand All @@ -25,7 +25,7 @@ public void setStackSize(int stackSize) {

/*
* OreDictionary Keys (compatibility)
* https://mcreator.net/wiki/ore-dictionary-names-list for commonly used OreDict names
* https://MCreator.net/wiki/ore-dictionary-names-list for commonly used OreDict names
* Don't hesitate to use this :D
*/
public void setOreDict(String[] oreDictKeys) {
Expand Down
Loading

0 comments on commit 4991cb3

Please sign in to comment.