Giter Site home page Giter Site logo

weaponmechanics / mechanicsmain Goto Github PK

View Code? Open in Web Editor NEW
66.0 2.0 23.0 351.08 MB

A New Age of Weapons in Minecraft.

Home Page: https://www.spigotmc.org/resources/WeaponMechanics.99913/

License: MIT License

Java 95.46% Batchfile 0.04% Kotlin 4.46% Shell 0.04%
spigot-plugin spigot weaponmechanics minecraft bukkit bukkit-plugin guns minecraft-plugin paper plugin

mechanicsmain's Introduction

Image

Spigot Discord Download Version Wiki License

High performance, fully featured gun plugin for newer Minecraft versions.

Quick Links

How to (Server Owners)

See the Weapon Modules section on the wiki.

How to (Developers)

See Hooking into WeaponMechanics for detailed API information. See Contributing for information on how to contribute to the project.

Maven

WeaponMechanics is available on Maven Central. To use it, add the following to your pom.xml:

<dependencies>
    <dependency>
        <groupId>com.cjcrafter</groupId>
        <artifactId>weaponmechanics</artifactId>
        <version>3.3.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Gradle

Add the following into your build.gradle.kts:

repositories {
    mavenCentral()
}

dependencies {
    implementation("com.cjcrafter:weaponmechanics:3.3.0")
}

Support the Developers

WeaponMechanics is the combination of hundreds of hours of work. If you appreciate the work that was put into the plugin, please consider donating.

mechanicsmain's People

Contributors

2008choco avatar cjcrafter avatar deecaad avatar feyxiexzf avatar galacticwarrior9 avatar halfuwu avatar mcmdev avatar melonhell avatar shakytimon avatar thierryboiago avatar vierdant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mechanicsmain's Issues

Play sound when a weapon is selected/unselected in the hotbar.

Description

Was a feature on CrackShotPlus, used this on every weapon I made.
Made weapons feel more natural.
It is simple, You scroll through items in your hotbar, when it goes over a weapon recognized by WeaponMechanics, the sounds you have configured for this weapon should play once.
Additional feature request: Sounds for unselecting the weapon.

Configuration

Item:
  Custom_Equip_Sound: <Sound-Volume-Pitch-Delay>,<...>
  Custom_Holster_Sound: <Sound-Volume-Pitch-Delay>,<...>

Gun unload/empy magazine when you load

Description

A way for unload the gun and give back ammo (maybe not the magazine full/or maybe just projectiles) and when you load a gun he gives you back the magazine empy

Configuration

Ammo:
Give_ammo_back_when_you_unload: <true/false>
Give_magazine: <true/false>
Ammo_Item_ID: ITEM
Ammo_Name_Check: "NAME"
Give_empy_magazine_when_you_load_gun: : <true/false>

Toggleable option if broken blocks drop themselves

Description

Currently blocks broken from explosions do not drop themselves, making it not very useful in Survival focussed servers.
Adding a toggle to allow broken blocks to be dropped as items should fix this.

Configuration

  Explosion:
    Block_Damage:
      Break_Blocks: true
      Drop_Broken_Blocks: <true/false>

EntityEquipmentEvent

The EntityEquipmentEvent is an ongoing project to be able to detect all changes to an EntityEquipment. It works best for non-stackable items (tools/weapons), but should work for all items.

Current Known Issues:

  • Doesn't work at all in versions <1.11
  • Sometimes items appear to disappear
  • Behavior of event changes depending on player gamemode
  • Placing blocks in survival mode seems to cause issues

Dynamic version check

Link to code

https://github.com/WeaponMechanics/MechanicsMain/blob/master/WeaponMechanics/src/main/java/me/deecaad/weaponmechanics/WeaponMechanicsLoader.java#L66

Related Issues

None

Improvements

Currently, this code must be changed for each version. This is not ideal, and it should be able to read the current version from gradle.

This will involve using BuildWeaponMechanics to generate some file (MechanicsCoreVersion.txt) in WeaponMechanics.jar which contains the current version of MechanicsCore. From there, we can read that file as a resource, and append the version to a link to the latest github download.

Better dual-wielding support

Description

Describe as well as you can about the feature you're requesting

  • weapon info display integration
  • trigger dual wield support
  • modify spread and recoil when dual-wielding support

