Compare commits

..

No commits in common. "main" and "issue/11-fix-bank-manager" have entirely different histories.

48 changed files with 321 additions and 4368 deletions

4
.gitignore vendored
View File

@ -9,10 +9,6 @@ classes/
*.launch *.launch
# Doxygen ignores
**html/*
**latex/*
# idea # idea
.idea/ .idea/

2658
Doxyfile

File diff suppressed because it is too large Load Diff

View File

@ -16,12 +16,6 @@ repositories {
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically. // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html // See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories. // for more information about repositories.
// maven {
// url "https://maven.squiddev.cc"
// content {
// includeGroup("cc.tweaked")
// }
// }
} }
loom { loom {
@ -44,8 +38,7 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway. // Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
//modCompileOnly "cc.tweaked:cc-tweaked-1.20-fabric-api:1.105.0"
//modRuntimeOnly "cc.tweaked:cc-tweaked-1.20-fabric-api:1.105.0"
} }
processResources { processResources {
@ -57,7 +50,7 @@ processResources {
} }
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
it.options.release = 17 it.options.release = 21
} }
java { java {
@ -66,8 +59,8 @@ java {
// If you remove this line, sources will not be generated. // If you remove this line, sources will not be generated.
withSourcesJar() withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_21
} }
jar { jar {

View File

@ -9,7 +9,7 @@ yarn_mappings=1.20+build.1
loader_version=0.15.11 loader_version=0.15.11
# Mod Properties # Mod Properties
mod_version=0.0.1 mod_version=1.0.0
maven_group=jesse.keeblarcraft maven_group=jesse.keeblarcraft
archives_base_name=keeblarcraft archives_base_name=keeblarcraft

View File

@ -1,4 +0,0 @@
#!/bin/bash
rm ~/.minecraft/mods/keeblarcraft* # What else could be named this? Really now?
cp build/devlibs/*sources.jar ~/.minecraft/mods
echo Moved minecraft to mods dir

View File

@ -1,21 +1,10 @@
package jesse.keeblarcraft; package jesse.keeblarcraft;
import jesse.keeblarcraft.gui.ClientHandlers;
import jesse.keeblarcraft.gui.ScreenManager;
import jesse.keeblarcraft.gui.widgets.TreeWidget;
import jesse.keeblarcraft.Shortcuts.ShortcutManager;
import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ClientModInitializer;
public class KeeblarcraftClient implements ClientModInitializer { public class KeeblarcraftClient implements ClientModInitializer {
@Override
@Override public void onInitializeClient() {
public void onInitializeClient() { // This entrypoint is suitable for setting up client-specific logic, such as rendering.
ShortcutManager.RegisterKeybinds(); }
ClientHandlers.RegisterHandlers(); }
ScreenManager.GetInstance();
ScreenManager.AddWidget(TreeWidget.class, 10);
}
}

View File

@ -1,97 +0,0 @@
/*
*
* ShortcutManager
*
* This is the client-side shortcut keybind manager
*
*
*/
package jesse.keeblarcraft.Shortcuts;
import org.lwjgl.glfw.GLFW;
// import jesse.keeblarcraft.Keeblarcraft;
import jesse.keeblarcraft.gui.ScreenManager;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.text.Text;
public class ShortcutManager {
private static KeyBinding skillTreeShortcut;
private static KeyBinding globalConfig;
private static Boolean toggleTreeGui = true; // Initialized to true for first time pressing keybind to actually display gui
// private static ScreenManager treeGui = null;
/////////////////////////////////////////////////////////////////////////////
/// @fn RegisterKeybinds
///
/// @brief Registers all player keybinds and callbacks to them
/////////////////////////////////////////////////////////////////////////////
// All callbacks for keyboard shortcuts are put here
public static void RegisterKeybinds() {
// Keybindings are registered here
skillTreeShortcut = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.keeblarcraft.treemap",
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_K,
"category.keeblarcraft.test"
));
globalConfig = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.keeblarcraft.globalconfig",
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_M,
"category.keeblarcraft.test"
));
/// Callbacks are down here
ClientTickEvents.END_CLIENT_TICK.register(client -> {
// The keybinding util does 2 things in one, if I check the state of the key press it flips a bit and deducts from
// the actual pressed amount - which we don't want to do. We will call the callbacks for keybinding functions here,
// and let them check the keybind themselves. NOTE: These functions are called at the end of every tick! Future us
// should see if there is a less expensive way to check this on just the keybind itself being flipped
DrawTreeGui(client);
if (globalConfig.wasPressed()) {
client.player.sendMessage(Text.of("Keeblarcraft recognizes you pressed the config button, but this option doesn't do anything yet"), false);
}
});
}
/////////////////////////////////////////////////////////////////////////////
/// @fn DrawTreeGui
///
/// @arg[in] client is the minecraft client instance that is passed in
/// so we have context of the client itself
///
/// @brief Draws the attribute tree GUI
/////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("resource")
public static void DrawTreeGui(MinecraftClient client) {
while (skillTreeShortcut.wasPressed()) { // Constant loop required to redraw screen continuously
System.out.println("Key pressed detected"); /// TODO: When we figure out how to get key presses to still work when a screen opens; then we can toggle menus with buttons...
if (toggleTreeGui) {
// There is a technical resource leak that current screen is never closed when defining it here; which is ok I think because we want to return to it anyways
Screen currentScreen = MinecraftClient.getInstance().currentScreen;
client.player.sendMessage(Text.of("You pressed the GUI key!"));
// treeGui = new ScreenManager(Keeblarcraft.TREE_HANDLER.create(0, client.player.getInventory()), client.player.getInventory(), Text.of("Test"));
// treeGui.AddParent(currentScreen); ///TODO: Put this in the constructor when you figure out how the hell the magic is happening with registration
ScreenManager treeGui = ScreenManager.GetInstance();
treeGui.AddParent(currentScreen);
MinecraftClient.getInstance().setScreen(treeGui);
// toggleTreeGui intentionally never bit-flipped to false as a slight implementation bug exists such that pressing the keybind again
// does NOT call this callback function until the previous screen is CLOSED (which is why this isn't resource leaking...). This will
// need a slight rework or an extra subcall - but is fine for now since this is just how screens work.
}
}
}
}

View File

@ -1,14 +0,0 @@
/*
*
* IndividualAttribute
*
* This will be the handler class for each little attribute on the attribute tree itself.
* It will be fully implemented in the ticket that finishes the TreeWidget ticket (NOT GuiMgr)
*/
package jesse.keeblarcraft.gui.AttributeTree;
// This represents a single node in the tree of attributes drawn to the gui!!!
public class IndividualAttribute {
}

View File

@ -1,11 +0,0 @@
package jesse.keeblarcraft.gui;
import jesse.keeblarcraft.Keeblarcraft;
import net.minecraft.client.gui.screen.ingame.HandledScreens;
public class ClientHandlers {
public static void RegisterHandlers() {
System.out.println("Registering tree handler screen");
HandledScreens.register(Keeblarcraft.TREE_HANDLER, ScreenManager::new);
}
}

View File

@ -1,74 +0,0 @@
/*
*
* GenericLayerT
*
* GenericLayerT is the class that all layers must inherit from in order to be drawn. This allows for the GUI to properly
* draw the layers on which you want your canvas to exist!
*
*
*/
package jesse.keeblarcraft.gui;
import jesse.keeblarcraft.Utils.CommonStructures.Position2d;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
import net.minecraft.client.gui.widget.ClickableWidget;
import net.minecraft.text.Text;
abstract public class GenericLayerT extends ClickableWidget {
// These are the box bounds of the widget
public int startX;
public int startY;
public int endX;
public int endY;
public GenericLayerT() {
// default constructor
super(0, 0, 0, 0, Text.of(""));
}
/////////////////////////////////////////////////////////////////////////////
/// @fn GenericLayerT
///
/// @brief Constructor for class. This is setup directly by the screen
/// manager object and it is not recommended to change the x/y
/// positions or you may break the relation of your widget to
/// others on the screen at the same time!
/////////////////////////////////////////////////////////////////////////////
public GenericLayerT(int x, int y, int width, int height, Text message) {
super(x, y, width, height, message);
}
/////////////////////////////////////////////////////////////////////////////
/// @fn DrawLayer
///
/// @brief Draw on a layer! This is an early implementation of being
/// able to choose the layer you are drawing on and making sure
/// you can customize which layer your context will draw on.
/// This will be called by the overall screen manager so the
/// layer id will be passed in. You will need to handle the layer
/// id yourself.
///
/// @note It is possible to get passed any layer id and you handle each
/// layer respectively; however, it is possible to draw on the
/// wrong layer if handled wrong. For example, you could be
/// passed layer '3' but this function is called for every layer
/// drawn on screen; so you must handle this to only draw on a
/// specific layer. Be careful!
/////////////////////////////////////////////////////////////////////////////
public abstract void DrawLayer(DrawContext context, int layer);
public void UpdateAnchorValues(int x, int y) {
this.startX = x;
this.startY = y;
}
// Calculated based on center of box values
public Position2d GetScreenCenter() {
return new Position2d((this.endX - this.startX) / 2, (this.endY - this.startY) / 2);
}
public abstract void renderButton(DrawContext context, int mouseX, int mouseY, float delta);
protected abstract void appendClickableNarrations(NarrationMessageBuilder builder);
}

View File

