Compare commits

...

2 Commits

Author SHA1 Message Date
30995c0cc3 1.0.7
All checks were successful
Gulliver Reloaded/pipeline/head This commit looks good
GulliverReloaded/pipeline/head This commit looks good
Fix Speed When Giant
Fix Third-Person View
Fix Inventory View
2020-03-27 14:31:47 -04:00
ce28c1c609 1.0.6
All checks were successful
Gulliver Reloaded/pipeline/head This commit looks good
Fix Gradle Script
Automatically Adjust Shadow Size
2020-03-27 13:13:12 -04:00
10 changed files with 102 additions and 4 deletions

View File

@ -1,5 +1,14 @@
# 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

View File

@ -78,7 +78,7 @@ if (project.hasProperty('curseforge.api_key')) {
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.5
mod_version = 1.0.7
maven_group = com.thebrokenrail
archives_base_name = gulliver-reloaded

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

@ -4,6 +4,8 @@ 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;

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

@ -16,6 +16,7 @@ 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;
@ -27,13 +28,16 @@ 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);
@Shadow
public abstract EntityAttributeInstance getAttributeInstance(EntityAttribute attribute);
@Override
public float getScale() {
@ -92,7 +96,7 @@ public abstract class MixinLivingEntity implements ScaledEntity {
if (speedAttribute.getModifier(SCALED_SPEED_ID) != null) {
speedAttribute.removeModifier(SCALED_SPEED_ID);
}
speedAttribute.addModifier((new EntityAttributeModifier(SCALED_SPEED_ID, "Scaled speed multiplier", getScale() - 1, EntityAttributeModifier.Operation.MULTIPLY_TOTAL)).setSerialize(false));
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")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 342 B

View File

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