Configuration

  • weapon info display integration
    Weapon_Info_Display:
      Action_Bar:
        Message: <string>
        Time: <ticks>
      Title:
        Title: <string>
        Subtitle: <string>
        Time: <fade in ticks>-<stay ticks>-<fade out ticks>
      Boss_Bar:
        Title: <string>
        Bar_Color: <string>
        Bar_Style: <string>
        Time: <ticks>
      Update_Item_Name: <true/false>
      Show_Ammo_In:
        Boss_Bar_Progress: <true/false>
        Exp_Level: <true/false>
        Exp_Progress: <true/false>
      Dual_Wielding:
        Action_Bar_Message: <string>
        Title: <string>
        Subtitle: <string>
        Boss_Bar: <string>
Placeholder_Symbols:
  Dual_Wield_Separator: " &7| "
  • trigger dual wield support
  Trigger:
    Main_Hand: right_click
    Off_Hand: right_click
    Dual_Wield:
      Main_Hand: right_click
      Off_Hand: left_click
  • modify spread and recoil when dual-wielding support
      Modify_Spread_When + recoil + increasing spread:
        Zooming: <amount> or <amount>%
        Sneaking: <amount> or <amount>%
        Standing: <amount> or <amount>%
        Walking: <amount> or <amount>%
        Swimming: <amount> or <amount>%
        In_Midair: <amount> or <amount>%
        Gliding: <amount> or <amount>%
        Dual_Wielding: <amount> or <amount>%

actual magazines

Description

The possibility for guns to actually use magazines, similar to how it is on flans mod. the magazines save the ammo in them and when reloading it just takes another one from your inventory. An empty magazine disappears (or maybe it just puts empty magazines into the inventory). While a partially empty magazine has nbt data that separates it from others and saves how much ammo is left. Reloading with that magazine will only give you the amount of ammo in that magazine.

Configuration

dunno tbh

Testing - projectile.settings

What
Wiki link

Details

  • reasonable amount of different ProjectileTypes (especially things like snowball, arrow)
  • width and height (easiest to test with absurd amount, most of the time should be kept 0.25)
  • test that for example falling_block projectile works correctly with projectile_item_or_block

Can you think of ways to break this feature?
Projectiles appearing wrong visually

When posting testing results, make sure to include configurations used!

OnFire ModelChange Event

Description

This could be enabled or a disabled feature just want to point that out. When firing the weapon if enabled by adding the "OnFire" prefix to the skins, the model of the gun will change, for example in this case a we use a muzzleflash texture. Same model but with a texture of fire to simulate a muzzle fire in front of it.

Pros:
You can get creative by making guns glow when firing or have barrels glow red or like in my case muzzle flashes.

Cons:
It may remove the possibility to make skins for a gun given that you would have to make separate textures for each skin when the gun shoots instead it would assign a default skin when shooting but you have lets say a blue skinned gun. By itself its a blue gun, when I fire I get a black skinned gun with muzzle texture but resorts back to being blue when not shooting.

Sounds good on paper but may be poorly executed? let me know your thoughts!
SuperCSS20#1776

Configuration

Skin:
    Default:
      Custom_Model_Data: 1
    Scope:
      Custom_Model_Data: 2
    OnFire:
      Custom_Model_data: 3
    OnFireScope:
      Custom_Model_data: 4

1.18.2 Support

Description

Add support for Minecraft version 1.18.2

In code, 1_18_R2

Armor

Description

An option for make armor:
Armor can be used for give effect to the player that wear it (a single piece or the entire set), protect the player from some guns, and it might help server owner for pvps server.

Configuration

Armor:
Enable: <true/false>
Apply_Potion_Effect_When_You_Wear_Only_A_Piece: (Effect)-(ticks)-(level)
Apply_Potion_Effect_When_You_Wear_The_Entire_Set: (Effect)-(ticks)-(level)
Apply_Command_When_You_Wear_Only_A_Piece: (command)
Apply_Command_When_You_Wear_The_Entire_Set: (command)
Armor_Piece: (helmet,chestplate,leggins,boots)
Other_Piece_Of_Armor: (ID1),(ID2),(ID3),(ID4)
Resistance_To_Weapon:
- (gun name)-(max resistance percentage)-(mix resistance percentage) #resistance percentage are the percentage that the armor can "protect" you from the gun

Weapon Jamming and reload

Description

ability to make it so that weapons can jam, this can incentivize more expensive weapons due to cheaper ones being more likely to fail. You set a percent chance of failure and then a time to fix the jam. jams would be fixed by pressing the reload key. Different times per weapon can be set. Perhaps also add the ability to set a minimum and maximum reload and jam clean time. default is 0.00, no weapon jamming.

Configuration

jamming_chance: 0.00-100.00
minimum_clean_time: 4
maximum_clean_time: 7

