Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 1.18's lack of Chest Boats #35

Open
wants to merge 2 commits into
base: 1.18
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
}

Expand Down Expand Up @@ -80,7 +80,7 @@ publishing {

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {

// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ org.gradle.jvmargs=-Xmx4G
# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.18.2
loader_version=0.13.3
loader_version=0.14.17

# Mod Properties
mod_version = 1.2.3
mod_version = 1.2.4
maven_group = de.kxmischesdomi
archives_base_name = boatcontainer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ public void render(Boat boatEntity, float f, float g, PoseStack matrixStack, Mul

}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 1.0
*/
public class EnderChestBoatEntity extends BoatWithBlockEntity implements HasCustomInventoryScreen {
public class EnderChestBoatEntity extends BoatWithBlockEntity {

public EnderChestBoatEntity(EntityType<? extends Boat> entityType, Level world) {
super(entityType, world);
Expand All @@ -43,7 +43,6 @@ public EnderChestBoatEntity(Level world) {
super(ModEntities.ENDER_CHEST_BOAT, world);
}

@Override
public void openCustomInventoryScreen(Player player) {
openEnderchest(player);
}
Expand All @@ -59,7 +58,7 @@ private void openEnderchest(Player player) {
player.openMenu(new SimpleMenuProvider((syncId, inventory, playerx) -> {
return ChestMenu.threeRows(syncId, inventory, enderChestInventory);
}, new TranslatableComponent(this.getType().getDescriptionId())));
}
}

@Override
public ItemStack getPickResult() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @author KxmischesDomi | https://github.com/kxmischesdomi
* @since 1.0
*/
public abstract class StorageBoatEntity extends BoatWithBlockEntity implements Container, MenuProvider, HasCustomInventoryScreen {
public abstract class StorageBoatEntity extends BoatWithBlockEntity implements Container, MenuProvider {

private NonNullList<ItemStack> inventory;
private ResourceLocation lootTableId;
Expand All @@ -46,7 +46,6 @@ public StorageBoatEntity(EntityType<? extends Boat> entityType, Level world, dou
this.inventory = NonNullList.withSize(36, ItemStack.EMPTY);
}

@Override
public void openCustomInventoryScreen(Player player) {
player.openMenu(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public class ModItems {
public static CustomBoatItem[] FURNACE_BOAT = registerBoat("furnace_boat", ModEntities.FURNACE_BOAT, FurnaceBoatEntity::new);

public static void init() {
for (CustomBoatItem item : CHEST_BOAT) {
addRecipe(item, "chest_boat", new ResourceLocation("chest"));
}

for (CustomBoatItem item : ENDER_CHEST_BOAT) {
addRecipe(item, "ender_chest_boat", new ResourceLocation("ender_chest"));

Expand All @@ -60,19 +64,24 @@ private static void addRecipe(CustomBoatItem item, String name, ResourceLocation
}

public static CustomBoatItem[] registerBoat(String name, EntityType<? extends OverriddenBoatEntity> type, Function5<EntityType<? extends OverriddenBoatEntity>, Level, Double, Double, Double, ? extends OverriddenBoatEntity> instanceCreator) {
return registerBoat(name, type, instanceCreator, false);
}

public static CustomBoatItem[] registerBoat(String name, EntityType<? extends OverriddenBoatEntity> type, Function5<EntityType<? extends OverriddenBoatEntity>, Level, Double, Double, Double, ? extends OverriddenBoatEntity> instanceCreator, boolean hideItem) {

List<CustomBoatItem> list = new ArrayList<>();

for (Type value : Type.values()) {
try {
Properties settings = new Properties().stacksTo(1);
settings.tab(CreativeModeTab.TAB_TRANSPORTATION);
if (!hideItem) {
settings.tab(CreativeModeTab.TAB_TRANSPORTATION);
}

ResourceLocation originBoatLocation = new ResourceLocation(value.getName() + "_" + name);

CustomBoatItem item = register(originBoatLocation.getPath(), new CustomBoatItem(type, instanceCreator, value, settings));
list.add(item);

registerBoatDispenserBehavior(item, type, instanceCreator);
} catch (Exception exception) {
// Dont block mod loading for issues with other mods
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/boatcontainer/lang/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
"entity.boatcontainer.ender_chest_boat": "Boot mit Endertruhe",
"entity.boatcontainer.furnace_boat": "Boot mit Ofen"

}
}
4 changes: 0 additions & 4 deletions src/main/resources/boatcontainer.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
"mixins": [
"BoatEntityAccessor",
"BoatEntityMixin",
"ServerGamePacketListenerImplMixin",
"RecipeManagerMixin"
],
"client": [
"client.MultiPlayerGameModeMixin"
],
"injectors": {
"defaultRequire": 1
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "chest_boat",
"ingredients": [
{
"item": "minecraft:chest"
},
{
"item": "minecraft:acacia_boat"
}
],
"result": {
"item": "boatcontainer:acacia_chest_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "ender_chest_boat",
"ingredients": [
{
"item": "minecraft:ender_chest"
},
{
"item": "minecraft:acacia_boat"
}
],
"result": {
"item": "boatcontainer:acacia_ender_chest_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "furnace_boat",
"ingredients": [
{
"item": "minecraft:furnace"
},
{
"item": "minecraft:acacia_boat"
}
],
"result": {
"item": "boatcontainer:acacia_furnace_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "chest_boat",
"ingredients": [
{
"item": "minecraft:chest"
},
{
"item": "minecraft:birch_boat"
}
],
"result": {
"item": "boatcontainer:birch_chest_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "ender_chest_boat",
"ingredients": [
{
"item": "minecraft:ender_chest"
},
{
"item": "minecraft:birch_boat"
}
],
"result": {
"item": "boatcontainer:birch_ender_chest_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "furnace_boat",
"ingredients": [
{
"item": "minecraft:furnace"
},
{
"item": "minecraft:birch_boat"
}
],
"result": {
"item": "boatcontainer:birch_furnace_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "chest_boat",
"ingredients": [
{
"item": "minecraft:chest"
},
{
"item": "minecraft:dark_oak_boat"
}
],
"result": {
"item": "boatcontainer:dark_oak_chest_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "ender_chest_boat",
"ingredients": [
{
"item": "minecraft:ender_chest"
},
{
"item": "minecraft:dark_oak_boat"
}
],
"result": {
"item": "boatcontainer:dark_oak_ender_chest_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "furnace_boat",
"ingredients": [
{
"item": "minecraft:furnace"
},
{
"item": "minecraft:dark_oak_boat"
}
],
"result": {
"item": "boatcontainer:dark_oak_furnace_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "chest_boat",
"ingredients": [
{
"item": "minecraft:chest"
},
{
"item": "minecraft:jungle_boat"
}
],
"result": {
"item": "boatcontainer:jungle_chest_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "ender_chest_boat",
"ingredients": [
{
"item": "minecraft:ender_chest"
},
{
"item": "minecraft:jungle_boat"
}
],
"result": {
"item": "boatcontainer:jungle_ender_chest_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "furnace_boat",
"ingredients": [
{
"item": "minecraft:furnace"
},
{
"item": "minecraft:jungle_boat"
}
],
"result": {
"item": "boatcontainer:jungle_furnace_boat",
"count": 1
}
}
16 changes: 16 additions & 0 deletions src/main/resources/data/boatcontainer/recipes/oak_chest_boat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "chest_boat",
"ingredients": [
{
"item": "minecraft:chest"
},
{
"item": "minecraft:oak_boat"
}
],
"result": {
"item": "boatcontainer:oak_chest_boat",
"count": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"group": "ender_chest_boat",
"ingredients": [
{
"item": "minecraft:ender_chest"
},
{
"item": "minecraft:oak_boat"
}
],
"result": {
"item": "boatcontainer:oak_ender_chest_boat",
"count": 1
}
}
Loading