1.0.4
All checks were successful
Gulliver Reloaded/pipeline/head This commit looks good

Scale Fall Damage and Reach Distance By Size
Namespace Lang
This commit is contained in:
TheBrokenRail 2020-03-27 11:00:15 -04:00
parent f7a95f0c96
commit caf78d54ba
8 changed files with 51 additions and 13 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
**1.0.4**
* Scale Fall Damage and Reach Distance By Size
* Namespace Lang
**1.0.3** **1.0.3**
* Fix Assets Namespace * Fix Assets Namespace

View File

@ -73,7 +73,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/SorceryCraft/src/branch/master/CHANGELOG.md' changelog = 'A changelog can be found at https://gitea.thebrokenrail.com/TheBrokenRail/GulliverReloaded/src/branch/master/CHANGELOG.md'
releaseType = 'release' releaseType = 'release'
addGameVersion project.simple_minecraft_version addGameVersion project.simple_minecraft_version
addGameVersion 'Fabric' addGameVersion 'Fabric'

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.3 mod_version = 1.0.4
maven_group = com.thebrokenrail maven_group = com.thebrokenrail
archives_base_name = gulliver-reloaded archives_base_name = gulliver-reloaded

View File

@ -26,9 +26,9 @@ public class GulliverReloaded implements ModInitializer {
private CustomPotion registerEffect(String name, int color) { private CustomPotion registerEffect(String name, int color) {
StatusEffect effect = Registry.register(Registry.STATUS_EFFECT, new Identifier(NAMESPACE, name), new CustomPotion.CustomStatusEffect(StatusEffectType.NEUTRAL, color)); StatusEffect effect = Registry.register(Registry.STATUS_EFFECT, new Identifier(NAMESPACE, name), new CustomPotion.CustomStatusEffect(StatusEffectType.NEUTRAL, color));
Potion potion = Registry.register(Registry.POTION, new Identifier(NAMESPACE, name), new Potion(new StatusEffectInstance(effect, 3600))); Potion potion = Registry.register(Registry.POTION, new Identifier(NAMESPACE, name), new Potion(NAMESPACE + '.' + name, new StatusEffectInstance(effect, 3600)));
Potion longPotion = Registry.register(Registry.POTION, new Identifier(NAMESPACE, "long_" + name), new Potion(name, new StatusEffectInstance(effect, 9600))); Potion longPotion = Registry.register(Registry.POTION, new Identifier(NAMESPACE, "long_" + name), new Potion(NAMESPACE + '.' + name, new StatusEffectInstance(effect, 9600)));
Potion strongPotion = Registry.register(Registry.POTION, new Identifier(NAMESPACE, "strong_" + name), new Potion(name, new StatusEffectInstance(effect, 1800, 1))); Potion strongPotion = Registry.register(Registry.POTION, new Identifier(NAMESPACE, "strong_" + name), new Potion(NAMESPACE + '.' + name, new StatusEffectInstance(effect, 1800, 1)));
return new CustomPotion(effect, potion, longPotion, strongPotion); return new CustomPotion(effect, potion, longPotion, strongPotion);
} }

View File

@ -0,0 +1,28 @@
package com.thebrokenrail.gulliverreloaded.mixin;
import com.thebrokenrail.gulliverreloaded.ScaledEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@SuppressWarnings("unused")
@Environment(EnvType.CLIENT)
@Mixin(ClientPlayerInteractionManager.class)
public class MixinClientPlayerInteractionManager {
@Shadow
@Final
private MinecraftClient client;
@Inject(at = @At("RETURN"), method = "getReachDistance", cancellable = true)
public void getReachDistance(CallbackInfoReturnable<Float> info) {
assert client.player != null;
info.setReturnValue((float) Math.min(8d, info.getReturnValue() * ((ScaledEntity) client.player).getScale()));
}
}

View File

@ -94,4 +94,9 @@ public abstract class MixinLivingEntity implements ScaledEntity {
((LivingEntity) (Object) this).calculateDimensions(); ((LivingEntity) (Object) this).calculateDimensions();
} }
} }
@Inject(at = @At("RETURN"), method = "computeFallDamage", cancellable = true)
public void computeFallDamage(float fallDistance, float damageMultiplier, CallbackInfoReturnable<Integer> info) {
info.setReturnValue((int) (info.getReturnValue() * Math.pow(getScale(), -1)));
}
} }

View File

@ -1,12 +1,12 @@
{ {
"effect.gulliver-reloaded.shrink": "Shrink", "effect.gulliver-reloaded.shrink": "Shrink",
"effect.gulliver-reloaded.grow": "Grow", "effect.gulliver-reloaded.grow": "Grow",
"item.minecraft.potion.effect.shrink": "Potion of Shrinking", "item.minecraft.potion.effect.gulliver-reloaded.shrink": "Potion of Shrinking",
"item.minecraft.potion.effect.grow": "Potion of Growing", "item.minecraft.potion.effect.gulliver-reloaded.grow": "Potion of Growing",
"item.minecraft.splash_potion.effect.shrink": "Splash Potion of Shrinking", "item.minecraft.splash_potion.effect.gulliver-reloaded.shrink": "Splash Potion of Shrinking",
"item.minecraft.splash_potion.effect.grow": "Splash Potion of Growing", "item.minecraft.splash_potion.effect.gulliver-reloaded.grow": "Splash Potion of Growing",
"item.minecraft.lingering_potion.effect.shrink": "Lingering Potion of Shrinking", "item.minecraft.lingering_potion.effect.gulliver-reloaded.shrink": "Lingering Potion of Shrinking",
"item.minecraft.lingering_potion.effect.grow": "Lingering Potion of Growing", "item.minecraft.lingering_potion.effect.gulliver-reloaded.grow": "Lingering Potion of Growing",
"item.minecraft.tipped_arrow.effect.shrink": "Arrow of Shrinking", "item.minecraft.tipped_arrow.effect.gulliver-reloaded.shrink": "Arrow of Shrinking",
"item.minecraft.tipped_arrow.effect.grow": "Arrow of Growing" "item.minecraft.tipped_arrow.effect.gulliver-reloaded.grow": "Arrow of Growing"
} }

View File

@ -3,6 +3,7 @@
"package": "com.thebrokenrail.gulliverreloaded.mixin", "package": "com.thebrokenrail.gulliverreloaded.mixin",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_8",
"client": [ "client": [
"MixinClientPlayerInteractionManager",
"MixinLivingEntityRenderer" "MixinLivingEntityRenderer"
], ],
"mixins": [ "mixins": [