@ -1,381 +0,0 @@
/*
*
* ScreenManager
*
* This is the screen manager for the global screen handler of `TreeHandler` type
* Please note: `TreeHandler` is suited for a more broad range of things; however
* its initial implementation is for the skill tree. It will be renamed to a more
* generic name so this class is more obviously re-usable after its implementation
* is complete AND we verify this class can be made more generic for it. Since this
* is unknown, it will remain the name it has currently.
*
*
*/
package jesse.keeblarcraft.gui;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import jesse.keeblarcraft.Keeblarcraft;
import jesse.keeblarcraft.GuiMgr.TreeHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
// Client side renderer
public class ScreenManager extends HandledScreen<TreeHandler> {
private static ScreenManager static_inst;
@SuppressWarnings("resource")
private static PlayerInventory static_inventory = new PlayerInventory(null);// = MinecraftClient.getInstance().player.getInventory();
public static ScreenManager GetInstance() {
if (static_inst == null) {
static_inst = new ScreenManager(Keeblarcraft.TREE_HANDLER.create(0, static_inventory), static_inventory, Text.of("Test"));
}
return static_inst;
}
private static HashMap<Integer, ArrayList<Class<? extends GenericLayerT>>> layerMap = new HashMap<Integer, ArrayList<Class<? extends GenericLayerT>>>();
private static HashMap<Integer, ArrayList<GenericLayerT>> layers = new HashMap<Integer, ArrayList<GenericLayerT>>(); // key: layer id; value: list of classes to draw
// private TreeWidget treeWidget = null;
private Screen parent;
/////////////////////////////////////////////////////////////////////////////
/// @fn ScreenManager
///
/// @arg[in] handler is the TreeHandler (ScreenHandler) object
///
/// @arg[in] inventory is the players inventory. Required by HandledScreen
/// object however is unused currently in this Screen
///
/// @arg[in] title is the title of the screen window
///
/// @brief Class constructor
/////////////////////////////////////////////////////////////////////////////
public ScreenManager(TreeHandler handler, PlayerInventory inventory, Text title) {
super(handler, inventory, title);
System.out.println("Called constructor of screen manager!");
// Initialize layers in map
// for (int i = 0; i < NUMBER_DRAW_LAYERS; i++) {
// layers.put(i, new ArrayList<Class<? extends GenericLayerT>>());
// }
}
/////////////////////////////////////////////////////////////////////////////
/// @fn AddParent
///
/// @arg[in] parent is the parent screen object
///
/// @brief Add a parent screen to the screen object. This is useful if
/// you want to return to the previous screen when this one gets
/// closed by the user
/////////////////////////////////////////////////////////////////////////////
public void AddParent(Screen parent) {
this.parent = parent;
}
public static void AddWidget(Class<? extends GenericLayerT> widget, int drawLayer) {
if (layerMap.containsKey(drawLayer)) {
// Just append the widget to the draw layer
var layerList = layerMap.get(drawLayer);
layerList.add(widget);
} else {
// Brand new layer!
layerMap.put(drawLayer, new ArrayList<>(List.of(widget)));
}
}
/////////////////////////////////////////////////////////////////////////////
/// @fn init
///
/// @brief Initialize method; called one-time to setup class variables
/////////////////////////////////////////////////////////////////////////////
@Override
public void init() {
// initialize screen size to the global background picture
this.width = MinecraftClient.getInstance().getWindow().getScaledWidth();
this.height = MinecraftClient.getInstance().getWindow().getScaledHeight();
// Let's go through and initialize all the screen types now in our active memory
for (Entry<Integer, ArrayList<Class<? extends GenericLayerT>>> layerEntry : layerMap.entrySet()) {
var layerList = layerEntry.getValue();
layers.put(layerEntry.getKey(), new ArrayList<>());
var activeLayerList = layers.get(layerEntry.getKey());
for (int i = 0; i < layerList.size(); i++) {
try {
System.out.println("Attempting to initialize widget with information: LAYER I-VAL W H: " + layerEntry.getKey() + " " + i + " " + this.width + " " + this.height);
GenericLayerT initializedWidget = layerList.get(i).getDeclaredConstructor(int.class, int.class, int.class, int.class, Text.class).newInstance(0, 0, this.width, this.height, Text.of(""));
activeLayerList.add(initializedWidget);
} catch (InstantiationException e) {
System.out.println("Could not initialize GenericLayerT class (" + layerList.get(i).getClass().toString() + ") because of IntantiationException");
e.printStackTrace();
} catch (IllegalAccessException e) {
System.out.println("Could not initialize GenericLayerT class (" + layerList.get(i).getClass().toString() + ") because of IllegalAccessException");
e.printStackTrace();
} catch (IllegalArgumentException e) {
System.out.println("Could not initialize GenericLayerT class (" + layerList.get(i).getClass().toString() + ") because of IllegalArgumentException");
e.printStackTrace();
} catch (InvocationTargetException e) {
System.out.println("Could not initialize GenericLayerT class (" + layerList.get(i).getClass().toString() + ") because of InvocationTargetException");
e.printStackTrace();
} catch (NoSuchMethodException e) {
System.out.println("Could not initialize GenericLayerT class (" + layerList.get(i).getClass().toString() + ") because of NoSuchMethodException");
e.printStackTrace();
} catch (SecurityException e) {
System.out.println("Could not initialize GenericLayerT class (" + layerList.get(i).getClass().toString() + ") because of SecurityException");
e.printStackTrace();
}
}
}
// Initialize child widgets with correct screen values so they can draw themselves in the right area on the screen (duh!)
// treeWidget = new TreeWidget(GLOBAL_SCREEN_START_X + 24, GLOBAL_SCREEN_START_Y + 24, GLOBAL_SCREEN_WIDTH - 24, GLOBAL_SCREEN_HEIGHT - 24);
// this.addDrawableChild(treeWidget);
}
/////////////////////////////////////////////////////////////////////////////
/// @fn render
///
/// @arg[in] context is the drawing context of super class
///
/// @arg[in] mouseX is passed to parent class but unused here
///
/// @arg[in] mouseY is passed to parent class but unused here
///
/// @brief Render is called every frame while the screen is open
///
/// @note This is a pure abstract in parent and is required
/////////////////////////////////////////////////////////////////////////////
@Override
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
super.render(context, mouseX, mouseY, delta); // This takes care of calling drawBackground which calls DrawMainScreen
}
/////////////////////////////////////////////////////////////////////////////
/// @fn drawForeground
///
/// @arg[in] context is the drawing context of super class
///
/// @arg[in] mouseX is unused
///
/// @arg[in] mouseY is unused
///
/// @brief Draw foreground exists to draw the titles; however we
/// intentionally override it so the superclass object does not
/// draw the overlay over the background screen
/////////////////////////////////////////////////////////////////////////////
@Override
public void drawForeground(DrawContext context, int mouseX, int mouseY) {
// We override this function to intentionally do nothing
// If in the future we want, we would draw the foreground and TITLES with this!
}
/////////////////////////////////////////////////////////////////////////////
/// @fn close
///
/// @brief Called when the screen closes
///
/// @note This is a pure abstract in parent and is required
/////////////////////////////////////////////////////////////////////////////
@Override
public void close() {
this.client.setScreen(parent); // return to previous screen or null
}
/////////////////////////////////////////////////////////////////////////////
/// @fn mouseDragged
///
/// @arg[in] mouseX is x-axis position of original mouse click
///
/// @arg[in] mouseY is y-axis position of original mouse click
///
/// @arg[in] button is the int value of button pressed for mouse dragging
///
/// @arg[in] deltaX is the change in the X position from the previous
/// mouse click
///
/// @arg[in] deltaY is the change in the Y position from the previous
/// mouse click
///
/// @brief The drag event is called on all widgets on the screen so
/// long as the initial position of the drag is within the
/// bounds of the widget box itself. Widgets themselves will need
/// to handle any sub-widgets since the bound check is only
/// there to verify if the event happened ANYWHERE within a
/// widget box
/////////////////////////////////////////////////////////////////////////////
@Override
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) {
super.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
// UpdateAnchorValues();
for (Entry<Integer, ArrayList<GenericLayerT>> layerEntry : layers.entrySet()) {
var layerList = layerEntry.getValue();
for (var layerListIterator = 0; layerListIterator < layerList.size(); layerListIterator++) {
var layer = layerList.get(layerListIterator);
// Check to make sure scroll is within the context of the widget then deliver information
if (InBounds(layer.startX, layer.startY, layer.endX, layer.endY, (int) mouseX, (int) mouseY)) {
layer.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
}
}
}
return true;
}
/////////////////////////////////////////////////////////////////////////////
/// @fn mouseScrolled
///
/// @arg[in] mouseX is the initial X position of the cursor on a scroll
///
/// @arg[in] mouseY is the initial Y position of the cursor on a scroll
///
/// @arg[in] amount is a normalized value that indicates scroll direction
///
/// @brief The scroll event is called on all widgets on the screen so
/// long as the initial position of the scroll is within the
/// bounds of the widget box itself. Widgets themselves will need
/// to handle any sub-widgets since the bound check is only
/// there to verify if the event happened ANYWHERE within a
/// widget box
///
/////////////////////////////////////////////////////////////////////////////
@Override
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
super.mouseScrolled(mouseX, mouseY, amount);
for (Entry<Integer, ArrayList<GenericLayerT>> layerEntry : layers.entrySet()) {
var layerList = layerEntry.getValue();
for (var layerListIterator = 0; layerListIterator < layerList.size(); layerListIterator++) {
var layer = layerList.get(layerListIterator);
// Check to make sure scroll is within the context of the widget then deliver information
if (InBounds(layer.startX, layer.startY, layer.endX, layer.endY, (int) mouseX, (int) mouseY)) {
layer.mouseScrolled(mouseX, mouseY, amount);
}
}
}
return true; // The parent function defines this to be boolean; but I have no idea when I would want to return false from this
}
/////////////////////////////////////////////////////////////////////////////
/// @fn mouseClicked
///
/// @arg[in] mouseX is the initial X position of the mouse click event
///
/// @arg[in] mouseY is the initial Y position of the mouse click event
///
/// @arg[in] button is the mouse click button (left/right click value)
///
/// @brief The mouse click is called on all widgets on the screen so
/// long as the initial position of the click is within the
/// bounds of the widget box itself. Widgets themselves will need
/// to handle any sub-widgets since the bound check is only
/// there to verify if the event happened ANYWHERE within a
/// widget box
///
/////////////////////////////////////////////////////////////////////////////
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
super.mouseClicked(mouseX, mouseY, button);
for (Entry<Integer, ArrayList<GenericLayerT>> layerEntry : layers.entrySet()) {
var layerList = layerEntry.getValue();
for (var layerListIterator = 0; layerListIterator < layerList.size(); layerListIterator++) {
var layer = layerList.get(layerListIterator);
// Check to make sure scroll is within the context of the widget then deliver information
if (InBounds(layer.startX, layer.startY, layer.endX, layer.endY, (int) mouseX, (int) mouseY)) {
layer.mouseClicked(mouseX, mouseY, button);
}
}
}
return true;
}
/////////////////////////////////////////////////////////////////////////////
/// @fn DrawLayers
///
/// @arg[in] context is the global drawing context for the screen
///
/// @arg[in] delta is passed in from background draw
///
/// @brief This is the primary drawing function so that all the texture
/// draws can be done in one place in this class. We want as
/// little distance as possible between redraws when possible!
///
/// @note Currently the foreground is not drawn in the custom screen
/// manager. This is because the foreground features the general
/// inventory manager that this screen handler is based on and we
/// do not want to see those text pop ups.
/////////////////////////////////////////////////////////////////////////////
public void DrawLayers(DrawContext context, float delta) {
for (Entry<Integer, ArrayList<GenericLayerT>> layerEntry : layers.entrySet()) {
var layerList = layerEntry.getValue();
for (var layerListIterator = 0; layerListIterator < layerList.size(); layerListIterator++) {
var layer = layerList.get(layerListIterator);
System.out.println("Drawing layer " + layerEntry.getKey() + " for class type " + layer.getClass().toString());
layer.DrawLayer(context, layerEntry.getKey());
}
}
}
/////////////////////////////////////////////////////////////////////////////
/// @fn InBounds
///
/// @arg[in] initX is initial position of X axis
///
/// @arg[in] initY is initial position of Y axis
///
/// @arg[in] endX is the end position of X axis
///
/// @arg[in] endY is the end position of Y axis
///
/// @arg[in] x is the current X value we are comparing in the X axis
///
/// @arg[in] y is the current Y value we are comparing in the Y axis
///
/// @brief Checks if an x,y coordinate position falls within the bounds
/// of a bounded box
/////////////////////////////////////////////////////////////////////////////
private boolean InBounds(int initX, int initY, int endX, int endY, int x, int y) {
return (x >= initX && x <= endX) && (y >= initY && y <= endY);
}
/////////////////////////////////////////////////////////////////////////////
/// @fn drawBackground
///
/// @arg[in] context is the drawing context of super class
///
/// @arg[in] delta is the change in background draw
///
/// @arg[in] mouseX is the mouse x-axis position
///
/// @arg[in] mouseY is the mouse y-axis position
///
/// @brief This function is an abstract parent class and must be
/// implemented. This is "hijacked" and just being used as our
/// main drawing method of all the background images. There isn't
/// a huge difference of drawing our stuff in background vs the
/// foreground - except possibly foreground is drawn first.
/////////////////////////////////////////////////////////////////////////////
@Override
protected void drawBackground(DrawContext context, float delta, int mouseX, int mouseY) {
DrawLayers(context, delta);
}
}

View File

