-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from H0Imes/1.18.x
Server Configuration and Gameplay Update
- Loading branch information
Showing
19 changed files
with
508 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
crafting-dead-core/src/main/java/com/craftingdead/core/mixin/ItemEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Crafting Dead | ||
* Copyright (C) 2022 NexusNode LTD | ||
* | ||
* This Non-Commercial Software License Agreement (the "Agreement") is made between | ||
* you (the "Licensee") and NEXUSNODE (BRAD HUNTER). (the "Licensor"). | ||
* By installing or otherwise using Crafting Dead (the "Software"), you agree to be | ||
* bound by the terms and conditions of this Agreement as may be revised from time | ||
* to time at Licensor's sole discretion. | ||
* | ||
* If you do not agree to the terms and conditions of this Agreement do not download, | ||
* copy, reproduce or otherwise use any of the source code available online at any time. | ||
* | ||
* https://github.com/nexusnode/crafting-dead/blob/1.18.x/LICENSE.txt | ||
* | ||
* https://craftingdead.net/terms.php | ||
*/ | ||
|
||
package com.craftingdead.core.mixin; | ||
|
||
import com.craftingdead.core.world.entity.extension.PlayerExtension; | ||
import net.minecraft.world.entity.item.ItemEntity; | ||
import net.minecraft.world.entity.player.Player; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(ItemEntity.class) | ||
public class ItemEntityMixin { | ||
|
||
@Inject(method = "playerTouch", at = @At("HEAD"), cancellable = true) | ||
public void onPlayerTouch(Player player, CallbackInfo ci) { | ||
if (PlayerExtension.getOrThrow(player).isHandcuffed()) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
Oops, something went wrong.