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 {
|
||||
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);
|
||||
|
||||
objectList.addElement(customImageObject);
|
||||
|
||||
@@ -4,6 +4,7 @@ import eu.crushedpixel.replaymod.interpolation.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
||||
@Data
|
||||
@@ -25,6 +26,12 @@ public class Position implements KeyframeValue {
|
||||
this.z = pos.getZ();
|
||||
}
|
||||
|
||||
public Position(Entity entity) {
|
||||
this.x = entity.posX;
|
||||
this.y = entity.posY;
|
||||
this.z = entity.posZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Interpolation getLinearInterpolator() {
|
||||
return new GenericLinearInterpolation<Position>();
|
||||
|
||||
Reference in New Issue
Block a user