Skip to content

Commit

Permalink
proveitemdrops
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Aug 28, 2023
1 parent 43b7624 commit 40e4bd7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
19 changes: 10 additions & 9 deletions NightX.iws
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<component name="ChangeListManager">
<list default="true" id="af093b99-5942-419c-869b-8b2d7cb4dd2a" name="変更" comment="">
<change beforePath="$PROJECT_DIR$/NightX.iws" beforeDir="false" afterPath="$PROJECT_DIR$/NightX.iws" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemRenderer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemRenderer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/api/PacketManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/features/api/PacketManager.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayer.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
Expand Down Expand Up @@ -163,7 +164,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -178,7 +179,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand Down Expand Up @@ -253,7 +254,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -268,7 +269,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStart" />
<option name="VM_PARAMETERS" value="-Dfml.coreMods.load=net.aspw.client.injection.forge.TransformerLoader -Ddev-mode" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand Down Expand Up @@ -325,7 +326,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -340,7 +341,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand Down Expand Up @@ -415,7 +416,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand All @@ -430,7 +431,7 @@
<option name="MAIN_CLASS_NAME" value="GradleStartServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-Client\run" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/../NightX-master\run" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/net/aspw/client/features/api/PacketManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.aspw.client.util.MinecraftInstance;
import net.aspw.client.util.PacketUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.client.C0APacketAnimation;
Expand Down Expand Up @@ -55,6 +56,8 @@ public void onMotion(MotionEvent event) {
swing = Math.max(0, swing - 1);
}
}
if (GameSettings.isKeyDown(mc.gameSettings.keyBindDrop) && mc.thePlayer.getHeldItem() != null && mc.currentScreen == null)
mc.thePlayer.isSwingInProgress = true;
}

@EventTarget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,16 @@ public float getEyeHeight() {
*/
@Inject(method = "dropItem", at = @At("HEAD"))
private void dropItem(ItemStack p_dropItem_1_, boolean p_dropItem_2_, boolean p_dropItem_3_, CallbackInfoReturnable<EntityItem> cir) {
Minecraft.getMinecraft().thePlayer.isSwingInProgress = true;

for (int i = 0; i < this.mainInventory.length; ++i) {
Minecraft.getMinecraft().thePlayer.isSwingInProgress = true;
if (this.mainInventory[i] != null) {
Minecraft.getMinecraft().thePlayer.dropItem(this.mainInventory[i], true, false);
this.mainInventory[i] = null;
}
}

for (int j = 0; j < this.armorInventory.length; ++j) {
Minecraft.getMinecraft().thePlayer.isSwingInProgress = true;
if (this.armorInventory[j] != null) {
Minecraft.getMinecraft().thePlayer.dropItem(this.armorInventory[j], true, false);
this.armorInventory[j] = null;
Expand Down

0 comments on commit 40e4bd7

Please sign in to comment.