Getting double messages when I don't have permissions for a command

Has this issue already been reported? Did you ask for help before making this report?

  • I have searched the existing issues
  • I have asked for help

Current Behavior

There are 2 error messages when I don't have permission for the comman
2022-01-08_11 47 42
d

Expected Behavior

Only 1 error message

Steps To Reproduce

  1. Remove all permissions
  2. Use /wm get or /wm

Frequency

100% of the time when invalid perms

Version and Log

Need op to use /wm info, needs fix

Screenshot 2022-01-08 114920

Anything else?

No response

WM items compatibility issue with Citizens

Has this issue already been reported? Did you ask for help before making this report?

  • I have searched the existing issues
  • I have asked for help

Current Behavior

When giving Citizen NPC weapon item this error occurs removing the NPC

[17:29:17] [Server thread/ERROR]: Entity threw exception at world:398.5297,32.5,-372.9959
java.lang.NullPointerException: Cannot invoke "net.minecraft.nbt.NBTBase.c()" because the return value of "java.util.Map$Entry.getValue()" is null
	at net.minecraft.nbt.CompoundTag.copy(CompoundTag.java:459) ~[?:?]
	at net.minecraft.world.item.ItemStack.cloneItemStack(ItemStack.java:662) ~[paper-1.18.1.jar:git-Paper-177]
	at net.minecraft.world.item.ItemStack.copy(ItemStack.java:653) ~[paper-1.18.1.jar:git-Paper-177]
	at net.minecraft.world.entity.LivingEntity.lambda$handleEquipmentChanges$6(LivingEntity.java:3066) ~[?:?]
	at java.util.Map.forEach(Map.java:713) ~[?:?]
	at net.minecraft.world.entity.LivingEntity.handleEquipmentChanges(LivingEntity.java:3065) ~[?:?]
	at net.minecraft.world.entity.LivingEntity.detectEquipmentUpdates(LivingEntity.java:2993) ~[?:?]
	at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:2895) ~[?:?]
	at net.minecraft.world.entity.decoration.ArmorStand.tick(ArmorStand.java:687) ~[?:?]
	at net.citizensnpcs.nms.v1_18_R1.entity.nonliving.ArmorStandController$EntityArmorStandNPC.k(ArmorStandController.java:113) ~[Citizens-2.0.29-b2464.jar:?]
	at net.minecraft.server.level.ServerLevel.tickNonPassenger(ServerLevel.java:1128) ~[?:?]
	at net.minecraft.world.level.Level.guardEntityTick(Level.java:970) ~[?:?]
	at net.minecraft.server.level.ServerLevel.lambda$tick$5(ServerLevel.java:670) ~[?:?]
	at net.minecraft.world.level.entity.EntityTickList.forEach(EntityTickList.java:43) ~[paper-1.18.1.jar:git-Paper-177]
	at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:650) ~[?:?]
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1607) ~[paper-1.18.1.jar:git-Paper-177]
	at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:480) ~[paper-1.18.1.jar:git-Paper-177]
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1470) ~[paper-1.18.1.jar:git-Paper-177]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1264) ~[paper-1.18.1.jar:git-Paper-177]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-177]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

Expected Behavior

That error won't happen

Steps To Reproduce

Give weapon for citizen NPC

Frequency

100%?

Version and Log

Paper 1.18.1

Anything else?

No response

Scope issue

Has this issue already been reported? Did you ask for help before making this report?

  • I have searched the existing issues
  • I have asked for help

Current Behavior

Kick & error

Expected Behavior

Everything goes smoothly

Steps To Reproduce

  1. I assume this is a scope issue

Frequency

Don't know

Version and Log

1.18

Anything else?

https://pastebin.com/8RacwVgf

Improve FakeEntity Metadata Packet Handling

Link to code

https://github.com/WeaponMechanics/MechanicsMain/blob/master/CoreCompatibility/Core_1_18_R1/src/main/java/me/deecaad/core/compatibility/entity/FakeEntity_1_18_R1.java#L242-L267

Related Issues

N/A

Improvements

This improvement will remove the need for a #getMetaPacket() method, and it will improve performance by skipping cloning every meta item and only cloning the ones we change.

public void setGlowing(boolean flag) {
    // this 'entity' is a net.minecraft.world.entity
    entity.setSharedFlag(6, flag)
}

Consider removing EntityMeta and BitMutator (though it could be useful for changing meta of entities that already exist).

For the performance benefit, call new ClientboundSetEntityDataPacket(entity.getId(), entity.getEntityData(), false)