@ -1,165 +0,0 @@
/*
*
* TreeWidget
*
* Handles the skill tree widget
*
*
*/
package jesse.keeblarcraft.gui.widgets;
import jesse.keeblarcraft.Keeblarcraft;
import jesse.keeblarcraft.Utils.CommonStructures.Position2d;
import jesse.keeblarcraft.gui.GenericLayerT;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
public class TreeWidget extends GenericLayerT {
private static Identifier BACKGROUND_TEXTURE = new Identifier(Keeblarcraft.MOD_ID + ":" + "textures/gui/attribute_tree_background.png");
private static int maxHeight = 320;
private static int maxLength = 640;
private int zoomScale = 1;
// private static Identifier FLIGHT_ATTRIBUTE = new Identifier(Keeblarcraft.MOD_ID + ":" + "textures/gui/attribute_flight.png");
///TODO: Make this THE root node in the attribute tree! Rename in future
// private static Identifier EXAMPLE_NODE = new Identifier(Keeblarcraft.MOD_ID + ":" + "textures/gui/attribute_tree_example_node.png"); ///TODO: Make a way to make this programmatic (Proabably extend AbstractNode to carry this var)
/////////////////////////////////////////////////////////////////////////////
/// @fn TreeWidget
///
/// @brief Class constructor for constructing a tree widget. This will
/// be deprecated in a future version but exists for testing
/////////////////////////////////////////////////////////////////////////////
public TreeWidget() {
this(0, 0, 0, 0, Text.of("Test"));
System.out.println("Calling empty tree constructor");
}
/////////////////////////////////////////////////////////////////////////////
/// @fn TreeWidget
///
/// @brief Class constructor for constructing a tree widget
/////////////////////////////////////////////////////////////////////////////
public TreeWidget(int x, int y, int width, int height, Text message) {
super(x, y, width, height, message);
this.startX = x;
this.startY = y;
this.endX = x + width;
this.endY = y + height;
}
/////////////////////////////////////////////////////////////////////////////
/// @fn renderButton
///
/// @param[in] context is the drawing pane
///
/// @param[in] x is the X position to draw at
///
/// @param[in] y is the Y position to draw at
///
/// @param[in] delta is unused in this version
///
/// @brief Primary call to draw the GUI for this widget
/////////////////////////////////////////////////////////////////////////////
@Override
public void renderButton(DrawContext context, int x, int y, float delta) {
context.drawTexture(BACKGROUND_TEXTURE, x, y, 0, 0, maxLength, maxHeight, maxLength, maxHeight);
}
/////////////////////////////////////////////////////////////////////////////
/// @fn appendClickableNarrations
///
/// @param[in] builder is the narration builder. This is pure virtual in
/// the parent but is unused in this widget currently
///
/// @brief Handles the narrator
/////////////////////////////////////////////////////////////////////////////
@Override
protected void appendClickableNarrations(NarrationMessageBuilder builder) {
return;
}
/////////////////////////////////////////////////////////////////////////////
/// @fn mouseClicked
///
/// @param[in] mouseX is where on the x-axis the mouse was clicked
///
/// @param[in] mouseY is where on the y-axis the mouse was clicked
///
/// @param[in] button is the button clicked with (think of a mouse...)
///
/// @brief Handler for mouse click events
/////////////////////////////////////////////////////////////////////////////
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
return true;
}
/////////////////////////////////////////////////////////////////////////////
/// @fn mouseDragged
///
/// @param[in] mouseX is where on the x-axis the mouse was dragged
///
/// @param[in] mouseY is where on the y-axis the mouse was dragged
///
/// @param[in] button is the button dragged with (think of a mouse...)
///
/// @brief Handler for mouse drag events. delta's unused currently
/////////////////////////////////////////////////////////////////////////////
@Override
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) {
boolean ret = false;
if (this.isValidClickButton(button)) {
// Do camera panning magic stuff here
ret = true;
}
return ret;
}
/////////////////////////////////////////////////////////////////////////////
/// @fn mouseDragged
///
/// @param[in] mouseX is where on the x-axis the mouse was dragged
///
/// @param[in] mouseY is where on the y-axis the mouse was dragged
///
/// @param[in] amount represents scroll direction. If the value is negative
/// we scale out. If positive, we scale in
///
/// @brief Handler for mouse scroll events
/////////////////////////////////////////////////////////////////////////////
@Override
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
// Zooming INWARDS on scroll wheel produces 1.0 (which means zoom in)
// Zooming BACKWARDS on scroll wheel produces -1.0 (which means zoom out)
// We enforce a max scroll of 10 in either direction here
if (amount > 0 && zoomScale <= 10) {
// Zoom in
zoomScale++;
} else if (amount < 0 && zoomScale >= -10) {
// Zoom out
zoomScale--;
}
return true;
}
/////////////////////////////////////////////////////////////////////////////
/// @fn DrawLayer
///
/// @param[in] context is the drawing pane
///
/// @param[in] layer is the layer in which this widget is being drawn in
///
/// @brief This calls renderButton and gives it the valid drawing
/// context to use. This function is called by a ScreenManager<T>
/////////////////////////////////////////////////////////////////////////////
@Override
public void DrawLayer(DrawContext context, int layer) {
Position2d pos = GetScreenCenter();
this.renderButton(context, pos.x - (maxLength / 2), pos.y - (maxHeight / 2), 0);
}
}

View File

@ -0,0 +1,15 @@
package jesse.keeblarcraft.mixin.client;
import net.minecraft.client.MinecraftClient;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(MinecraftClient.class)
public class ExampleClientMixin {
@Inject(at = @At("HEAD"), method = "run")
private void init(CallbackInfo info) {
// This code is injected into the start of MinecraftClient.run()V
}
}

View File

@ -0,0 +1,11 @@
{
"required": true,
"package": "jesse.keeblarcraft.mixin.client",
"compatibilityLevel": "JAVA_21",
"client": [
"ExampleClientMixin"
],
"injectors": {
"defaultRequire": 1
}
}

View File

@ -25,11 +25,11 @@ public class MetalJacketArmor implements ArmorMaterial {
System.out.println("durability for armor called"); System.out.println("durability for armor called");
// Replace this multiplier by a constant value for the durability of the armor. // Replace this multiplier by a constant value for the durability of the armor.
// For reference, diamond uses 33 for all armor pieces, whilst leather uses 5. // For reference, diamond uses 33 for all armor pieces, whilst leather uses 5.
return switch (type) { // All from ArmorItem.Type return switch (type) {
case BOOTS -> Integer.MAX_VALUE; case ArmorItem.Type.BOOTS -> Integer.MAX_VALUE;
case LEGGINGS -> Integer.MAX_VALUE; case ArmorItem.Type.LEGGINGS -> Integer.MAX_VALUE;
case CHESTPLATE -> Integer.MAX_VALUE; case ArmorItem.Type.CHESTPLATE -> Integer.MAX_VALUE;
case HELMET -> Integer.MAX_VALUE; case ArmorItem.Type.HELMET -> Integer.MAX_VALUE;
}; };
} }
@ -40,10 +40,10 @@ public class MetalJacketArmor implements ArmorMaterial {
// For reference, diamond uses 3 for boots, 6 for leggings, 8 for chestplate, and 3 for helmet, // For reference, diamond uses 3 for boots, 6 for leggings, 8 for chestplate, and 3 for helmet,
// whilst leather uses 1, 2, 3 and 1 respectively. // whilst leather uses 1, 2, 3 and 1 respectively.
return switch (type) { return switch (type) {
case BOOTS -> defaultArmorModifier; case ArmorItem.Type.BOOTS -> defaultArmorModifier;
case HELMET -> defaultArmorModifier; case ArmorItem.Type.HELMET -> defaultArmorModifier;
case LEGGINGS -> defaultArmorModifier; case ArmorItem.Type.LEGGINGS -> defaultArmorModifier;
case CHESTPLATE -> defaultArmorModifier; case ArmorItem.Type.CHESTPLATE -> defaultArmorModifier;
}; };
} }

View File

