Skip to content

Commit

Permalink
1.12 port WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
2piradians committed Jul 23, 2017
1 parent 0de4261 commit fe9c76a
Show file tree
Hide file tree
Showing 23 changed files with 286 additions and 203 deletions.
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.


version = "1.11.2-2.2"
version = "1.12-2.2"
group = "twopiradians.minewatch" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Minewatch"

sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly.
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = "1.8"
sourceCompatibility = targetCompatibility = '1.8'
}

minecraft {
version = "1.11.2-13.20.0.2282"
version = "1.12-14.21.1.2387"
runDir = "run"

// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20161220"
mappings = "snapshot_20170617"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}

Expand Down Expand Up @@ -74,4 +74,4 @@ processResources {
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
}
Binary file removed libs/itemtransformhelper-1.11.2a.jar
Binary file not shown.
Binary file removed libs/jei_1.11.2-4.3.3.266.jar
Binary file not shown.
8 changes: 4 additions & 4 deletions src/main/java/twopiradians/minewatch/client/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ public class ClientProxy extends CommonProxy
public void preInit(FMLPreInitializationEvent event) {
super.preInit(event);
OBJLoader.INSTANCE.addDomain(Minewatch.MODID);
registerObjRenders();
registerEntityRenders();
KeyToggleMode.TOGGLE_MODE = new KeyBinding("Activate Set Effect", Keyboard.KEY_Z, Minewatch.MODNAME);
}

@Override
public void init(FMLInitializationEvent event) {
super.init(event);
registerRenders();
registerObjRenders();
registerRenders();
MinecraftForge.EVENT_BUS.register(Minewatch.keyMode);
ClientRegistry.registerKeyBinding(KeyToggleMode.TOGGLE_MODE);
}
Expand All @@ -64,7 +64,7 @@ public void init(FMLInitializationEvent event) {
public void postInit(FMLPostInitializationEvent event) {
super.postInit(event);
}

private static void registerRenders() {
for (Item item : ModItems.jsonModelItems)
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Minewatch.MODID+":" + item.getUnlocalizedName().substring(5), "inventory"));
Expand Down Expand Up @@ -99,7 +99,7 @@ else if (model > 4)
}
else
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(Minewatch.MODID+":" + item.getUnlocalizedName().substring(5) + "_3d", "inventory"));
}
}

