Port to 1.15.2
All checks were successful
SlightlyVanilla/pipeline/head This commit looks good

This commit is contained in:
TheBrokenRail 2020-03-21 12:31:49 -04:00
parent 12920cdf8d
commit 3ab20c3200
14 changed files with 19 additions and 81 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
**1.15.2 Port**
* Remove Crying Obsidian Nether Portal
* Remove Use Respawn Anchor In Any Dimension
**1.0.9** **1.0.9**
* Disable Instant Nether Portal In Creative * Disable Instant Nether Portal In Creative

View File

@ -1,16 +1,16 @@
# SlightlyVanilla # SlightlyVanilla
**1.15.2 Port**
A Collection of Tweaks for Vanilla Minecraft A Collection of Tweaks for Vanilla Minecraft
All tweaks can be enabled/disabled individually. All tweaks can be enabled/disabled individually.
Suggest more tweaks in the issue tracker! Suggest more tweaks in the issue tracker!
## Tweaks ## Tweaks
* Use Respawn Anchor in Any Dimension
* Instant Kill In Creative Mode * Instant Kill In Creative Mode
* Throwable Slimeballs * Throwable Slimeballs
* Throwable Spawn Eggs * Throwable Spawn Eggs
* Open Loot Chests In Spectator Mode * Open Loot Chests In Spectator Mode
* Crying Obsidian Nether Portal
* Allow Leashing Villagers * Allow Leashing Villagers
* Disable Instant Nether Portal In Creative * Disable Instant Nether Portal In Creative

View File

