Git Product home page Git Product logo

golfiv's People

Contributors

ampflower avatar dev0louis avatar fxmorin avatar imgbotapp avatar samolego avatar spaceclouds42 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

golfiv's Issues

[suggestion] use json features where applicable?

the current default as of latest release as of this message

{
  "// Patches some outgoing server packets": "",
  "main": {
    "// Prevents hitting/chatting with open GUI": "",
    "checkInventoryActions": true,
    "// Prevents headless pistons from destroying blocks that are not piston extensions.": "",
    "preventDestructionByHeadlessPistons": true,
    "// Allows headless pistons to destroy certain blocks when preventing destruction is enabled.": "",
    "// Useful to allow only breaking of bedrock but denying destruction of barriers.": "",
    "allowedDestructibleByHeadlessPistons": [
      "minecraft:piston_head"
    ],
    "// What altitude in the nether should start inflicting void damage (e.g. 128). -1 disables it.": "",
    "inflictNetherRoofDamage": -1
  },
  "items": {
    "survival": {
      "// Whether to enable 'legalising' survival items.": "",
      "// Whether to check whole inventory when connecting / changing dimensions, etc.": "",
      "legaliseWholeInventory": true,
      "// Which items should be cleared when clicked in survival inventory": "",
      "bannedItems": {
        "minecraft:structure_void": "",
        "minecraft:end_portal_frame": "",
        "minecraft:bedrock": "",
        "minecraft:barrier": "",
        "minecraft:repeating_command_block": "",
        "minecraft:command_block": "",
        "minecraft:spawner": "",
        "minecraft:jigsaw": "",
        "minecraft:air": "",
        "minecraft:structure_block": "",
        "minecraft:air": "",
        "minecraft:air": "",
        "minecraft:chain_command_block": ""
      },
      "banSpawnEggs": true,
      "checkEnchants": true,
      "checkPotionLevels": true,
      "checkItemCount": true
    },
    "creative": {
      "// Whether to check whole inventory when connecting / changing dimensions, etc.": "",
      "legaliseWholeInventory": true,
      "// Which NBT shouldn't be cleared": "",
      "// Disallow all NBT tags in creative which aren't in whitelist section.": "",
      "whitelistedNBT": [
        "EntityTag",
        "Enchantments",
        "StoredEnchantments",
        "BlockEntityTag",
        "Damage",
        "Potion",
        "display"
      ],
      "removeCreativeNBTTags": true,
      "checkEnchants": true,
      "checkPotionLevels": true,
      "checkItemCount": true
    }
  },
  "combat": {
    "_comment": "// Combat checks settings.",
    "preventWallHit": true,
    "checkHitDistance": true,
    "checkHitAngle": true
  },
  "packet": {
    "removeTeleportData": true,
    "removeHealthTags": true,
    "// Allows health tags for certain entities.": "",
    "// This maps entity ID to percentage as decimal.": "",
    "allowedHealthTags": {
      "minecraft:iron_golem": 0.25,
      "minecraft:wither": 0.5,
      "minecraft:wolf": 0.0
    },
    "removeEquipmentTags": true,
    "checkPortalHack": true,
    "patchSoundExploits": true,
    "removeDroppedItemInfo": true,
    "patchItemKickExploit": true
  },
  "movement": {
    "patchNoFall": true
  },
  "duplication": {
    "_comment": "// Duplication fixes",
    "// Whether to prevent throwing an error when saving large string data.": "",
    "// This is done by ignoring data after DataOutputStream limit.": "",
    "// Written books can reach that point with hacked clients.": "",
    "patchSaveLimit": true,
    "// Whether to disable gravity block duping.": "",
    "patchGravityBlock": true,
    "// Checks if player is connected before applying damage.": "",
    "// Prevents duplicating inventory if player dies after disconnect.": "",
    "patchDeathDuplication": true
  }
}

proposed json

