This commit is contained in:
TheBrokenRail 2020-12-15 11:21:36 -05:00
parent e04dc6ffe2
commit dd4694ec40
6 changed files with 32 additions and 6 deletions

View File

@ -1,5 +1,8 @@
# Changelog
**1.0.12**
* Allow Disabling Beds Setting Spawn
**1.0.11**
* Fix Loading On Client Without ModMenu
* Fix Loading On Server

View File

@ -3,11 +3,11 @@ org.gradle.jvmargs = -Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version = 1.16.3
minecraft_version = 1.16.4
curseforge_id = 368420
simple_minecraft_version = 1.16.3
yarn_build = 47
fabric_loader_version = 0.10.3+build.211
simple_minecraft_version = 1.16.4
yarn_build = 7
fabric_loader_version = 0.10.8
# Mod Properties
mod_version = 1.0.11
@ -16,7 +16,7 @@ org.gradle.jvmargs = -Xmx1G
# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_api_version = 0.24.1+build.412-1.16
fabric_api_version = 0.28.1+1.16
modmenu_version = 1.14.6+build.31
cloth_config_version = 4.7.0-unstable
autoconfig_version = 3.2.0-unstable

View File

@ -21,6 +21,7 @@ public class ModConfig implements ConfigData {
public boolean disableInstantNetherPortalInCreative = true;
@Environment(EnvType.CLIENT)
public boolean noteBlockScreen = true;
public boolean bedsSetSpawn = true;
public static class ThrowableOption {
public boolean player;

View File

@ -0,0 +1,20 @@
package com.thebrokenrail.slightlyvanilla.mixin;
import com.thebrokenrail.slightlyvanilla.SlightlyVanilla;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ServerPlayerEntity.class)
public class MixinServerPlayerEntity {
@Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;setSpawnPoint(Lnet/minecraft/util/registry/RegistryKey;Lnet/minecraft/util/math/BlockPos;FZZ)V"), method = "trySleep")
public void setSpawnPoint(ServerPlayerEntity obj, RegistryKey<World> dimension, BlockPos pos, float angle, boolean spawnPointSet, boolean bl) {
if (SlightlyVanilla.getConfig().bedsSetSpawn) {
obj.setSpawnPoint(dimension, pos, angle, spawnPointSet, bl);
}
}
}

View File

@ -13,6 +13,7 @@
"text.autoconfig.slightlyvanilla.option.allowLeashingVillagers": "Allow Leashing Villagers",
"text.autoconfig.slightlyvanilla.option.disableInstantNetherPortalInCreative": "Disable Instant Nether Portal In Creative",
"text.autoconfig.slightlyvanilla.option.noteBlockScreen": "Add Note Block Screen",
"text.autoconfig.slightlyvanilla.option.bedsSetSpawn": "Beds Set Spawn",
"entity.slightlyvanilla.slimeball": "Slimeball",
"entity.slightlyvanilla.spawn_egg": "Spawn Egg",
"text.slightlyvanilla.noteblock_screen_slider": "Note: %s (%s)",

View File

@ -3,8 +3,8 @@
"package": "com.thebrokenrail.slightlyvanilla.mixin",
"compatibilityLevel": "JAVA_8",
"client": [
"MixinClientPlayNetworkHandler",
"MixinClientPlayerInteractionManager",
"MixinClientPlayNetworkHandler",
"ScreenHandlerAccessor"
],
"mixins": [
@ -14,6 +14,7 @@
"MixinNetherPortalBlockAreaHelper",
"MixinPlayerEntity",
"MixinRespawnAnchorBlock",
"MixinServerPlayerEntity",
"MixinSpawnEggItem"
],
"injectors": {