Skip to content

Commit

Permalink
Updated to cover MC from 1.9 to 1.10.2 and Forge >= 1887
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueAnanas committed Jul 23, 2016
1 parent f62d543 commit d377866
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 21 deletions.
20 changes: 15 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'com.matthewprenger:CurseGradle:1.0-SNAPSHOT'
}
}
Expand All @@ -24,17 +24,25 @@ compileJava.options.encoding = 'UTF-8'

group = project.group_name
version = project.mod_version
archivesBaseName = "[${project.minecraft_version}]${project.mod_id}"
archivesBaseName = "${project.mod_id}_mc${project.minecraft_version}-${project.minecraft_maxversion}_v"

minecraft {
version = project.minecraft_version + '-' + project.forge_version + "-" + project.minecraft_version // grab latest forge
version = project.minecraft_version + '-' + project.forge_version // + "-" + project.minecraft_version // grab latest forge
mappings = project.mappings_version
runDir = 'run'
replace '@MOD_VERSION@', project.mod_version
replace '@MINECRAFT_VERSION@', project.minecraft_version
replace '@MIN_MC_VERSION@', project.minecraft_version
replace '@MAX_MC_VERSION@', project.minecraft_maxversion
}

processResources {
// force replacements if input changes
inputs.property 'mod_version', version
inputs.property 'forge_version', project.forge_version
inputs.property 'forge_versionlimit', project.forge_versionlimit
inputs.property 'minecraft_version', project.minecraft_version
inputs.property 'minecraft_maxversion', project.minecraft_maxversion

// replace stuff in the files we want.
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
Expand All @@ -44,11 +52,13 @@ processResources {
expand ([
'mod_version': project.mod_version,
'forge_version': project.forge_version,
'forge_versionlimit': project.forge_versionlimit,
'minecraft_version': project.minecraft_version,
'minecraft_maxversion': project.minecraft_maxversion
])
}

// copy everything else that we didnt do before
// copy everything else that we didn't do before
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
exclude '**/*.properties'
Expand Down
11 changes: 5 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
minecraft_version=1.9
forge_version=12.16.0.1782
mappings_version=snapshot_20160320
mod_version=7.1
minecraft_maxversion=1.10.2
forge_version=12.16.1.1887
forge_versionlimit=12.18.2
mappings_version=stable_24
mod_version=7.1.1
mod_id=bspkrsCore
group_name=bspkrscore
appendix=universal

# extra_curse_id=-1
# extra_curse_releasetype=release
7 changes: 5 additions & 2 deletions src/main/java/bspkrs/bspkrscore/fml/bspkrsCoreMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
import bspkrs.util.Const;
import bspkrs.util.UniqueNameListGenerator;

@Mod(modid = Reference.MODID, name = Reference.NAME, version = "@MOD_VERSION@", useMetadata = true, guiFactory = Reference.GUI_FACTORY, updateJSON = Const.VERSION_URL_BASE + Reference.MODID + Const.VERSION_URL_EXT)
@Mod(modid = Reference.MODID, name = Reference.NAME, version = "@MOD_VERSION@",
useMetadata = true, guiFactory = Reference.GUI_FACTORY,
updateJSON = Const.VERSION_URL_BASE + Reference.MODID + Const.VERSION_URL_EXT,
acceptedMinecraftVersions = "[@MIN_MC_VERSION@,@MAX_MC_VERSION@]")
public class bspkrsCoreMod
{
// config stuff
Expand Down Expand Up @@ -117,7 +120,7 @@ public void serverStarting(FMLServerStartingEvent event)
@SubscribeEvent
public void onConfigChanged(OnConfigChangedEvent event)
{
if (event.modID.equals(Reference.MODID))
if (event.getModID().equals(Reference.MODID))
{
Reference.config.save();
syncConfig();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/bspkrs/client/util/EntityUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public static EntityLivingBase getRandomLivingEntity(World world,
{
Random random = new Random();
// Get a COPY dumbass!
Set entities = new TreeSet(EntityList.stringToClassMapping.keySet());
Set entities = new TreeSet(EntityList.NAME_TO_CLASS.keySet());

if (blacklist != null)
entities.removeAll(blacklist);
Expand All @@ -230,7 +230,7 @@ public static EntityLivingBase getRandomLivingEntity(World world,
do
{
id = random.nextInt(entStrings.length);
clazz = (Class) EntityList.stringToClassMapping.get(entStrings[id]);
clazz = (Class) EntityList.NAME_TO_CLASS.get(entStrings[id]);
}
while (!EntityLivingBase.class.isAssignableFrom(clazz)
&& (++tries <= numberOfAttempts));
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/bspkrs/client/util/HUDUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ public static void renderItemOverlayIntoGUI(FontRenderer fontRenderer, ItemStack

if (itemStack.getMaxStackSize() > 1)
count = HUDUtils.countInInventory(Minecraft.getMinecraft().thePlayer, itemStack.getItem(), itemStack.getItemDamage());
else if (itemStack.getItem().equals(Items.bow))
count = HUDUtils.countInInventory(Minecraft.getMinecraft().thePlayer, Items.arrow);
else if (itemStack.getItem().equals(Items.BOW))
count = HUDUtils.countInInventory(Minecraft.getMinecraft().thePlayer, Items.ARROW);

if (count > 1)
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bspkrs/util/CommonUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public static int parseInt(String string, int defaultValue)
public void playAtPitch(int i, World world, EntityPlayer entityplayer)
{
float f = (float) Math.pow(2D, (i - 12) / 12D);
world.playSound(entityplayer, entityplayer.getPosition(), SoundEvents.block_note_pling, SoundCategory.getByName("block"), 0.5F, f);
world.playSound(entityplayer, entityplayer.getPosition(), SoundEvents.BLOCK_NOTE_PLING, SoundCategory.getByName("block"), 0.5F, f);
}

public static boolean moveBlock(World world, BlockPos src, BlockPos tgt, boolean allowBlockReplacement)
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"name": "bspkrsCore",
"description": "Shared classes used in the mods maintained by bspkrs.",
"version": "${mod_version}",
"mcversion": "${minecraft_version}",
"mcversion": "${minecraft_maxversion}",
"url": "http://www.minecraftforum.net/topic/1114612-/",
"updateUrl": "",
"authorList": [ "DaftPVF", "bspkrs" ],
"credits": "Much of this code was originally part of DaftPVF's mods that I maintain.",
"logoFile": "",
"screenshots": [],
"parent": "",
"requiredMods": ["Forge@[${forge_version},)"],
"dependencies": ["Forge@[${forge_version},)"],
"requiredMods": ["Forge@[${forge_version},${forge_versionlimit})"],
"dependencies": ["Forge@[${forge_version},${forge_versionlimit})"],
"dependants": [],
"useDependencyInformation": "true"
}]
Expand Down

0 comments on commit d377866

Please sign in to comment.