-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into database-performance-v2
- Loading branch information
Showing
75 changed files
with
1,632 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,15 +16,25 @@ jobs: | |
with: | ||
java-version: 17 | ||
|
||
- name: Release versions | ||
env: | ||
CURSEFORGE_TOKEN: ${{ secrets.CF_API_TOKEN }} | ||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | ||
CHANGELOG: ${{ github.event.body }} | ||
run: ./gradlew release | ||
|
||
- name: Upload GitHub release | ||
uses: AButler/[email protected] | ||
- name: Build release | ||
run: ./gradlew build | ||
|
||
- name: Upload assets to GitHub, Modrinth and CurseForge | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
files: 'build/libs/*.jar;!build/libs/*-sources.jar;!build/libs/*-dev-all.jar' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
modrinth-id: LVN9ygNV | ||
modrinth-featured: false | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
|
||
curseforge-id: 491137 | ||
curseforge-token: ${{ secrets.CF_API_TOKEN }} | ||
|
||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
loaders: | | ||
fabric | ||
quilt | ||
files: | | ||
build/libs/!(*-@(dev-all|sources|javadoc)).jar | ||
build/libs/*-@(dev-all|sources|javadocs).jar |
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
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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/github/quiltservertools/ledger/mixin/DyeItemMixin.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,32 @@ | ||
package com.github.quiltservertools.ledger.mixin; | ||
|
||
import com.github.quiltservertools.ledger.callbacks.EntityModifyCallback; | ||
import com.github.quiltservertools.ledger.utility.Sources; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.DyeItem; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NbtCompound; | ||
import net.minecraft.util.ActionResult; | ||
import net.minecraft.util.Hand; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(DyeItem.class) | ||
public abstract class DyeItemMixin { | ||
@Unique | ||
private NbtCompound oldEntityTags; | ||
|
||
@Inject(method = "useOnEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/SheepEntity;setColor(Lnet/minecraft/util/DyeColor;)V")) | ||
private void ledgerOldEntity(ItemStack stack, PlayerEntity player, LivingEntity entity, Hand hand, CallbackInfoReturnable<ActionResult> cir) { | ||
oldEntityTags = entity.writeNbt(new NbtCompound()); | ||
} | ||
|
||
@Inject(method = "useOnEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/SheepEntity;setColor(Lnet/minecraft/util/DyeColor;)V", shift = At.Shift.AFTER)) | ||
private void ledgerPlayerDyeSheep(ItemStack stack, PlayerEntity player, LivingEntity entity, Hand hand, CallbackInfoReturnable<ActionResult> cir) { | ||
EntityModifyCallback.EVENT.invoker().modify(player.getWorld(), entity.getBlockPos(), oldEntityTags, entity, stack, player, Sources.DYE); | ||
} | ||
} |
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
22 changes: 0 additions & 22 deletions
22
src/main/java/com/github/quiltservertools/ledger/mixin/SnowGolemEntityMixin.java
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
src/main/java/com/github/quiltservertools/ledger/mixin/blocks/BedBlockMixin.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,46 @@ | ||
package com.github.quiltservertools.ledger.mixin.blocks; | ||
|
||
import com.github.quiltservertools.ledger.callbacks.BlockBreakCallback; | ||
import com.github.quiltservertools.ledger.utility.Sources; | ||
import net.minecraft.block.BedBlock; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.block.enums.BedPart; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.util.ActionResult; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.hit.BlockHitResult; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture; | ||
|
||
@Mixin(BedBlock.class) | ||
public abstract class BedBlockMixin { | ||
@Unique | ||
private BlockEntity oldBlockEntity = null; | ||
|
||
@Inject(method = "onBreak", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z"), locals = LocalCapture.CAPTURE_FAILEXCEPTION) | ||
public void storeBlockEntity(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfoReturnable<BlockState> cir, BedPart bedPart, BlockPos blockPos, BlockState blockState) { | ||
oldBlockEntity = world.getBlockEntity(blockPos); | ||
} | ||
|
||
@Inject(method = "onBreak", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILEXCEPTION) | ||
public void logBedBreak(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfoReturnable<BlockState> cir, BedPart bedPart, BlockPos blockPos, BlockState blockState) { | ||
BlockBreakCallback.EVENT.invoker().breakBlock(world, blockPos, blockState, oldBlockEntity, player); | ||
} | ||
|
||
@Inject(method = "onUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;removeBlock(Lnet/minecraft/util/math/BlockPos;Z)Z")) | ||
public void storeBlockEntity(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit, CallbackInfoReturnable<ActionResult> cir) { | ||
oldBlockEntity = world.getBlockEntity(pos); | ||
} | ||
|
||
@Inject(method = "onUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;removeBlock(Lnet/minecraft/util/math/BlockPos;Z)Z", shift = At.Shift.AFTER)) | ||
public void logBedExplosion(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit, CallbackInfoReturnable<ActionResult> cir) { | ||
BlockBreakCallback.EVENT.invoker().breakBlock(world, pos, state, oldBlockEntity, Sources.INTERACT, player); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/github/quiltservertools/ledger/mixin/blocks/CactusBlockMixin.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,21 @@ | ||
package com.github.quiltservertools.ledger.mixin.blocks; | ||
|
||
import com.github.quiltservertools.ledger.callbacks.BlockBreakCallback; | ||
import com.github.quiltservertools.ledger.utility.Sources; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.CactusBlock; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.random.Random; | ||
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(CactusBlock.class) | ||
public abstract class CactusBlockMixin { | ||
@Inject(method = "scheduledTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;breakBlock(Lnet/minecraft/util/math/BlockPos;Z)Z")) | ||
public void logCactusBreak(BlockState state, ServerWorld world, BlockPos pos, Random random, CallbackInfo ci) { | ||
BlockBreakCallback.EVENT.invoker().breakBlock(world, pos, state, null, Sources.GRAVITY); | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/github/quiltservertools/ledger/mixin/blocks/CarvedPumpkinBlockMixin.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,24 @@ | ||
package com.github.quiltservertools.ledger.mixin.blocks; | ||
|
||
import com.github.quiltservertools.ledger.callbacks.BlockBreakCallback; | ||
import com.github.quiltservertools.ledger.utility.Sources; | ||
import net.minecraft.block.CarvedPumpkinBlock; | ||
import net.minecraft.block.pattern.BlockPattern; | ||
import net.minecraft.block.pattern.CachedBlockPosition; | ||
import net.minecraft.world.World; | ||
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; | ||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture; | ||
|
||
@Mixin(CarvedPumpkinBlock.class) | ||
public abstract class CarvedPumpkinBlockMixin { | ||
@Inject(method = "breakPatternBlocks", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILEXCEPTION) | ||
private static void logStatueBreak(World world, BlockPattern.Result patternResult, CallbackInfo ci, int i, int j, CachedBlockPosition cachedBlockPosition) { | ||
if (cachedBlockPosition.getBlockState().isAir()) { | ||
return; | ||
} | ||
BlockBreakCallback.EVENT.invoker().breakBlock(world, cachedBlockPosition.getBlockPos(), cachedBlockPosition.getBlockState(), cachedBlockPosition.getBlockEntity(), Sources.STATUE); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/github/quiltservertools/ledger/mixin/blocks/ChorusFlowerBlockMixin.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,28 @@ | ||
package com.github.quiltservertools.ledger.mixin.blocks; | ||
|
||
import com.github.quiltservertools.ledger.callbacks.BlockBreakCallback; | ||
import com.github.quiltservertools.ledger.utility.Sources; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.ChorusFlowerBlock; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.entity.projectile.ProjectileEntity; | ||
import net.minecraft.util.hit.BlockHitResult; | ||
import net.minecraft.world.World; | ||
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(ChorusFlowerBlock.class) | ||
public abstract class ChorusFlowerBlockMixin { | ||
@Inject(method = "onProjectileHit", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;breakBlock(Lnet/minecraft/util/math/BlockPos;ZLnet/minecraft/entity/Entity;)Z")) | ||
public void logChorusFlowerBreak(World world, BlockState state, BlockHitResult hit, ProjectileEntity projectile, CallbackInfo ci) { | ||
Entity entity = projectile.getOwner(); | ||
if (entity instanceof PlayerEntity player) { | ||
BlockBreakCallback.EVENT.invoker().breakBlock(world, hit.getBlockPos(), state, null, Sources.PROJECTILE, player); | ||
} else { | ||
BlockBreakCallback.EVENT.invoker().breakBlock(world, hit.getBlockPos(), state, null, Sources.PROJECTILE); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/github/quiltservertools/ledger/mixin/blocks/ChorusPlantBlockMixin.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,21 @@ | ||
package com.github.quiltservertools.ledger.mixin.blocks; | ||
|
||
import com.github.quiltservertools.ledger.callbacks.BlockBreakCallback; | ||
import com.github.quiltservertools.ledger.utility.Sources; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.ChorusPlantBlock; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.random.Random; | ||
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(ChorusPlantBlock.class) | ||
public abstract class ChorusPlantBlockMixin { | ||
@Inject(method = "scheduledTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;breakBlock(Lnet/minecraft/util/math/BlockPos;Z)Z")) | ||
public void logChorusPlantBreak(BlockState state, ServerWorld world, BlockPos pos, Random random, CallbackInfo ci) { | ||
BlockBreakCallback.EVENT.invoker().breakBlock(world, pos, state, null, Sources.GRAVITY); | ||
} | ||
} |
Oops, something went wrong.