repo for my hex addons :3
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

disable negative item stacks by default

+8
+2
project/hexic/changelog
··· 31 31 2.0.0 rename media bundles to casting pouches 32 32 2.0.0 sent Stickia to the milk dimension 33 33 2.0.0 textures now use JPEG XL 34 + 2.1.0 added -Dhexic.max_stack_size to cap itemstack size at deserialization-time (default: max integer) 34 35 2.1.0 demiplane spells' docs have been changed again 35 36 2.1.0 dual's reflection only considers players in ambit 36 37 2.1.0 hitbox for void blocks is no longer weirdly offset 37 38 2.1.0 item/fluid concept displays no longer suck 38 39 2.1.0 mediaweave can now actually be erased, sorry 39 40 2.1.0 mediaweave can now be tied 41 + 2.1.0 negative item stacks are now disabled by default, they can be reenabled by setting -Dhexic.min_stack_size to your favorite value 40 42 2.1.0 read-only properties can no longer be converted to access iotas 41 43 2.1.0 Refinement Distillation now properly drops input iotas on first loop as it should 42 44 2.1.0 translations have been updated [@chuijk]
+6
project/hexic/src/main/scala/org/eu/net/pool/hexic/mixin/ItemStackMixin.java
··· 5 5 import net.minecraft.item.ItemStack; 6 6 import net.minecraft.nbt.NbtCompound; 7 7 import net.minecraft.nbt.NbtElement; 8 + import org.eu.net.pool.hexic.cfg; 8 9 import org.spongepowered.asm.mixin.Mixin; 9 10 import org.spongepowered.asm.mixin.Shadow; 10 11 import org.spongepowered.asm.mixin.injection.At; 11 12 import org.spongepowered.asm.mixin.injection.Inject; 12 13 import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 + import scala.util.CommandLineParser; 13 15 14 16 @Mixin(ItemStack.class) 15 17 public class ItemStackMixin { ··· 20 22 if (nbt.contains("Count", NbtElement.INT_TYPE)) { 21 23 count = nbt.getInt("Count"); 22 24 } 25 + int minSize = cfg.apply("hexic.min_stack_size", Integer::parseInt).getOrElse(() -> 0); 26 + int maxSize = cfg.apply("hexic.max_stack_size", Integer::parseInt).getOrElse(() -> Integer.MAX_VALUE); 27 + if (count < minSize) count = minSize; 28 + if (count > maxSize) count = maxSize; 23 29 } 24 30 25 31 @WrapOperation(method = {"writeNbt", "method_7953"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/nbt/NbtCompound;putByte(Ljava/lang/String;B)V"))