Overheating guns

Description

A option to make guns overheating (unable to shoot) and take more damage to the gun or apply potion effects to the player.

Configuration

Shoot:
  Overheating:
    Enable: <true/false>
    Shoots_Takes_Before_Overheating: <number>
    Bonus_Durability_Per_Overheating: <negative number>
    Apply_Effect_When_Overheating: <potion effect>-tick-level_effect,<potion effect>-tick-level_effect
    Bonus_Damage_Per_Overheating_To_Target: <number>
    Overheating_Message: "&cThe weapon is overheating!"
    Cooling_Cooldown: <number>
    Cool_Weapon_While_In_Water: <true/false>
    Bonus_Cooling_Weapon_While_In_Water: <number>

Edit CJCrafter: Fixed code format

Delays between aiming and switching guns.

Description

So basically I'm asking for a configurable delay per gun when you switch to a gun in your hotbar and one when you scope in/out.
Like, heavier weapons could take longer to equip when switching to them and also take longer to aim in or out.

During the delay, the weapon cannot be fired, however reloading should be still allowed, and unscoping during the scope delay should also be allowed so you shouldn't have to wait too long if you accidently aim for example.

Configuration

Scope:
  Firing_Delay_When_Scoping: <integer> (Should support decimals)
Info:
  Firing_Delay_When_Equipping: <integer> (Should support decimals)

Model engine support

Description

Support for custom mythicmobs using modelengine models. currently guns won't function if you are looking at a modelengine mob and are close enough to interact with it, I believe this is because modelengine uses armor stands. Modelengine also uses custom hitboxes, and I'm not sure if WeaponMechanics supports this, as it's difficult to tell on normal-sized mobs. but many modelengine users make huge bosses, and that could be a big issue for them if WM projectiles don't work with custom-sized ModelEngine hitboxes.

Configuration

ME_compat:
  enabled: <true/false>

Melee

Description

Melee mode like configuration below

Configuration

  Melee:
    Enable_Melee: <true/false>
    Melee_Attachment: <melee weapon name>
    Melee_Range: <maximum melee range>
    Melee_Hit_Delay: <ticks>
    Consume_Ammo_On_Hit: <true/false>
    Melee_Miss:
      Mechanics: <MechanicsSerializer>
      Melee_Miss_Delay: <ticks>
      Consume_Ammo_On_Miss: <true/false>

Testing - reload.ammo

What
Wiki link

Details

  • out_of_ammo triggers correctly
  • exp as ammo works
  • money as ammo works
  • item as ammo works
  • item ammo with magazines works
  • filling magazine works
  • unload_ammo_on_reload and ammo_per_reload works with item and magazine reload ++ exp and money

Can you think of ways to break this feature?
Filling doesn't work properly, items aren't consumed properly, ammo converting takes too much time

When posting testing results, make sure to include configurations used!

Gives the player a visual arm to hold the gun

Description

Let the player in the first person can see the other hand (maybe the left hand?) Holding a firearm
I think this can be implemented as a side-effect.
Offered for use with guns that don't use the sidearm function :)
Since I'm using version 1.14 or above, the next ones used are CustomModelData, which you can optimize
#1 My idea is to hold an item in the left hand, and make a model of the arm to change the model of the item and change the position of the model of the left hand

Configuration

weapons_arm:
  Default: <custom_model_data>
  Default_Hand: <custom_model_data> #1
  Scope: <custom_model_data>
  Scope_Hand: <custom_model_data>

etc

Mythicmobs addon

Description

An addon for permits to shoot/throw grenate/use melee weapon to mobs in Mythicmobs with an addon for Mythicmobs

Configuration

(In mythicmobs)
Enable_WM_Gun: <T/F>
Gun:
Switch_Gun_When_No_Ammo: <T/F>
Sec_Gun:

Falling blocks glide when on ground

Expected Behavior
The tick a block (thrown from an Explosion) touches the ground, it should be removed.

Observed Behavior
Sometimes, a few blocks will sit on the ground for a few ticks.
https://user-images.githubusercontent.com/43940682/147023361-1879dc8d-3fcb-4825-ab99-d2ddef9044d9.mp4

