Compare commits

...

5 Commits

Author SHA1 Message Date
TheBrokenRail 30995c0cc3 1.0.7
Gulliver Reloaded/pipeline/head This commit looks good Details
GulliverReloaded/pipeline/head This commit looks good Details
Fix Speed When Giant
Fix Third-Person View
Fix Inventory View
2020-03-27 14:31:47 -04:00
TheBrokenRail ce28c1c609 1.0.6
Gulliver Reloaded/pipeline/head This commit looks good Details
Fix Gradle Script
Automatically Adjust Shadow Size
2020-03-27 13:13:12 -04:00
TheBrokenRail 6ebf8e9c2f 1.0.5
Gulliver Reloaded/pipeline/head This commit looks good Details
Tweak Jumping Speed and Movement Speed
2020-03-27 12:51:54 -04:00
TheBrokenRail caf78d54ba 1.0.4
Gulliver Reloaded/pipeline/head This commit looks good Details
Scale Fall Damage and Reach Distance By Size
Namespace Lang
2020-03-27 11:00:15 -04:00
TheBrokenRail f7a95f0c96 1.0.3
Gulliver Reloaded/pipeline/head This commit looks good Details
Fix Assets Namespace
2020-03-26 23:36:21 -04:00
17 changed files with 181 additions and 40 deletions

View File

@ -1,5 +1,24 @@
# Changelog
**1.0.7**
* Fix Speed When Giant
* Fix Third-Person View
* Fix Inventory View
**1.0.6**
* Fix Gradle Script
* Automatically Adjust Shadow Size
**1.0.5**
* Tweak Jumping Speed and Movement Speed
**1.0.4**
* Scale Fall Damage and Reach Distance By Size
* Namespace Lang
**1.0.3**
* Fix Assets Namespace
**1.0.2**
* Update ModID
* Update Artifact Base Name

View File

@ -73,12 +73,12 @@ 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'
mainArtifact(remapJar) {
displayName = "SorceryCraft v${mod_version} for ${project.minecraft_version}"
displayName = "Gulliver Reloaded 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.2
mod_version = 1.0.7
maven_group = com.thebrokenrail
archives_base_name = gulliver-reloaded

View File

@ -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);
}

View File