@ -22,8 +22,6 @@ public class AttributeMgr {
ConfigManager config; ConfigManager config;
// Global list of attributes // Global list of attributes
// Key: node title
// Val: The node class itself
public static final HashMap<String, Class<? extends AbstractNode>> attributes = new HashMap<String, Class<? extends AbstractNode>>(); public static final HashMap<String, Class<? extends AbstractNode>> attributes = new HashMap<String, Class<? extends AbstractNode>>();
// This is a list of all logged in player tree's. These are kept in memory until either the mod is torn down or // This is a list of all logged in player tree's. These are kept in memory until either the mod is torn down or
@ -110,7 +108,6 @@ public class AttributeMgr {
public static void RegisterAttributes() { public static void RegisterAttributes() {
// Manually register all attribute node classes here // Manually register all attribute node classes here
/// TODO: Find a better way to do this more dynamically in the future /// TODO: Find a better way to do this more dynamically in the future
/// hint: make it an API for other modders to add to
RegisterAttributeClass(AttributeFlight.class); RegisterAttributeClass(AttributeFlight.class);
RegisterAttributeClass(AttributeMetalJacket.class); RegisterAttributeClass(AttributeMetalJacket.class);

View File

@ -13,6 +13,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
abstract public class AbstractNode { abstract public class AbstractNode {
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/// @fn GetNodeTitle /// @fn GetNodeTitle
/// ///

View File

@ -13,7 +13,7 @@ import net.minecraft.server.PlayerManager;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
public class BankManager { public class BankManager {
BankManagerFile bankInfo = new BankManagerFile(); // not sure why we make another one but i guess so we BankManagerFile bankInfo = new BankManagerFile();
ConfigManager config = new ConfigManager(); // for read and write privs ConfigManager config = new ConfigManager(); // for read and write privs
CommonServerUtils commonServerUtils = new CommonServerUtils(); CommonServerUtils commonServerUtils = new CommonServerUtils();
@ -97,153 +97,110 @@ public class BankManager {
} }
return ret; return ret;
} }
//https://maven.fabricmc.net/docs/fabric-api-0.34.8+1.17/net/fabricmc/fabric/api/networking/v1/PlayerLookup.html maybe this for getting the players im still not sure
public void SetBalance(Integer newBalance, String reason, String otherParty) {
Integer transactionNumber = bankInfo.bank.size();
bankInfo.bank.put(transactionNumber.toString(),
new BankManagerMetaData(newBalance, reason, newBalance, otherParty, 0));
FlashConfig(PlayerListNameChecker(otherParty)); public void SetBalance(long payment, String reason, ServerPlayerEntity otherParty) {
bankInfo.uuid = otherParty.getUuidAsString();
bankInfo.bank.put(bankInfo.uuid, new BankManagerMetaData(payment, reason, payment, "SERVER", 0));
FlashConfig(bankInfo.uuid);
} }
public void AddMoney(String reason, long payment, String otherParty) { public void AddMoney(ServerPlayerEntity otherParty, long payment, ServerPlayerEntity player, String reason) {
bankInfo.uuid = otherParty.getUuidAsString();
bankInfo.bank = DoesBankAccountExist(otherParty);
if (bankInfo.bank.size() > 0) { if (bankInfo.bank.size() > 0) {
for (Entry<String, BankManagerMetaData> entry : bankInfo.bank.entrySet()) { for (Entry<String, BankManagerMetaData> entry : bankInfo.bank.entrySet()) {
entry.getValue().balance += payment; entry.getValue().balance += payment;
entry.getValue().reason = "SERVER: " + reason; entry.getValue().reason = "SERVER: " + reason;
entry.getValue().payment = payment; entry.getValue().payment = payment;
entry.getValue().otherParty = otherParty; entry.getValue().otherParty = "SERVER";
entry.getValue().time = 0; entry.getValue().time = 0;
} }
} else { } else {
bankInfo.bank.put(bankInfo.uuid, new BankManagerMetaData(payment, reason, payment, otherParty, 0)); bankInfo.bank.put(bankInfo.uuid, new BankManagerMetaData(payment, reason, payment, "SERVER", 0));
} }
FlashConfig(PlayerListNameChecker(otherParty)); FlashConfig(otherParty.getUuidAsString());
} }
public void SubtractBalance(String reason, long payment, String otherParty) { public void SubtractBalance(String reason, long payment, ServerPlayerEntity otherParty) {
if (bankInfo.bank.size() > 0) { bankInfo.uuid = otherParty.getUuidAsString();
bankInfo.bank = DoesBankAccountExist(otherParty);
for (Entry<String, BankManagerMetaData> entry : bankInfo.bank.entrySet()) { for (Entry<String, BankManagerMetaData> entry : bankInfo.bank.entrySet()) {
entry.getValue().balance -= payment;//not working? entry.getValue().balance -= payment;//not working?
entry.getValue().reason = "SERVER: " + reason; entry.getValue().reason = "SERVER: " + reason;
entry.getValue().payment = payment; entry.getValue().payment = payment;
entry.getValue().otherParty = otherParty; entry.getValue().otherParty = "SERVER";
entry.getValue().time = 0; entry.getValue().time = 0;
} }
} else { FlashConfig(bankInfo.uuid);
bankInfo.bank.put(bankInfo.uuid, new BankManagerMetaData(0, reason, payment, otherParty, 0));
}
FlashConfig(PlayerListNameChecker(otherParty));
} }
public void Wire(String reason, long payment, String otherParty) { public void Wire(ServerPlayerEntity otherParty, long payment, String reason, ServerPlayerEntity sender) {
if (bankInfo.bank.size() > 0) {
for (Entry<String, BankManagerMetaData> entry : bankInfo.bank.entrySet()) { BankManagerFile sendersBankInfo = new BankManagerFile();
BankManagerFile otherPartyBankInfo = new BankManagerFile();
sendersBankInfo.uuid = sender.getUuidAsString();
otherPartyBankInfo.uuid = otherParty.getUuidAsString();
sendersBankInfo.bank = DoesBankAccountExist(sender);
otherPartyBankInfo.bank = DoesBankAccountExist(otherParty);
//check to make sure they can afford to send the money
for (Entry<String, BankManagerMetaData> entry : sendersBankInfo.bank.entrySet()) {
if (entry.getValue().balance > payment) {
entry.getValue().balance -= payment; entry.getValue().balance -= payment;
entry.getValue().reason = reason; entry.getValue().reason = reason;
entry.getValue().payment = payment; entry.getValue().payment = payment;
entry.getValue().otherParty = otherParty; entry.getValue().otherParty = otherParty.getUuidAsString();
entry.getValue().time = 0; entry.getValue().time = 0;
} else {
if (payment <= 0) { System.out.println(ChatUtil.ColoredString("You ain't the goverment: " + otherParty, CONSOLE_COLOR.RED));
// add a error for the PLAYER not the server
return;
}
}
// make a server instance
MinecraftServer server = CommonServerUtils.GetServerInstance();
String[] playerList = server.getPlayerNames();
//NOT SURE IF THIS FOR LOOP IS ONE OFF COULD POSSIBLEY BE SO IF NO ONE IS GETTING MONEY DOUBLE CHECK FOR LOOP
for (int i = 0; i < playerList.length; i++) {
System.out.println(ChatUtil.ColoredString("PLAYERS: " + playerList, CONSOLE_COLOR.YELLOW));
if (playerList[i] == otherParty) {
System.out.println(ChatUtil.ColoredString("Found Player: " + otherParty, CONSOLE_COLOR.GREEN));
// we will use getuuidbyname then set the other VALID players bank BE SURE TO
// MAKE THEM A BANK FIRST IF THEY DONT HAVE ONE fortnite forever
if (config.GetFile("bank/" + GetUuidByName(server, otherParty) + ".json").size() < 1) {
BankManagerFile newBankInfo = new BankManagerFile();
BankManagerMetaData newBank = new BankManagerMetaData(0, "Account Created", 0, "Server", 0);
newBankInfo.bank.put(GetUuidByName(server, otherParty).toString(), newBank);
try {
config.WriteToJsonFile("bank/" + newBankInfo.uuid + ".json", newBankInfo);
} catch (FILE_WRITE_EXCEPTION e) {
System.out.println(ChatUtil.ColoredString("Could not flash notes configuration file", CONSOLE_COLOR.RED));
return;
}
}
//since the other player has a account now and we have access to it we can start fucking around
BankManagerFile newBankInfo = new BankManagerFile();
newBankInfo = config.GetJsonObjectFromFile("bank/" + GetUuidByName(server, otherParty) + ".json", BankManagerFile.class);
// for now we will only use adding valance and not subtracting since that dosent make any sense
for (Entry<String, BankManagerMetaData> entry : newBankInfo.bank.entrySet()) {
entry.getValue().balance += payment;
entry.getValue().reason = reason;
entry.getValue().payment = payment;
entry.getValue().otherParty = otherParty;
entry.getValue().time = 0;
}
//cannot use regular flash config since the hard coded values need to add agurment for the uuid
//needs to be inside the player check
FlashConfig(newBankInfo.uuid);
try {
config.WriteToJsonFile("bank/" + newBankInfo.uuid + ".json", bankInfo);
} catch (FILE_WRITE_EXCEPTION e) {
System.out.println(ChatUtil.ColoredString("Could not flash notes configuration file", CONSOLE_COLOR.RED));
}
} else {
System.out.println(ChatUtil.ColoredString("Player Not Found: " + otherParty, CONSOLE_COLOR.RED));
return;
}
}
} else {
System.out.println(ChatUtil.ColoredString("You need to finance better", CONSOLE_COLOR.RED));
return; return;
}
}
String GetUuidByName(MinecraftServer server, String playerName) {
PlayerManager playerManager = server.getPlayerManager();
ServerPlayerEntity player = playerManager.getPlayer(playerName);
if (player.getUuid() != null) {
return player.getUuidAsString();
} else {
return "";
}
}
String PlayerListNameChecker(String otherParty) {
MinecraftServer server = CommonServerUtils.GetServerInstance();
String[] playerList = server.getPlayerNames();
for (int i = 0; i < playerList.length; i++) {
System.out.println(ChatUtil.ColoredString("PLAYERS: " + playerList, CONSOLE_COLOR.YELLOW));
if (playerList[i] == otherParty) {
System.out.println(ChatUtil.ColoredString("Found Player: " + otherParty, CONSOLE_COLOR.GREEN));
// we will use getuuidbyname then set the other VALID players bank BE SURE TO
// MAKE THEM A BANK FIRST IF THEY DONT HAVE ONE fortnite forever
if (config.GetFile("bank/" + GetUuidByName(server, otherParty) + ".json").size() < 1) {
BankManagerFile newBankInfo = new BankManagerFile();
BankManagerMetaData newBank = new BankManagerMetaData(0, "Account Created", 0, "Server", 0);
newBankInfo.bank.put(GetUuidByName(server, otherParty).toString(), newBank);
try {
config.WriteToJsonFile("bank/" + newBankInfo.uuid + ".json", newBankInfo);
} catch (FILE_WRITE_EXCEPTION e) {
System.out.println(ChatUtil.ColoredString("Could not flash notes configuration file", CONSOLE_COLOR.RED));
return "";
}
}
else {
System.out.println(ChatUtil.ColoredString("Bank Account Found", CONSOLE_COLOR.GREEN));
}
return GetUuidByName(server, otherParty);
} }
} }
System.out.println(ChatUtil.ColoredString("For Loop condition bypassed Null Playerlist or Null Server instance", CONSOLE_COLOR.RED)); for (Entry<String, BankManagerMetaData> entry : otherPartyBankInfo.bank.entrySet()) {
return ""; entry.getValue().balance += payment;
entry.getValue().reason = reason;
entry.getValue().payment = payment;
entry.getValue().otherParty = otherParty.getUuidAsString();
entry.getValue().time = 0;
}
//needs to be inside the player check flash config has a write check
FlashConfig(otherPartyBankInfo.uuid);
FlashConfig(sendersBankInfo.uuid);
}
public HashMap<String, BankManagerMetaData> DoesBankAccountExist(ServerPlayerEntity otherParty) {
Boolean existingFile = false;
try {
bankInfo.uuid = otherParty.getUuidAsString();
bankInfo = config.GetJsonObjectFromFile("bank/" + otherParty.getUuidAsString() + ".json", BankManagerFile.class);
existingFile = true;
} catch (Exception e) {
// Do nothing. This means the file does not exist
}
if (!existingFile) {
System.out.println("Procced no account exisiting");
BankManagerFile newBankInfo = new BankManagerFile();
BankManagerMetaData newBank = new BankManagerMetaData(0, "Account Created", 0, "Server", 0);
newBankInfo.uuid = otherParty.getUuidAsString();
newBankInfo.bank.put(newBankInfo.uuid, newBank);
try {
config.WriteToJsonFile("bank/" + newBankInfo.uuid + ".json", newBankInfo);
} catch (FILE_WRITE_EXCEPTION e) {
System.out.println(ChatUtil.ColoredString("Could not flash notes configuration file", CONSOLE_COLOR.RED));
return newBankInfo.bank;
}
return newBankInfo.bank;
} else {
try {
bankInfo = config.GetJsonObjectFromFile("bank/" + bankInfo.uuid + ".json", BankManagerFile.class);
} catch (Exception e) {
// Do nothing. This means the file does not exist
System.out.println("How did this fail Function: DoesBankAccountExist try catch statement -first if failed incorrectly");
}
return bankInfo.bank;
}
} }
public void FlashConfig(String uuid) { public void FlashConfig(String uuid) {

View File

@ -1,5 +0,0 @@
package jesse.keeblarcraft.CCTweakedExtension;
public class CCTweakedTest {
}

View File

@ -71,6 +71,7 @@ public class AttributeCommands {
playerArgAdd.addChild(attributeNameAdd); playerArgAdd.addChild(attributeNameAdd);
playerArgRemove.addChild(attributeNameDelete); playerArgRemove.addChild(attributeNameDelete);
}); });
} }
public int ApplyAttribute(ServerPlayerEntity targetPlayer, String attributeName, CommandContext<ServerCommandSource> context) { public int ApplyAttribute(ServerPlayerEntity targetPlayer, String attributeName, CommandContext<ServerCommandSource> context) {
@ -79,7 +80,8 @@ public class AttributeCommands {
System.out.println("Applying attribute"); System.out.println("Applying attribute");
if (context.getSource().isExecutedByPlayer()) { if (context.getSource().isExecutedByPlayer()) {
System.out.println("Executed by player"); System.out.println("Executed by player");
String result = AttributeMgr.ApplyAttribute(targetPlayer.getUuidAsString(), attributeName); // String result = AttributeMgr.ApplyAttribute(targetPlayer.getUuidAsString(), attributeName);
String result = AttributeMgr.ApplyAttribute(context.getSource().getPlayer().getUuidAsString(), attributeName);
Keeblarcraft.LOGGER.info("[ApplyAttribute] -> " + result); Keeblarcraft.LOGGER.info("[ApplyAttribute] -> " + result);
context.getSource().getPlayer().sendMessage(Text.of(result)); context.getSource().getPlayer().sendMessage(Text.of(result));
ret = 0; ret = 0;

View File

@ -7,6 +7,7 @@ import com.mojang.brigadier.context.CommandContext;
import jesse.keeblarcraft.BankMgr.BankManager; import jesse.keeblarcraft.BankMgr.BankManager;
import jesse.keeblarcraft.ConfigMgr.ConfigManager; import jesse.keeblarcraft.ConfigMgr.ConfigManager;
import net.minecraft.command.argument.EntityArgumentType;
import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
@ -17,68 +18,94 @@ public class BankCommands {
ConfigManager config = new ConfigManager(); ConfigManager config = new ConfigManager();
public void RegisterCommands(){ public void RegisterCommands(){
// Command: "/getbalance"
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> { CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> {
dispatcher.register(CommandManager.literal("getbalance") var rootBank = CommandManager.literal("bank").build();
.executes(context -> GetBalance(context)));
});
// Command: "/setbalance || rootSetBalance" //second layer of tree
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> { var balance = CommandManager.literal("balance").build();
final var rootSetBalance = dispatcher.register(CommandManager.literal("setbalance") var wire = CommandManager.literal("wire").build();
.then(CommandManager.argument("newBalance", IntegerArgumentType.integer())
.then(CommandManager.argument("reason", StringArgumentType.string())
.then(CommandManager.argument("otherParty", StringArgumentType.string())
.executes(context -> SetBalance(
IntegerArgumentType.getInteger(context, "newBalance"),
StringArgumentType.getString(context, "reason"),
StringArgumentType.getString(context, "otherParty"),
context))))));
dispatcher.register(CommandManager.literal("setbalance").redirect(rootSetBalance)); //third layer of tree
}); var setBalance = CommandManager.literal("setBalance").build();
var getBalance = CommandManager.literal("getBalance").build();
var addMoney = CommandManager.literal("addMoney").build();
var subtractBalance = CommandManager.literal("subtractBalance").build();
// Command: "/AddMoney" var playerArgAdd = CommandManager.argument("otherParty", EntityArgumentType.player()).build();
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> { var paymentArg = CommandManager.argument("payment", LongArgumentType.longArg()).build();
dispatcher.register(CommandManager.literal("AddMoney")
.then(CommandManager.argument("reason", StringArgumentType.string())
.then(CommandManager.argument("payment", LongArgumentType.longArg())
.then(CommandManager.argument("otherParty", StringArgumentType.string())
.executes(context -> AddMoney(
StringArgumentType.getString(context, "reason"),
LongArgumentType.getLong(context, "payment"),
StringArgumentType.getString(context, "otherParty"),
context))))));
});
// Command: "/subtractbalance || /SubtractBalance" var wireFunction = CommandManager.argument("reason", StringArgumentType.greedyString())
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> { .executes(context -> Wire
final var SubtractBalance = dispatcher.register(CommandManager.literal("subtractbalance") (
.then(CommandManager.argument("reason", StringArgumentType.string()) EntityArgumentType.getPlayer(context, "otherParty"),
.then(CommandManager.argument("payment", LongArgumentType.longArg()) LongArgumentType.getLong(context, "payment"),
.then(CommandManager.argument("otherParty", StringArgumentType.string()) StringArgumentType.getString(context, "reason"),
.executes(context -> SubtractBalance( context)
StringArgumentType.getString(context, "reason"), )
LongArgumentType.getLong(context, "payment"), .build();
StringArgumentType.getString(context, "otherParty"),
context))))));
dispatcher.register(CommandManager.literal("subtractbalance").redirect(SubtractBalance)); var setBalanceFunction = CommandManager.argument("reason", StringArgumentType.greedyString())
}); .executes(context -> SetBalance
(
EntityArgumentType.getPlayer(context, "otherParty"),
LongArgumentType.getLong(context, "payment"),
StringArgumentType.getString(context, "reason"),
context)
)
.build();
var addMoneyFunction = CommandManager.argument("reason", StringArgumentType.greedyString())
.executes(context -> AddMoney
(
EntityArgumentType.getPlayer(context, "otherParty"),
LongArgumentType.getLong(context, "payment"),
StringArgumentType.getString(context, "reason"),
context)
)
.build();
// Command: "/wire || /sendmoney" var subtractMoneyFunction = CommandManager.argument("reason", StringArgumentType.greedyString())
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> { .executes(context -> SubtractBalance
final var sendmoney = dispatcher.register(CommandManager.literal("wire") (
.then(CommandManager.argument("reason", StringArgumentType.string()) EntityArgumentType.getPlayer(context, "otherParty"),
.then(CommandManager.argument("payment", LongArgumentType.longArg()) LongArgumentType.getLong(context, "payment"),
.then(CommandManager.argument("otherParty", StringArgumentType.string()) StringArgumentType.getString(context, "reason"),
.executes(context -> Wire( context)
StringArgumentType.getString(context, "reason"), )
LongArgumentType.getLong(context, "payment"), .build();
StringArgumentType.getString(context, "otherParty"),
context))))));
dispatcher.register(CommandManager.literal("wire").redirect(sendmoney));
// Build out the argument tree here
dispatcher.getRoot().addChild(rootBank);
rootBank.addChild(wire);
rootBank.addChild(balance);
// Subcommands of balance node "/getbalance", [ADMIN->] "/setbalance", "/subtractbalance", "/addmoney"
balance.addChild(getBalance);
balance.addChild(setBalance);
balance.addChild(subtractBalance);
balance.addChild(addMoney);
//subcommands of wire node "/playernamehere"
wire.addChild(playerArgAdd);
playerArgAdd.addChild(paymentArg);
paymentArg.addChild(wireFunction);
//subcommands of setBalance
setBalance.addChild(playerArgAdd);
playerArgAdd.addChild(paymentArg);
paymentArg.addChild(setBalanceFunction);
//subcommands of addMoney
addMoney.addChild(playerArgAdd);
playerArgAdd.addChild(paymentArg);
paymentArg.addChild(addMoneyFunction);
//subcommands for subtractbalance
subtractBalance.addChild(playerArgAdd);
playerArgAdd.addChild(paymentArg);
paymentArg.addChild(subtractMoneyFunction);
}); });
} }
@ -96,28 +123,27 @@ public class BankCommands {
} }
//SetBalance will be a ServerCommand only Perm level Op //SetBalance will be a ServerCommand only Perm level Op
public Integer SetBalance(Integer newBalance, String reason, String otherParty, CommandContext<ServerCommandSource> context) { public Integer SetBalance(ServerPlayerEntity otherParty, long payment, String reason, CommandContext<ServerCommandSource> context) {
Integer ret = -1; Integer ret = -1;
if (context.getSource().hasPermissionLevel(1)) { if (context.getSource().hasPermissionLevel(1)) {
ServerPlayerEntity player = context.getSource().getPlayer(); BankManager playerBank = new BankManager(otherParty.getUuidAsString());
BankManager playerBank = new BankManager(player.getUuidAsString()); System.out.println("UUID TEST IN COMMANDS " + otherParty.getUuidAsString());
playerBank.SetBalance(newBalance, reason, otherParty); playerBank.SetBalance(payment, reason, otherParty);
player.sendMessage(Text.literal(String.valueOf(playerBank.GetBalance()))); ret = 0;
} }
return ret; return ret;
} }
//AddMoney will be a ServerCommand Only Perm level Op //AddMoney will be a ServerCommand Only Perm level Op
public Integer AddMoney(String reason, long payment, String otherParty, CommandContext<ServerCommandSource> context) { public Integer AddMoney(ServerPlayerEntity otherParty, long payment, String reason, CommandContext<ServerCommandSource> context) {
Integer ret = -1; Integer ret = -1;
if (context.getSource().hasPermissionLevel(1)) { if (context.getSource().hasPermissionLevel(1)) {
ret = 0; ret = 0;
ServerPlayerEntity player = context.getSource().getPlayer(); ServerPlayerEntity player = context.getSource().getPlayer();
BankManager playerBank = new BankManager(player.getUuidAsString()); BankManager playerBank = new BankManager(player.getUuidAsString());
playerBank.AddMoney(reason, payment, otherParty); playerBank.AddMoney(otherParty, payment, player, reason);
player.sendMessage(Text.literal(String.valueOf(playerBank.GetBalance()))); player.sendMessage(Text.literal(String.valueOf(playerBank.GetBalance())));
} }
@ -125,31 +151,34 @@ public class BankCommands {
} }
//SubtractBalance will be a ServerCommand Perm leve Op //SubtractBalance will be a ServerCommand Perm leve Op
public Integer SubtractBalance(String reason, long payment, String otherParty, CommandContext<ServerCommandSource> context) { public Integer SubtractBalance(ServerPlayerEntity otherParty, long payment, String reason, CommandContext<ServerCommandSource> context) {
Integer ret = -1; Integer ret = -1;
if (context.getSource().hasPermissionLevel(1)) { if (context.getSource().hasPermissionLevel(1)) {
ret = 0; BankManager playerBank = new BankManager(otherParty.getUuidAsString());
ServerPlayerEntity player = context.getSource().getPlayer();
BankManager playerBank = new BankManager(player.getUuidAsString());
playerBank.SubtractBalance(reason, payment, otherParty); playerBank.SubtractBalance(reason, payment, otherParty);
player.sendMessage(Text.literal(String.valueOf(playerBank.GetBalance()))); otherParty.sendMessage(Text.literal(String.valueOf(playerBank.GetBalance())));
ret = 0;
} }
return ret; return ret;
} }
public Integer Wire(String reason, long payment, String otherParty, CommandContext<ServerCommandSource> context) { public Integer Wire(ServerPlayerEntity otherParty, long payment, String reason, CommandContext<ServerCommandSource> context) {
Integer ret = -1; Integer ret = -1;
if (context.getSource().isExecutedByPlayer()) { if (context.getSource().isExecutedByPlayer()) {
ServerPlayerEntity sender = context.getSource().getPlayer();
BankManager playerBank = new BankManager(sender.getUuidAsString());
if (sender.getUuidAsString() == otherParty.getUuidAsString()) {
sender.sendMessage(Text.of("you aint congress"));
return -1;
}
playerBank.Wire(otherParty, payment, reason, sender);
sender.sendMessage(Text.literal(String.valueOf(playerBank.GetBalance())));
ret = 0; ret = 0;
ServerPlayerEntity player = context.getSource().getPlayer();
BankManager playerBank = new BankManager(player.getUuidAsString());
playerBank.Wire(reason, payment, otherParty);
player.sendMessage(Text.literal(String.valueOf(playerBank.GetBalance())));
} }
return ret; return ret;
} }
} }