Steps to Reproduce
Use a weapon that spawns falling blocks during explosions

  Explosion:
    Explosion_Exposure: OPTIMIZED
    Explosion_Shape: DEFAULT
    Explosion_Type_Data:
      Yield: 5
      Rays: 16
    Detonation:
      Impact_When:
        Entity: true
        Block: true
    #Regeneration:
    #  Ticks_Before_Start: 200
    #  Max_Blocks_Per_Update: 100 # this should help reduce CPU load by scheduling 1 task for every 10 blocks
    #  Ticks_Between_Updates: 2
    Block_Damage:
      Break_Blocks: true
      Blacklist: true
      Damage_Per_Hit: 4
      Spawn_Falling_Block_Chance: 1.0
      Block_List:
        - $GLASS
      Shots_To_Break_Blocks:
        - STONE~4

Frequency
50% of blocks that stay near the ground will show this gliding issue

Version
image

Additional context
This feature was working properly in 1.15, it is possible that changes to motion have caused it to break in newer versions

Explosion Block_Damage

Has this issue already been reported? Did you ask for help before making this report?

  • I have searched the existing issues
  • I have asked for help

Current Behavior

When only $GLASS is defined in Block_List and Spawn_Falling_Block_Chance: 0.75

  1. With Blacklist: true
    All blocks expect GLASS gets destroyed, but Spawn_Falling_Block_Chance is also used for GLASS blocks that aren't destroyed. This is only a visual bug.

  2. With Blacklist: false
    Correct blocks (GLASS) gets destroyed properly. Null is thrown at this line. Id expect spawn falling block bug is here also for all blocks.

Expected Behavior

When a block isn't actually destroyed its falling blocks won't be sent either

Steps To Reproduce

RPG-7:
  Info:
    Weapon_Item:
      Type: "FEATHER"
      Name: "&6RPG-7"
      Unbreakable: true
      Hide_Flags: true
      Attributes:
        - "GENERIC_MOVEMENT_SPEED--0.02855"
      Deny_Use_In_Crafting: true
    Weapon_Info_Display:
      Action_Bar:
        Message: "&6RPG-7 &7«&6%ammo-left%&7»&6%reload%"
        Time: 40
    Weapon_Get_Mechanics:
      Sounds:
        - "ITEM_ARMOR_EQUIP_CHAIN-1-0.75"
    Cancel:
      Drop_Item: true
      Swap_Hands: true
      Arm_Swing_Animation: true
  Skin:
    Default:
      Custom_Model_Data: 101
    Scope:
      Custom_Model_Data: 111
  Projectile: "rocket_launcher.Projectile"
  Shoot:
    Trigger:
      Main_Hand: "RIGHT_CLICK"
      Off_Hand: "RIGHT_CLICK"
      Deny_When:
        Swimming: true
    Projectile_Speed: 40
    Spread:
      Base_Spread: 0.55
      Modify_Spread_When:
        Zooming: 50%
        Sneaking: 50%
        Walking: 0.1
        In_Midair: 150%
        Gliding: 200%
    Recoil:
      Push_Time: 200
      Recover_Time: 200
      Horizontal:
        - 11
        - -11
      Vertical:
        - 11
    Mechanics:
      Sounds:
        - "custom:shoot.rpg7-6-1-0-0.1"
  Reload:
    Trigger:
      Main_Hand: "DROP_ITEM"
      Off_Hand: "DROP_ITEM"
    Magazine_Size: 1
    Reload_Duration: 71
    Start_Mechanics:
      Sounds:
        - "BLOCK_NOTE_BLOCK_HAT-0.5-1-0-0.1"
        - "BLOCK_PISTON_CONTRACT-0.5-1-2-0.1"
        - "ITEM_FLINTANDSTEEL_USE-0.5-1.5-33"
        - "ITEM_FLINTANDSTEEL_USE-0.5-1.7-35"
        - "ITEM_FLINTANDSTEEL_USE-0.5-1.9-37"
        - "BLOCK_PISTON_EXTEND-0.5-1-69-0.1"
  Damage:
    Base_Damage: 12.2
    Base_Explosion_Damage: 12.2
    Fire_Ticks: 40
    Armor_Damage: 4
  Explosion:
    Explosion_Exposure: "DEFAULT"
    Explosion_Shape: "SPHERE"
    Explosion_Type_Data:
      Radius: 5.6
    Detonation:
      Impact_When:
        Entity: true
        Block: true
    Block_Damage:
      Break_Blocks: true
      Spawn_Falling_Block_Chance: 0.75
      Blacklist: false
      Block_List:
        - "$GLASS"
    Regeneration:
      Ticks_Before_Start: 300
      Max_Blocks_Per_Update: 3
      Ticks_Between_Updates: 5
    Flashbang:
      Effect_Distance: 11.2
      Mechanics:
        Potion_Effects:
          - "CONFUSION-200-3-false"
  Scope:
    Trigger:
      Main_Hand: "LEFT_CLICK"
      Off_Hand: "LEFT_CLICK"
    Zoom_Amount: 6
    Mechanics:
      Sounds:
        - "custom:scope.in-0.5-1-0-0.1"
    Zoom_Off:
      Mechanics:
        Sounds:
          - "custom:scope.out-0.5-1-0-0.1"

