1.0.4
All checks were successful
SlightlyVanilla/pipeline/head This commit looks good

Allow Opening Loot Chests In Spectator Mode
This commit is contained in:
TheBrokenRail 2020-03-20 14:05:40 -04:00
parent 75d69cf372
commit 77b09ccfe2
8 changed files with 36 additions and 2 deletions

View File

@ -1,5 +1,8 @@
# Changelog
**1.0.4**
* Allow Opening Loot Chests In Spectator Mode
**1.0.3**
* Update Dispenser Behavior

View File

@ -9,6 +9,7 @@ Suggest more tweaks in the issue tracker!
* Instant Kill In Creative Mode
* Throwable Slimeballs
* Throwable Spawn Eggs
* Open Loot Chests In Spectator Mode
## Changelog
[View Changelog](CHANGELOG.md)

View File

@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
fabric_loader_version = 0.7.8+build.189
# Mod Properties
mod_version = 1.0.3
mod_version = 1.0.4
maven_group = com.thebrokenrail
archives_base_name = slightlyvanilla

View File

@ -12,6 +12,7 @@ public class ModConfig implements ConfigData {
public ThrowableOption throwableSlimeballs = new ThrowableOption(true, true);
@ConfigEntry.Gui.CollapsibleObject(startExpanded = true)
public ThrowableOption throwableSpawnEggs = new ThrowableOption(true, false);
public boolean openLootChestsInSpectatorMode = true;
public static class ThrowableOption {
public boolean player;

View File

@ -2,6 +2,7 @@ package com.thebrokenrail.slightlyvanilla.mixin;
import com.thebrokenrail.slightlyvanilla.SlightlyVanilla;
import com.thebrokenrail.slightlyvanilla.entity.SlimeballEntity;
import net.minecraft.block.ChestBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

View File

@ -0,0 +1,26 @@
package com.thebrokenrail.slightlyvanilla.mixin;
import com.thebrokenrail.slightlyvanilla.SlightlyVanilla;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.block.entity.LockableContainerBlockEntity;
import net.minecraft.block.entity.LootableContainerBlockEntity;
import net.minecraft.entity.player.PlayerEntity;
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.CallbackInfoReturnable;
@SuppressWarnings("unused")
@Mixin(LootableContainerBlockEntity.class)
public abstract class MixinLootableContainerBlockEntity extends LockableContainerBlockEntity {
protected MixinLootableContainerBlockEntity(BlockEntityType<?> blockEntityType) {
super(blockEntityType);
}
@Inject(at = @At("HEAD"), method = "checkUnlocked", cancellable = true)
public void checkUnlocked(PlayerEntity player, CallbackInfoReturnable<Boolean> info) {
if (SlightlyVanilla.getConfig().openLootChestsInSpectatorMode) {
info.setReturnValue(super.checkUnlocked(player));
}
}
}

View File

@ -8,6 +8,7 @@
"text.autoconfig.slightlyvanilla.option.throwableSpawnEggs": "Throwable Spawn Eggs",
"text.autoconfig.slightlyvanilla.option.throwableSpawnEggs.player": "Player",
"text.autoconfig.slightlyvanilla.option.throwableSpawnEggs.dispenser": "Dispenser",
"text.autoconfig.slightlyvanilla.option.openLootChestsInSpectatorMode": "Open Loot Chests In Spectator Mode",
"entity.slightlyvanilla.slimeball": "Slimeball",
"entity.slightlyvanilla.spawn_egg": "Spawn Egg"
}

View File

@ -9,7 +9,8 @@
"MixinRespawnAnchorBlock",
"MixinPlayerEntity",
"MixinItem",
"MixinSpawnEggItem"
"MixinSpawnEggItem",
"MixinLootableContainerBlockEntity"
],
"injectors": {
"defaultRequire": 1