Skip to content

Commit

Permalink
Merge pull request #76 from gottsch/1.5.0
Browse files Browse the repository at this point in the history
1.5.0
  • Loading branch information
gottsch authored Aug 19, 2019
2 parents d3194f5 + 7217189 commit 7461288
Show file tree
Hide file tree
Showing 115 changed files with 2,814 additions and 2,062 deletions.
48 changes: 6 additions & 42 deletions Treasure2-1.12.2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,10 @@ sourceSets.main{
}
}

//dependencies {
// compile files("../../gottsch-minecraft-GottschCore/GottschCore1.12.2/build/libs/GottschCore-mc1.12.2-f${forge_version}-v1.2.0.jar")
//}

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('../../ModCommonLibs/libs/h2-1.4.187.jar')
// compile files('../../ModCommonLibs/libs/ormlite-core-5.0.jar')
// compile files('../../ModCommonLibs/libs/ormlite-jdbc-5.0.jar')
compile files(gottschcore_path)
}

jar {
// for PROD only
//from (zipTree('../../ModCommonLibs/libs/h2-1.4.187.jar')) {
// exclude 'META-INF/**'
//}
//from (zipTree('../../ModCommonLibs/libs/ormlite-core-5.0.jar')) {
// exclude 'META-INF/**'
//}
//from (zipTree('../../ModCommonLibs/libs/ormlite-jdbc-5.0.jar')) {
// exclude 'META-INF/**'
//}
}

processResources
{
Expand All @@ -89,27 +69,11 @@ processResources
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}

// copy everything else, thats not the mcmod.info
// from(sourceSets.main.resources.srcDirs) {
// include '**/*.sql'
// }

// from(sourceSets.main.java.srcDirs) {
// include '**/*.sql'
// }

}

//task packageJavadoc(type: Jar, dependsOn: 'javadoc') {
// from javadoc.destinationDir
// classifier = 'javadoc'
//}

//artifacts {
// archives packageJavadoc
//}

//task copyTask(type: Copy) {
// from 'node_modules/.'
// into 'build/resources/main/static'
//}
task copyJar(type: Copy) {
from jar
into "${dest_folder}"
}
build.dependsOn copyJar
8 changes: 5 additions & 3 deletions Treasure2-1.12.2/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ mod_name=Treasure2
package_group=someguyssoftware.treasure2
# user alpha, beta, or v (for version)
mod_version_type=v
mod_version=1.4.3

mod_version=1.5.0

#versions
mc_version=1.12.2
forge_version=14.23.5.2768
mappings_version=snapshot_20171003
gottschcore_version=1.8.0