rocket_launcher:
  Projectile:
    Projectile_Settings:
      Type: "WITHER_SKULL"
      Minimum:
        Speed: 25
      Gravity: 0.02
      Decrease_Motion:
        Base: 0.99
        In_Water: 0.96
        When_Raining_Or_Snowing: 0.98

Frequency

100%

Version and Log

https://imgur.com/qqsEO7Z

[21:17:10] [Server thread/WARN]: [WeaponMechanics] Task #524 for WeaponMechanics v0.3.0 generated an exception
java.lang.NullPointerException: Cannot invoke "me.deecaad.weaponmechanics.weapon.damage.BlockDamageData$DamageData.isBroken()" because "data" is null
        at me.deecaad.weaponmechanics.weapon.explode.Explosion.damageBlocks(Explosion.java:368) ~[?:?]
        at me.deecaad.weaponmechanics.weapon.explode.Explosion.explode(Explosion.java:273) ~[?:?]
        at me.deecaad.weaponmechanics.weapon.projectile.weaponprojectile.RayTraceResult$1.run(RayTraceResult.java:129) ~[?:?]
        at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftTask.run(CraftTask.java:82) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3368-Spigot-8965a50-2a2caa7]
        at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:415) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3368-Spigot-8965a50-2a2caa7]
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1255) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3368-Spigot-8965a50-2a2caa7]
        at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:428) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3368-Spigot-8965a50-2a2caa7]
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1206) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3368-Spigot-8965a50-2a2caa7]
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1034) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3368-Spigot-8965a50-2a2caa7]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3368-Spigot-8965a50-2a2caa7]
        at java.lang.Thread.run(Thread.java:833) [?:?]

Anything else?

No response

Compatibility interfaces - Spigot contribution

As we are going to make Spigot contributions to get rid of compatibility usage in newer versions, we have to get rid of methods such as Object getDestroyPacket(Object entity);. They should be modified to work like void sendDestroyPacket(int entityId)

https://github.com/DeeCaaD/MechanicsMain/blob/master/MechanicsCore/src/main/java/me/deecaad/core/compatibility/block/BlockCompatibility.java

https://github.com/DeeCaaD/MechanicsMain/blob/master/MechanicsCore/src/main/java/me/deecaad/core/compatibility/entity/EntityCompatibility.java

This isn't yet relevant, but when we make those Spigot contributions, it becomes relevant ^^

Testing - projectile.through

What
Wiki link

Details

  • maximum pass throughs works for entities and blocks
  • allow any block / entity works (this overrides List and Whitelist)
  • whitelist and blacklist
  • speed modifier

Can you think of ways to break this feature?
This should work properly as I tested these pretty well back then, but still requires testing

When posting testing results, make sure to include configurations used!

Homing ( projectile )

Description

from crack shot plus, homing and manual homing were some pretty fun and cool features, i'm not sure if it's already on WeaponMechanics but they should.

Configuration

Homing:
Homing_Manual: <true/false> ( keeping it true will make players move the projectile around like hl2 rocket, false will be default and will follow enemy )
Other_Option_for_homing: ( aother options from csp )
etc.

-- this is for projectiles --

Out of ammo skin

Description

A skin for a gun when it has no ammo left (0 ammo in inventory or it says 0 in its ammo amt).

Configuration

Skin:
Out_Of_Ammo_Inv: #for when there is no ammo in the inventory
Out_Of_Ammo_Gun: #for when there it says 0 in its ammo amt

Add Vanilla Command Arguments/Validation

Link to code

https://github.com/WeaponMechanics/MechanicsMain/tree/master/MechanicsCore/src/main/java/me/deecaad/core/commands

Related Issues

No response

Improvements

Lets say you are making a CSGO or Valorant or similar server. You need to give weapons to each member of a team. You cannot do this using /wm give since it doesn't accept command arguments like @a[type=PLAYER,team=blue]. However, in vanilla MC, commands handle this automatically.

MC also shows validation through colors, making command usage more responsive on the fly. To handle this,
you need an NMS based command api.

Existing:

Option to reload guns on death

Description

An option to reload the player's guns when they die.