View File

@ -19,7 +19,6 @@ import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.minecraft.entity.player.PlayerAbilities; import net.minecraft.entity.player.PlayerAbilities;
import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.command.TimeCommand;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text; import net.minecraft.text.Text;
@ -65,20 +64,6 @@ public class ShortcutCommands {
return 0; return 0;
})); }));
}); });
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> {
dispatcher.register(CommandManager.literal("day")
.executes(context -> { DayShortcut(context);
return 0;
}));
});
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> {
dispatcher.register(CommandManager.literal("night")
.executes(context -> { NightShortcut(context);
return 0;
}));
});
} }
/// Command handlers below /// Command handlers below
@ -225,35 +210,4 @@ public class ShortcutCommands {
return retValue; return retValue;
} }
private int DayShortcut(CommandContext<ServerCommandSource> context) {
int retValue = -1;
if (context.getSource().isExecutedByPlayer()) {
ServerPlayerEntity player = context.getSource().getPlayer();
if (player.hasPermissionLevel(4)) {
retValue=0;
TimeCommand.executeSet(context.getSource(), retValue);
} else {
player.sendMessage(Text.literal("You do not have permission for this command"));
}
}
return retValue;
}
private int NightShortcut(CommandContext<ServerCommandSource> context) {
int retValue = -1;
if (context.getSource().isExecutedByPlayer()) {
ServerPlayerEntity player = context.getSource().getPlayer();
if (player.hasPermissionLevel(4)) {
retValue=13000;
TimeCommand.executeSet(context.getSource(), retValue);
} else {
player.sendMessage(Text.literal("You do not have permission for this command"));
}
}
return retValue;
}
} }

View File

@ -171,11 +171,15 @@ public class ConfigManager {
} }
public Boolean DoesFileExist(String fileName) { public Boolean DoesFileExist(String fileName) {
return new File(fileName).exists(); // untested Boolean ret = false;
return ret;
} }
public Boolean DoesDirectoryExist(String dirName) { public Boolean DoesDirectoryExist(String dirName) {
return new File(dirName).isDirectory(); // untested Boolean ret = false;
return ret;
} }
public Boolean CreateDirectory(String dirName) throws DIRECTORY_CREATE_EXCEPTION { public Boolean CreateDirectory(String dirName) throws DIRECTORY_CREATE_EXCEPTION {

View File

@ -1,24 +0,0 @@
package jesse.keeblarcraft.CustomBlocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.math.intprovider.UniformIntProvider;
// Put all your blocks here
public class BlockList {
/////////////////////////////////////////////////////////////////////////////
/// @fn RegisterBlocks
///
/// @brief This function is called by the main thread to register all
/// block objects. Please register your blocks here
/////////////////////////////////////////////////////////////////////////////
public static void RegisterBlocks() {
BlockManager.RegisterBlock("example_block_ore", new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).sounds(BlockSoundGroup.AMETHYST_BLOCK).requiresTool().breakInstantly()));
BlockManager.RegisterBlock("example_block", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).sounds(BlockSoundGroup.ANCIENT_DEBRIS).requiresTool(), UniformIntProvider.create(4, 20)));
BlockManager.RegisterBlock("example_statue", new Block(FabricBlockSettings.copyOf(Blocks.BELL)));
}
}

View File

@ -9,23 +9,28 @@
package jesse.keeblarcraft.CustomBlocks; package jesse.keeblarcraft.CustomBlocks;
import java.util.HashMap; import java.util.ArrayList;
import java.util.List;
import jesse.keeblarcraft.Keeblarcraft; import jesse.keeblarcraft.Keeblarcraft;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.math.intprovider.UniformIntProvider;
public class BlockManager { public class BlockManager {
/// The block list. DO NOT ADD TO THE LIST YOURSELF. USE /// The block list. DO NOT ADD TO THE LIST YOURSELF. USE
/// THE RegisterBlock(...) FUNCTION OTHERWISE YOUR BLOCK WILL /// THE RegisterBlock(...) FUNCTION OTHERWISE YOUR BLOCK WILL
/// NOT BE REGISTERED PROPERLY AND MAY BREAK THE GAME /// NOT BE REGISTERED PROPERLY AND MAY BREAK THE GAME
// public static final List<Block> blockList = new ArrayList<Block>(); public static final List<Block> blockList = new ArrayList<Block>();
public static final HashMap<String, Block> blockList = new HashMap<String, Block>();
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/// @fn RegisterBlock /// @fn RegisterBlock
@ -51,18 +56,24 @@ public class BlockManager {
Block newBlock = Registry.register(Registries.BLOCK, new Identifier(Keeblarcraft.MOD_ID, name), block); Block newBlock = Registry.register(Registries.BLOCK, new Identifier(Keeblarcraft.MOD_ID, name), block);
// Add the block to the block list // Add the block to the block list
blockList.put(name, newBlock); blockList.add(newBlock);
} }
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/// @fn GetBlock /// @fn RegisterBlocks
/// ///
/// @brief Gets a block from the block list by name /// @brief This function is only meant to be called by the main mod
/// /// execution path and should only be called once. This is a
/// @return Returns a block from the blockList object if name is found, /// glorified print statement - but also serves to add the
/// will return null if not found /// example block in the game
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
public static Block GetBlock(String name) { public static void RegisterBlocks() {
return blockList.get(name); Keeblarcraft.LOGGER.info("Registering modded blocks for " + Keeblarcraft.MOD_ID);
// Register example block to the mod
Block exampleBlock = new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).sounds(BlockSoundGroup.AMETHYST_BLOCK).requiresTool().breakInstantly());
Block exampleBlockOre = new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).sounds(BlockSoundGroup.ANCIENT_DEBRIS).requiresTool(), UniformIntProvider.create(4, 20));
RegisterBlock("example_block_ore", exampleBlockOre);
RegisterBlock("example_block", exampleBlock);
} }
} }

