Interfaced refrences
This commit is contained in:
@@ -1,18 +0,0 @@
|
|||||||
package org.saturnclient.common;
|
|
||||||
|
|
||||||
public class MinecraftBinding {
|
|
||||||
public Object inner;
|
|
||||||
|
|
||||||
public MinecraftBinding(Object binding) {
|
|
||||||
this.inner = binding;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public <T> T get() {
|
|
||||||
try {
|
|
||||||
return (T) inner;
|
|
||||||
} catch (ClassCastException e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +1,18 @@
|
|||||||
package org.saturnclient.common.ref.asset;
|
package org.saturnclient.common.ref.asset;
|
||||||
|
|
||||||
import org.saturnclient.common.MinecraftBinding;
|
public interface IdentifierRef {
|
||||||
import org.saturnclient.common.MinecraftProvider;
|
|
||||||
|
|
||||||
public class IdentifierRef extends MinecraftBinding {
|
|
||||||
public IdentifierRef(String namespace, String path) {
|
|
||||||
super(MinecraftProvider.PROVIDER.createIdentifier(namespace, path));
|
|
||||||
}
|
|
||||||
|
|
||||||
public IdentifierRef(Object o) {
|
|
||||||
super(o);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IdentifierRef of(String namespace, String path) {
|
public static IdentifierRef of(String namespace, String path) {
|
||||||
return new IdentifierRef(namespace, path);
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IdentifierRef of(String fullPath) {
|
public static IdentifierRef of(String fullPath) {
|
||||||
String[] p = fullPath.split(":", 2);
|
return null;
|
||||||
|
|
||||||
return new IdentifierRef(p[0], p[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IdentifierRef ofVanilla(String path) {
|
public static IdentifierRef ofVanilla(String path) {
|
||||||
return new IdentifierRef("minecraft", path);
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString();
|
||||||
return this.inner.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
package org.saturnclient.common.ref.asset;
|
package org.saturnclient.common.ref.asset;
|
||||||
|
|
||||||
import org.saturnclient.common.MinecraftBinding;
|
public interface SpriteRef {
|
||||||
|
|
||||||
public class SpriteRef extends MinecraftBinding {
|
|
||||||
public SpriteRef(Object binding) {
|
|
||||||
super(binding);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
package org.saturnclient.common.ref.game;
|
package org.saturnclient.common.ref.game;
|
||||||
|
|
||||||
import org.saturnclient.common.MinecraftBinding;
|
public interface ItemStackRef {
|
||||||
|
|
||||||
public class ItemStackRef extends MinecraftBinding {
|
|
||||||
public ItemStackRef(Object binding) {
|
|
||||||
super(binding);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.saturnclient.common.ref.game;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import org.saturnclient.common.ref.asset.IdentifierRef;
|
||||||
|
import org.saturnclient.common.ref.render.WindowRef;
|
||||||
|
|
||||||
|
public interface MinecraftClientRef {
|
||||||
|
|
||||||
|
public File getRunDirectory();
|
||||||
|
|
||||||
|
public InputStream getResource(IdentifierRef identifier);
|
||||||
|
|
||||||
|
public WindowRef getWindow();
|
||||||
|
}
|
||||||
@@ -7,9 +7,9 @@ public interface MatrixStackRef {
|
|||||||
|
|
||||||
public void scale(float x, float y, float z);
|
public void scale(float x, float y, float z);
|
||||||
|
|
||||||
public void multiply(SaturnQuaternionf quaternion);
|
public void multiply(QuaternionfRef quaternion);
|
||||||
|
|
||||||
public void multiply(SaturnQuaternionf quaternion, float originX, float originY, float originZ);
|
public void multiply(QuaternionfRef quaternion, float originX, float originY, float originZ);
|
||||||
|
|
||||||
public void push();
|
public void push();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package org.saturnclient.common.ref.render;
|
||||||
|
|
||||||
|
public interface QuaternionfRef {
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package org.saturnclient.common.ref.render;
|
|
||||||
|
|
||||||
import org.saturnclient.common.MinecraftBinding;
|
|
||||||
|
|
||||||
public class SaturnQuaternionf extends MinecraftBinding {
|
|
||||||
public SaturnQuaternionf(Object o) {
|
|
||||||
super(o);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user