@ -0,0 +1,29 @@
package com.thebrokenrail.gulliverreloaded.mixin;
import com.thebrokenrail.gulliverreloaded.ScaledEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.Camera;
import net.minecraft.entity.Entity;
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.Redirect;
@SuppressWarnings("unused")
@Environment(EnvType.CLIENT)
@Mixin(Camera.class)
public abstract class MixinCamera {
@Shadow
private Entity focusedEntity;
@Shadow
protected abstract double clipToSpace(double distance);
@Shadow
protected abstract void moveBy(double x, double y, double z);
@Redirect(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/Camera;clipToSpace(D)D"))
public double onUpdateClipToSpaceProxy(Camera obj, double distance) {
float scale = focusedEntity instanceof ScaledEntity ? ((ScaledEntity) focusedEntity).getScale() : 1f;
return clipToSpace(distance * scale);
}
}

View File

@ -0,0 +1,30 @@
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.gui.screen.ingame.CreativeInventoryScreen;
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
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

@ -0,0 +1,27 @@
package com.thebrokenrail.gulliverreloaded.mixin;
import com.thebrokenrail.gulliverreloaded.ScaledEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.world.WorldView;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
@SuppressWarnings("unused")
@Environment(EnvType.CLIENT)
@Mixin(EntityRenderDispatcher.class)
public class MixinEntityRenderDispatcher {
@ModifyArg(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/EntityRenderDispatcher;renderShadow(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/entity/Entity;FFLnet/minecraft/world/WorldView;F)V"), method = "render", index = 6)
public float adjustShadowSize(MatrixStack matrices, VertexConsumerProvider vertexConsumers, Entity entity, float darkness, float tickDelta, WorldView world, float size) {
if (entity instanceof ScaledEntity) {
return ((ScaledEntity) entity).getScale() * size;
} else {
return size;
}
}
}

View File

@ -0,0 +1,24 @@
package com.thebrokenrail.gulliverreloaded.mixin;
import com.thebrokenrail.gulliverreloaded.ScaledEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
import net.minecraft.entity.LivingEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
@SuppressWarnings("unused")
@Environment(EnvType.CLIENT)
@Mixin(InventoryScreen.class)
public class MixinInventoryScreen {
@ModifyVariable(at = @At("HEAD"), method = "drawEntity", argsOnly = true, index = 2)
private static int adjustEntitySize(int initial, int x, int y, int size, float mouseX, float mouseY, LivingEntity entity) {
if (entity instanceof ScaledEntity) {
return (int) (initial / ((ScaledEntity) entity).getScale());
} else {
return initial;
}
}
}

View File

@ -5,6 +5,10 @@ import com.thebrokenrail.gulliverreloaded.ScaledEntity;
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityPose;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.attribute.EntityAttribute;
import net.minecraft.entity.attribute.EntityAttributeInstance;
import net.minecraft.entity.attribute.EntityAttributeModifier;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.data.DataTracker;
import net.minecraft.entity.data.TrackedData;
import net.minecraft.entity.data.TrackedDataHandlerRegistry;
@ -12,21 +16,29 @@ import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Map;
import java.util.UUID;
@SuppressWarnings("unused")
@Mixin(LivingEntity.class)
public abstract class MixinLivingEntity implements ScaledEntity {
@Unique
private static final UUID SCALED_SPEED_ID = UUID.fromString("c5267238-6a78-4257-ae83-a2a5e34c1128");
@Unique
private static final TrackedData<Float> SCALE = DataTracker.registerData(LivingEntity.class, TrackedDataHandlerRegistry.FLOAT);
@Shadow
public abstract Map<StatusEffect, StatusEffectInstance> getActiveStatusEffects();
@Shadow
public abstract EntityAttributeInstance getAttributeInstance(EntityAttribute attribute);
@Override
public float getScale() {
return ((LivingEntity) (Object) this).getDataTracker().get(SCALE);
@ -61,12 +73,7 @@ public abstract class MixinLivingEntity implements ScaledEntity {
@Inject(at = @At("RETURN"), method = "getJumpVelocity", cancellable = true)
public void getJumpVelocity(CallbackInfoReturnable<Float> info) {
info.setReturnValue(info.getReturnValue() * (float) Math.pow(getScale(), 0.2f));
}
@Inject(at = @At("RETURN"), method = "getMovementSpeed()F", cancellable = true)
public void getMovementSpeed(CallbackInfoReturnable<Float> info) {
info.setReturnValue(info.getReturnValue() * (float) Math.pow(getScale(), 0.2f));
info.setReturnValue(info.getReturnValue() * (float) Math.pow(getScale(), 0.4f));
}
@Inject(at = @At("RETURN"), method = "getEyeHeight", cancellable = true)
@ -79,8 +86,17 @@ public abstract class MixinLivingEntity implements ScaledEntity {
@Inject(at = @At("HEAD"), method = "tick")
public void tick(CallbackInfo info) {
if (!((LivingEntity) (Object) this).getEntityWorld().isClient()) {
((LivingEntity) (Object) this).getDataTracker().set(SCALE, computeScale());
float scale = computeScale();
if (((LivingEntity) (Object) this).getDataTracker().get(SCALE) != scale) {
((LivingEntity) (Object) this).getDataTracker().set(SCALE, computeScale());
}
}
EntityAttributeInstance speedAttribute = getAttributeInstance(EntityAttributes.MOVEMENT_SPEED);
if (speedAttribute.getModifier(SCALED_SPEED_ID) != null) {
speedAttribute.removeModifier(SCALED_SPEED_ID);
}
speedAttribute.addModifier((new EntityAttributeModifier(SCALED_SPEED_ID, "Scaled speed multiplier", Math.pow(getScale(), 0.4) - 1, EntityAttributeModifier.Operation.MULTIPLY_TOTAL)).setSerialize(false));
}
@Inject(at = @At("RETURN"), method = "initDataTracker")
@ -94,4 +110,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)));
}
}

View File

@ -4,27 +4,14 @@ import com.thebrokenrail.gulliverreloaded.ScaledEntity;
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityPose;
import net.minecraft.entity.player.PlayerEntity;
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;
import java.util.Map;
@SuppressWarnings("unused")
@Mixin(PlayerEntity.class)
public abstract class MixinPlayerEntity {
@Shadow
@Final
private static Map<EntityPose, EntityDimensions> POSE_DIMENSIONS;
@Inject(at = @At("RETURN"), method = "getMovementSpeed()F", cancellable = true)
public void getMovementSpeed(CallbackInfoReturnable<Float> info) {
info.setReturnValue(info.getReturnValue() * ((ScaledEntity) this).getScale());
}
@Inject(at = @At("RETURN"), method = "getDimensions", cancellable = true)
public void getDimensions(EntityPose pose, CallbackInfoReturnable<EntityDimensions> info) {
info.setReturnValue(((ScaledEntity) this).scaleDimensions(info.getReturnValue()));

View File

@ -0,0 +1,12 @@
{
"effect.gulliver-reloaded.shrink": "Shrink",
"effect.gulliver-reloaded.grow": "Grow",
"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"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

View File

@ -1,12 +0,0 @@
{
"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"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

View File

@ -13,7 +13,7 @@
"issues": "https://gitea.thebrokenrail.com/TheBrokenRail/GulliverReloaded/issues"
},
"license": "MIT",
"icon": "assets/gulliverreloaded/textures/mob_effect/shrink.png",
"icon": "assets/gulliver-reloaded/textures/mob_effect/shrink.png",
"environment": "*",
"entrypoints": {
"main": [
@ -21,7 +21,7 @@
]
},
"mixins": [
"gulliverreloaded.mixins.json"
"gulliver-reloaded.mixins.json"
],
"depends": {
"fabricloader": ">=0.7.4",

View File

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