View File

@ -1,11 +1,8 @@
package jesse.keeblarcraft.CustomItems; package jesse.keeblarcraft.CustomItems;
import java.util.Map.Entry;
import jesse.keeblarcraft.Keeblarcraft; import jesse.keeblarcraft.Keeblarcraft;
import jesse.keeblarcraft.CustomBlocks.BlockManager; import jesse.keeblarcraft.CustomBlocks.BlockManager;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
import net.minecraft.block.Block;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
@ -27,8 +24,8 @@ public class CustomItemGroups {
} }
// We iterate through all the modded blocks and add them to the custom block group here // We iterate through all the modded blocks and add them to the custom block group here
for(Entry<String, Block> blocks : BlockManager.blockList.entrySet()) { for (int i = 0; i < BlockManager.blockList.size(); i++) {
entries.add(blocks.getValue()); entries.add(BlockManager.blockList.get(i));
} }
}).build()); }).build());

View File

@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import jesse.keeblarcraft.Keeblarcraft; import jesse.keeblarcraft.Keeblarcraft;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;

View File

@ -0,0 +1,13 @@
/*
*
* GuiMgr
*
* Handles everything related to in-game gui environments
*
*/
package jesse.keeblarcraft.GuiMgr;
public class GuiMgr {
}

View File

@ -1,86 +0,0 @@
package jesse.keeblarcraft.GuiMgr;
import jesse.keeblarcraft.Keeblarcraft;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.Inventory;
import net.minecraft.inventory.SimpleInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandler;
// Server side screen handler for the attribute tree
public class TreeHandler extends ScreenHandler {
/////////////////////////////////////////////////////////////////////////////
/// @fn TreeHandler
///
/// @arg[in] syncId is SUPPOSED to be some sync identifier between the
/// server and client. This isn't being used yet, so there isn't
/// enough knowledge to make a good documentation note on it.
/// Coming soon!
///
/// @arg[in] inventory is the players inventory. Required by HandledScreen
/// object however is unused currently so we make the size 0. As
/// needs and use-cases change; this may be reworked in the future
///
/// @brief Class constructor
/////////////////////////////////////////////////////////////////////////////
public TreeHandler(int syncId, PlayerInventory inventory) {
// Call the constructor below
this(syncId, inventory, new SimpleInventory(0));
}
/////////////////////////////////////////////////////////////////////////////
/// @fn TreeHandler
///
/// @arg[in] syncId is SUPPOSED to be some sync identifier between the
/// server and client. This isn't being used yet, so there isn't
/// enough knowledge to make a good documentation note on it.
/// Coming soon!
///
/// @arg[in] inventory is the players inventory. Required by HandledScreen
/// object however is unused currently so we make the size 0. As
/// needs and use-cases change; this may be reworked in the future
///
/// @arg[in] inventory is the SERVER's inventory - which is what syncId
/// would likely be useful for. Once I (Jesse) get the screen stuff
/// more sorted out - a more useful doxygen comment will be applied
/// here in this class. Coming soon!
///
/// @brief Class constructor
/////////////////////////////////////////////////////////////////////////////
public TreeHandler(int syncId, PlayerInventory playerInventory, Inventory inventory) {
super(Keeblarcraft.TREE_HANDLER, syncId);
System.out.println("Created tree handler");
System.out.println("Is static var null? " + Keeblarcraft.TREE_HANDLER == null ? "YES":"NO");
}
/////////////////////////////////////////////////////////////////////////////
/// @fn quickMove
///
/// @arg[in] player is the player entity moving an item
///
/// @arg[in] slot is the inventory slot to quick move to (shift+click)
///
/// @brief Required by parent class; currently do nothing as we aren't
/// using inventories in the gui's!
/////////////////////////////////////////////////////////////////////////////
@Override
public ItemStack quickMove(PlayerEntity player, int slot) {
return ItemStack.EMPTY;
}
/////////////////////////////////////////////////////////////////////////////
/// @fn canUse
///
/// @arg[in] player is the player entity moving an item
///
/// @brief Returns whether the screen handler can be used. Required by
/// parent class as its abstract; but for now players can always
/// use GUI's and need no confirmation!
/////////////////////////////////////////////////////////////////////////////
@Override
public boolean canUse(PlayerEntity player) {
return true;
}
}

View File