private void registerEntityRenders() {
RenderingRegistry.registerEntityRenderingHandler(EntityReaperBullet.class, RenderReaperBullet::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ public class GuiFactory implements IModGuiFactory {
@Override
public void initialize(Minecraft minecraftInstance) {}

@Override
/*@Override
public Class<? extends GuiScreen> mainConfigGuiClass() {
return MinewatchGuiConfig.class;
}
}*/

@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
return null;
}

@SuppressWarnings("deprecation")
/*@SuppressWarnings("deprecation")
@Override
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) {
return null;
}
}*/

@Override
public boolean hasConfigGui() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public int getFXLayer() {
}

@Override
public boolean isTransparent() {
public boolean shouldDisableDepth() {
return true;
}

Expand Down
177 changes: 123 additions & 54 deletions src/main/java/twopiradians/minewatch/common/CommonProxy.java

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/java/twopiradians/minewatch/common/Minewatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import twopiradians.minewatch.client.key.KeyToggleMode;
import twopiradians.minewatch.creativetab.MinewatchTab;

@Mod(modid = Minewatch.MODID, version = Minewatch.VERSION, name = Minewatch.MODNAME, guiFactory = "twopiradians.minewatch.client.gui.config.GuiFactory", updateJSON = "https://raw.githubusercontent.com/2piradians/Minewatch/1.11.2/update.json")
@Mod(modid = Minewatch.MODID, version = Minewatch.VERSION, name = Minewatch.MODNAME, guiFactory = "twopiradians.minewatch.client.gui.config.GuiFactory", updateJSON = "https://raw.githubusercontent.com/2piradians/Minewatch/1.12/update.json")
public class Minewatch
{
public static final String MODNAME = "Minewatch";
Expand Down
160 changes: 84 additions & 76 deletions src/main/java/twopiradians/minewatch/common/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.registries.IForgeRegistry;
import twopiradians.minewatch.common.Minewatch;
import twopiradians.minewatch.common.config.Config;
import twopiradians.minewatch.common.item.armor.ItemAnaArmor;
Expand Down Expand Up @@ -81,15 +85,15 @@ public class ModItems {
public static Item tracer_boots;
public static Item tracer_pistol;
public static Item tracer_token;

public static ArmorMaterial mccree = EnumHelper.addArmorMaterial("mccree", "minewatch:mccree", 20, new int[] {2,3,3,2}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0);
public static Item mccree_helmet;
public static Item mccree_chestplate;
public static Item mccree_leggings;
public static Item mccree_boots;
public static Item mccree_gun;
public static Item mccree_token;

public static ArmorMaterial soldier = EnumHelper.addArmorMaterial("soldier", "minewatch:soldier", 20, new int[] {2,3,3,2}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0);
public static Item soldier_helmet;
public static Item soldier_chestplate;
Expand All @@ -98,78 +102,82 @@ public class ModItems {
public static Item soldier_gun;
public static Item soldier_token;

public static void preInit () {
reaper_helmet = registerItem(new ItemReaperArmor(reaper, 0, EntityEquipmentSlot.HEAD), "reaper_helmet", true, false);
reaper_chestplate = registerItem(new ItemReaperArmor(reaper, 0, EntityEquipmentSlot.CHEST), "reaper_chestplate", true, false);
reaper_leggings = registerItem(new ItemReaperArmor(reaper, 0, EntityEquipmentSlot.LEGS), "reaper_leggings", true, false);
reaper_boots = registerItem(new ItemReaperArmor(reaper, 0, EntityEquipmentSlot.FEET), "reaper_boots", true, false);
reaper_shotgun = registerItem(new ItemReaperShotgun(), "reaper_shotgun", true, true);
reaper_token = registerItem(new ModTokens.ItemReaperToken(), "reaper_token", true, false);

hanzo_helmet = registerItem(new ItemHanzoArmor(hanzo, 0, EntityEquipmentSlot.HEAD), "hanzo_helmet", true, false);
hanzo_chestplate = registerItem(new ItemHanzoArmor(hanzo, 0, EntityEquipmentSlot.CHEST), "hanzo_chestplate", true, false);
hanzo_leggings = registerItem(new ItemHanzoArmor(hanzo, 0, EntityEquipmentSlot.LEGS), "hanzo_leggings", true, false);
hanzo_boots = registerItem(new ItemHanzoArmor(hanzo, 0, EntityEquipmentSlot.FEET), "hanzo_boots", true, false);
hanzo_bow = registerItem(new ItemHanzoBow(), "hanzo_bow", true, true);
hanzo_token = registerItem(new ModTokens.ItemHanzoToken(), "hanzo_token", true, false);

reinhardt_helmet = registerItem(new ItemReinhardtArmor(reinhardt, 0, EntityEquipmentSlot.HEAD), "reinhardt_helmet", true, false);
reinhardt_chestplate = registerItem(new ItemReinhardtArmor(reinhardt, 0, EntityEquipmentSlot.CHEST), "reinhardt_chestplate", true, false);
reinhardt_leggings = registerItem(new ItemReinhardtArmor(reinhardt, 0, EntityEquipmentSlot.LEGS), "reinhardt_leggings", true, false);
reinhardt_boots = registerItem(new ItemReinhardtArmor(reinhardt, 0, EntityEquipmentSlot.FEET), "reinhardt_boots", true, false);
reinhardt_hammer = registerItem(new ItemReinhardtHammer(), "reinhardt_hammer", true, true);
reinhardt_token = registerItem(new ModTokens.ItemReinhardtToken(), "reinhardt_token", true, false);

ana_helmet = registerItem(new ItemAnaArmor(ana, 0, EntityEquipmentSlot.HEAD), "ana_helmet", true, false);
ana_chestplate = registerItem(new ItemAnaArmor(ana, 0, EntityEquipmentSlot.CHEST), "ana_chestplate", true, false);
ana_leggings = registerItem(new ItemAnaArmor(ana, 0, EntityEquipmentSlot.LEGS), "ana_leggings", true, false);
ana_boots = registerItem(new ItemAnaArmor(ana, 0, EntityEquipmentSlot.FEET), "ana_boots", true, false);
ana_rifle = registerItem(new ItemAnaRifle(), "ana_rifle", true, true);
ana_token = registerItem(new ModTokens.ItemAnaToken(), "ana_token", true, false);

genji_helmet = registerItem(new ItemGenjiArmor(genji, 0, EntityEquipmentSlot.HEAD), "genji_helmet", true, false);
genji_chestplate = registerItem(new ItemGenjiArmor(genji, 0, EntityEquipmentSlot.CHEST), "genji_chestplate", true, false);
genji_leggings = registerItem(new ItemGenjiArmor(genji, 0, EntityEquipmentSlot.LEGS), "genji_leggings", true, false);
genji_boots = registerItem(new ItemGenjiArmor(genji, 0, EntityEquipmentSlot.FEET), "genji_boots", true, false);
genji_shuriken = registerItem(new ItemGenjiShuriken(), "genji_shuriken", true, true);
genji_shuriken_single = registerItem(new ItemGenjiShuriken(), "genji_shuriken_single", false, true);
genji_token = registerItem(new ModTokens.ItemGenjiToken(), "genji_token", true, false);

tracer_helmet = registerItem(new ItemTracerArmor(tracer, 0, EntityEquipmentSlot.HEAD), "tracer_helmet", true, false);
tracer_chestplate = registerItem(new ItemTracerArmor(tracer, 0, EntityEquipmentSlot.CHEST), "tracer_chestplate", true, false);
tracer_leggings = registerItem(new ItemTracerArmor(tracer, 0, EntityEquipmentSlot.LEGS), "tracer_leggings", true, false);
tracer_boots = registerItem(new ItemTracerArmor(tracer, 0, EntityEquipmentSlot.FEET), "tracer_boots", true, false);
tracer_pistol = registerItem(new ItemTracerPistol(), "tracer_pistol", true, true);
tracer_token = registerItem(new ModTokens.ItemTracerToken(), "tracer_token", true, false);

mccree_helmet = registerItem(new ItemMcCreeArmor(mccree, 0, EntityEquipmentSlot.HEAD), "mccree_helmet", true, false);
mccree_chestplate = registerItem(new ItemMcCreeArmor(mccree, 0, EntityEquipmentSlot.CHEST), "mccree_chestplate", true, false);
mccree_leggings = registerItem(new ItemMcCreeArmor(mccree, 0, EntityEquipmentSlot.LEGS), "mccree_leggings", true, false);
mccree_boots = registerItem(new ItemMcCreeArmor(mccree, 0, EntityEquipmentSlot.FEET), "mccree_boots", true, false);
mccree_gun = registerItem(new ItemMcCreeGun(), "mccree_gun", true, true);
mccree_token = registerItem(new ModTokens.ItemMcCreeToken(), "mccree_token", true, false);

soldier_helmet = registerItem(new ItemSoldierArmor(soldier, 0, EntityEquipmentSlot.HEAD), "soldier_helmet", true, false);
soldier_chestplate = registerItem(new ItemSoldierArmor(soldier, 0, EntityEquipmentSlot.CHEST), "soldier_chestplate", true, false);
soldier_leggings = registerItem(new ItemSoldierArmor(soldier, 0, EntityEquipmentSlot.LEGS), "soldier_leggings", true, false);
soldier_boots = registerItem(new ItemSoldierArmor(soldier, 0, EntityEquipmentSlot.FEET), "soldier_boots", true, false);
soldier_gun = registerItem(new ItemSoldierGun(), "soldier_gun", true, true);
soldier_token = registerItem(new ModTokens.ItemMcCreeToken(), "soldier_token", true, false);
@Mod.EventBusSubscriber
public static class RegistrationHandler {

@SubscribeEvent(priority=EventPriority.NORMAL)
public static void registerItems(RegistryEvent.Register<Item> event) {
reaper_helmet = registerItem(event.getRegistry(), new ItemReaperArmor(reaper, 0, EntityEquipmentSlot.HEAD), "reaper_helmet", true, false);
reaper_chestplate = registerItem(event.getRegistry(), new ItemReaperArmor(reaper, 0, EntityEquipmentSlot.CHEST), "reaper_chestplate", true, false);
reaper_leggings = registerItem(event.getRegistry(), new ItemReaperArmor(reaper, 0, EntityEquipmentSlot.LEGS), "reaper_leggings", true, false);
reaper_boots = registerItem(event.getRegistry(), new ItemReaperArmor(reaper, 0, EntityEquipmentSlot.FEET), "reaper_boots", true, false);
reaper_shotgun = registerItem(event.getRegistry(), new ItemReaperShotgun(), "reaper_shotgun", true, true);
reaper_token = registerItem(event.getRegistry(), new ModTokens.ItemReaperToken(), "reaper_token", true, false);

hanzo_helmet = registerItem(event.getRegistry(), new ItemHanzoArmor(hanzo, 0, EntityEquipmentSlot.HEAD), "hanzo_helmet", true, false);
hanzo_chestplate = registerItem(event.getRegistry(), new ItemHanzoArmor(hanzo, 0, EntityEquipmentSlot.CHEST), "hanzo_chestplate", true, false);
hanzo_leggings = registerItem(event.getRegistry(), new ItemHanzoArmor(hanzo, 0, EntityEquipmentSlot.LEGS), "hanzo_leggings", true, false);
hanzo_boots = registerItem(event.getRegistry(), new ItemHanzoArmor(hanzo, 0, EntityEquipmentSlot.FEET), "hanzo_boots", true, false);
hanzo_bow = registerItem(event.getRegistry(), new ItemHanzoBow(), "hanzo_bow", true, true);
hanzo_token = registerItem(event.getRegistry(), new ModTokens.ItemHanzoToken(), "hanzo_token", true, false);

reinhardt_helmet = registerItem(event.getRegistry(), new ItemReinhardtArmor(reinhardt, 0, EntityEquipmentSlot.HEAD), "reinhardt_helmet", true, false);
reinhardt_chestplate = registerItem(event.getRegistry(), new ItemReinhardtArmor(reinhardt, 0, EntityEquipmentSlot.CHEST), "reinhardt_chestplate", true, false);
reinhardt_leggings = registerItem(event.getRegistry(), new ItemReinhardtArmor(reinhardt, 0, EntityEquipmentSlot.LEGS), "reinhardt_leggings", true, false);
reinhardt_boots = registerItem(event.getRegistry(), new ItemReinhardtArmor(reinhardt, 0, EntityEquipmentSlot.FEET), "reinhardt_boots", true, false);
reinhardt_hammer = registerItem(event.getRegistry(), new ItemReinhardtHammer(), "reinhardt_hammer", true, true);
reinhardt_token = registerItem(event.getRegistry(), new ModTokens.ItemReinhardtToken(), "reinhardt_token", true, false);

ana_helmet = registerItem(event.getRegistry(), new ItemAnaArmor(ana, 0, EntityEquipmentSlot.HEAD), "ana_helmet", true, false);
ana_chestplate = registerItem(event.getRegistry(), new ItemAnaArmor(ana, 0, EntityEquipmentSlot.CHEST), "ana_chestplate", true, false);
ana_leggings = registerItem(event.getRegistry(), new ItemAnaArmor(ana, 0, EntityEquipmentSlot.LEGS), "ana_leggings", true, false);
ana_boots = registerItem(event.getRegistry(), new ItemAnaArmor(ana, 0, EntityEquipmentSlot.FEET), "ana_boots", true, false);
ana_rifle = registerItem(event.getRegistry(), new ItemAnaRifle(), "ana_rifle", true, true);
ana_token = registerItem(event.getRegistry(), new ModTokens.ItemAnaToken(), "ana_token", true, false);

genji_helmet = registerItem(event.getRegistry(), new ItemGenjiArmor(genji, 0, EntityEquipmentSlot.HEAD), "genji_helmet", true, false);
genji_chestplate = registerItem(event.getRegistry(), new ItemGenjiArmor(genji, 0, EntityEquipmentSlot.CHEST), "genji_chestplate", true, false);
genji_leggings = registerItem(event.getRegistry(), new ItemGenjiArmor(genji, 0, EntityEquipmentSlot.LEGS), "genji_leggings", true, false);
genji_boots = registerItem(event.getRegistry(), new ItemGenjiArmor(genji, 0, EntityEquipmentSlot.FEET), "genji_boots", true, false);
genji_shuriken = registerItem(event.getRegistry(), new ItemGenjiShuriken(), "genji_shuriken", true, true);
genji_shuriken_single = registerItem(event.getRegistry(), new ItemGenjiShuriken(), "genji_shuriken_single", false, true);
genji_token = registerItem(event.getRegistry(), new ModTokens.ItemGenjiToken(), "genji_token", true, false);

tracer_helmet = registerItem(event.getRegistry(), new ItemTracerArmor(tracer, 0, EntityEquipmentSlot.HEAD), "tracer_helmet", true, false);
tracer_chestplate = registerItem(event.getRegistry(), new ItemTracerArmor(tracer, 0, EntityEquipmentSlot.CHEST), "tracer_chestplate", true, false);
tracer_leggings = registerItem(event.getRegistry(), new ItemTracerArmor(tracer, 0, EntityEquipmentSlot.LEGS), "tracer_leggings", true, false);
tracer_boots = registerItem(event.getRegistry(), new ItemTracerArmor(tracer, 0, EntityEquipmentSlot.FEET), "tracer_boots", true, false);
tracer_pistol = registerItem(event.getRegistry(), new ItemTracerPistol(), "tracer_pistol", true, true);
tracer_token = registerItem(event.getRegistry(), new ModTokens.ItemTracerToken(), "tracer_token", true, false);

mccree_helmet = registerItem(event.getRegistry(), new ItemMcCreeArmor(mccree, 0, EntityEquipmentSlot.HEAD), "mccree_helmet", true, false);
mccree_chestplate = registerItem(event.getRegistry(), new ItemMcCreeArmor(mccree, 0, EntityEquipmentSlot.CHEST), "mccree_chestplate", true, false);
mccree_leggings = registerItem(event.getRegistry(), new ItemMcCreeArmor(mccree, 0, EntityEquipmentSlot.LEGS), "mccree_leggings", true, false);
mccree_boots = registerItem(event.getRegistry(), new ItemMcCreeArmor(mccree, 0, EntityEquipmentSlot.FEET), "mccree_boots", true, false);
mccree_gun = registerItem(event.getRegistry(), new ItemMcCreeGun(), "mccree_gun", true, true);
mccree_token = registerItem(event.getRegistry(), new ModTokens.ItemMcCreeToken(), "mccree_token", true, false);

soldier_helmet = registerItem(event.getRegistry(), new ItemSoldierArmor(soldier, 0, EntityEquipmentSlot.HEAD), "soldier_helmet", true, false);
soldier_chestplate = registerItem(event.getRegistry(), new ItemSoldierArmor(soldier, 0, EntityEquipmentSlot.CHEST), "soldier_chestplate", true, false);
soldier_leggings = registerItem(event.getRegistry(), new ItemSoldierArmor(soldier, 0, EntityEquipmentSlot.LEGS), "soldier_leggings", true, false);
soldier_boots = registerItem(event.getRegistry(), new ItemSoldierArmor(soldier, 0, EntityEquipmentSlot.FEET), "soldier_boots", true, false);
soldier_gun = registerItem(event.getRegistry(), new ItemSoldierGun(), "soldier_gun", true, true);
soldier_token = registerItem(event.getRegistry(), new ModTokens.ItemMcCreeToken(), "soldier_token", true, false);
}

private static Item registerItem(IForgeRegistry<Item> registry, Item item, String unlocalizedName, boolean addToTab, boolean usesObjModel) {
if (usesObjModel && Config.useObjModels)
objModelItems.add(item);
else
jsonModelItems.add(item);
if (item instanceof ModTokens)
tokens.add(item);
item.setUnlocalizedName(unlocalizedName);
item.setRegistryName(Minewatch.MODID, unlocalizedName);
if (addToTab)
item.setCreativeTab(Minewatch.tab);
registry.register(item);
return item;
}
}

private static Item registerItem(Item item, String unlocalizedName, boolean addToTab, boolean usesObjModel) {
if (usesObjModel && Config.useObjModels)
objModelItems.add(item);
else
jsonModelItems.add(item);
if (item instanceof ModTokens)
tokens.add(item);
item.setUnlocalizedName(unlocalizedName);
item.setRegistryName(Minewatch.MODID, unlocalizedName);
if (addToTab)
item.setCreativeTab(Minewatch.tab);
GameRegistry.register(item);
return item;
}

}
Loading

0 comments on commit fe9c76a

Please sign in to comment.