Scale Fall Damage and Reach Distance By Size Namespace Lang
This commit is contained in:
parent
f7a95f0c96
commit
caf78d54ba
@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
**1.0.4**
|
||||
* Scale Fall Damage and Reach Distance By Size
|
||||
* Namespace Lang
|
||||
|
||||
**1.0.3**
|
||||
* Fix Assets Namespace
|
||||
|
||||
|
@ -73,7 +73,7 @@ if (project.hasProperty('curseforge.api_key')) {
|
||||
apiKey = project.getProperty('curseforge.api_key')
|
||||
project {
|
||||
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'
|
||||
addGameVersion project.simple_minecraft_version
|
||||
addGameVersion 'Fabric'
|
||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
||||
fabric_loader_version = 0.7.8+build.189
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.3
|
||||
mod_version = 1.0.4
|
||||
maven_group = com.thebrokenrail
|
||||
archives_base_name = gulliver-reloaded
|
||||
|
||||
|
@ -26,9 +26,9 @@ public class GulliverReloaded implements ModInitializer {
|
||||
|
||||
private CustomPotion registerEffect(String name, int 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 longPotion = Registry.register(Registry.POTION, new Identifier(NAMESPACE, "long_" + name), new Potion(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 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(NAMESPACE + '.' + name, new StatusEffectInstance(effect, 9600)));
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -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()));
|
||||
}
|
||||
}
|
@ -94,4 +94,9 @@ public abstract class MixinLivingEntity implements ScaledEntity {
|
||||
((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)));
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
{
|
||||
"effect.gulliver-reloaded.shrink": "Shrink",
|
||||
"effect.gulliver-reloaded.grow": "Grow",
|
||||
"item.minecraft.potion.effect.shrink": "Potion of Shrinking",
|
||||
"item.minecraft.potion.effect.grow": "Potion of Growing",
|
||||
"item.minecraft.splash_potion.effect.shrink": "Splash Potion of Shrinking",
|
||||
"item.minecraft.splash_potion.effect.grow": "Splash Potion of Growing",
|
||||
"item.minecraft.lingering_potion.effect.shrink": "Lingering Potion of Shrinking",
|
||||
"item.minecraft.lingering_potion.effect.grow": "Lingering Potion of Growing",
|
||||
"item.minecraft.tipped_arrow.effect.shrink": "Arrow of Shrinking",
|
||||
"item.minecraft.tipped_arrow.effect.grow": "Arrow of Growing"
|
||||
"item.minecraft.potion.effect.gulliver-reloaded.shrink": "Potion of Shrinking",
|
||||
"item.minecraft.potion.effect.gulliver-reloaded.grow": "Potion of Growing",
|
||||
"item.minecraft.splash_potion.effect.gulliver-reloaded.shrink": "Splash Potion of Shrinking",
|
||||
"item.minecraft.splash_potion.effect.gulliver-reloaded.grow": "Splash Potion of Growing",
|
||||
"item.minecraft.lingering_potion.effect.gulliver-reloaded.shrink": "Lingering Potion of Shrinking",
|
||||
"item.minecraft.lingering_potion.effect.gulliver-reloaded.grow": "Lingering Potion of Growing",
|
||||
"item.minecraft.tipped_arrow.effect.gulliver-reloaded.shrink": "Arrow of Shrinking",
|
||||
"item.minecraft.tipped_arrow.effect.gulliver-reloaded.grow": "Arrow of Growing"
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
"package": "com.thebrokenrail.gulliverreloaded.mixin",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"client": [
|
||||
"MixinClientPlayerInteractionManager",
|
||||
"MixinLivingEntityRenderer"
|
||||
],
|
||||
"mixins": [
|
||||
|
Reference in New Issue
Block a user