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

Disable Instant Nether Portal In Creative
This commit is contained in:
TheBrokenRail 2020-03-25 11:23:09 -04:00
parent 484429ed23
commit 12920cdf8d
7 changed files with 24 additions and 5 deletions

View File

@ -1,5 +1,8 @@
# Changelog
**1.0.9**
* Disable Instant Nether Portal In Creative
**1.0.8**
* Play Throw Sound

View File

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

View File

@ -9,7 +9,8 @@ compileJava {
}
archivesBaseName = project.archives_base_name
version = project.mod_version as Object
def mod_version = project.mod_version as Object
version = "${mod_version}+${project.minecraft_version}"
group = project.maven_group as Object
minecraft {
@ -36,12 +37,12 @@ dependencies {
}
processResources {
inputs.property 'version', version
inputs.property 'version', mod_version
inputs.property 'name', rootProject.name
from(sourceSets.main.resources.srcDirs) {
include 'fabric.mod.json'
expand 'version': version, 'name': rootProject.name
expand 'version': mod_version, 'name': rootProject.name
}
from(sourceSets.main.resources.srcDirs) {
@ -88,7 +89,7 @@ if (project.hasProperty('curseforge.api_key')) {
addGameVersion project.simple_minecraft_version
addGameVersion 'Fabric'
mainArtifact(remapJar) {
displayName = "SlightlyVanilla v${version} for ${project.minecraft_version}"
displayName = "SlightlyVanilla v${mod_version} for ${project.minecraft_version}"
}
afterEvaluate {
uploadTask.dependsOn('remapJar')

View File

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

View File

@ -15,6 +15,7 @@ public class ModConfig implements ConfigData {
public boolean openLootChestsInSpectatorMode = true;
public boolean cryingObsidianNetherPortal = true;
public boolean allowLeashingVillagers = true;
public boolean disableInstantNetherPortalInCreative = true;
public static class ThrowableOption {
public boolean player;

View File

@ -2,10 +2,13 @@ package com.thebrokenrail.slightlyvanilla.mixin;
import com.thebrokenrail.slightlyvanilla.SlightlyVanilla;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.player.PlayerAbilities;
import net.minecraft.entity.player.PlayerEntity;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.Redirect;
@SuppressWarnings("unused")
@Mixin(PlayerEntity.class)
@ -19,4 +22,13 @@ public class MixinPlayerEntity {
return amount;
}
}
@Redirect(at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/entity/player/PlayerAbilities;invulnerable:Z"), method = "getMaxNetherPortalTime")
public boolean adjustMaxNetherPortalTime(PlayerAbilities playerAbilities) {
if (SlightlyVanilla.getConfig().disableInstantNetherPortalInCreative) {
return false;
} else {
return playerAbilities.invulnerable;
}
}
}

View File

@ -11,6 +11,7 @@
"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.disableInstantNetherPortalInCreative": "Disable Instant Nether Portal In Creative",
"entity.slightlyvanilla.slimeball": "Slimeball",
"entity.slightlyvanilla.spawn_egg": "Spawn Egg"
}