Skip to content

Commit

Permalink
Update readme, Update to latest forge.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbegt committed Feb 19, 2019
1 parent f5e8eb5 commit 973ae4b
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 65 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
ironchest
=========
Iron Chests [![Curseforge](http://cf.way2muchnoise.eu/full_iron-chests_downloads.svg)](https://minecraft.curseforge.com/projects/iron-chests) [![Curseforge](http://cf.way2muchnoise.eu/versions/For%20MC_iron-chests_all.svg)](https://minecraft.curseforge.com/projects/iron-chests)
===========

Iron Chest minecraft mod
Iron Chests! A mod that adds new chests.

a GPL v3 licensed mod by cpw
Please note that the Shulker Boxes in 1.13 have been moved to their own mod:
Github: [Iron Shulker Boxes](https://github.com/progwml6/ironshulkerboxes)
CurseForge: [Iron Shulker Boxes](https://github.com/progwml6/ironshulkerboxes)

Currently Maintained by ProgWML6
For issues with the Shulker Boxes starting in 1.13, Please report them to [Iron Shulker Boxes](https://github.com/progwml6/ironshulkerboxes)

See http://files.minecraftforge.net/IronChests2/ for downloads
## Setting up a Workspace/Compiling from Source
Note: Git MUST be installed and in the system path to use our scripts.
* Setup: Run [gradle]in the repository root: `gradlew[.bat] [eclipse] OR import build.gradle into idea`
* Build: Run [gradle]in the repository root: `gradlew[.bat] build`
* If obscure Gradle issues are found try running `gradlew clean` and `gradlew cleanCache`

[![Discord](https://img.shields.io/discord/102860784329052160.svg?style=for-the-badge)](https://discord.gg/njGrvuh)

If you have queries about any license or the other restrictions, please drop by our IRC channel, #progsmods on irc.esper.net
61 changes: 39 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,36 @@ minecraft {
mappings channel: 'snapshot', version: mappings_version

runs {
client = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'debug'
workingDirectory project.file('run').canonicalPath
source sourceSets.main
client {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'

mods {
ironchest {
source sourceSets.main
}
}
}
server = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'debug'
workingDirectory project.file('run').canonicalPath
source sourceSets.main

server {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'

mods {
ironchest {
source sourceSets.main
}
}
}
}
}
Expand Down Expand Up @@ -77,7 +92,7 @@ processResources {
from(sourceSets.main.resources.srcDirs) {
include 'META-INF/mods.toml'

expand 'version': project.version, 'mcversion': minecraft_version
expand 'version': project.version, 'mcversion': minecraft_version, 'forge_version': forge_version_toml
}

from(sourceSets.main.resources.srcDirs) {
Expand All @@ -96,13 +111,15 @@ artifacts {

jar {
manifest {
attributes(["Specification-Title": "Iron Chests",
"Specification-Vendor": "Progwml6",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"Progwml6",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
attributes([
"Specification-Title" : "Iron Chests",
"Specification-Vendor" : "Progwml6",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "Progwml6",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}

Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ minecraft_version=1.13.2
minecraft_version_toml=13

# Forge Version Information
forge_version=25.0.23
forge_version=25.0.34
forge_version_toml=25
forge_group=net.minecraftforge

# Mappings Information
mappings_version=20190215-1.13.1
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ public class TileEntityIronChestItemRenderer extends TileEntityItemStackRenderer

private static final TileEntityDirtChest DIRT_CHEST = new TileEntityDirtChest();

private static final TileEntityIronChest[] CHESTS = { IRON_CHEST, GOLD_CHEST, DIAMOND_CHEST, COPPER_CHEST, SILVER_CHEST, CRYSTAL_CHEST, OBSIDIAN_CHEST,
DIRT_CHEST };
private static final TileEntityIronChest[] CHESTS = { IRON_CHEST, GOLD_CHEST, DIAMOND_CHEST, COPPER_CHEST, SILVER_CHEST, CRYSTAL_CHEST, OBSIDIAN_CHEST, DIRT_CHEST };

public static TileEntityIronChestItemRenderer instance = new TileEntityIronChestItemRenderer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public void render(T tileEntityIn, double x, double y, double z, float partialTi
GlStateManager.scalef(1.0F, -1.0F, -1.0F);

float f = iBlockState.get(BlockChest.FACING).getHorizontalAngle();

if (Math.abs(f) > 1.0E-5D)
{
GlStateManager.translatef(0.5F, 0.5F, 0.5F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
package com.progwml6.ironchest.common.blocks;

import com.progwml6.ironchest.common.tileentity.TileEntityIronChest;
import io.netty.buffer.Unpooled;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.state.BlockFaceShape;
Expand All @@ -27,7 +26,6 @@
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer;
Expand Down Expand Up @@ -143,10 +141,8 @@ public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos,
if (player instanceof EntityPlayerMP && !(player instanceof FakePlayer))
{
EntityPlayerMP entityPlayerMP = (EntityPlayerMP) player;
PacketBuffer buffer = new PacketBuffer(Unpooled.buffer());
buffer.writeBlockPos(pos);

NetworkHooks.openGui(entityPlayerMP, ilockablecontainer, buffer);
NetworkHooks.openGui(entityPlayerMP, ilockablecontainer, buf -> buf.writeBlockPos(pos));
}

player.addStat(StatList.OPEN_CHEST);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
import com.progwml6.ironchest.common.network.packets.PacketTopStackSyncChest;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fml.network.NetworkDirection;
import net.minecraftforge.fml.network.NetworkRegistry;
import net.minecraftforge.fml.network.PacketDistributor;
import net.minecraftforge.fml.network.simple.SimpleChannel;

public final class PacketHandler
Expand All @@ -33,15 +37,11 @@ public static void register()
{
int disc = 0;

HANDLER.registerMessage(disc++, PacketTopStackSyncChest.class, PacketTopStackSyncChest::encode, PacketTopStackSyncChest::decode,
PacketTopStackSyncChest.Handler::handle);
HANDLER.registerMessage(disc++, PacketTopStackSyncChest.class, PacketTopStackSyncChest::encode, PacketTopStackSyncChest::decode, PacketTopStackSyncChest.Handler::handle);
}

public static void sendTo(Object msg, EntityPlayerMP player)
public static <MSG> void send(PacketDistributor.PacketTarget target, MSG message)
{
if (!(player instanceof FakePlayer))
{
HANDLER.sendTo(msg, player.connection.netManager, NetworkDirection.PLAY_TO_CLIENT);
}
HANDLER.send(target, message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
import com.progwml6.ironchest.common.network.packets.PacketTopStackSyncChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.server.ServerLifecycleHooks;
import net.minecraftforge.fml.network.PacketDistributor;

import java.util.Collections;

Expand Down Expand Up @@ -220,20 +219,7 @@ protected void sendTopStacksPacket()
{
NonNullList<ItemStack> stacks = this.buildItemStackDataList();

for (EntityPlayerMP player : ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayers())
{
if (player.dimension == world.getDimension().getType())
{
double d4 = getPos().getX() - player.posX;
double d5 = getPos().getY() - player.posY;
double d6 = getPos().getZ() - player.posZ;

if (d4 * d4 + d5 * d5 + d6 * d6 < 16384)
{
PacketHandler.sendTo(new PacketTopStackSyncChest(this.getWorld().getDimension().getType().getId(), this.getPos(), stacks), player);
}
}
}
PacketHandler.send(PacketDistributor.TRACKING_CHUNK.with(() -> this.getWorld().getChunk(this.getPos())), new PacketTopStackSyncChest(this.getWorld().getDimension().getType().getId(), this.getPos(), stacks));
}

public void receiveMessageFromServer(NonNullList<ItemStack> topStacks)
Expand Down
7 changes: 3 additions & 4 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
modLoader="javafml"
loaderVersion="[24,)"

issueTrackerURL="https://github.com/progwml6/ironchest/issues"

[[mods]]
modId="ironchest"
namespace="ironchest"
version="${version}"
displayName="Iron Chests"
authors="cpw, alexbegt, progwml6"
description='''
New chests with larger sizes, with in-place upgrade items.
The feature chest is the crystal chest, which is transparent - some inventory contents are visible without opening the chest
'''
namespace="ironchest"
issueTrackerURL="https://github.com/progwml6/ironchest/issues"
displayURL="https://minecraft.curseforge.com/projects/iron-chests"
[[dependencies.ironchest]]
modId="forge"
mandatory=true
versionRange="[24,)"
versionRange="[${forge_version},)"
ordering="NONE"
side="BOTH"
Binary file removed src/main/resources/itemsheet.xcf
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"description": "ironchests resources",
"description": "Iron Chests Resources",
"pack_format": 4,
"_comment": "A pack_format of 4 requires json lang files. Note: we require v4 pack meta for all mods."
}
Expand Down
Binary file removed src/main/resources/texturesheet.xcf
Binary file not shown.

0 comments on commit 973ae4b

Please sign in to comment.