Skip to content

Commit

Permalink
v.0.2 MERGE
Browse files Browse the repository at this point in the history
v.0.2-REL
  • Loading branch information
lu4arm authored Nov 24, 2022
2 parents 883a804 + 025a781 commit 8ca6c4c
Show file tree
Hide file tree
Showing 39 changed files with 144 additions and 162 deletions.
79 changes: 5 additions & 74 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,24 @@ plugins {
id 'net.minecraftforge.gradle' version '5.1.+'
}


group = 'io.github.justuswalter-helk'
version = '0.1'
version = '0.2'

java {
archivesBaseName = 'chestpresents'
toolchain.languageVersion = JavaLanguageVersion.of(17)
}

minecraft {
// The mappings can be changed at any time and must be in the following format.
// Channel: Version:
// official MCVersion Official field/method names from Mojang mapping files
// parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
//
// You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
// Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'official', version: '1.19.2'

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'


// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'

// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', 'chestpresents'

mods {
Expand All @@ -62,9 +33,7 @@ minecraft {
workingDirectory project.file('run')

property 'forge.logging.markers', 'REGISTRIES'

property 'forge.logging.console.level', 'debug'

property 'forge.enabledGameTestNamespaces', 'chestpresents'

mods {
Expand All @@ -74,16 +43,11 @@ minecraft {
}
}

// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
workingDirectory project.file('run')

property 'forge.logging.markers', 'REGISTRIES'

property 'forge.logging.console.level', 'debug'

property 'forge.enabledGameTestNamespaces', 'chestpresents'

mods {
Expand All @@ -97,10 +61,7 @@ minecraft {
workingDirectory project.file('run')

property 'forge.logging.markers', 'REGISTRIES'

property 'forge.logging.console.level', 'debug'

// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', 'chestpresents', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

mods {
Expand All @@ -112,45 +73,18 @@ minecraft {
}
}

// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
// Put repositories for dependencies here
// ForgeGradle automatically adds the Forge maven and Maven Central for you

// If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
// flatDir {
// dir 'libs'
// }
}

dependencies {
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.19.2-43.1.52'

// Real mod deobf dependency examples - these get remapped to your current mappings
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
repositories {}

// Examples using mod jars from ./libs
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
dependencies {minecraft 'net.minecraftforge:forge:1.19.2-43.1.52'}

// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}

// Example for how to get properties into the manifest for reading at runtime.
jar {
manifest {
attributes([
"Specification-Title" : "chestpresents",
"Specification-Vendor" : "JustusWalterHelk",
"Specification-Version" : "1", // We are version 1 of ourselves
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "JustusWalterHelk",
Expand All @@ -160,7 +94,4 @@ jar {
}

jar.finalizedBy('reobfJar')

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
tasks.withType(JavaCompile).configureEach {options.encoding = 'UTF-8'}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pluginManagement {
}
}

rootProject.name = 'chestpresents'
rootProject.name = 'chestpresents'
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.github.justuswalterhelk.chestpresents.blocks.PresentBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.Material;
import net.minecraftforge.registries.DeferredRegister;
Expand All @@ -12,7 +13,7 @@ public class BlockInit
{
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, Main.MODID);

public static final RegistryObject<Block> presentBlock = BLOCKS.register("present_block", () -> new PresentBlock(BlockBehaviour.Properties.of(Material.WOOD).destroyTime(2)));
public static final RegistryObject<Block> presentBlock = BLOCKS.register("present_block", () -> new PresentBlock(BlockBehaviour.Properties.of(Material.WOOD).destroyTime(2).sound(SoundType.WOOL)));


}
43 changes: 1 addition & 42 deletions src/main/java/io/github/justuswalterhelk/chestpresents/Main.java
Original file line number Diff line number Diff line change
@@ -1,54 +1,13 @@
package io.github.justuswalterhelk.chestpresents;

import com.mojang.logging.LogUtils;
import io.github.justuswalterhelk.chestpresents.blocks.PresentBlock;
import io.github.justuswalterhelk.chestpresents.blocks.PresentBlockEntity;
import io.github.justuswalterhelk.chestpresents.events.E_PlayerInteract;
import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.*;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.ChestBlockEntity;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.common.capabilities.CapabilityToken;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.level.BlockEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import net.minecraftforge.items.wrapper.InvWrapper;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import org.slf4j.Logger;

import java.util.ArrayList;
import java.util.List;


@Mod(Main.MODID)
public class Main {
public static final String MODID = "chestpresents";
Expand All @@ -64,4 +23,4 @@ public Main()
ItemInit.ITEMS.register(bus);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public static VoxelShape makeShape(){
VoxelShape shape = Shapes.empty();
shape = Shapes.join(shape, Shapes.box(0, 0, 0, 1, 1, 1), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.4375, 1, 0, 0.5625, 1.0625, 1), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.4375, 0, -0.0625, 0.5625, 1, 0), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.4375, 0, 1, 0.5625, 1, 1.0625), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.4375, 0.125, -0.0625, 0.5625, 1, 0), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.4375, 0.0625, 1, 0.5625, 1, 1.0625), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0, 1, 0.4375, 1, 1.0625, 0.5625), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(-0.0625, 0, 0.4375, 0, 1, 0.5625), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(-0.0625, 0.0625, 0.4375, 0, 1, 0.5625), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.4375, 1.0625, 0.1875, 0.5625, 1.125, 0.8125), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.4375, 1.1875, 0.1875, 0.5625, 1.25, 0.4375), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.4375, 1.125, 0.125, 0.5625, 1.1875, 0.1875), BooleanOp.OR);
Expand All @@ -58,7 +58,7 @@ public static VoxelShape makeShape(){
shape = Shapes.join(shape, Shapes.box(0.8125, 1.125, 0.4375, 0.875, 1.1875, 0.5625), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.125, 1.125, 0.4375, 0.1875, 1.1875, 0.5625), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(0.1875, 1.1875, 0.4375, 0.4375, 1.25, 0.5625), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(1, 0, 0.4375, 1.0625, 1, 0.5625), BooleanOp.OR);
shape = Shapes.join(shape, Shapes.box(1, 0.0625, 0.4375, 1.0625, 1, 0.5625), BooleanOp.OR);
return shape;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.items.ItemStackHandler;
import net.minecraftforge.items.wrapper.InvWrapper;

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ license = "MIT"
issueTrackerURL="https://github.com/Spitfox/ChestPresents/issues"
[[mods]]
modId = "chestpresents"
version = "0.1"
version = "0.2"
displayName = "Present Block"
#updateJSONURL="" auto update checker
displayURL="https://www.curseforge.com/minecraft/mc-mods/present-block"
logoFile="logo.png"
#logoFile=""
credits="Spitfox"
authors = "JustusWalterHelk, lu3arm"
displayTest="MATCH_VERSION"
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/ar_ae.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "الحالي",
"item.chestpresents.wrapping_paper": "الورقة الحالية"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/cs_cz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Dárek",
"item.chestpresents.wrapping_paper": "Přítomný Papír"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/da_dk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Til Stede",
"item.chestpresents.wrapping_paper": "Præsenter Papir"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/de_de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Geschenk",
"item.chestpresents.wrapping_paper": "Geschenk Papier"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/es_es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Presente",
"item.chestpresents.wrapping_paper": "Papel Presente"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/fi_fi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Esittää",
"item.chestpresents.wrapping_paper": "Käärepaperi"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/fr_fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Cadeau",
"item.chestpresents.wrapping_paper": "Papier Cadeau"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/in_id.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Hadiah",
"item.chestpresents.wrapping_paper": "Kertas Hadir"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/it_it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Regalo",
"item.chestpresents.wrapping_paper": "Carta Presente"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/ja_jp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "現在",
"item.chestpresents.wrapping_paper": "発表論文"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/ko_kr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "현재의",
"item.chestpresents.wrapping_paper": "발표 논문"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/ms_my.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Hadir",
"item.chestpresents.wrapping_paper": "Kertas Kerja"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/nl_nl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Cadeau",
"item.chestpresents.wrapping_paper": "Presenteer Papier"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/no_no.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Tilstede",
"item.chestpresents.wrapping_paper": "Presenter Papir"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/pl_pl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Teraźniejszość",
"item.chestpresents.wrapping_paper": "Obecny Papier"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/pt_br.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Presente",
"item.chestpresents.wrapping_paper": "Presente Papel"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/ro_ro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Prezent",
"item.chestpresents.wrapping_paper": "Prezent Hârtie"
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/chestpresents/lang/ru_ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"block.chestpresents.present_block": "Подарок",
"item.chestpresents.wrapping_paper": "Настоящая статья"
}
Loading

0 comments on commit 8ca6c4c

Please sign in to comment.