{
  //Patches some outgoing server packets,
  "main": {
    //Prevents hitting/chatting with open GUI,
    "checkInventoryActions": true,
    //Prevents headless pistons from destroying blocks that are not piston extensions.,
    "preventDestructionByHeadlessPistons": true,
    //Allows headless pistons to destroy certain blocks when preventing destruction is enabled.,
    //Useful to allow only breaking of bedrock but denying destruction of barriers.,
    "allowedDestructibleByHeadlessPistons": [
      "minecraft:piston_head"
    ],
    //What altitude in the nether should start inflicting void damage (e.g. 128). -1 disables it.,
    "inflictNetherRoofDamage": -1
  },
  "items": {
    "survival": {
      //Whether to enable 'legalising' survival items.,
      //Whether to check whole inventory when connecting / changing dimensions, etc.,
      "legaliseWholeInventory": true,
      //Which items should be cleared when clicked in survival inventory,
      "bannedItems": [
        "minecraft:structure_void",
        "minecraft:end_portal_frame",
        "minecraft:bedrock",
        "minecraft:barrier",
        "minecraft:repeating_command_block",
        "minecraft:command_block",
        "minecraft:spawner",
        "minecraft:jigsaw",
        "minecraft:air",
        "minecraft:structure_block",
        "minecraft:air",
        "minecraft:air",
        "minecraft:chain_command_block"
	  ],
      "banSpawnEggs": true,
      "checkEnchants": true,
      "checkPotionLevels": true,
      "checkItemCount": true
    },
    "creative": {
      //Whether to check whole inventory when connecting / changing dimensions, etc.,
      "legaliseWholeInventory": true,
      //Which NBT shouldn't be cleared,
      //Disallow all NBT tags in creative which aren't in whitelist section.,
      "whitelistedNBT": [
        "EntityTag",
        "Enchantments",
        "StoredEnchantments",
        "BlockEntityTag",
        "Damage",
        "Potion",
        "display"
      ],
      "removeCreativeNBTTags": true,
      "checkEnchants": true,
      "checkPotionLevels": true,
      "checkItemCount": true
    }
  },
  "combat": {
    //Combat checks settings.",
    "preventWallHit": true,
    "checkHitDistance": true,
    "checkHitAngle": true
  },
  "packet": {
    "removeTeleportData": true,
    "removeHealthTags": true,
    //Allows health tags for certain entities.,
    //This maps entity ID to percentage as decimal.,
    "allowedHealthTags": {
      "minecraft:iron_golem": 0.25,
      "minecraft:wither": 0.5,
      "minecraft:wolf": 0.0
    },
    "removeEquipmentTags": true,
    "checkPortalHack": true,
    "patchSoundExploits": true,
    "removeDroppedItemInfo": true,
    "patchItemKickExploit": true
  },
  "movement": {
    "patchNoFall": true
  },
  "duplication": {
    //Duplication fixes
    //Whether to prevent throwing an error when saving large string data.,
    //This is done by ignoring data after DataOutputStream limit.,
    //Written books can reach that point with hacked clients.,
    "patchSaveLimit": true,
    //Whether to disable gravity block duping.,
    "patchGravityBlock": true,
    //Checks if player is connected before applying damage.,
    //Prevents duplicating inventory if player dies after disconnect.,
    "patchDeathDuplication": true
  }
}
  1. make comments be actual comments (not json keys)
  • Easier to read
  1. make inventory blacklist actually be an [list] and not an {table}
  • Makes editors not have a heart attack when modified

if you are concerned about reading the config file, what you can do is
(psuedo code)

// open file
for each line do
  line = readLine
  line = (trim whitespace from beginning)
  if line.hasPrefix("//") then
    ignore
  else
    append(jsondata, line) // append line to jsondata
 end
 // parse jsondata as if you are parsing file

Creative inventories may get inadvertently sanitized by PatchItemKickExploit

Description

Currently, with patchItemKickExploit set to true, creative inventories may have item NBT silently sanitized as the client resyncs the inventory with the server, even if nothing should be replaced or legalised to begin with. It's not a major problem when it's more patched out, but can still show through in certain scenarios, i.e. block or entity data stored in a block or spawn egg.

