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

Allow Leashing Villagers
This commit is contained in:
TheBrokenRail 2020-03-20 20:37:39 -04:00
parent 003726ef22
commit f44cdd0699
7 changed files with 36 additions and 2 deletions

View File

@ -1,5 +1,8 @@
# Changelog # Changelog
**1.0.7**
* Allow Leashing Villagers
**1.0.6** **1.0.6**
* Improve Instant Kill * Improve Instant Kill

View File

@ -11,6 +11,7 @@ Suggest more tweaks in the issue tracker!
* Throwable Spawn Eggs * Throwable Spawn Eggs
* Open Loot Chests In Spectator Mode * Open Loot Chests In Spectator Mode
* Crying Obsidian Nether Portal * Crying Obsidian Nether Portal
* Allow Leashing Villagers
## Changelog ## Changelog
[View Changelog](CHANGELOG.md) [View Changelog](CHANGELOG.md)

View File

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

View File

@ -14,6 +14,7 @@ public class ModConfig implements ConfigData {
public ThrowableOption throwableSpawnEggs = new ThrowableOption(true, false); public ThrowableOption throwableSpawnEggs = new ThrowableOption(true, false);
public boolean openLootChestsInSpectatorMode = true; public boolean openLootChestsInSpectatorMode = true;
public boolean cryingObsidianNetherPortal = true; public boolean cryingObsidianNetherPortal = true;
public boolean allowLeashingVillagers = true;
public static class ThrowableOption { public static class ThrowableOption {
public boolean player; public boolean player;

View File

@ -0,0 +1,27 @@
package com.thebrokenrail.slightlyvanilla.mixin;
import com.thebrokenrail.slightlyvanilla.SlightlyVanilla;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.passive.AbstractTraderEntity;
import net.minecraft.entity.passive.PassiveEntity;
import net.minecraft.entity.player.PlayerEntity;
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.CallbackInfoReturnable;
@SuppressWarnings("unused")
@Mixin(AbstractTraderEntity.class)
public abstract class MixinAbstractTraderEntity extends PassiveEntity {
protected MixinAbstractTraderEntity(EntityType<? extends PassiveEntity> entityType, World world) {
super(entityType, world);
}
@Inject(at = @At("HEAD"), method = "canBeLeashedBy", cancellable = true)
public void canBeLeashedBy(PlayerEntity player, CallbackInfoReturnable<Boolean> info) {
if (SlightlyVanilla.getConfig().allowLeashingVillagers) {
info.setReturnValue(super.canBeLeashedBy(player));
}
}
}

View File

@ -10,6 +10,7 @@
"text.autoconfig.slightlyvanilla.option.throwableSpawnEggs.dispenser": "Dispenser", "text.autoconfig.slightlyvanilla.option.throwableSpawnEggs.dispenser": "Dispenser",
"text.autoconfig.slightlyvanilla.option.openLootChestsInSpectatorMode": "Open Loot Chests In Spectator Mode", "text.autoconfig.slightlyvanilla.option.openLootChestsInSpectatorMode": "Open Loot Chests In Spectator Mode",
"text.autoconfig.slightlyvanilla.option.cryingObsidianNetherPortal": "Crying Obsidian Nether Portal", "text.autoconfig.slightlyvanilla.option.cryingObsidianNetherPortal": "Crying Obsidian Nether Portal",
"text.autoconfig.slightlyvanilla.option.allowLeashingVillagers": "Allow Leashing Villagers",
"entity.slightlyvanilla.slimeball": "Slimeball", "entity.slightlyvanilla.slimeball": "Slimeball",
"entity.slightlyvanilla.spawn_egg": "Spawn Egg" "entity.slightlyvanilla.spawn_egg": "Spawn Egg"
} }

View File

@ -11,7 +11,8 @@
"MixinItem", "MixinItem",
"MixinSpawnEggItem", "MixinSpawnEggItem",
"MixinLootableContainerBlockEntity", "MixinLootableContainerBlockEntity",
"MixinNetherPortalBlockAreaHelper" "MixinNetherPortalBlockAreaHelper",
"MixinAbstractTraderEntity"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1