gottschcore_version=1.7.0
# paths
dest_folder=E:/Minecraft/mods/1.12.2/
21 changes: 14 additions & 7 deletions Treasure2-1.12.2/src/com/someguyssoftware/treasure2/Treasure.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.someguyssoftware.treasure2.item.PaintingItem;
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.TreasureTemplateManager;
import com.someguyssoftware.treasure2.worldgen.ChestWorldGenerator;
import com.someguyssoftware.treasure2.worldgen.GemOreWorldGenerator;
Expand Down Expand Up @@ -71,7 +72,7 @@
modid=Treasure.MODID,
name=Treasure.NAME,
version=Treasure.VERSION,
dependencies="required-after:gottschcore@[1.7.0,)",
dependencies="required-after:gottschcore@[1.8.0,)",
acceptedMinecraftVersions = "[1.12.2]",
updateJSON = Treasure.UPDATE_JSON_URL
)
Expand All @@ -86,7 +87,7 @@ 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.3";
protected static final String VERSION = "1.5.0";
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 = "";
Expand Down Expand Up @@ -122,6 +123,9 @@ public ItemStack getTabIconItem() {
// template manager
public static TreasureTemplateManager TEMPLATE_MANAGER;

// meta manager // NOTE can't be final as Treasure.instance is required.
public static TreasureMetaManager META_MANAGER;

/**
*
*/
Expand All @@ -146,13 +150,13 @@ public void preInt(FMLPreInitializationEvent event) {
Configs.init(this, event.getModConfigurationDirectory());

// configure logging
addRollingFileAppenderToLogger(Treasure.NAME, Treasure.NAME + "Appender", (ILoggerConfig) getConfig());
// addRollingFileAppenderToLogger(Treasure.NAME, Treasure.NAME + "Appender", (ILoggerConfig) getConfig());
// create a rolling file appender
// Appender appender = createRollingFileAppender(Treasure.NAME + "Appender", (ILoggerConfig) getConfig());
Appender appender = createRollingFileAppender(Treasure.NAME + "Appender", (ILoggerConfig) getConfig());
// add appender to mod logger
// addAppenderToLogger(appender, Treasure.NAME, (ILoggerConfig) getConfig());
addAppenderToLogger(appender, Treasure.NAME, (ILoggerConfig) getConfig());
// add appender to the GottschCore logger
// addAppenderToLogger(appender, GottschCore.instance.getName(), (ILoggerConfig) getConfig());
addAppenderToLogger(appender, GottschCore.instance.getName(), (ILoggerConfig) getConfig());

// register the GUI handler
NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
Expand Down Expand Up @@ -219,10 +223,13 @@ public void init(FMLInitializationEvent event) {
LOOT_TABLES = new TreasureLootTableMaster(Treasure.instance, "", "loot_tables");

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

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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public abstract class AbstractPaintingBlock extends CardinalDirectionFacadeBlock
*/
public AbstractPaintingBlock(String modID, String name, Material material) {
super(modID, name, material);
setSoundType(SoundType.WOOD); // TODO find vanilla painting code
setSoundType(SoundType.WOOD);
setCreativeTab(Treasure.TREASURE_TAB);
setHardness(0.1F);
setBoundingBox(new AxisAlignedBB(0F, 0F, 0F, 1F, 1F, 1F), // N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,24 +274,6 @@ private void checkFallable(World worldIn, BlockPos pos) {
}
}

/**
*
*/
// @Deprecated
public void onEndFalling(World worldIn, BlockPos pos, IBlockState blockState1, IBlockState blockState2) {
// Treasure.logger.debug("Block has stopped falling");
// Treasure.logger.debug("pos: {}", pos.toString());
// Treasure.logger.debug("blockstate #1: {}, CD: {}, D:{}", blockState1.getBlock().toString(), blockState1.getValue(CHECK_DECAY), blockState1.getValue(DECAYABLE));
// Treasure.logger.debug("blockstate #2: {}", blockState2.getBlock().toString());
//
// // TODO figure out why or how to stop updateTick from being called, then can reenable inheritance from FallingBlock
// Treasure.logger.debug("Why does this immediately call updateTick() on block which then changes the block");
// IBlockState newState = blockState1.getBlock().getDefaultState().withProperty(CHECK_DECAY, true);
// worldIn.setBlockState(pos, newState);

// NOTE I think the new block keeps the previous state, so it is already activated and when it is created again
// it calls update right away and thus changes size... so, need on BeforeFalling to set the set ACTIVATED = false
}

/**
*
Expand Down Expand Up @@ -393,20 +375,6 @@ protected boolean canSilkHarvest() {
*/
@Override
public IBlockState getStateFromMeta(int meta) {
// boolean decay = false;
// boolean check = false;
// boolean activated = false;
//
// // TODO change to check the individual bits
// if (meta == 1) decay = true;
// else if (meta == 2) check = true;
// else if (meta ==3) { decay = check = true;}
// else if (meta ==4) { activated = true;}
// // TODO add a check for the last bit to see if it is activated. the last bit isn't translated to a state--> need another method
// return this.getDefaultState()
// .withProperty(DECAYABLE, Boolean.valueOf(decay))
// .withProperty(CHECK_DECAY, Boolean.valueOf(check));

return this.getDefaultState()
.withProperty(DECAYABLE, Boolean.valueOf((meta&1)>0))
.withProperty(CHECK_DECAY, Boolean.valueOf((meta&2)>0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ public class TreasureBlocks {
// MIMIC CHESTS
public static final Block WOOD_MIMIC;

// TODO chests
// unimplemented chests
public static final Block VASE = null;
public static final Block INVISIBLE_CHEST = null;

public static final Block WHALE_BONE_PIRATE_CHEST = null;

// chest holder
public static Multimap<Rarity, Block> chests;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,13 @@ public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, Enti
}

// read in nbt
// Treasure.logger.debug("Checking if item has stack compound.");
if (stack.hasTagCompound()) {
// Treasure.logger.debug("Stack has compound!");

tcte.readFromItemStackNBT(stack.getTagCompound());
forceUpdate = true;

// get the old tcte facing direction
oldPersistedChestDirection = Direction.fromFacing(EnumFacing.getFront(tcte.getFacing()));
// Treasure.logger.debug("old chest facing (int) -> {}", tcte.getFacing());
// Treasure.logger.debug("old chest facing enum -> {}", EnumFacing.getFront(tcte.getFacing()));
// Treasure.logger.debug("old chest direction -> {}", oldPersistedChestDirection);


// dump stack NBT
if (Treasure.logger.isDebugEnabled()) {
Expand All @@ -261,78 +256,24 @@ public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, Enti

// get the direction the block is facing.
Direction direction = Direction.fromFacing(placer.getHorizontalFacing().getOpposite());
// Treasure.logger.debug("new chest direction -> {}", direction);

// Treasure.logger.debug("required rotation -> {}", oldPersistedChestDirection.getRotation(direction));
// Treasure.logger.debug("should update prior to rotate -> {}", shouldUpdate);
// rotate the lock states
shouldUpdate = rotateLockStates(worldIn, pos, oldPersistedChestDirection.getRotation(direction)); // old -> Direction.NORTH //

// Treasure.logger.debug("should update after rotate -> {}", shouldUpdate);


// Treasure.logger.debug("New lock states ->");
// for (LockState ls : tcte.getLockStates()) {
// Treasure.logger.debug(ls);
// }

// update the TCTE facing
tcte.setFacing(placer.getHorizontalFacing().getOpposite().getIndex());
// Treasure.logger.debug("updated tcte facing -> {}", tcte.getFacing());
}
if ((forceUpdate || shouldUpdate) && tcte != null) {
// update the client
tcte.sendUpdates();
}

// if (tcte != null && tcte.getLockStates() != null) {
// Treasure.logger.debug("Is TE.lockStates empty? " + tcte.getLockStates().isEmpty());
// }
}

// /**
// *
// * @param world
// * @param pos
// * @param rotate
// * @return
// */
// public boolean rotateLockStates(World world, BlockPos pos, Rotate rotate) {
// boolean hasRotated = false;
// boolean shouldRotate = false;
// if (rotate != Rotate.NO_ROTATE) shouldRotate = true;
// Treasure.logger.debug("Rotate to:" + rotate);
//
// AbstractTreasureChestTileEntity tcte = null;
// TileEntity te = world.getTileEntity(pos);
// if (te != null && te instanceof AbstractTreasureChestTileEntity) {
// // get the backing tile entity
// tcte = (AbstractTreasureChestTileEntity) te;
// }
// else {
// return false;
// }
//
// try {
// for (LockState lockState : tcte.getLockStates()) {
// if (lockState != null && lockState.getSlot() != null) {
//// Treasure.logger.debug("Original lock state:" + lockState);
// // if a rotation is needed
// if (shouldRotate) {
// ILockSlot newSlot = lockState.getSlot().rotate(rotate);
//// Treasure.logger.debug("New slot position:" + newSlot);
// lockState.setSlot(newSlot);
// // set the flag to indicate the lockStates have rotated
// hasRotated = true;
// }
// }
// }
// }
// catch(Exception e) {
// Treasure.logger.error("Error updating lock states: ", e);
// }
// return hasRotated;
// }

/**
*
*/
Expand All @@ -341,16 +282,11 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state,
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {

AbstractTreasureChestTileEntity te = (AbstractTreasureChestTileEntity) worldIn.getTileEntity(pos);

// TODO dump TE


// exit if on the client
if (WorldInfo.isClientSide(worldIn)) {
return true;
}
else {
// TODO message
}

boolean isLocked = false;
// determine if chest is locked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import net.minecraft.world.World;

/**
* TODO this block is not necessary unless we can get the colliding working here
* NOTE this block is not necessary
* @author Mark Gottschling on Apr 18, 2018
*
*/
Expand All @@ -31,35 +31,4 @@ public class WitherFogBlock extends FogBlock {
public WitherFogBlock(String modID, String name, Material material, Map<FogHeight, FogBlock> map) {
super(modID, name, material, map);
}

/**
* TODO this never happens because there isn't a collision box
*/
@Override
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
// TODO inflict player with wither
if (WorldInfo.isClientSide(worldIn)) {
return;
}

// EntityPlayer player = null;

// set the proximity to wither tree for activation
// double activatingProximity = 10.0D;

// for (int i = 0; i < worldIn.playerEntities.size(); ++i) {
// player = (EntityPlayer)worldIn.playerEntities.get(i);
// get the distance
// double distance = player.getDistanceSq(pos.add(0.5D, 0.5D, 0.5D));

// if player is within range of activating the wither tree
// if ((distance < 0.0D || distance < activatingProximity * activatingProximity)) {

// TODO if mob has not spawned, then spawn it -- that is for the wither spawner log/heart block

// }

// }

}
}
Loading

0 comments on commit 7461288

Please sign in to comment.