Configuration

Reload_on_death:
  Enabled: <true/false>
  Blacklist:
  - <gun_name>
  - <gun_name>

Shooting mobs with guns does not count as a player attack, so animals will not run around, and zombie piglins will not becom hostile

Has this issue already been reported? Did you ask for help before making this report?

  • I have searched the existing issues
  • I have asked for help

Current Behavior

Shooting mobs with guns does not count as a player attack, so animals will not run around, and zombie piglins will not becom hostile

Expected Behavior

For guns to properly affect mobs

Steps To Reproduce

shoot zombie piglins and animals in survival

Frequency

100%

Version and Log

image
No issues in server log

Anything else?

No response

Attachments

Description

Attachments would be a cool feature to have, just like you had on your crackshotplus plugin. Stuff like supressors, extended clips, scopes and more.

Configuration

##In the weapons config
WEAPON_HERE
Extended_Clip:
  enabled: true

Also an attachments folder with the configurable attachments, such as setting how many bullets the extended clip can hold, how much zooms does, sounds etc.

Testing - projectile.bouncy

What
Wiki link

Details

  • maximum bounce amount works for entities and blocks
  • allow any block / entity works (this overrides List and Whitelist)
  • whitelist and blacklist
  • speed modifier

Can you think of ways to break this feature?
This should work properly as I tested these pretty well back then, but still requires testing. With larger projectile hitboxes this doesn't always work properly.

When posting testing results, make sure to include configurations used!

Different ammo types

Description

Different ammo types that can be used on the same gun, things like poison bullets, incindeary shells, ap and he rockets, etc.
one gun can reload a different ammo type that changes stats like recoil, damage, trajectory, etc.

Configuration

use advanced ammos: true
insert gun here:
possible_ammos:
.45, .45_poison, .45_fire

then instead of a weapon config for details like recoil, damage, etc. there are ammo configs.

CSP Durability re-implementation

Description

Simply, re-add the durability system in CSP (the config above is copy-pasted from the wiki of CSP)

Configuration

    Weapon_Durability:
        Maxium_Durability: <Integer>
        Lose_Durability_Per_Shot: <Double>
        Weapon_Lose_Durability_Message: <String>~<String>
        Deny_Weapon_Usage_Instead_Of_Breaking: <Boolean>
        Weapon_Break_Message: <String>
        Weapon_Break_Sound: <String>-<Double>-<Double>,<etc.>

2 resource pack issues

Has this issue already been reported? Did you ask for help before making this report?

  • I have searched the existing issues
  • I have asked for help

Current Behavior

Some of the default items such as grenades show up as feathers

Full list of all items with this issue:

R9-0
Grenade
Flashbang
Cluster Grenade
AX-50
Airstrike
Semtex
Stim

Expected Behavior

the resource pack to work correctly with all items

Steps To Reproduce

use the plugin and resource pack then give yourself the afore-mentioned items

Frequency

100% of the time

Version and Log

No log, texture issue

Anything else?

image

Unload ammo

Description

unload the gun by left-clicking on the weapon in inventory or add command /ammoremove

Configuration

Ammo_Unload:
Unload: <true/false>
TRIGGER: 'LEFT_CLICK'

Choosing which fire mode is the default fire mode.

Description

Currently Semi will always be defaulted when a gun is spawned.
This is annoying for automatic weapons to turn them to Auto or Burst everytime they are given.

A simple solution is a simple option to choose which fire mode is the default fire mode.

Configuration

Selective_Fire:
  Trigger: <TriggerSerializer>
  Default: <Fire Mode>
  Mechanics: <MechanicsSerializer>

FAWE Compatibility Issue

Has this issue already been reported? Did you ask for help before making this report?

  • I have searched the existing issues
  • I have asked for help

Current Behavior

When you run a command like //wand, FAWE will async add an item to your inventory. This causes an error in console since the EntityEquipmentEvent can not be called async. The devs threw thread-safety out the window for... command performance? Not entirely clear, but either way the decision was made.

Expected Behavior

The plugin shouldn't throw an error.

Steps To Reproduce

  1. Install FAWE
  2. Install MechanicsCore
  3. Use //wand
  4. Check console

Frequency

100% of the time

Version and Log


