Places new CustomImageObjects at Camera's exact instead of Block Position
This commit is contained in:
@@ -153,7 +153,7 @@ public class GuiObjectManager extends GuiScreen implements GuiReplayOverlay.NoOv
|
|||||||
try {
|
try {
|
||||||
CustomImageObject customImageObject = new CustomImageObject(I18n.format("replaymod.gui.objects.defaultname"), null);
|
CustomImageObject customImageObject = new CustomImageObject(I18n.format("replaymod.gui.objects.defaultname"), null);
|
||||||
|
|
||||||
Position defaultPosition = new Position(mc.getRenderViewEntity().getPosition());
|
Position defaultPosition = new Position(mc.getRenderViewEntity());
|
||||||
customImageObject.getTransformations().setDefaultPosition(defaultPosition);
|
customImageObject.getTransformations().setDefaultPosition(defaultPosition);
|
||||||
|
|
||||||
objectList.addElement(customImageObject);
|
objectList.addElement(customImageObject);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import eu.crushedpixel.replaymod.interpolation.*;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -25,6 +26,12 @@ public class Position implements KeyframeValue {
|
|||||||
this.z = pos.getZ();
|
this.z = pos.getZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Position(Entity entity) {
|
||||||
|
this.x = entity.posX;
|
||||||
|
this.y = entity.posY;
|
||||||
|
this.z = entity.posZ;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Interpolation getLinearInterpolator() {
|
public Interpolation getLinearInterpolator() {
|
||||||
return new GenericLinearInterpolation<Position>();
|
return new GenericLinearInterpolation<Position>();
|
||||||
|
|||||||
Reference in New Issue
Block a user