Skip to content

Commit

Permalink
Update 1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Fox2Code committed Sep 24, 2024
1 parent ef58554 commit bcb4715
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void onAttackTargetEntityWithCurrentItem(Entity var1, CallbackInfo ci) {
if (!(this instanceof NetworkPlayer)) return;
NetworkPlayer networkPlayer = (NetworkPlayer) this;
if (ModLoader.Internal.notifyPlayerAttackEntity(networkPlayer,
networkPlayer.getRegisteredHeldItem(), (RegisteredEntity) var1)) {
networkPlayer.getRegisteredHeldItem(), (RegisteredEntity) var1, false)) {
ci.cancel();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@ public static boolean notifyPlayerUseItemOnEntity(
}

public static boolean notifyPlayerAttackEntity(
NetworkPlayer networkPlayer, RegisteredItemStack itemStack, RegisteredEntity targetEntity) {
boolean cancelled = false;
NetworkPlayer networkPlayer, RegisteredItemStack itemStack, RegisteredEntity targetEntity,
boolean cancelled) {
for (ModContainer modContainer : modContainers.values()) {
cancelled = modContainer.notifyPlayerAttackEntity(
networkPlayer, itemStack, targetEntity, cancelled);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.parallel=true
org.gradle.jvmargs=-Xmx1024m -XX:-UseGCOverheadLimit -Dfile.encoding=UTF-8

# FoxLoader properties
foxloader.version=1.3.2
foxloader.version=1.3.3
foxloader.lastReIndevTransformerChanges=1.3.0
# https://www.jitpack.io/#com.fox2code/FoxLoader

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.fox2code.foxloader.loader.lua.LuaObjectHolder;
import com.fox2code.foxloader.network.NetworkPlayer;
import com.fox2code.foxloader.registry.RegisteredEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.src.game.entity.Entity;
import net.minecraft.src.game.entity.player.EntityPlayer;
import net.minecraft.src.game.nbt.NBTTagCompound;
Expand Down Expand Up @@ -33,8 +34,11 @@ public void onUseCurrentItemOnEntity(Entity var1, CallbackInfo ci) {
public void onAttackTargetEntityWithCurrentItem(Entity var1, CallbackInfo ci) {
if (!(this instanceof NetworkPlayer)) return;
NetworkPlayer networkPlayer = (NetworkPlayer) this;
// Hotfix: Can attack with some items when pvp is off.
boolean cancelled = var1 instanceof NetworkPlayer &&
!MinecraftServer.getInstance().pvpOn;
if (ModLoader.Internal.notifyPlayerAttackEntity(networkPlayer,
networkPlayer.getRegisteredHeldItem(), (RegisteredEntity) var1)) {
networkPlayer.getRegisteredHeldItem(), (RegisteredEntity) var1, cancelled)) {
ci.cancel();
}
}
Expand Down

0 comments on commit bcb4715

Please sign in to comment.