-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0cc128f
commit 025807c
Showing
17 changed files
with
380 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ | |
/Core/build/ | ||
/TNIL-Sponge/build/ | ||
*.lock | ||
/TNIL-Fabric/build/ | ||
/TNIL-Fabric/.gradle/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
${project} | ||
|
||
Copyright (C) ${year} Daniel "creatorfromhell" Vidmar | ||
|
||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
|
||
You should have received a copy of the GNU Lesser General Public License | ||
along with this program; if not, write to the Free Software Foundation, | ||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
plugins { | ||
id("java") | ||
id("com.github.johnrengelman.shadow") version "8.1.1" apply true | ||
id("fabric-loom") version "1.6-SNAPSHOT" apply true | ||
id("maven-publish") apply true | ||
} | ||
|
||
group = property("maven_group")!! | ||
version = property("tnil_version")!! | ||
|
||
repositories { | ||
// Add repositories to retrieve artifacts from in here. | ||
// You should only use this when depending on other mods because | ||
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically. | ||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html | ||
// for more information about repositories. | ||
} | ||
|
||
dependencies { | ||
minecraft("com.mojang:minecraft:${property("minecraft_version")}") | ||
mappings("net.fabricmc:yarn:${property("yarn_mappings")}:v2") | ||
modImplementation("net.fabricmc:fabric-loader:${property("loader_version")}") | ||
modImplementation("net.fabricmc.fabric-api:fabric-api:${property("fabric_version")}") | ||
api(project(":TNIL-Core")) | ||
} | ||
|
||
tasks { | ||
compileJava { | ||
sourceCompatibility = "21" | ||
targetCompatibility = "21" | ||
} | ||
|
||
processResources { | ||
inputs.property("version", project.version) | ||
filesMatching("fabric.mod.json") { | ||
expand(getProperties()) | ||
expand(mutableMapOf("version" to project.version)) | ||
} | ||
} | ||
|
||
shadowJar { | ||
archiveFileName = "TNIL-Fabric-${project.version}-shadow.jar" | ||
|
||
dependencies { | ||
exclude("net.fabricmc:.*") | ||
include(dependency(":TNIL-Core")) | ||
exclude("/mappings/*") | ||
} | ||
} | ||
|
||
remapJar { | ||
dependsOn(shadowJar) | ||
addNestedDependencies = true | ||
archiveFileName = "TNIL-Fabric-${project.version}.jar" | ||
} | ||
} | ||
|
||
java { | ||
//withSourcesJar() | ||
} | ||
|
||
description = "The New Item Library Fabric" |
242 changes: 242 additions & 0 deletions
242
TNIL-Fabric/src/main/java/net/tnemc/item/fabric/FabricItemStack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,242 @@ | ||
package net.tnemc.item.fabric; | ||
/* | ||
* The New Kings | ||
* Copyright (C) 2022 - 2024 Daniel "creatorfromhell" Vidmar | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import net.minecraft.item.ItemStack; | ||
import net.tnemc.item.AbstractItemStack; | ||
import net.tnemc.item.SerialItem; | ||
import net.tnemc.item.SerialItemData; | ||
import net.tnemc.item.attribute.SerialAttribute; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
import java.util.Set; | ||
|
||
/** | ||
* FabricItemStack | ||
* | ||
* @author creatorfromhell | ||
* @since 0.0.1.0 | ||
*/ | ||
public class FabricItemStack implements AbstractItemStack<ItemStack> { | ||
|
||
private boolean dirty = false; | ||
private ItemStack stack; | ||
|
||
|
||
|
||
@Override | ||
public AbstractItemStack<ItemStack> of(String material, int amount) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> of(SerialItem<ItemStack> serialItem) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> of(ItemStack locale) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> flags(List<String> flags) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> lore(List<String> lore) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> attribute(String name, SerialAttribute attribute) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> attribute(Map<String, SerialAttribute> attributes) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> enchant(String enchantment, int level) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> enchant(Map<String, Integer> enchantments) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> enchant(List<String> enchantments) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> material(String material) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> amount(int amount) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> slot(int slot) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> display(String display) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> damage(short damage) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> modelData(int modelData) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> unbreakable(boolean unbreakable) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> applyData(SerialItemData<ItemStack> data) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public List<String> flags() { | ||
return List.of(); | ||
} | ||
|
||
@Override | ||
public List<String> lore() { | ||
return List.of(); | ||
} | ||
|
||
@Override | ||
public Map<String, SerialAttribute> attributes() { | ||
return Map.of(); | ||
} | ||
|
||
@Override | ||
public Map<String, Integer> enchantments() { | ||
return Map.of(); | ||
} | ||
|
||
@Override | ||
public String material() { | ||
return ""; | ||
} | ||
|
||
@Override | ||
public int amount() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void setAmount(int amount) { | ||
|
||
} | ||
|
||
@Override | ||
public int slot() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public String display() { | ||
return ""; | ||
} | ||
|
||
@Override | ||
public short damage() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public int modelData() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public boolean unbreakable() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void markDirty() { | ||
|
||
} | ||
|
||
@Override | ||
public Optional<SerialItemData<ItemStack>> data() { | ||
return Optional.empty(); | ||
} | ||
|
||
/** | ||
* Returns true if the provided item is similar to this. An item is similar if the basic | ||
* information is the same, except for the amount. What this includes: - material - display - | ||
* modelData - flags - lore - attributes - enchantments | ||
* | ||
* What this does not include: - Item Data. | ||
* | ||
* @param compare The stack to compare. | ||
* | ||
* @return True if the two are similar, otherwise false. | ||
*/ | ||
@Override | ||
public boolean similar(AbstractItemStack<? extends ItemStack> compare) { | ||
return false; | ||
} | ||
|
||
/** | ||
* @return An instance of the implementation's locale version of AbstractItemStack. | ||
*/ | ||
@Override | ||
public ItemStack locale() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public <V> boolean listsEquals(List<V> list1, List<V> list2) { | ||
return AbstractItemStack.super.listsEquals(list1, list2); | ||
} | ||
|
||
@Override | ||
public <V> boolean setsEquals(Set<V> list1, Set<V> list2) { | ||
return AbstractItemStack.super.setsEquals(list1, list2); | ||
} | ||
|
||
@Override | ||
public AbstractItemStack<ItemStack> of(org.json.simple.JSONObject json) { | ||
return null; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...c/src/main/java/net/tnemc/TNILFabric.java → ...ava/net/tnemc/item/fabric/TNILFabric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package net.tnemc; | ||
package net.tnemc.item.fabric; | ||
|
||
import net.fabricmc.api.ModInitializer; | ||
|
||
|
Oops, something went wrong.