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

Crying Obsidian Nether Portal
This commit is contained in:
TheBrokenRail 2020-03-20 18:09:01 -04:00
parent b02c3982c1
commit 4197534e8f
9 changed files with 46 additions and 4 deletions

View File

@ -1,5 +1,8 @@
# Changelog # Changelog
**1.0.5**
* Crying Obsidian Nether Portal
**1.0.4** **1.0.4**
* Allow Opening Loot Chests In Spectator Mode * Allow Opening Loot Chests In Spectator Mode

View File

@ -10,6 +10,7 @@ Suggest more tweaks in the issue tracker!
* 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
## Changelog ## Changelog
[View Changelog](CHANGELOG.md) [View Changelog](CHANGELOG.md)

View File

@ -6,11 +6,11 @@ org.gradle.jvmargs = -Xmx1G
minecraft_version = 20w12a minecraft_version = 20w12a
curseforge_id = 368420 curseforge_id = 368420
simple_minecraft_version = 1.16-Snapshot simple_minecraft_version = 1.16-Snapshot
yarn_build = 14 yarn_build = 16
fabric_loader_version = 0.7.8+build.189 fabric_loader_version = 0.7.8+build.189
# Mod Properties # Mod Properties
mod_version = 1.0.4 mod_version = 1.0.5
maven_group = com.thebrokenrail maven_group = com.thebrokenrail
archives_base_name = slightlyvanilla archives_base_name = slightlyvanilla
@ -19,4 +19,4 @@ org.gradle.jvmargs = -Xmx1G
fabric_api_version = 0.5.5+build.311-1.16 fabric_api_version = 0.5.5+build.311-1.16
cloth_config_version = 3.1.0-unstable cloth_config_version = 3.1.0-unstable
auto_config_version = 1.2.4 auto_config_version = 1.2.4
mod_menu_version = 1.10.2+build.1 mod_menu_version = 1.11.0+build.2

View File

@ -13,6 +13,7 @@ public class ModConfig implements ConfigData {
@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 static class ThrowableOption { public static class ThrowableOption {
public boolean player; public boolean player;

View File

@ -6,6 +6,8 @@ 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;
@ -17,6 +19,7 @@ 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.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;
@ -30,6 +33,8 @@ 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();
} }

View File

@ -0,0 +1,24 @@
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 {
@Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;getBlock()Lnet/minecraft/block/Block;"), method = {"distanceToPortalEdge", "findHeight"})
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

@ -9,6 +9,7 @@
"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",
"entity.slightlyvanilla.slimeball": "Slimeball", "entity.slightlyvanilla.slimeball": "Slimeball",
"entity.slightlyvanilla.spawn_egg": "Spawn Egg" "entity.slightlyvanilla.spawn_egg": "Spawn Egg"
} }

View File

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

View File

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