@ -12,12 +12,8 @@
package jesse.keeblarcraft; package jesse.keeblarcraft;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
// import net.minecraft.server.command.ServerCommandSource;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents; import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.resource.featuretoggle.FeatureSet;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.util.Identifier;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -25,10 +21,9 @@ import org.slf4j.LoggerFactory;
import jesse.keeblarcraft.AttributeMgr.AttributeMgr; import jesse.keeblarcraft.AttributeMgr.AttributeMgr;
import jesse.keeblarcraft.AttributeMgr.AttributeTree; import jesse.keeblarcraft.AttributeMgr.AttributeTree;
import jesse.keeblarcraft.Commands.CustomCommandManager; import jesse.keeblarcraft.Commands.CustomCommandManager;
import jesse.keeblarcraft.CustomBlocks.BlockList; import jesse.keeblarcraft.CustomBlocks.BlockManager;
import jesse.keeblarcraft.CustomItems.ItemManager; import jesse.keeblarcraft.CustomItems.ItemManager;
import jesse.keeblarcraft.EventMgr.ServerTickListener; import jesse.keeblarcraft.EventMgr.ServerTickListener;
import jesse.keeblarcraft.GuiMgr.TreeHandler;
import jesse.keeblarcraft.Utils.CustomExceptions.SETUP_FAILED_EXCEPTION; import jesse.keeblarcraft.Utils.CustomExceptions.SETUP_FAILED_EXCEPTION;
import jesse.keeblarcraft.Utils.ChatUtil; import jesse.keeblarcraft.Utils.ChatUtil;
import jesse.keeblarcraft.Utils.Setup; import jesse.keeblarcraft.Utils.Setup;
@ -37,14 +32,8 @@ import jesse.keeblarcraft.Utils.ChatUtil.CONSOLE_COLOR;
public class Keeblarcraft implements ModInitializer { public class Keeblarcraft implements ModInitializer {
public static String MOD_ID = "keeblarcraft"; public static String MOD_ID = "keeblarcraft";
public static final Logger LOGGER = LoggerFactory.getLogger("keeblarcraft"); public static final Logger LOGGER = LoggerFactory.getLogger("keeblarcraft");
// May be moved in future; but is the universal TREE_HANDLER call for at least the tree gui. It's possible it can get a more
// generic name in the future after the tree gui is done; however until then it will remain TREE_HANDLER.
public static final ScreenHandlerType<TreeHandler> TREE_HANDLER = Registry.register(Registries.SCREEN_HANDLER,
Identifier.of(Keeblarcraft.MOD_ID, "tree_gui"),
new ScreenHandlerType<>(TreeHandler::new, FeatureSet.empty()));
CustomCommandManager cmdMgr = new CustomCommandManager(); CustomCommandManager cmdMgr = new CustomCommandManager();
Setup setup = Setup.GetInstance(); Setup setup = Setup.GetInstance();
@Override @Override
@ -96,7 +85,7 @@ public class Keeblarcraft implements ModInitializer {
ItemManager.RegisterAllItems(); ItemManager.RegisterAllItems();
// Register blocks // Register blocks
BlockList.RegisterBlocks(); BlockManager.RegisterBlocks();
} catch (SETUP_FAILED_EXCEPTION e) { } catch (SETUP_FAILED_EXCEPTION e) {

View File

@ -24,22 +24,22 @@ public class ChatUtil {
public static String getColor(CONSOLE_COLOR color) { public static String getColor(CONSOLE_COLOR color) {
String ret = ""; String ret = "";
switch(color) { switch(color) {
case RED: case CONSOLE_COLOR.RED:
ret = "31"; ret = "31";
break; break;
case GREEN: case CONSOLE_COLOR.GREEN:
ret = "32"; ret = "32";
break; break;
case YELLOW: case CONSOLE_COLOR.YELLOW:
ret = "33"; ret = "33";
break; break;
case BLUE: case CONSOLE_COLOR.BLUE:
ret = "34"; ret = "34";
break; break;
case MAGENTA: case CONSOLE_COLOR.MAGENTA:
ret = "35"; ret = "35";
break; break;
case CYAN: case CONSOLE_COLOR.CYAN:
ret = "36"; ret = "36";
break; break;
} }

View File

@ -1,11 +0,0 @@
package jesse.keeblarcraft.Utils.CommonStructures;
public class Position2d {
public Position2d(int x, int y) {
this.x = x;
this.y = y;
}
public int x;
public int y;
}

View File

@ -1,13 +0,0 @@
package jesse.keeblarcraft.Utils.CommonStructures;
public class Position3d {
public Position3d(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public int x;
public int y;
public int z;
}

View File

@ -15,6 +15,7 @@ import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import jesse.keeblarcraft.ConfigMgr.ConfigManager; import jesse.keeblarcraft.ConfigMgr.ConfigManager;
import jesse.keeblarcraft.EventMgr.ServerTickListener;
import jesse.keeblarcraft.Utils.ChatUtil.CONSOLE_COLOR; import jesse.keeblarcraft.Utils.ChatUtil.CONSOLE_COLOR;
import jesse.keeblarcraft.Utils.CustomExceptions.DIRECTORY_CREATE_EXCEPTION; import jesse.keeblarcraft.Utils.CustomExceptions.DIRECTORY_CREATE_EXCEPTION;
import jesse.keeblarcraft.Utils.CustomExceptions.SETUP_FAILED_EXCEPTION; import jesse.keeblarcraft.Utils.CustomExceptions.SETUP_FAILED_EXCEPTION;

View File

@ -0,0 +1,15 @@
package jesse.keeblarcraft.mixin;
import net.minecraft.server.MinecraftServer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(MinecraftServer.class)
public class ExampleMixin {
@Inject(at = @At("HEAD"), method = "loadWorld")
private void init(CallbackInfo info) {
// This code is injected into the start of MinecraftServer.loadWorld()V
}
}

View File

@ -1,7 +0,0 @@
{
"variants": {
"": {
"model": "keeblarcraft:block/example_statue"
}
}
}

View File

@ -7,10 +7,5 @@
"itemgroup.keeblarcraft": "Keeblarcraft Modded Items", "itemgroup.keeblarcraft": "Keeblarcraft Modded Items",
"block.keeblarcraft.example_block": "Keeblarcraft example block", "block.keeblarcraft.example_block": "Keeblarcraft example block",
"block.keeblarcraft.example_block_ore": "Keeblarcraft example block ore", "block.keeblarcraft.example_block_ore": "Keeblarcraft example block ore"
"block.keeblarcraft.example_statue": "Keeblarcraft example statue",
"category.keeblarcraft.test": "Keeblarcraft bindings",
"key.keeblarcraft.treemap": "Tree GUI",
"key.keeblarcraft.globalconfig": "Config menu"
} }

View File

@ -1,481 +0,0 @@
{
"credit": "Made with Blockbench",
"texture_size": [64, 64],
"textures": {
"0": "keeblarcraft:block/example_statue",
"particle": "keeblarcraft:block/example_statue"
},
"elements": [
{
"name": "platform",
"from": [0, 0, 0],
"to": [16, 1, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [5, 0, 3]},
"faces": {
"north": {"uv": [4, 2.5, 8, 2.75], "texture": "#0"},
"east": {"uv": [4, 2.75, 8, 3], "texture": "#0"},
"south": {"uv": [4, 3, 8, 3.25], "texture": "#0"},
"west": {"uv": [4, 3.25, 8, 3.5], "texture": "#0"},
"up": {"uv": [4, 4, 0, 0], "texture": "#0"},
"down": {"uv": [4, 4, 0, 8], "texture": "#0"}
}
},
{
"name": "left_leg",
"from": [7, 1, 3],
"to": [9, 5, 5],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0, 2]},
"faces": {
"north": {"uv": [5.5, 5.5, 6, 6.75], "texture": "#0"},
"east": {"uv": [6, 0, 6.5, 1.25], "texture": "#0"},
"south": {"uv": [6, 1.25, 6.5, 2.5], "texture": "#0"},
"west": {"uv": [6, 3.5, 6.5, 4.75], "texture": "#0"},
"up": {"uv": [6.75, 7.75, 6.25, 7.25], "texture": "#0"},
"down": {"uv": [7.75, 7, 7.25, 7.5], "texture": "#0"}
}
},
{
"name": "right_leg",
"from": [7, 1, 11],
"to": [9, 5, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0, 11]},
"faces": {
"north": {"uv": [6, 4.75, 6.5, 6], "texture": "#0"},
"east": {"uv": [6, 6, 6.5, 7.25], "texture": "#0"},
"south": {"uv": [6.5, 0, 7, 1.25], "texture": "#0"},
"west": {"uv": [6.5, 1.25, 7, 2.5], "texture": "#0"},
"up": {"uv": [8, 0.5, 7.5, 0], "texture": "#0"},
"down": {"uv": [8, 0.5, 7.5, 1], "texture": "#0"}
}
},
{
"from": [7, 5, 5],
"to": [9, 10, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 5, 7]},
"faces": {
"north": {"uv": [6.5, 3.5, 7, 4.75], "texture": "#0"},
"east": {"uv": [4, 0, 5.5, 1.25], "texture": "#0"},
"south": {"uv": [6.5, 4.75, 7, 6], "texture": "#0"},
"west": {"uv": [4, 1.25, 5.5, 2.5], "texture": "#0"},
"up": {"uv": [6, 1.5, 5.5, 0], "texture": "#0"},
"down": {"uv": [4.5, 5.5, 4, 7], "texture": "#0"}
}
},
{
"from": [7, 8, 10],
"to": [9, 10, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 10]},
"faces": {
"north": {"uv": [7.5, 1, 8, 1.5], "texture": "#0"},
"east": {"uv": [7.5, 1.5, 8, 2], "texture": "#0"},
"south": {"uv": [7.5, 2, 8, 2.5], "texture": "#0"},
"west": {"uv": [7.5, 3.5, 8, 4], "texture": "#0"},
"up": {"uv": [8, 4.5, 7.5, 4], "texture": "#0"},
"down": {"uv": [8, 5, 7.5, 5.5], "texture": "#0"}
}
},
{
"from": [7, 10, 11],
"to": [9, 11, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 10, 11]},
"faces": {
"north": {"uv": [8, 2.75, 8.5, 3], "texture": "#0"},
"east": {"uv": [8, 3, 8.5, 3.25], "texture": "#0"},
"south": {"uv": [8, 3.25, 8.5, 3.5], "texture": "#0"},
"west": {"uv": [3.5, 8, 4, 8.25], "texture": "#0"},
"up": {"uv": [8, 6, 7.5, 5.5], "texture": "#0"},
"down": {"uv": [8, 6, 7.5, 6.5], "texture": "#0"}
}
},
{
"from": [7, 10, 13],
"to": [9, 11, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 10, 12]},
"faces": {
"north": {"uv": [8, 3.5, 8.5, 3.75], "texture": "#0"},
"east": {"uv": [7.5, 8.5, 7.75, 8.75], "texture": "#0"},
"south": {"uv": [8, 3.75, 8.5, 4], "texture": "#0"},
"west": {"uv": [8.75, 8.75, 9, 9], "texture": "#0"},
"up": {"uv": [8.5, 4.25, 8, 4], "texture": "#0"},
"down": {"uv": [8.5, 4.25, 8, 4.5], "texture": "#0"}
}
},
{
"from": [7, 11, 14],
"to": [9, 13, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 11, 13]},
"faces": {
"north": {"uv": [7.5, 6.5, 8, 7], "texture": "#0"},
"east": {"uv": [8, 5, 8.25, 5.5], "texture": "#0"},
"south": {"uv": [7.25, 7.5, 7.75, 8], "texture": "#0"},
"west": {"uv": [5.5, 8, 5.75, 8.5], "texture": "#0"},
"up": {"uv": [8.5, 5.75, 8, 5.5], "texture": "#0"},
"down": {"uv": [8.5, 5.75, 8, 6], "texture": "#0"}
}
},
{
"from": [7, 14, 12],
"to": [9, 15, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 14, 12]},
"faces": {
"north": {"uv": [8, 6, 8.5, 6.25], "texture": "#0"},
"east": {"uv": [8, 6.25, 8.5, 6.5], "texture": "#0"},
"south": {"uv": [8, 6.5, 8.5, 6.75], "texture": "#0"},
"west": {"uv": [8, 6.75, 8.5, 7], "texture": "#0"},
"up": {"uv": [4.5, 8.25, 4, 7.75], "texture": "#0"},
"down": {"uv": [5, 7.75, 4.5, 8.25], "texture": "#0"}
}
},
{
"from": [7, 14, 11],
"to": [9, 15, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 13, 10]},
"faces": {
"north": {"uv": [7.25, 8, 7.75, 8.25], "texture": "#0"},
"east": {"uv": [0, 9, 0.25, 9.25], "texture": "#0"},
"south": {"uv": [7.75, 8, 8.25, 8.25], "texture": "#0"},
"west": {"uv": [9, 0, 9.25, 0.25], "texture": "#0"},
"up": {"uv": [8.75, 0.75, 8.25, 0.5], "texture": "#0"},
"down": {"uv": [8.75, 0.75, 8.25, 1], "texture": "#0"}
}
},
{
"from": [7, 14, 10],
"to": [9, 15, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 13, 9]},
"faces": {
"north": {"uv": [8.25, 1, 8.75, 1.25], "texture": "#0"},
"east": {"uv": [0.25, 9, 0.5, 9.25], "texture": "#0"},
"south": {"uv": [8.25, 1.25, 8.75, 1.5], "texture": "#0"},
"west": {"uv": [9, 0.25, 9.25, 0.5], "texture": "#0"},
"up": {"uv": [8.75, 1.75, 8.25, 1.5], "texture": "#0"},
"down": {"uv": [8.75, 1.75, 8.25, 2], "texture": "#0"}
}
},
{
"from": [7, 13, 9],
"to": [9, 14, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 13, 9]},
"faces": {
"north": {"uv": [8.25, 2, 8.75, 2.25], "texture": "#0"},
"east": {"uv": [0.5, 9, 0.75, 9.25], "texture": "#0"},
"south": {"uv": [8.25, 2.25, 8.75, 2.5], "texture": "#0"},
"west": {"uv": [0.75, 9, 1, 9.25], "texture": "#0"},
"up": {"uv": [3.25, 8.5, 2.75, 8.25], "texture": "#0"},
"down": {"uv": [3.75, 8.25, 3.25, 8.5], "texture": "#0"}
}
},
{
"from": [7, 11, 8],
"to": [9, 13, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 11, 7]},
"faces": {
"north": {"uv": [5, 7.75, 5.5, 8.25], "texture": "#0"},
"east": {"uv": [5.75, 8, 6, 8.5], "texture": "#0"},
"south": {"uv": [6.25, 7.75, 6.75, 8.25], "texture": "#0"},
"west": {"uv": [3.75, 8.25, 4, 8.75], "texture": "#0"},
"up": {"uv": [4.5, 8.5, 4, 8.25], "texture": "#0"},
"down": {"uv": [5, 8.25, 4.5, 8.5], "texture": "#0"}
}
},
{
"from": [7, 10, 9],
"to": [9, 11, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 9, 8]},
"faces": {
"north": {"uv": [5, 8.25, 5.5, 8.5], "texture": "#0"},
"east": {"uv": [8.25, 5, 8.75, 5.25], "texture": "#0"},
"south": {"uv": [8.25, 5.25, 8.75, 5.5], "texture": "#0"},
"west": {"uv": [6.25, 8.25, 6.75, 8.5], "texture": "#0"},
"up": {"uv": [8.25, 7.5, 7.75, 7], "texture": "#0"},
"down": {"uv": [8.25, 7.5, 7.75, 8], "texture": "#0"}
}
},
{
"from": [7, 13, 14],
"to": [9, 14, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 13, 14]},
"faces": {
"north": {"uv": [6.75, 8.25, 7.25, 8.5], "texture": "#0"},
"east": {"uv": [1, 9, 1.25, 9.25], "texture": "#0"},
"south": {"uv": [8.25, 7, 8.75, 7.25], "texture": "#0"},
"west": {"uv": [1.25, 9, 1.5, 9.25], "texture": "#0"},
"up": {"uv": [7.75, 8.5, 7.25, 8.25], "texture": "#0"},
"down": {"uv": [8.75, 7.25, 8.25, 7.5], "texture": "#0"}
}
},
{
"from": [7, 7, 4],
"to": [9, 9, 5],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 7, 4]},
"faces": {
"north": {"uv": [0, 8, 0.5, 8.5], "texture": "#0"},
"east": {"uv": [8.25, 7.5, 8.5, 8], "texture": "#0"},
"south": {"uv": [8, 0, 8.5, 0.5], "texture": "#0"},
"west": {"uv": [7.75, 8.25, 8, 8.75], "texture": "#0"},
"up": {"uv": [8.5, 8.5, 8, 8.25], "texture": "#0"},
"down": {"uv": [8.75, 8, 8.25, 8.25], "texture": "#0"}
}
},
{
"from": [7, 8, 3],
"to": [9, 9, 4],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 7, 2]},
"faces": {
"north": {"uv": [0, 8.5, 0.5, 8.75], "texture": "#0"},
"east": {"uv": [1.5, 9, 1.75, 9.25], "texture": "#0"},
"south": {"uv": [8.5, 0, 9, 0.25], "texture": "#0"},
"west": {"uv": [1.75, 9, 2, 9.25], "texture": "#0"},
"up": {"uv": [9, 0.5, 8.5, 0.25], "texture": "#0"},
"down": {"uv": [3.25, 8.5, 2.75, 8.75], "texture": "#0"}
}
},
{
"from": [7, 9, 2],
"to": [9, 12, 3],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 9, 1]},
"faces": {
"north": {"uv": [4, 7, 4.5, 7.75], "texture": "#0"},
"east": {"uv": [2.25, 8, 2.5, 8.75], "texture": "#0"},
"south": {"uv": [4.5, 7, 5, 7.75], "texture": "#0"},
"west": {"uv": [2.5, 8, 2.75, 8.75], "texture": "#0"},
"up": {"uv": [9, 3, 8.5, 2.75], "texture": "#0"},
"down": {"uv": [9, 3, 8.5, 3.25], "texture": "#0"}
}
},
{
"from": [7, 12, 3],
"to": [9, 13, 4],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 12, 3]},
"faces": {
"north": {"uv": [3.25, 8.5, 3.75, 8.75], "texture": "#0"},
"east": {"uv": [2, 9, 2.25, 9.25], "texture": "#0"},
"south": {"uv": [8.5, 3.25, 9, 3.5], "texture": "#0"},
"west": {"uv": [2.25, 9, 2.5, 9.25], "texture": "#0"},
"up": {"uv": [9, 3.75, 8.5, 3.5], "texture": "#0"},
"down": {"uv": [9, 3.75, 8.5, 4], "texture": "#0"}
}
},
{
"from": [7, 13, 4],
"to": [9, 14, 5],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 13, 4]},
"faces": {
"north": {"uv": [4, 8.5, 4.5, 8.75], "texture": "#0"},
"east": {"uv": [2.5, 9, 2.75, 9.25], "texture": "#0"},
"south": {"uv": [8.5, 4, 9, 4.25], "texture": "#0"},
"west": {"uv": [2.75, 9, 3, 9.25], "texture": "#0"},
"up": {"uv": [9, 4.5, 8.5, 4.25], "texture": "#0"},
"down": {"uv": [5, 8.5, 4.5, 8.75], "texture": "#0"}
}
},
{
"from": [7, 10, 5],
"to": [9, 14, 6],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 10, 5]},
"faces": {
"north": {"uv": [5.5, 1.5, 6, 2.5], "texture": "#0"},
"east": {"uv": [6.75, 7.25, 7, 8.25], "texture": "#0"},
"south": {"uv": [7, 3.5, 7.5, 4.5], "texture": "#0"},
"west": {"uv": [0.5, 8, 0.75, 9], "texture": "#0"},
"up": {"uv": [9, 4.75, 8.5, 4.5], "texture": "#0"},
"down": {"uv": [9, 4.75, 8.5, 5], "texture": "#0"}
}
},
{
"from": [7, 10, 6],
"to": [9, 15, 7],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 14, 6]},
"faces": {
"north": {"uv": [6.5, 6, 7, 7.25], "texture": "#0"},
"east": {"uv": [7, 5.75, 7.25, 7], "texture": "#0"},
"south": {"uv": [5.5, 6.75, 6, 8], "texture": "#0"},
"west": {"uv": [7, 7, 7.25, 8.25], "texture": "#0"},
"up": {"uv": [5.5, 8.75, 5, 8.5], "texture": "#0"},
"down": {"uv": [6, 8.5, 5.5, 8.75], "texture": "#0"}
}
},
{
"from": [7, 10, 7],
"to": [9, 15, 8],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 14, 7]},
"faces": {
"north": {"uv": [7, 0, 7.5, 1.25], "texture": "#0"},
"east": {"uv": [7.25, 5.75, 7.5, 7], "texture": "#0"},
"south": {"uv": [7, 1.25, 7.5, 2.5], "texture": "#0"},
"west": {"uv": [6, 7.25, 6.25, 8.5], "texture": "#0"},
"up": {"uv": [9, 8, 8.5, 7.75], "texture": "#0"},
"down": {"uv": [8.5, 8.5, 8, 8.75], "texture": "#0"}
}
},
{
"from": [7, 15, 6],
"to": [9, 16, 7],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 15, 6]},
"faces": {
"north": {"uv": [8.5, 5.5, 9, 5.75], "texture": "#0"},
"east": {"uv": [9, 2.75, 9.25, 3], "texture": "#0"},
"south": {"uv": [8.5, 5.75, 9, 6], "texture": "#0"},
"west": {"uv": [3, 9, 3.25, 9.25], "texture": "#0"},
"up": {"uv": [6.5, 8.75, 6, 8.5], "texture": "#0"},
"down": {"uv": [9, 6, 8.5, 6.25], "texture": "#0"}
}
},
{
"from": [7, 15, 13],
"to": [9, 16, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 15, 13]},
"faces": {
"north": {"uv": [8.5, 6.5, 9, 6.75], "texture": "#0"},
"east": {"uv": [9, 3, 9.25, 3.25], "texture": "#0"},
"south": {"uv": [8.5, 6.75, 9, 7], "texture": "#0"},
"west": {"uv": [3.25, 9, 3.5, 9.25], "texture": "#0"},
"up": {"uv": [7.5, 8.75, 7, 8.5], "texture": "#0"},
"down": {"uv": [9, 7.5, 8.5, 7.75], "texture": "#0"}
}
},
{
"from": [7, 10, 8],
"to": [9, 11, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 10, 8]},
"faces": {
"north": {"uv": [8.5, 8.25, 9, 8.5], "texture": "#0"},
"east": {"uv": [9, 3.25, 9.25, 3.5], "texture": "#0"},
"south": {"uv": [8.5, 8.5, 9, 8.75], "texture": "#0"},
"west": {"uv": [3.5, 9, 3.75, 9.25], "texture": "#0"},
"up": {"uv": [0.5, 9, 0, 8.75], "texture": "#0"},
"down": {"uv": [9.25, 0.5, 8.75, 0.75], "texture": "#0"}
}
},
{
"from": [7, 14, 8],
"to": [9, 15, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 14, 8]},
"faces": {
"north": {"uv": [8.75, 0.75, 9.25, 1], "texture": "#0"},
"east": {"uv": [9, 3.5, 9.25, 3.75], "texture": "#0"},
"south": {"uv": [8.75, 1, 9.25, 1.25], "texture": "#0"},
"west": {"uv": [3.75, 9, 4, 9.25], "texture": "#0"},
"up": {"uv": [9.25, 1.5, 8.75, 1.25], "texture": "#0"},
"down": {"uv": [9.25, 1.5, 8.75, 1.75], "texture": "#0"}
}
},
{
"from": [7, 13, 8],
"to": [9, 14, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 13, 8]},
"faces": {
"north": {"uv": [8.75, 1.75, 9.25, 2], "texture": "#0"},
"east": {"uv": [9, 3.75, 9.25, 4], "texture": "#0"},
"south": {"uv": [8.75, 2, 9.25, 2.25], "texture": "#0"},
"west": {"uv": [4, 9, 4.25, 9.25], "texture": "#0"},
"up": {"uv": [2.75, 9, 2.25, 8.75], "texture": "#0"},
"down": {"uv": [9.25, 2.25, 8.75, 2.5], "texture": "#0"}
}
},
{
"from": [7, 15, 8],
"to": [9, 16, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 15, 8]},
"faces": {
"north": {"uv": [8.75, 2.5, 9.25, 2.75], "texture": "#0"},
"east": {"uv": [9, 4, 9.25, 4.25], "texture": "#0"},
"south": {"uv": [2.75, 8.75, 3.25, 9], "texture": "#0"},
"west": {"uv": [4.25, 9, 4.5, 9.25], "texture": "#0"},
"up": {"uv": [3.75, 9, 3.25, 8.75], "texture": "#0"},
"down": {"uv": [4.25, 8.75, 3.75, 9], "texture": "#0"}
}
},
{
"from": [7, 15, 7],
"to": [9, 16, 8],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 15, 7]},
"faces": {
"north": {"uv": [4.25, 8.75, 4.75, 9], "texture": "#0"},
"east": {"uv": [9, 4.25, 9.25, 4.5], "texture": "#0"},
"south": {"uv": [4.75, 8.75, 5.25, 9], "texture": "#0"},
"west": {"uv": [4.5, 9, 4.75, 9.25], "texture": "#0"},
"up": {"uv": [9.25, 5.25, 8.75, 5], "texture": "#0"},
"down": {"uv": [5.75, 8.75, 5.25, 9], "texture": "#0"}
}
},
{
"from": [7, 15, 9],
"to": [9, 16, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 15, 9]},
"faces": {
"north": {"uv": [8.75, 5.25, 9.25, 5.5], "texture": "#0"},
"east": {"uv": [9, 4.5, 9.25, 4.75], "texture": "#0"},
"south": {"uv": [5.75, 8.75, 6.25, 9], "texture": "#0"},
"west": {"uv": [4.75, 9, 5, 9.25], "texture": "#0"},
"up": {"uv": [6.75, 9, 6.25, 8.75], "texture": "#0"},
"down": {"uv": [7.25, 8.75, 6.75, 9], "texture": "#0"}
}
},
{
"from": [7, 14, 9],
"to": [9, 15, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 14, 9]},
"faces": {
"north": {"uv": [8.75, 7, 9.25, 7.25], "texture": "#0"},
"east": {"uv": [9, 4.75, 9.25, 5], "texture": "#0"},
"south": {"uv": [7.25, 8.75, 7.75, 9], "texture": "#0"},
"west": {"uv": [5, 9, 5.25, 9.25], "texture": "#0"},
"up": {"uv": [9.25, 7.5, 8.75, 7.25], "texture": "#0"},
"down": {"uv": [8.25, 8.75, 7.75, 9], "texture": "#0"}
}
},
{
"from": [7, 15, 10],
"to": [9, 16, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 15, 10]},
"faces": {
"north": {"uv": [8.75, 8, 9.25, 8.25], "texture": "#0"},
"east": {"uv": [8, 2.5, 8.75, 2.75], "texture": "#0"},
"south": {"uv": [8.25, 8.75, 8.75, 9], "texture": "#0"},
"west": {"uv": [2.75, 8, 3.5, 8.25], "texture": "#0"},
"up": {"uv": [5.5, 7.75, 5, 7], "texture": "#0"},
"down": {"uv": [7.5, 5, 7, 5.75], "texture": "#0"}
}
},
{
"from": [7, 16, 7],
"to": [9, 17, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 16, 7]},
"faces": {
"north": {"uv": [8.5, 6.25, 9, 6.5], "texture": "#0"},
"east": {"uv": [7, 4.5, 8.5, 4.75], "texture": "#0"},
"south": {"uv": [6.5, 8.5, 7, 8.75], "texture": "#0"},
"west": {"uv": [7, 4.75, 8.5, 5], "texture": "#0"},
"up": {"uv": [5, 7, 4.5, 5.5], "texture": "#0"},
"down": {"uv": [5.5, 5.5, 5, 7], "texture": "#0"}
}
},
{
"from": [6, 6, 6],
"to": [7, 10, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [5, 6, 6]},
"faces": {
"north": {"uv": [8, 0.5, 8.25, 1.5], "texture": "#0"},
"east": {"uv": [4, 3.5, 5, 4.5], "texture": "#0"},
"south": {"uv": [0.75, 8, 1, 9], "texture": "#0"},
"west": {"uv": [4, 4.5, 5, 5.5], "texture": "#0"},
"up": {"uv": [1.25, 9, 1, 8], "texture": "#0"},
"down": {"uv": [1.5, 8, 1.25, 9], "texture": "#0"}
}
},
{
"from": [9, 6, 6],
"to": [10, 10, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6, 6]},
"faces": {
"north": {"uv": [1.5, 8, 1.75, 9], "texture": "#0"},
"east": {"uv": [5, 3.5, 6, 4.5], "texture": "#0"},
"south": {"uv": [8, 1.5, 8.25, 2.5], "texture": "#0"},
"west": {"uv": [5, 4.5, 6, 5.5], "texture": "#0"},
"up": {"uv": [2, 9, 1.75, 8], "texture": "#0"},
"down": {"uv": [2.25, 8, 2, 9], "texture": "#0"}
}
}
]
}

