Added internal labels to identify 1.7 worlds for the purpose of converting to 1.8
This commit is contained in:
parent
18ac3dabe4
commit
cbc8bbe7c9
132
build.gradle
132
build.gradle
|
@ -1,7 +1,6 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven {
|
||||
name = "ForgeFS"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
|
@ -128,73 +127,72 @@ curseforge {
|
|||
|
||||
uploadArchives {
|
||||
repositories {
|
||||
add getProject().repositories.mavenLocal()
|
||||
}
|
||||
repositories.mavenDeployer {
|
||||
configuration = configurations.deployJars
|
||||
mavenDeployer {
|
||||
if (project.hasProperty('forgeMavenPassword'))
|
||||
{
|
||||
repository(url: "http://files.minecraftforge.net/maven/manage/upload") {
|
||||
authentication(userName: project.getProperty('forgeMavenUsername'), password: project.getProperty('forgeMavenPassword'))
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// local repo folder. Might wanna juset use gradle install if you wanans end it to maven-local
|
||||
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
|
||||
}
|
||||
|
||||
if (project.hasProperty("filesmaven")) {
|
||||
logger.info('Publishing to files server')
|
||||
repository(url: project.filesmaven.url) {
|
||||
authentication(userName: project.filesmaven.username, privateKey: project.filesmaven.key)
|
||||
}
|
||||
} else {
|
||||
logger.info('Publishing to repo folder')
|
||||
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
|
||||
}
|
||||
|
||||
pom {
|
||||
groupId = project.group
|
||||
version = project.version
|
||||
artifactId = project.archivesBaseName
|
||||
}
|
||||
pom.project {
|
||||
name project.archivesBaseName
|
||||
packaging 'jar'
|
||||
description 'Biomes O Plenty'
|
||||
url 'https://github.com/Glitchfiend/BiomesOPlenty'
|
||||
|
||||
scm {
|
||||
url 'https://github.com/Glitchfiend/BiomesOPlenty'
|
||||
connection 'scm:git:git://github.com/Glitchfiend/BiomesOPlenty.git'
|
||||
developerConnection 'scm:git:git@github.com:Glitchfiend/BiomesOPlenty.git'
|
||||
}
|
||||
|
||||
issueManagement {
|
||||
system 'github'
|
||||
url 'https://github.com/Glitchfiend/BiomesOPlenty/issues'
|
||||
}
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name 'Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported'
|
||||
url 'http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US'
|
||||
distribution 'repo'
|
||||
pom {
|
||||
groupId = project.group
|
||||
version = project.version
|
||||
artifactId = project.archivesBaseName
|
||||
project {
|
||||
name project.archivesBaseName
|
||||
packaging 'jar'
|
||||
description 'Biomes O Plenty'
|
||||
url 'https://github.com/Glitchfiend/BiomesOPlenty'
|
||||
|
||||
scm {
|
||||
url 'https://github.com/Glitchfiend/BiomesOPlenty'
|
||||
connection 'scm:git:git://github.com/Glitchfiend/BiomesOPlenty.git'
|
||||
developerConnection 'scm:git:git@github.com:Glitchfiend/BiomesOPlenty.git'
|
||||
}
|
||||
|
||||
issueManagement {
|
||||
system 'github'
|
||||
url 'https://github.com/Glitchfiend/BiomesOPlenty/issues'
|
||||
}
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name 'Creative Commons Attribution-NonCommercial-NoDerivs 4.0 International Public License'
|
||||
url 'http://creativecommons.org/licenses/by-nc-nd/4.0/'
|
||||
distribution 'repo'
|
||||
}
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id 'Adubbz'
|
||||
name 'Adubbz'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
developer {
|
||||
id 'Amnet'
|
||||
name 'Amnet'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
developer {
|
||||
id 'Forstride'
|
||||
name 'Forstride'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
developer {
|
||||
id 'ted80'
|
||||
name 'ted80'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id 'Adubbz'
|
||||
name 'Adubbz'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
developer {
|
||||
id 'Forstride'
|
||||
name 'Forstride'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
developer {
|
||||
id 'Amnet'
|
||||
name 'Amnet'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
developer {
|
||||
id 'ted80'
|
||||
name 'ted80'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package biomesoplenty.common.eventhandler;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import biomesoplenty.client.fog.FogHandler;
|
||||
import biomesoplenty.common.eventhandler.client.FlowerScatterEventHandler;
|
||||
import biomesoplenty.common.eventhandler.client.gui.MainMenuEventHandler;
|
||||
|
@ -9,6 +8,7 @@ import biomesoplenty.common.eventhandler.entity.DyeEventHandler;
|
|||
import biomesoplenty.common.eventhandler.entity.FlippersEventHandler;
|
||||
import biomesoplenty.common.eventhandler.entity.SlimeSpawnEventHandler;
|
||||
import biomesoplenty.common.eventhandler.entity.TemptEventHandler;
|
||||
import biomesoplenty.common.eventhandler.loading.LabelHandler;
|
||||
import biomesoplenty.common.eventhandler.misc.BonemealEventHandler;
|
||||
import biomesoplenty.common.eventhandler.misc.BucketEventHandler;
|
||||
import biomesoplenty.common.eventhandler.misc.CompatibilityWithVanillaAchievements;
|
||||
|
@ -21,6 +21,7 @@ import biomesoplenty.common.eventhandler.world.MapGenEventHandler;
|
|||
import biomesoplenty.common.eventhandler.world.VillageMaterialEventHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public class BOPEventHandlers
|
||||
{
|
||||
|
@ -44,6 +45,7 @@ public class BOPEventHandlers
|
|||
MinecraftForge.TERRAIN_GEN_BUS.register(new BiomeSizeEventHandler());
|
||||
MinecraftForge.TERRAIN_GEN_BUS.register(new VillageMaterialEventHandler());
|
||||
MinecraftForge.TERRAIN_GEN_BUS.register(new MapGenEventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new LabelHandler());
|
||||
}
|
||||
|
||||
private static void registerEntityEventHandlers()
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package biomesoplenty.common.eventhandler.loading;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.WorldSavedData;
|
||||
|
||||
public class BOPSavedData extends WorldSavedData
|
||||
{
|
||||
public static final String DATA_IDENTIFIER = "biomesoplenty";
|
||||
|
||||
public int lastLoadVersion;
|
||||
|
||||
public BOPSavedData(String identifier)
|
||||
{
|
||||
super(identifier);
|
||||
|
||||
this.lastLoadVersion = LabelHandler.CURRENT_LOAD_VERSION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
this.lastLoadVersion = nbt.getInteger("LastLoadVersion");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
nbt.setInteger("LastLoadVersion", this.lastLoadVersion);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package biomesoplenty.common.eventhandler.loading;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.storage.MapStorage;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
public class LabelHandler
|
||||
{
|
||||
/**This should be updated every time there is a world-breaking change**/
|
||||
public static final int CURRENT_LOAD_VERSION = 0;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldLoad(WorldEvent.Load event)
|
||||
{
|
||||
World world = event.world;
|
||||
MapStorage mapStorage = world.perWorldStorage;
|
||||
BOPSavedData savedData = (BOPSavedData)mapStorage.loadData(BOPSavedData.class, BOPSavedData.DATA_IDENTIFIER);
|
||||
|
||||
//If the saved data file hasn't been created before, create it
|
||||
if (savedData == null)
|
||||
{
|
||||
savedData = new BOPSavedData(BOPSavedData.DATA_IDENTIFIER);
|
||||
mapStorage.setData(BOPSavedData.DATA_IDENTIFIER, savedData);
|
||||
savedData.markDirty(); //Mark for saving
|
||||
}
|
||||
|
||||
//Update load version to match current version if it doesn't already
|
||||
if (savedData.lastLoadVersion != CURRENT_LOAD_VERSION)
|
||||
{
|
||||
savedData.lastLoadVersion = CURRENT_LOAD_VERSION;
|
||||
savedData.markDirty(); //Mark for saving
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue