Skip to content

Commit

Permalink
Merge pull request #53 from gottsch/1.4.2
Browse files Browse the repository at this point in the history
1.4.2
  • Loading branch information
gottsch authored Jul 25, 2019
2 parents 73a7de9 + d976fa1 commit 612bf28
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 24 deletions.
5 changes: 5 additions & 0 deletions Treasure2-1.12.2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,9 @@ processResources

//artifacts {
// archives packageJavadoc
//}

//task copyTask(type: Copy) {
// from 'node_modules/.'
// into 'build/resources/main/static'
//}
2 changes: 1 addition & 1 deletion Treasure2-1.12.2/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod_name=Treasure2
package_group=someguyssoftware.treasure2
# user alpha, beta, or v (for version)
mod_version_type=v
mod_version=1.4.1
mod_version=1.4.2


mc_version=1.12.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.IWorldGenerator;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
Expand Down Expand Up @@ -85,12 +86,12 @@ public class Treasure extends AbstractMod {
// constants
public static final String MODID = "treasure2";
protected static final String NAME = "Treasure2";
protected static final String VERSION = "1.4.1";
protected static final String VERSION = "1.4.2";
public static final String UPDATE_JSON_URL = "https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/master/Treasure2-1.12.2/update.json";

private static final String VERSION_URL = "";
private static final BuildVersion MINECRAFT_VERSION = new BuildVersion(1, 12, 2);

// latest version
private static BuildVersion latestVersion;

Expand Down Expand Up @@ -217,7 +218,10 @@ public void init(FMLInitializationEvent event) {
// add the loot table managers
LOOT_TABLES = new TreasureLootTableMaster(Treasure.instance, "", "loot_tables");

TEMPLATE_MANAGER = new TreasureTemplateManager(TreasureConfig.CUSTOM_STRUCTURE_FOLDER, Minecraft.getMinecraft().getDataFixer());
TEMPLATE_MANAGER = new TreasureTemplateManager(
TreasureConfig.CUSTOM_STRUCTURE_FOLDER,
FMLCommonHandler.instance().getDataFixer());
// Minecraft.getMinecraft().getDataFixer());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;

Expand All @@ -26,23 +25,21 @@
import com.someguyssoftware.treasure2.config.TreasureConfig;
import com.someguyssoftware.treasure2.enums.Category;
import com.someguyssoftware.treasure2.enums.PitTypes;
import com.someguyssoftware.treasure2.enums.Pits;
import com.someguyssoftware.treasure2.enums.Rarity;
import com.someguyssoftware.treasure2.enums.StructureMarkers;
import com.someguyssoftware.treasure2.generator.GenUtil;
import com.someguyssoftware.treasure2.generator.marker.GravestoneMarkerGenerator;
import com.someguyssoftware.treasure2.generator.marker.RandomStructureMarkerGenerator;
import com.someguyssoftware.treasure2.generator.pit.IPitGenerator;
import com.someguyssoftware.treasure2.generator.pit.StructurePitGenerator;
import com.someguyssoftware.treasure2.item.LockItem;
import com.someguyssoftware.treasure2.item.TreasureItems;
import com.someguyssoftware.treasure2.lock.LockState;
import com.someguyssoftware.treasure2.tileentity.AbstractTreasureChestTileEntity;
import com.someguyssoftware.treasure2.world.gen.structure.IStructureInfo;
import com.someguyssoftware.treasure2.world.gen.structure.IStructureInfoProvider;
import com.someguyssoftware.treasure2.worldgen.ChestWorldGenerator;

import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

Expand Down Expand Up @@ -124,21 +121,39 @@ else if (config.isBelowGroundAllowed()) {

// 5. update the chest coords
// chestCoords = new Coords(spawnCoords);
if (pitGenerator instanceof IStructureInfoProvider) {
// TODO could extend IStructureInfoProvider for Treasure context that only records a single or main chest
List<ICoords> coordsList = (List<ICoords>)((IStructureInfoProvider)pitGenerator).getInfo().getMap().get(GenUtil.getMarkerBlock(StructureMarkers.CHEST));
chestCoords = coordsList.get(0);
Treasure.logger.debug("Using StructureInfo relative chest coords -> {}", chestCoords.toShortString());
chestCoords = chestCoords.add((((IStructureInfoProvider)pitGenerator).getInfo().getCoords()));
}
else {
chestCoords = new Coords(spawnCoords);

// TODO refactor this whole block/method
if (isGenerated) {
if (pitGenerator instanceof IStructureInfoProvider) {
// TODO could extend IStructureInfoProvider for Treasure context that only records a single or main chest
IStructureInfoProvider structureInfoProvider = (IStructureInfoProvider)pitGenerator;
IStructureInfo structureInfo = structureInfoProvider.getInfo();
if (structureInfo != null) {
List<ICoords> chestCoordsList = (List<ICoords>) structureInfo
.getMap()
.get(GenUtil.getMarkerBlock(StructureMarkers.CHEST));
if (!chestCoordsList.isEmpty()) {
chestCoords = chestCoordsList.get(0);
}
}
// List<ICoords> coordsList = (List<ICoords>)((IStructureInfoProvider)pitGenerator).getInfo().getMap().get(GenUtil.getMarkerBlock(StructureMarkers.CHEST));
// chestCoords = coordsList.get(0);
Treasure.logger.debug("Using StructureInfo relative chest coords -> {}", chestCoords.toShortString());
chestCoords = chestCoords.add((((IStructureInfoProvider)pitGenerator).getInfo().getCoords()));
}
else {
chestCoords = new Coords(spawnCoords);
}

}

}
else { return false; }

// TODO change to has chest coords ie if (chestCoords != null && chestCoords != WorldInfo.EMPTY_COORDS

// if successfully gen the pit
if (isGenerated) {
if (/*isGenerated*/chestCoords != null) {
// Treasure.logger.debug("isGenerated = TRUE");
LootTable lootTable = selectLootTable(random, chestRarity);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private void init() {
pitGens.put(PitTypes.STRUCTURE, Pits.AIR_PIT, new StructurePitGenerator(new AirPitGenerator()));

pitGens.put(PitTypes.STANDARD, Pits.LAVA_TRAP_PIT, new LavaTrapPitGenerator());
pitGens.put(PitTypes.STRUCTURE, Pits.LAVA_TRAP_PIT, new StructurePitGenerator(new LavaTrapPitGenerator()));
// NONE for STRUCTURE

pitGens.put(PitTypes.STANDARD, Pits.MOB_TRAP_PIT, new MobTrapPitGenerator());
pitGens.put(PitTypes.STRUCTURE, Pits.MOB_TRAP_PIT, new StructurePitGenerator(new MobTrapPitGenerator()));
Expand All @@ -144,7 +144,7 @@ private void init() {
pitGens.put(PitTypes.STRUCTURE, Pits.LAVA_SIDE_TRAP_PIT, new StructurePitGenerator(new LavaSideTrapPitGenerator()));

pitGens.put(PitTypes.STANDARD, Pits.BIG_BOTTOM_MOB_TRAP_PIT, new BigBottomMobTrapPitGenerator());
pitGens.put(PitTypes.STRUCTURE, Pits.BIG_BOTTOM_MOB_TRAP_PIT, new StructurePitGenerator(new BigBottomMobTrapPitGenerator()));
// NONE for STRUCTURE

// setup the structures pit generators - a subset of the pit generators map
// structurePitGenerators.put(Pits.SIMPLE_PIT, pitGenerators.get(Pits.SIMPLE_PIT));
Expand Down
2 changes: 1 addition & 1 deletion Treasure2-1.12.2/src/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"modid": "treasure2",
"name": "Treasure2!",
"description": "",
"version": "1.4.1",
"version": "1.4.2",
"mcversion": "1.12.2",
"url": "",
"updateUrl": "",
Expand Down
7 changes: 4 additions & 3 deletions Treasure2-1.12.2/update.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"homepage": "https://minecraft.curseforge.com/projects/treasure2",
"promos": {
"1.12.2-latest": "1.4.1",
"1.12.2-recommended": "1.4.1"
"1.12.2-latest": "1.4.2",
"1.12.2-recommended": "1.4.2"
},
"1.12.2": {
"0.5.0": "alpha release",
Expand All @@ -23,7 +23,8 @@
"1.3.5": "Updated to use GottschCore v1.7\nAdded Cauldron Chest (epic).\nAdded Skeleton Block.\nAdded Marker Generator.\nFixed world.isRemote() checks with GottschCore call WorldInfo.isServer/Client().\nExpose custom loot tables.\nUse of GottschCore Loot Tables system instead of Treasure2s.\nFixed so that Skeletons can be placed in Fog.\n",
"1.3.6": "Fixed Coin toss in well crash bug.\nRemoved all references to old Loot Tables setup (in ref to coin/well bug).\nFix foreign mod loot table registering.\nUpdated mocreates, sgs metals loot tables to point to right loot tables.\n",
"1.3.7": "Fixed bug where Treasure items weren't being added to chests.\n",
"1.4.1": "Add Structures add Structure files.\nUpdate MobTrapPitGenerator to use Proximity Spawners.\nFixed World Generators map - use Enum instead of String.\nRefactor Pit selection code.\n"
"1.4.1": "Add Structures add Structure files.\nUpdate MobTrapPitGenerator to use Proximity Spawners.\nFixed World Generators map - use Enum instead of String.\nRefactor Pit selection code.\n",
"1.4.2": "Fix DataFixer server-side crash.\nFixed AbstractChestGenerator crash.\nRemoved Structure Pit Generators that didnt make sense, ie. Big Bottom, Lava Trap.\nExpanded code when retrieving chest coords from pit structure.\n"

}
}
Expand Down

0 comments on commit 612bf28

Please sign in to comment.