Allow Leashing Villagers
This commit is contained in:
parent
003726ef22
commit
f44cdd0699
@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
**1.0.7**
|
||||
* Allow Leashing Villagers
|
||||
|
||||
**1.0.6**
|
||||
* Improve Instant Kill
|
||||
|
||||
|
@ -11,6 +11,7 @@ Suggest more tweaks in the issue tracker!
|
||||
* Throwable Spawn Eggs
|
||||
* Open Loot Chests In Spectator Mode
|
||||
* Crying Obsidian Nether Portal
|
||||
* Allow Leashing Villagers
|
||||
|
||||
## Changelog
|
||||
[View Changelog](CHANGELOG.md)
|
||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
||||
fabric_loader_version = 0.7.8+build.189
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.6
|
||||
mod_version = 1.0.7
|
||||
maven_group = com.thebrokenrail
|
||||
archives_base_name = slightlyvanilla
|
||||
|
||||
|
@ -14,6 +14,7 @@ public class ModConfig implements ConfigData {
|
||||
public ThrowableOption throwableSpawnEggs = new ThrowableOption(true, false);
|
||||
public boolean openLootChestsInSpectatorMode = true;
|
||||
public boolean cryingObsidianNetherPortal = true;
|
||||
public boolean allowLeashingVillagers = true;
|
||||
|
||||
public static class ThrowableOption {
|
||||
public boolean player;
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@
|
||||
"text.autoconfig.slightlyvanilla.option.throwableSpawnEggs.dispenser": "Dispenser",
|
||||
"text.autoconfig.slightlyvanilla.option.openLootChestsInSpectatorMode": "Open Loot Chests In Spectator Mode",
|
||||
"text.autoconfig.slightlyvanilla.option.cryingObsidianNetherPortal": "Crying Obsidian Nether Portal",
|
||||
"text.autoconfig.slightlyvanilla.option.allowLeashingVillagers": "Allow Leashing Villagers",
|
||||
"entity.slightlyvanilla.slimeball": "Slimeball",
|
||||
"entity.slightlyvanilla.spawn_egg": "Spawn Egg"
|
||||
}
|
@ -11,7 +11,8 @@
|
||||
"MixinItem",
|
||||
"MixinSpawnEggItem",
|
||||
"MixinLootableContainerBlockEntity",
|
||||
"MixinNetherPortalBlockAreaHelper"
|
||||
"MixinNetherPortalBlockAreaHelper",
|
||||
"MixinAbstractTraderEntity"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
Reference in New Issue
Block a user