@ -84,7 +84,7 @@ if (project.hasProperty('curseforge.api_key')) {
apiKey = project.getProperty('curseforge.api_key') apiKey = project.getProperty('curseforge.api_key')
project { project {
id = project.curseforge_id id = project.curseforge_id
changelog = 'A changelog can be found at https://gitea.thebrokenrail.com/TheBrokenRail/SlightlyVanilla/src/branch/master/CHANGELOG.md' changelog = 'A changelog can be found at https://gitea.thebrokenrail.com/TheBrokenRail/SlightlyVanilla/src/branch/1.15/CHANGELOG.md'
releaseType = 'release' releaseType = 'release'
addGameVersion project.simple_minecraft_version addGameVersion project.simple_minecraft_version
addGameVersion 'Fabric' addGameVersion 'Fabric'

View File

@ -3,10 +3,10 @@ org.gradle.jvmargs = -Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version = 20w12a minecraft_version = 1.15.2
curseforge_id = 368420 curseforge_id = 368420
simple_minecraft_version = 1.16-Snapshot simple_minecraft_version = 1.15.2
yarn_build = 18 yarn_build = 14
fabric_loader_version = 0.7.8+build.189 fabric_loader_version = 0.7.8+build.189
# Mod Properties # Mod Properties
@ -16,7 +16,7 @@ org.gradle.jvmargs = -Xmx1G
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # 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.5.5+build.311-1.16 fabric_api_version = 0.5.1+build.294-1.15
cloth_config_version = 3.1.0-unstable cloth_config_version = 2.9.3
auto_config_version = 1.2.4 auto_config_version = 1.2.4
mod_menu_version = 1.11.0+build.2 mod_menu_version = 1.10.2+build.32

View File

@ -6,14 +6,12 @@ import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry;
@Config(name = SlightlyVanilla.NAMESPACE) @Config(name = SlightlyVanilla.NAMESPACE)
public class ModConfig implements ConfigData { public class ModConfig implements ConfigData {
public boolean useRespawnAnchorInAnyDimension = true;
public boolean instantKillInCreative = true; public boolean instantKillInCreative = true;
@ConfigEntry.Gui.CollapsibleObject(startExpanded = true) @ConfigEntry.Gui.CollapsibleObject(startExpanded = true)
public ThrowableOption throwableSlimeballs = new ThrowableOption(true, true); public ThrowableOption throwableSlimeballs = new ThrowableOption(true, true);
@ConfigEntry.Gui.CollapsibleObject(startExpanded = true) @ConfigEntry.Gui.CollapsibleObject(startExpanded = true)
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 allowLeashingVillagers = true; public boolean allowLeashingVillagers = true;
public boolean disableInstantNetherPortalInCreative = true; public boolean disableInstantNetherPortalInCreative = true;

View File

@ -6,8 +6,6 @@ import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import me.sargunvohra.mcmods.autoconfig1u.serializer.GsonConfigSerializer; import me.sargunvohra.mcmods.autoconfig1u.serializer.GsonConfigSerializer;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.entity.FabricEntityTypeBuilder; import net.fabricmc.fabric.api.entity.FabricEntityTypeBuilder;
import net.fabricmc.fabric.api.tag.TagRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.DispenserBlock; import net.minecraft.block.DispenserBlock;
import net.minecraft.block.dispenser.ItemDispenserBehavior; import net.minecraft.block.dispenser.ItemDispenserBehavior;
import net.minecraft.block.dispenser.ProjectileDispenserBehavior; import net.minecraft.block.dispenser.ProjectileDispenserBehavior;
@ -15,14 +13,13 @@ import net.minecraft.entity.EntityCategory;
import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnType; import net.minecraft.entity.SpawnType;
import net.minecraft.entity.projectile.Projectile;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.ProjectileEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.item.SpawnEggItem; import net.minecraft.item.SpawnEggItem;
import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents; import net.minecraft.sound.SoundEvents;
import net.minecraft.tag.Tag;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPointer; import net.minecraft.util.math.BlockPointer;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
@ -38,8 +35,6 @@ public class SlightlyVanilla implements ModInitializer {
public static EntityType<SlimeballEntity> SLIMEBALL_ENTITY; public static EntityType<SlimeballEntity> SLIMEBALL_ENTITY;
public static EntityType<SpawnEggEntity> SPAWN_EGG_ENTITY; public static EntityType<SpawnEggEntity> SPAWN_EGG_ENTITY;
public static final Tag<Block> EXTRA_PORTAL_BLOCKS_TAG = TagRegistry.block(new Identifier(NAMESPACE, "extra_portal_blocks"));
public static ModConfig getConfig() { public static ModConfig getConfig() {
return AutoConfig.getConfigHolder(ModConfig.class).getConfig(); return AutoConfig.getConfigHolder(ModConfig.class).getConfig();
} }
@ -58,7 +53,7 @@ public class SlightlyVanilla implements ModInitializer {
if (getConfig().throwableSlimeballs.dispenser) { if (getConfig().throwableSlimeballs.dispenser) {
return new ProjectileDispenserBehavior() { return new ProjectileDispenserBehavior() {
@Override @Override
protected ProjectileEntity createProjectile(World position, Position stack, ItemStack itemStack) { protected Projectile createProjectile(World position, Position stack, ItemStack itemStack) {
SlimeballEntity entity = new SlimeballEntity(position, stack.getX(), stack.getY(), stack.getZ()); SlimeballEntity entity = new SlimeballEntity(position, stack.getX(), stack.getY(), stack.getZ());
entity.setItem(itemStack); entity.setItem(itemStack);
return entity; return entity;
@ -74,7 +69,7 @@ public class SlightlyVanilla implements ModInitializer {
if (getConfig().throwableSpawnEggs.dispenser) { if (getConfig().throwableSpawnEggs.dispenser) {
return new ProjectileDispenserBehavior() { return new ProjectileDispenserBehavior() {
@Override @Override
protected ProjectileEntity createProjectile(World position, Position stack, ItemStack itemStack) { protected Projectile createProjectile(World position, Position stack, ItemStack itemStack) {
SpawnEggEntity entity = new SpawnEggEntity(position, stack.getX(), stack.getY(), stack.getZ()); SpawnEggEntity entity = new SpawnEggEntity(position, stack.getX(), stack.getY(), stack.getZ());
entity.setItem(itemStack); entity.setItem(itemStack);
return entity; return entity;

View File

@ -5,7 +5,7 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.projectile.thrown.ThrownItemEntity; import net.minecraft.entity.thrown.ThrownItemEntity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.network.Packet; import net.minecraft.network.Packet;
@ -56,7 +56,6 @@ public class SlimeballEntity extends ThrownItemEntity {
@Override @Override
protected void onCollision(HitResult hitResult) { protected void onCollision(HitResult hitResult) {
super.onCollision(hitResult);
if (!world.isClient()) { if (!world.isClient()) {
world.sendEntityStatus(this, (byte) 3); world.sendEntityStatus(this, (byte) 3);
remove(); remove();

View File

@ -6,7 +6,7 @@ import net.fabricmc.api.Environment;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.SpawnType; import net.minecraft.entity.SpawnType;
import net.minecraft.entity.projectile.thrown.ThrownItemEntity; import net.minecraft.entity.thrown.ThrownItemEntity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.item.SpawnEggItem; import net.minecraft.item.SpawnEggItem;
@ -59,7 +59,6 @@ public class SpawnEggEntity extends ThrownItemEntity {
@Override @Override
protected void onCollision(HitResult hitResult) { protected void onCollision(HitResult hitResult) {
super.onCollision(hitResult);
if (!world.isClient()) { if (!world.isClient()) {
world.sendEntityStatus(this, (byte) 3); world.sendEntityStatus(this, (byte) 3);
EntityType<?> entityType = ((SpawnEggItem) getStack().getItem()).getEntityType(getStack().getTag()); EntityType<?> entityType = ((SpawnEggItem) getStack().getItem()).getEntityType(getStack().getTag());

View File

@ -1,25 +0,0 @@
package com.thebrokenrail.slightlyvanilla.mixin;
import com.thebrokenrail.slightlyvanilla.SlightlyVanilla;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.NetherPortalBlock;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@SuppressWarnings("unused")
@Mixin(NetherPortalBlock.AreaHelper.class)
public class MixinNetherPortalBlockAreaHelper {
@SuppressWarnings("UnresolvedMixinReference")
@Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;getBlock()Lnet/minecraft/block/Block;"), method = "*")
public Block redirectBlock(BlockState state) {
Block block = state.getBlock();
if (block.isIn(SlightlyVanilla.EXTRA_PORTAL_BLOCKS_TAG) && SlightlyVanilla.getConfig().cryingObsidianNetherPortal) {
return Blocks.OBSIDIAN;
} else {
return block;
}
}
}

View File

@ -1,22 +0,0 @@
package com.thebrokenrail.slightlyvanilla.mixin;
import com.thebrokenrail.slightlyvanilla.SlightlyVanilla;
import net.minecraft.block.RespawnAnchorBlock;
import net.minecraft.world.dimension.Dimension;
import net.minecraft.world.dimension.DimensionType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@SuppressWarnings("unused")
@Mixin(RespawnAnchorBlock.class)
public class MixinRespawnAnchorBlock {
@Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/world/dimension/Dimension;getType()Lnet/minecraft/world/dimension/DimensionType;", ordinal = 0), method = "onUse")
public DimensionType getDimension(Dimension dimension) {
if (SlightlyVanilla.getConfig().useRespawnAnchorInAnyDimension) {
return DimensionType.THE_NETHER;
} else {
return dimension.getType();
}
}
}

View File

@ -1,6 +1,5 @@
{ {
"text.autoconfig.slightlyvanilla.title": "SlightlyVanilla Tweaks", "text.autoconfig.slightlyvanilla.title": "SlightlyVanilla Tweaks",
"text.autoconfig.slightlyvanilla.option.useRespawnAnchorInAnyDimension": "Use Respawn Anchor In Any Dimension",
"text.autoconfig.slightlyvanilla.option.instantKillInCreative": "Instant Kill In Creative Mode", "text.autoconfig.slightlyvanilla.option.instantKillInCreative": "Instant Kill In Creative Mode",
"text.autoconfig.slightlyvanilla.option.throwableSlimeballs": "Throwable Slimeballs", "text.autoconfig.slightlyvanilla.option.throwableSlimeballs": "Throwable Slimeballs",
"text.autoconfig.slightlyvanilla.option.throwableSlimeballs.player": "Player", "text.autoconfig.slightlyvanilla.option.throwableSlimeballs.player": "Player",
@ -9,7 +8,6 @@
"text.autoconfig.slightlyvanilla.option.throwableSpawnEggs.player": "Player", "text.autoconfig.slightlyvanilla.option.throwableSpawnEggs.player": "Player",
"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.allowLeashingVillagers": "Allow Leashing Villagers", "text.autoconfig.slightlyvanilla.option.allowLeashingVillagers": "Allow Leashing Villagers",
"text.autoconfig.slightlyvanilla.option.disableInstantNetherPortalInCreative": "Disable Instant Nether Portal In Creative", "text.autoconfig.slightlyvanilla.option.disableInstantNetherPortalInCreative": "Disable Instant Nether Portal In Creative",
"entity.slightlyvanilla.slimeball": "Slimeball", "entity.slightlyvanilla.slimeball": "Slimeball",

View File

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"minecraft:crying_obsidian"
]
}

View File

@ -32,6 +32,6 @@
"depends": { "depends": {
"fabricloader": ">=0.7.4", "fabricloader": ">=0.7.4",
"fabric": "*", "fabric": "*",
"minecraft": "1.16.x" "minecraft": "1.15.x"
} }
} }

View File

@ -6,12 +6,10 @@
"MixinClientPlayNetworkHandler" "MixinClientPlayNetworkHandler"
], ],
"mixins": [ "mixins": [
"MixinRespawnAnchorBlock",
"MixinPlayerEntity", "MixinPlayerEntity",
"MixinItem", "MixinItem",
"MixinSpawnEggItem", "MixinSpawnEggItem",
"MixinLootableContainerBlockEntity", "MixinLootableContainerBlockEntity",
"MixinNetherPortalBlockAreaHelper",
"MixinAbstractTraderEntity" "MixinAbstractTraderEntity"
], ],
"injectors": { "injectors": {