Skip to content

Commit

Permalink
Merge pull request #102 from gottsch/1.8.0
Browse files Browse the repository at this point in the history
1.8.0
  • Loading branch information
gottsch authored Jan 12, 2020
2 parents 5f340d2 + c07f753 commit 5eb8714
Show file tree
Hide file tree
Showing 76 changed files with 1,839 additions and 550 deletions.
46 changes: 39 additions & 7 deletions Treasure2-1.12.2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ buildscript {
}

plugins {
id 'io.franzbecker.gradle-lombok' version '3.1.0'
// id 'io.franzbecker.gradle-lombok' version '3.1.0'
// must use gradle v3.0+ for this version of shadow (2.0.1). Update gradle-wrapper.properties
id "com.github.johnrengelman.shadow" version "2.0.1"
}

apply plugin: 'net.minecraftforge.gradle.forge'
Expand Down Expand Up @@ -57,7 +59,9 @@ sourceSets.main{

def gottschcore_path="../../gottsch-minecraft-GottschCore/GottschCore${mc_version}/build/libs/GottschCore-mc${mc_version}-f${forge_version}-v${gottschcore_version}.jar"
dependencies {
compile files(gottschcore_path)
compile files('../../ModCommonLibs/libs/commons-cli-1.4.jar')
//compile files(gottschcore_path)
shadow files(gottschcore_path)
}

processResources
Expand All @@ -72,17 +76,45 @@ processResources

// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}

}
}

shadowJar {
// move everything under "io.github" (which in the DelaunayTriangulator lib) to "com.someguyssoftware.dungeons2.triangulation"
relocate "org.apache.commons.cli", "com.someguyssoftware.treasure2.cli"
// Replace the default JAR
classifier ''
}

reobf {
// Reobfuscate the shadowed JAR
shadowJar {}
}

//an array containing destination paths
def destinations = ["${dest_folder}", "${dest_server_folder}"]
println destinations[0]