View File

@ -1,3 +0,0 @@
{
"parent": "keeblarcraft:block/example_statue"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 782 B

View File

@ -1,11 +1,11 @@
{ {
"schemaVersion": 1, "schemaVersion": 1,
"id": "keeblarcraft", "id": "keeblarcraft",
"version": "0.1", "version": "${version}",
"name": "keeblarcraft", "name": "keeblarcraft",
"description": "My everything mod", "description": "This is an example description! Tell everyone what your mod is about!",
"authors": [ "authors": [
"Jkibbels" "Me!"
], ],
"contact": { "contact": {
"homepage": "https://fabricmc.net/", "homepage": "https://fabricmc.net/",
@ -22,12 +22,18 @@
"jesse.keeblarcraft.KeeblarcraftClient" "jesse.keeblarcraft.KeeblarcraftClient"
] ]
}, },
"mixins": [
"keeblarcraft.mixins.json",
{
"config": "keeblarcraft.client.mixins.json",
"environment": "client"
}
],
"depends": { "depends": {
"fabricloader": ">=0.15.11", "fabricloader": ">=0.15.11",
"minecraft": "~1.20", "minecraft": "~1.20",
"java": ">=17", "java": ">=21",
"fabric-api": "*", "fabric-api": "*"
"fabric-key-binding-api-v1": "*"
}, },
"suggests": { "suggests": {
"another-mod": "*" "another-mod": "*"

View File

@ -0,0 +1,11 @@
{
"required": true,
"package": "jesse.keeblarcraft.mixin",
"compatibilityLevel": "JAVA_21",
"mixins": [
"ExampleMixin"
],
"injectors": {
"defaultRequire": 1
}
}