[19:13:34]
[ERROR] An unexpected error while handling a FastAsyncWorldEdit command
java.lang.IllegalStateException: EntityEquipmentEvent may only be triggered synchronously.
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:616) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at me.deecaad.core.events.triggers.EquipListener.lambda$inject$0(EquipListener.java:194) ~[MechanicsCore-1.0.0.jar:?]
at me.deecaad.core.compatibility.equipevent.NonNullList_1_18_R1.set(NonNullList_1_18_R1.java:48) ~[MechanicsCore-1.0.0.jar:?]
at me.deecaad.core.compatibility.equipevent.NonNullList_1_18_R1.set(NonNullList_1_18_R1.java:16) ~[MechanicsCore-1.0.0.jar:?]
at net.minecraft.world.entity.player.Inventory.setItem(Inventory.java:500) ~[?:?]
at org.bukkit.craftbukkit.v1_18_R1.inventory.CraftInventory.setItem(CraftInventory.java:99) ~[paper-1.18.1.jar:git-Paper-123]
at org.bukkit.craftbukkit.v1_18_R1.inventory.CraftInventoryPlayer.setItem(CraftInventoryPlayer.java:74) ~[paper-1.18.1.jar:git-Paper-123]
at org.bukkit.craftbukkit.v1_18_R1.inventory.CraftInventoryPlayer.setItemInMainHand(CraftInventoryPlayer.java:37) ~[paper-1.18.1.jar:git-Paper-123]
at com.sk89q.worldedit.bukkit.BukkitPlayer.giveItem(BukkitPlayer.java:169) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at com.sk89q.worldedit.extension.platform.PlayerProxy.giveItem(PlayerProxy.java:84) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at com.sk89q.worldedit.command.SelectionCommands.wand(SelectionCommands.java:334) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at com.sk89q.worldedit.command.SelectionCommandsRegistration.cmd$_wand(SelectionCommandsRegistration.java:404) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at org.enginehub.piston.CommandManager.execute(CommandManager.java:157) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at com.sk89q.worldedit.extension.platform.PlatformCommandManager.lambda$handleCommandOnCurrentThread$16(PlatformCommandManager.java:728) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at com.sk89q.worldedit.extension.platform.PlatformCommandManager.handleCommandTask(PlatformCommandManager.java:749) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at com.sk89q.worldedit.extension.platform.PlatformCommandManager.handleCommandOnCurrentThread(PlatformCommandManager.java:730) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at com.sk89q.worldedit.extension.platform.PlatformCommandManager.lambda$handleCommand$13(PlatformCommandManager.java:700) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at com.sk89q.worldedit.extension.platform.AbstractPlayerActor.lambda$runAction$1(AbstractPlayerActor.java:672) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at com.fastasyncworldedit.core.util.task.AsyncNotifyQueue.lambda$run$0(AsyncNotifyQueue.java:28) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at com.fastasyncworldedit.core.util.task.AsyncNotifyQueue.lambda$call$1(AsyncNotifyQueue.java:45) ~[FastAsyncWorldEdit-Bukkit-2.0.2-SNAPSHOT-94 (1).jar:?]
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1428) ~[?:?]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]

Anything else?

The best solution is to stop using FAWE. WorldEdit is still getting updates as of February 2022.

The other solution is for MechanicsCore to skip the EntityEquipmentEvent when called async. While this will cause minor issues (Losing track of entity equipment), I can't think of a better solution.

Testing - projectile.sticky

What
Wiki link

Details

  • allow any block / entity works (this overrides List and Whitelist)
  • whitelist and blacklist
  • projectile location is updated when entity moves with sticky projectile

Can you think of ways to break this feature?
When block is destroyed or entity dies the projectile should drop. When used with stick to entities there should be something like explosive to remove the projectile

When posting testing results, make sure to include configurations used!

Weapon up & down

Expected Behavior
Weapon wouldn't go up and down

Observed Behavior
Weapon going up and down when shooting

Steps to Reproduce
Take any weapon and shoot

Frequency
When the weapon item stack is updated

Version
Happened also in 1.17
kuva

Additional context

Gunfire attract mobs

Description

Easy to explain, an optional feature that turns nearby monsters aggressive towards you when you fire a gun.
Configurable distance is in blocks.
Think of a zombie apocalypse, fire a gun and a ton of zombies nearby will hear that and start following the sound.

Via the upcoming attachments this should be possible to reduce/increase.

Configuration

Shooting_Attract_Mobs:
  Distance: <amount>
  Blacklist: <true/false>
  Entities:
    - "<ENTITY>"

Testing - projectile.projectile_motion

What
Wiki link

Details

  • gravity
  • minimum and maximum speed works and removing them based on it also works
  • motion decreases work based on circumstances

Can you think of ways to break this feature?
No

When posting testing results, make sure to include configurations used!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.