task deleteOldJar(type: Delete) {
delete fileTree("${dest_folder}") {
include "**/${mod_name}-*.*"

}
delete fileTree("${dest_server_folder}") {
include "**/${mod_name}-*.*"
}
}
task copyJar << {
// iterate over the array with destination paths
destinations.each { destination ->
// for every destination define new CopySpec
println destination
copy {
from jar
into destination
}
}
task copyJar(type: Copy) {
from jar
into "${dest_folder}"
}

build.dependsOn copyJar
copyJar.dependsOn deleteOldJar
5 changes: 3 additions & 2 deletions Treasure2-1.12.2/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ package_group=someguyssoftware.treasure2
# user alpha, beta, or v (for version)
mod_version_type=v

mod_version=1.7.0
mod_version=1.8.0

#versions
mc_version=1.12.2
forge_version=14.23.5.2768
mappings_version=snapshot_20171003
gottschcore_version=1.9.0
gottschcore_version=1.10.0

# paths
dest_folder=E:/Minecraft/mods/1.12.2/
dest_server_folder=F:/Minecraft Server/mods/
2 changes: 1 addition & 1 deletion Treasure2-1.12.2/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
15 changes: 12 additions & 3 deletions Treasure2-1.12.2/src/com/someguyssoftware/treasure2/Treasure.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.someguyssoftware.treasure2.command.SpawnPitCommand;
import com.someguyssoftware.treasure2.command.SpawnPitOnlyCommand;
import com.someguyssoftware.treasure2.command.SpawnPitStructureOnlyCommand;
import com.someguyssoftware.treasure2.command.SpawnRuinsCommand;
import com.someguyssoftware.treasure2.command.SpawnWellStructureCommand;
import com.someguyssoftware.treasure2.command.SpawnWitherTreeCommand;
import com.someguyssoftware.treasure2.config.TreasureConfig;
Expand All @@ -37,6 +38,7 @@
import com.someguyssoftware.treasure2.item.TreasureItems;
import com.someguyssoftware.treasure2.loot.TreasureLootTableMaster;
import com.someguyssoftware.treasure2.meta.TreasureMetaManager;
import com.someguyssoftware.treasure2.world.gen.structure.TreasureDecayManager;
import com.someguyssoftware.treasure2.world.gen.structure.TreasureTemplateManager;
import com.someguyssoftware.treasure2.worldgen.GemOreWorldGenerator;
import com.someguyssoftware.treasure2.worldgen.ITreasureWorldGenerator;
Expand Down Expand Up @@ -71,7 +73,7 @@
modid=Treasure.MODID,
name=Treasure.NAME,
version=Treasure.VERSION,
dependencies="required-after:gottschcore@[1.9.0,)",
dependencies="required-after:gottschcore@[1.10.0,)",
acceptedMinecraftVersions = "[1.12.2]",
updateJSON = Treasure.UPDATE_JSON_URL
)
Expand All @@ -80,14 +82,16 @@
"Treasure2 was first developed by Mark Gottschling on Jan 2018.",
"Credits to Mason Gottschling for ideas and debugging.",
"Credits to CuddleBeak for some Keys and Locks textures.",
"Credits to mn_ti for Chinese and to DarkKnightComes for Polish translation."
"Credits to mn_ti for Chinese and to DarkKnightComes for Polish translation.",
"Credits to Mythical Sausage for tutorials on house/tower designs.",
"Credits to OdinsRagnarok for Spanish translation and DarvinSlav for Russian translation."
})
public class Treasure extends AbstractMod {

// constants
public static final String MODID = "treasure2";
protected static final String NAME = "Treasure2";
protected static final String VERSION = "1.7.0";
protected static final String VERSION = "1.8.0";

public static final String UPDATE_JSON_URL = "https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/master/Treasure2-1.12.2/update.json";

Expand Down Expand Up @@ -127,6 +131,8 @@ public ItemStack getTabIconItem() {
// meta manager // NOTE can't be final as Treasure.instance is required.
public static TreasureMetaManager META_MANAGER;

public static TreasureDecayManager DECAY_MANAGER;

/**
*
*/
Expand Down Expand Up @@ -185,6 +191,7 @@ public void serverStarted(FMLServerStartingEvent event) {
event.registerServerCommand(new SpawnPitStructureOnlyCommand());
event.registerServerCommand(new SpawnWellStructureCommand());
event.registerServerCommand(new SpawnWitherTreeCommand());
event.registerServerCommand(new SpawnRuinsCommand());
}

/**
Expand Down Expand Up @@ -219,6 +226,8 @@ public void init(FMLInitializationEvent event) {
FMLCommonHandler.instance().getDataFixer());

META_MANAGER = new TreasureMetaManager(Treasure.instance, "meta");

DECAY_MANAGER = new TreasureDecayManager(Treasure.instance, "decay");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import com.someguyssoftware.gottschcore.block.AbstractModContainerBlock;
import com.someguyssoftware.gottschcore.enums.Rotate;
import com.someguyssoftware.gottschcore.positional.ICoords;
import com.someguyssoftware.treasure2.Treasure;
import com.someguyssoftware.treasure2.chest.ILockSlot;
import com.someguyssoftware.treasure2.chest.TreasureChestType;
Expand All @@ -22,7 +21,6 @@
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,18 @@

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.world.World;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.someguyssoftware.gottschcore.block.ModBlock;
import com.someguyssoftware.treasure2.Treasure;

import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;

/**
* @author Mark Gottschling on Sep 19, 2014
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ else if (((FogBlock)state.getBlock()).getFogHeight() == FogHeight.LOW_FOG) {
*/
private void checkFallable(World worldIn, BlockPos pos) {
if ((worldIn.isAirBlock(pos.down()) || canFallThrough(worldIn.getBlockState(pos.down()))) && pos.getY() >= 0) {
int i = 32;
final int RADIUS = 32;

if (worldIn.isAreaLoaded(pos.add(-32, -32, -32), pos.add(32, 32, 32))) {
if (worldIn.isAreaLoaded(pos.add(-RADIUS, -RADIUS, -RADIUS), pos.add(RADIUS, RADIUS, RADIUS))) {
if (WorldInfo.isServerSide(worldIn)) {
EntityFallingBlock entityfallingblock = new EntityFallingBlock(worldIn, (double) pos.getX() + 0.5D,
(double) pos.getY(), (double) pos.getZ() + 0.5D, worldIn.getBlockState(pos).withProperty(CHECK_DECAY,(Boolean)true).withProperty(ACTIVATED, (Boolean)false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import java.util.Random;

import com.someguyssoftware.gottschcore.enums.Direction;
import com.someguyssoftware.gottschcore.world.WorldInfo;
import com.someguyssoftware.treasure2.Treasure;
import com.someguyssoftware.treasure2.chest.TreasureChestType;
Expand All @@ -24,7 +23,6 @@
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,22 @@

import java.util.Random;

import net.minecraft.block.Block;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.someguyssoftware.gottschcore.block.ModBlock;
import com.someguyssoftware.treasure2.Treasure;

import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.someguyssoftware.gottschcore.block.ModBlock;
import com.someguyssoftware.treasure2.Treasure;

/**
*
* @author Mark Gottschling on Dec 4, 2018
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
import java.util.Random;

import com.someguyssoftware.gottschcore.positional.Coords;
import com.someguyssoftware.gottschcore.positional.ICoords;
import com.someguyssoftware.treasure2.Treasure;
import com.someguyssoftware.treasure2.config.IChestConfig;
import com.someguyssoftware.treasure2.config.TreasureConfig;
import com.someguyssoftware.treasure2.enums.Rarity;
import com.someguyssoftware.treasure2.enums.WorldGenerators;
import com.someguyssoftware.treasure2.generator.chest.IChestGenerator;
Expand Down Expand Up @@ -65,7 +68,7 @@ public void execute(MinecraftServer server, ICommandSender commandSender, String
// chestGen.getGenerators().get(rarity).generate(world, random, new Coords(x, y, z), rarity, Configs.chestConfigs.get(rarity));
SurfaceChestWorldGenerator chestGens = (SurfaceChestWorldGenerator) Treasure.WORLD_GENERATORS.get(WorldGenerators.SURFACE_CHEST);
IChestGenerator gen = chestGens.getChestGenMap().get(rarity).next();
gen.generate(world, random, new Coords(x, y, z), rarity, null);
SurfaceChestWorldGenerator.generatePit(world, random, rarity, new Coords(x, y, z), TreasureConfig.CHESTS.surfaceChests.configMap.get(rarity));
}
}
catch(Exception e) {
Expand Down
Loading

0 comments on commit 5eb8714

Please sign in to comment.