Do note, all other checks can be completely disabled and this will still occur.

Possible ways to reproduce the issue

All of the following will generally result in either reverts, or otherwise unobtainable glitched items.
After each of the following, all that is needed to trigger this is to either relog or open another inventory.

  • Place a chest, shulker, etc., place items inside of it, Ctrl+Pick-block
  • Write into book & quills and sign them. Written books results in no title, author, generation or page data.
  • Enchanting any items. This results in an item with a glint, but no enchantments.
  • Renaming any items.
  • Brewing any potion, tipping arrows or crafting suspicious stew. This results in uncraftable potions or arrows, or effectively normal stew.

Cause

As discussed at #39 (comment), this is caused primarily by the code below.

@Override
public void preSendPacket(Packet<?> packet, ServerPlayerEntity player, MinecraftServer server) {
if(golfConfig.packet.patchItemKickExploit && packet instanceof InventoryS2CPacket) {
List<ItemStack> contents = ((InventoryS2CPacketAccessor) packet).getContents();
List<ItemStack> fakedContents = contents.stream().map(stack -> {
NbtCompound tag = stack.getTag();
if(tag != null) {
stack = fakeStack(stack, false);
}
return stack;
}).collect(Collectors.toList());

Possible fixes

  • A configuration option to not sanitize creative inventories unless absolutely needed. This can allow a strict survival setting for if you want all items to be cleared regardless, and disabling will have both be strictly cleared.

  • A check to allow creative players a free pass unless absolutely needed. This would be automatic and would not require any intervention by server admins, but still strictly clear before it's sent out to survival players if desired.

  • Change the current check to allow all NBT unless sanitizing is needed to not kick the client. This would be automatic and not require any intervention by server admins, but would remove all strict clearing of unnecessary data before sending to the client.

Dying breaks the cheat log

When player dies, their golf nbt is corrupted (I have yet to look at the playerdat file right before and right after death, will do tomorrow morning) If you do /golf player @s seeCheatLog after dying (without doing clearCheatLog first), you will get an "Unexpected error" (it's a NullPointerException when you hover over it).

Players are invisible

Well... yeah. I'm gonna include some chat logs for no other purpose than entertainment

<supsm> where yat
<supsm> i hear you
<nanayu18> im in the cave
<nanayu18> go to the map room
<supsm> o ok
<nanayu18> im at the map room
<supsm> wnhat
<nanayu18> BRO
<nanayu18> I THINK UR INVISIBLE
<supsm> WHAT
<supsm> WTF
<nanayu18> PLACE A BLOCK
<nanayu18> LOL
<nanayu18> WTF
<supsm> WHAT THE FUCK BRO
<supsm> i cant hit you
<nanayu18> SAME
<supsm> im on this blokc
<nanayu18> same
<nanayu18> im on it as well
<supsm> WTF
<nanayu18> this is so weird
<supsm> im gonna try getting rid of anticheat

Unlike the invisibility potion effect, armor and held items were not visible, nor were walking particles or potion particles from a nearby beacon.

GolfIV Not Banning Anyone

I woke up today with reports of killaura and bhop, yet when i try to killaura and bhop, golf iv does not care at all

It says nothing, don't have commands to check cheat list either

Help?

Player Data Not Saving

I was testing out the mod using Wurst Client, and I flew upward and got disconnected. After reconnecting I tried using a elytra with the "jetpack" hack to fly around, afterword I went to shut down the server and I noticed in the console:

"[15:28:01] [Server thread/WARN]: Failed to save player data for Blue_Dye"

After reconnecting and disconnecting a couple of times I found that I always respawned up in the air where I got disconnected. I have verified that player data is saved successfully without GolfIV. I have no other mods than GolfIV and fabric api. Log attached. Build is https://github.com/samolego/GolfIV/actions/runs/438107637.

2020-12-26-3.log.gz

Request CheaterDeleter support

It would be nice if GolfIV and CheaterDeleter would be compatible.
Currently having both mods leads to following warnings

[12:36:40] [Server thread/WARN]: Method overwrite conflict for getX in golfiv.mixins.json:accessors.EntityPositionS2CPacketAccessor, previously written by io.github.coolmineman.cheaterdeleter.mixin.EntityPositionS2CPacketMixin. Skipping method.
[12:36:40] [Server thread/WARN]: Method overwrite conflict for getZ in golfiv.mixins.json:accessors.EntityPositionS2CPacketAccessor, previously written by io.github.coolmineman.cheaterdeleter.mixin.EntityPositionS2CPacketMixin. Skipping method.
[12:36:40] [Server thread/WARN]: Method overwrite conflict for setX in golfiv.mixins.json:accessors.EntityPositionS2CPacketAccessor, previously written by io.github.coolmineman.cheaterdeleter.mixin.EntityPositionS2CPacketMixin. Skipping method.
[12:36:40] [Server thread/WARN]: Method overwrite conflict for setZ in golfiv.mixins.json:accessors.EntityPositionS2CPacketAccessor, previously written by io.github.coolmineman.cheaterdeleter.mixin.EntityPositionS2CPacketMixin. Skipping method.

I am not sure if the warnings cause any issues though.

Can't breake blocks

I have installed GolfiV on my server and after 2 minutes of joining it, I can't brake block it fix after reconnecting.

The server is a 1.20 snapshot so that may be what is wrong but the mod is loading on server start.

Can you support 1.17 Snapshot 20w46a?

I try to made changes in gradle.properties and build.gradle according to the prompts in the Fabric Versions and migrated mappings to compile the 20w46a version, but it prompted me to make an error: abilities is private access control in PlayerEntity. if(golfConfig.main.noFly && !player.abilities.allowFlying && !player.isClimbing()) {

So can you support 1.17 Snapshot 20w46a?

Translate by Tencent Mr. Translator

Suggestion: Item Exception Whitelist Config Option

Would allow for a user-configurable list of items that would be ignored by this mod. More specifically, allowing for specific NBT tags (i.e, enchantments, attribute modifiers, etc) in this specification would be very helpful. An example of this being used would be a server with a customized item being made available through voting rewards or through some in-game item shop.

Client Side Crash

There is a Client side crash.

java.lang.ClassCastException: class net.minecraft.client.network.ClientPlayerEntity cannot be cast to class org.samo_lego.golfiv.casts.Golfer (net.minecraft.client.network.ClientPlayerEntity and org.samo_lego.golfiv.casts.Golfer are in unnamed module of loader net.fabricmc.loader.impl.launch.knot.KnotClassLoader @5622fdf)
	at org.samo_lego.golfiv.event.combat.InventoryHitCheck.interact(InventoryHitCheck.java:30)
	at net.fabricmc.fabric.api.event.player.UseEntityCallback.lambda$static$0(UseEntityCallback.java:57)
	at net.minecraft.client.MinecraftClient.handler$zbo000$fabric-events-interaction-v0$injectUseEntityCallback(MinecraftClient.java:3123)
	at net.minecraft.client.MinecraftClient.doItemUse(MinecraftClient.java:1782)
	at net.minecraft.client.MinecraftClient.handleInputEvents(MinecraftClient.java:2061)
	at net.minecraft.client.MinecraftClient.tick(MinecraftClient.java:1880)
	at net.minecraft.client.MinecraftClient.render(MinecraftClient.java:1180)
	at net.minecraft.client.MinecraftClient.run(MinecraftClient.java:801)
	at net.minecraft.client.main.Main.main(Main.java:237)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)

I will try to fix it ๐Ÿ‘ฏ

Mixin incompatibility with carpet-fixes

Minecraft: 1.17.1
GolfIV: 0.4.0
carpet-fixes: 1.0.1

Both GolfIV and carpet-fixes redirect the same method causing a crash on start up when used together. This mixin should be rewritten to use an Inject so one can be canceled if used together. If this is not possible with an Inject one of the mods can disable the entire mixin class in the mixin.json.

[main/WARN]: @Redirect conflict. Skipping carpetfixes.mixins.json:blockFixes.PistonBlock_bedrockBreakingMixin->@Redirect::removeBlock(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1000, already redirected by golfiv.mixins.json:PistonMixin_PreventDestruction->@Redirect::redirectWorld(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1000
[main/WARN]: @Redirect conflict. Skipping carpetfixes.mixins.json:blockFixes.PistonBlock_bedrockBreakingMixin->@Redirect::removeBlock(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1000, already redirected by golfiv.mixins.json:PistonMixin_PreventDestruction->@Redirect::redirectWorld(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1000

This issue has been cross-posted on both repositories so it can be fixed on both sides.

"Jetpack" Hack Works When Elytra is Activated

While I was testing I discovered that while in flight mode with a elytra on, you can use the "jetpack" hack to fly around without getting kicked. No idea if you are able to fix this, just thought I would let you know.

Falling in a boat triggers fly hack

I fell off a cliff in a boat for testing purposes, and it said that I was using fly hacks. It might be because boats fall slower, but I'm not sure.
image

Players with high ping get falsely accused a lot

This player had over 300 ping when this happened
image
I've also seen it happen with timer hacks in the past.

Also I'm not sure if this player is actually hacking. It seems pretty sus that this all happened in the span of 1 second. However, with the timer hacks, it was confirmed that the player wasn't hacking. (mightve been fixed tho)

Suggestion: Only make necessary changes to the enchantments of items

Currently, any item with an illegal enchantment (i.e., unbreaking 10 pickaxe) has all of its enchantments removed. My proposed change is to change this behavior so that these items would not have all of their enchantments removed, but rather set to their maximum legal limit (in the case of the unbreaking pickaxe example, it would simply set the enchantment level to 3). This would be very helpful in preserving the enchantment while still preventing such an absurd level of it being used. In the case of disallowed enchantments on an item (for example, diamond boots with sharpness and unbreaking), only the illegal enchantment(s) should be removed.

unable to break blocks

Fabric server 1.19.4 golf Version: 0.63

When I ( as a server admin) go from creative to survival i am unable to break any more blocks.

When I rejoin, I am able to break blocks again.

However, I also found that without switching game modes, it randomly doesn't let me break any more blocks. while not switching game modes.

I have removed the mod for now.

Vanilla 1.19.4 client

Potential overflow issue in ServerPlayNetworkHandlerMixin_TimerCheck.java

I've been messing around with your project on my anarchy server.
I have quite lax needs, just need an antifly and antielytra to save the tps, anything speed related is fine as long as its not too out of hands.

So I was looking around the src/main/java/org/samo_lego/golfiv/mixin_checks/C2SPacket/ServerPlayNetworkHandlerMixin_TimerCheck.java file and logging the packetRate value and I think there is a problem with the logic.

You expect a default packet rate of 50 and if everything is going well and the client timer is around 1 the packetrate will hover around 0 overall during cycles.

If you go over 1 then the packetrate will eventually go over 250 and an offense will be logged.

However you didn't account for the case where a client would set a timer to a value less than 1, and I think it would eventually overflow (packetRate will just keep growing in the negative) if a user managed to stay moving long enough with it for the counter to reach that point, and even if it doesnt overflow it just takes up extra memory for no real use.

I know it's a bit far fetched but I think it shows a problem with the current check (in my view at least). I'm making changes on my side anyways to allow people to use a timer up to x2 so that 50 number will have to go, I might make a PR if you are interested.

Items in GUI menus lose their names with GolfIV installed

Happens with Patbox's Armorstand Editor And Potatoboy's HeadIndex

Most notable with HeadIndex if you're gonna recreate . All heads show as 'player head' with the Steve texture. While in armorstandeditor items just lose their name. (same issue really but affects headindex worse)

Its late so im writing this pretty quick but you should know I have very many other mods. However removing this in particular fixed it.

If it doesnt recreate immediately tell me and I can probably find the modlist in a log somewhere.

I havent changed anything in the golf config

Can't read books in creative

Players aren't able to read books while in creative mode. Even if pages it's inside whitelistedNBT and removeCreativeNBTTags = false

Mod version: 0.5.1

Bobbing in a bubble column

Standing on the top of a soul sand bubble column makes the mod think I'm using fly hacks. I do not need to do anything, just standing there will trigger the mod. It will not activate at first, but it eventually will (probably because the player bobs higher over time).
2021-01-03_11 29 34

Inventory Walk Hack detection issues

When standing on a shulker box while opening it, GolfIV will think that the player is using inventory walk hacks. I think it also happens when the player closes the shulker box.

Let's discuss: report / kick / ban system

RN I have an idea of each player having "sus value" which is decreasing automatically while playing (untill it hits 0, then it stays there). If player is detected for cheating, their "sus value" is increased accordingly to the detection - e.g. if detection throws almost no false positives, it is bumped much higher compared to detection which is known to throw FPs.

If sus value reaches certain level, player is logged, then kicked, and if value is really high, banned?

Example:
sus value:

  • 0 - 100 = do nothing
  • 100 - 200 = report
  • 200 - 1000 = kick
  • > 1000 = ban

How much should the value be decreased over time?

These are just ideas flowing through my head. If you have different opinions / suggestions, please post them below for further discussion.

"Kicked" players aren't actually kicked

I was testing this mod, then at one point the server console said it kicked me. However, I did not leave the game, nor did it say that I left the game from the server console. I could open chests and load the world, but when I logged back in, what I did was not saved. Probably should just /kick them.

Banning Custom Named Items

Is there any way to ban a custom named item but not the item itself? For example player heads, i have a datapack installed which adds player heads into the game, but id like to ban my head from peoples inventory's which would read "Hinzy's Head"?

Ive tried "minecraft:player_head{display:{Name:'{"text":"Hinzy's Head"}'}}" in the survival banned items section and i just get this error when i reload the config "An unexpected error occurred trying to execute that command" as the output ingame.

Prevent seed cracking?

After some research, I found that most seed cracking mods use the "hashed seed" that is sent from the server to the client upon login and respawn. Do you think its possible to spoof the hash seed to make the seed cracking process harder?

Item NBT data is being cleared even though it's disabled (Bug?)

So, how do I put this. Me and my Friends are playing on a Fabric server and it's suspected that one of our players is using some kind of hacked client. I've installed this mod and everything works fine so far, except that all the NBT data from items is being cleared/not in sync. We're using custom model data for some items and they lose their nbt, banners lose their nbt and player/mob heads lose their nbt. They do however get their models/nbt data back after you click on them in your inventory but as soon as you open a new container or even just your inventory their nbt data is being reset -> EDIT: If you interact with anything (rightclick) it removes the nbt data of all items in your inventory/in the container interacted with. I can't even see the enchantments on my items after opening a door....
This is nothing major but it's just a bit annoying having to click the items constantly for them to look different.
We just want the movement/combat anticheat really so it'd be cool if there is a way to remove the nbt data specific part of the config :D
I should add that the server is in 1.17

This is the config file (I'm not too experienced with JSON so maybe I did something wrong here? If yes please let me know!)

{
"main": {
"_comment_checkInventoryActions": "// Prevents hitting/chatting with open GUI",
"checkInventoryActions": true
},
"items": {
"survival": {
"_comment_legalise": "// Whether to enable 'legalising' survival items.",
"_comment_bannedSurvivalItems": "// Which items should be cleared when clicked in survival inventory",
"bannedItems": [
"minecraft:barrier",
"minecraft:spawner",
"minecraft:structure_void",
"minecraft:bedrock",
"minecraft:command_block",
"minecraft:spawn_egg"
],
"checkEnchants": true,
"checkPotionLevels": true,
"checkItemCount": true
},
"creative": {
"_comment_whitelistedNBT": "// Which NBT shouldn't be cleared",
"whitelistedNBT": [
"EntityTag",
"Enchantments",
"StoredEnchantments",
"BlockEntityTag",
"Damage",
"Potion",
"display"
],
"_comment_removeCreativeNBTTags": "// Disallow all NBT tags in creative which aren't in whitelist section.",
"removeCreativeNBTTags": false,
"checkEnchants": true,
"checkPotionLevels": true,
"checkItemCount": true
}
},
"combat": {
"_comment": "// Combat checks settings.",
"preventWallHit": true,
"checkHitDistance": true,
"checkHitAngle": true
},
"packet": {
"_comment": "// Patches some outgoing server packets",
"removeTeleportData": true,
"removeHealthTags": true,
"removeEquipmentTags": false,
"checkPortalHack": true,
"patchSoundExploits": true,
"removeDroppedItemInfo": true,
"patchItemKickExploit": true
},
"movement": {
"_comment": "// Movement checks settings",
"yesFall": true
},
"duplication": {
"_comment": "// Duplication fixes",
"_comment_patchSaveLimit1": "// Whether to prevent throwing an error when saving large string data.",
"_comment_patchSaveLimit2": "// This is done by ignoring data after DataOutputStream limit.",
"_comment_patchSaveLimit3": "// Written books can reach that point with hacked clients.",
"patchSaveLimit": true,
"_comment_patchGravityBlock": "// Whether to disable gravity block duping.",
"patchGravityBlock": true,
"_comment_patchDeathDuplication1": "// Checks if player is connected before applying damage.",
"_comment_patchDeathDuplication2": "// Prevents duplicating inventory if player dies after disconnect.",
"patchDeathDuplication": true
}
}

Some issues

Elytra jumping causes the mod to think I'm hacking (maybe elytra movement control, not sure)
However, when using actual elytra movement hacks, it doesn't think I'm hacking...

With this configuration, item data is being cleared and we DONT want that

We have disabled all of the settings that would be clearing NBT data, but it still is.

{
  "main": {
    "_comment_checkInventoryActions": "// Prevents hitting/chatting with open GUI",
    "checkInventoryActions": false
  },
  "items": {
    "survival": {
      "_comment_legalise": "// Whether to enable 'legalising' survival items.",
      "_comment_bannedSurvivalItems": "// Which items should be cleared when clicked in survival inventory",
      "bannedItems": [],
      "checkEnchants": false,
      "checkPotionLevels": false,
      "checkItemCount": false
    },
    "creative": {
      "_comment_whitelistedNBT": "// Which NBT shouldn't be cleared",
      "whitelistedNBT": [
        "EntityTag",
        "Enchantments",
        "StoredEnchantments",
        "BlockEntityTag",
        "Damage",
        "Potion",
        "display"
      ],
      "_comment_removeCreativeNBTTags": "// Disallow all NBT tags in creative which aren't in whitelist section.",
      "removeCreativeNBTTags": false,
      "checkEnchants": false,
      "checkPotionLevels": false,
      "checkItemCount": false
    }
  },
  "combat": {
    "_comment": "// Combat checks settings.",
    "preventWallHit": false,
    "checkHitDistance": false,
    "checkHitAngle": false
  },
  "packet": {
    "_comment": "// Patches some outgoing server packets",
    "removeTeleportData": false,
    "removeHealthTags": false,
    "removeEquipmentTags": false,
    "checkPortalHack": false,
    "patchSoundExploits": true,
    "removeDroppedItemInfo": false,
    "patchItemKickExploit": true
  },
  "movement": {
    "_comment": "// Movement checks settings",
    "yesFall": false
  },
  "duplication": {
    "_comment": "// Duplication fixes",
    "_comment_patchSaveLimit1": "// Whether to prevent throwing an error when saving large string data.",
    "_comment_patchSaveLimit2": "// This is done by ignoring data after DataOutputStream limit.",
    "_comment_patchSaveLimit3": "// Written books can reach that point with hacked clients.",
    "patchSaveLimit": true,
    "_comment_patchGravityBlock": "// Whether to disable gravity block duping.",
    "patchGravityBlock": true,
    "_comment_patchDeathDuplication1": "// Checks if player is connected before applying damage.",
    "_comment_patchDeathDuplication2": "// Prevents duplicating inventory if player dies after disconnect.",
    "patchDeathDuplication": true
  }
}

Killaura detection issues & suggestion

Sometimes the killaura detecting thing will be hit without using killaura.

Possible fixes:

  • Make the killaura detector at the player's feet. This way they shouldn't be able to hit it, but if they do they'll probably kill themselves
  • Always make the killaura detector behind the player. You will have to filter out other mobs/players, and also make sure they can actually hit the player
  • Completely change the killaura detection so it detects if the entity they're trying to hit is something they're looking at (+-10ยฐ maybe)

Personally I prefer the last option, it seems less "quick and dirty" compared to what we currently have.

`patchItemSave` clears all inventories on world save

Description

The configuration, patchItemSave, clears all items from the world on either manual save (i.e. pausing the world on the client, or running /save-all on the server), or periodically by the auto-save timer.

Steps to reproduce.

  1. /save-all, pause the game (client only), or wait for the auto-save timer. This may also apply when you stop and start the world on the client due to the potential of two save rounds occurring, one for pause, and one for server shutdown.
  2. Notice how all items and inventories that stayed after the save round has disappeared, or has been emptied.

Cause

Line 26, this.setCount(0)

@Inject(method = "writeNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/nbt/NbtCompound;", at = @At("HEAD"), cancellable = true)
private void writeStack(NbtCompound nbt, CallbackInfoReturnable<NbtCompound> cir) {
if(golfConfig.duplication.patchItemSave) {
ItemStack copy = ((ItemStack) (Object) this).copy();
this.setCount(0);
Identifier identifier = Registry.ITEM.getId(copy.getItem());
nbt.putString("id", identifier.toString());
nbt.putByte("Count", (byte)copy.getCount());
if (copy.getNbt() != null) {
nbt.put("tag", copy.getNbt().copy());
}
cir.setReturnValue(nbt);
}
}

Current Workarounds

Disable patchItemSave by setting the value in the config to false.

Possible fixes

  • Call the alternative save function when the inventory is known to be destroyed right after. This would include going through a portal or going into unloaded chunks.

Inventory walk hack detection has a lot of false positives

The mod thinks I'm using inventory walk hacks a LOT. I think it occurs right when I open the chest/inventory, but I'm not sure. If this is the case, it could be that the player's momentum/lag could be causing this issue. Maybe try adding a delay (of say 0.5 seconds) when an inventory is opened before you check for movement?

Crash on server boot

All of Fabric 3 2.7.x Dev pack
Turns out we are starting to get some players using that book and quill dupe glitch, or more likely doing it with wurst. So figured it was time to test your mod out. Crash from the log https://paste.alloffabric.com/jexuviqefu.sql
Simply removing "illegal_items.CompoundTagMixin_SizeCheck", from golfiv.mixins.json inside the jar allowed it to load.

[00:11:02] [main/FATAL]: Mixin prepare failed preparing illegal_items.CompoundTagMixin_SizeCheck in golfiv.mixins.json: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException The specified mixin 'org.samo_lego.golfiv.mixin.illegal_items.CompoundTagMixin_SizeCheck' was not found
org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException: The specified mixin 'org.samo_lego.golfiv.mixin.illegal_items.CompoundTagMixin_SizeCheck' was not found

You have 5 mixins declared in your illegal_items part of golfiv.mixins.json
"illegal_items.CompoundTagMixin_SizeCheck",
"illegal_items.ItemStackMixinCast_ItemStackChecker",
"illegal_items.PlayerInventoryMixin_IllegalsCheckInsert",
"illegal_items.ServerPlayNetworkHandlerMixin_CreativeItemsCheck",
"illegal_items.ServerPlayNetworkHandlerMixin_IllegalsCheckSlot",
but you only have 4 of those mixins here
https://github.com/samolego/GolfIV/tree/golfive/src/main/java/org/samo_lego/golfiv/mixin/illegal_items

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.