mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
Merge pull request #2490 from asiekierka/master-MC1.12
update to Minecraft 1.12.1, various fixes
This commit is contained in:
commit
a537e72340
@ -73,10 +73,14 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
deobfCompile "li.cil.tis3d:TIS-3D:MC${config.minecraft.version}-${config.tis3d.version}"
|
deobfCompile ("li.cil.tis3d:TIS-3D:MC1.12-${config.tis3d.version}") {
|
||||||
|
exclude module: "jei_1.12"
|
||||||
|
}
|
||||||
deobfCompile "MCMultiPart2:MCMultiPart-exp:${config.mcmp.version}"
|
deobfCompile "MCMultiPart2:MCMultiPart-exp:${config.mcmp.version}"
|
||||||
deobfCompile "mezz.jei:jei_${config.minecraft.version}:${config.jei.version}"
|
deobfCompile "mezz.jei:jei_${config.minecraft.version}:${config.jei.version}"
|
||||||
deobfCompile "net.sengir.forestry:forestry_1.12:${config.forestry.version}"
|
deobfCompile ("net.sengir.forestry:forestry_1.12:${config.forestry.version}") {
|
||||||
|
exclude module: "jei_1.12"
|
||||||
|
}
|
||||||
|
|
||||||
embedded files('libs/OpenComputers-JNLua.jar', 'libs/OpenComputers-LuaJ.jar')
|
embedded files('libs/OpenComputers-JNLua.jar', 'libs/OpenComputers-LuaJ.jar')
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
minecraft.version=1.12
|
minecraft.version=1.12.1
|
||||||
minecraft.mappings=snapshot_20170620
|
minecraft.mappings=snapshot_20170812
|
||||||
forge.version=14.21.1.2413
|
forge.version=14.22.0.2452
|
||||||
|
|
||||||
mod.name=OpenComputers
|
mod.name=OpenComputers
|
||||||
mod.group=li.cil.oc
|
mod.group=li.cil.oc
|
||||||
mod.version=1.7.0
|
mod.version=1.7.0
|
||||||
|
|
||||||
forestry.version=5.4.3.134
|
forestry.version=5.5.0.157
|
||||||
jei.version=4.7.2.77
|
jei.version=4.7.5.87
|
||||||
mcmp.version=2.2.2_38
|
mcmp.version=2.2.2_38
|
||||||
tis3d.version=1.2.2.4
|
tis3d.version=1.2.2.4
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@ private[oc] class Proxy extends CommonProxy {
|
|||||||
|
|
||||||
OpenComputers.channel.register(client.PacketHandler)
|
OpenComputers.channel.register(client.PacketHandler)
|
||||||
|
|
||||||
ModelInitialization.init()
|
|
||||||
ColorHandler.init()
|
ColorHandler.init()
|
||||||
|
|
||||||
RenderingRegistry.registerEntityRenderingHandler(classOf[Drone], DroneRenderer)
|
RenderingRegistry.registerEntityRenderingHandler(classOf[Drone], DroneRenderer)
|
||||||
|
@ -18,8 +18,8 @@ import net.minecraft.item.Item
|
|||||||
import net.minecraft.item.ItemStack
|
import net.minecraft.item.ItemStack
|
||||||
import net.minecraft.util.ResourceLocation
|
import net.minecraft.util.ResourceLocation
|
||||||
import net.minecraft.util.registry.RegistrySimple
|
import net.minecraft.util.registry.RegistrySimple
|
||||||
import net.minecraftforge.client.event.ModelBakeEvent
|
import net.minecraftforge.client.event.{ModelBakeEvent, ModelRegistryEvent}
|
||||||
import net.minecraftforge.client.model.ModelLoader
|
import net.minecraftforge.client.model.{ModelLoader, ModelLoaderRegistry}
|
||||||
import net.minecraftforge.common.MinecraftForge
|
import net.minecraftforge.common.MinecraftForge
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
||||||
|
|
||||||
@ -53,7 +53,8 @@ object ModelInitialization {
|
|||||||
registerModel(Constants.BlockName.RobotAfterimage, RobotAfterimageBlockLocation, RobotAfterimageItemLocation)
|
registerModel(Constants.BlockName.RobotAfterimage, RobotAfterimageBlockLocation, RobotAfterimageItemLocation)
|
||||||
}
|
}
|
||||||
|
|
||||||
def init(): Unit = {
|
@SubscribeEvent
|
||||||
|
def onModelRegistration(event: ModelRegistryEvent): Unit = {
|
||||||
registerItems()
|
registerItems()
|
||||||
registerSubItems()
|
registerSubItems()
|
||||||
registerSubItemsCustom()
|
registerSubItemsCustom()
|
||||||
@ -102,27 +103,24 @@ object ModelInitialization {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val modelMeshes = Minecraft.getMinecraft.getRenderItem.getItemModelMesher
|
|
||||||
for (item <- meshableItems) {
|
for (item <- meshableItems) {
|
||||||
modelMeshes.register(item, meshDefinition)
|
ModelLoader.setCustomMeshDefinition(item, meshDefinition)
|
||||||
}
|
}
|
||||||
meshableItems.clear()
|
meshableItems.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
private def registerSubItems(): Unit = {
|
private def registerSubItems(): Unit = {
|
||||||
val modelMeshes = Minecraft.getMinecraft.getRenderItem.getItemModelMesher
|
|
||||||
for ((id, item) <- itemDelegates) {
|
for ((id, item) <- itemDelegates) {
|
||||||
val location = Settings.resourceDomain + ":" + id
|
val location = Settings.resourceDomain + ":" + id
|
||||||
modelMeshes.register(item.parent, item.itemId, new ModelResourceLocation(location, "inventory"))
|
ModelLoader.setCustomModelResourceLocation(item.parent, item.itemId, new ModelResourceLocation(location, "inventory"))
|
||||||
ModelBakery.registerItemVariants(item.parent, new ResourceLocation(location))
|
ModelBakery.registerItemVariants(item.parent, new ResourceLocation(location))
|
||||||
}
|
}
|
||||||
itemDelegates.clear()
|
itemDelegates.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
private def registerSubItemsCustom(): Unit = {
|
private def registerSubItemsCustom(): Unit = {
|
||||||
val modelMeshes = Minecraft.getMinecraft.getRenderItem.getItemModelMesher
|
|
||||||
for (item <- itemDelegatesCustom) {
|
for (item <- itemDelegatesCustom) {
|
||||||
modelMeshes.register(item.parent, new ItemMeshDefinition {
|
ModelLoader.setCustomMeshDefinition(item.parent, new ItemMeshDefinition {
|
||||||
override def getModelLocation(stack: ItemStack): ModelResourceLocation = Delegator.subItem(stack) match {
|
override def getModelLocation(stack: ItemStack): ModelResourceLocation = Delegator.subItem(stack) match {
|
||||||
case Some(subItem: CustomModel) => subItem.getModelLocation(stack)
|
case Some(subItem: CustomModel) => subItem.getModelLocation(stack)
|
||||||
case _ => null
|
case _ => null
|
||||||
|
@ -16,16 +16,16 @@ import scala.collection.convert.WrapAsJava._
|
|||||||
import scala.collection.convert.WrapAsScala._
|
import scala.collection.convert.WrapAsScala._
|
||||||
|
|
||||||
object ObfNames {
|
object ObfNames {
|
||||||
final val Class_EntityHanging = Array("net/minecraft/entity/EntityHanging", "aby")
|
final val Class_EntityHanging = Array("net/minecraft/entity/EntityHanging")
|
||||||
final val Class_EntityLiving = Array("net/minecraft/entity/EntityLiving", "vo")
|
final val Class_EntityLiving = Array("net/minecraft/entity/EntityLiving")
|
||||||
final val Class_RenderLiving = Array("net/minecraft/client/renderer/entity/RenderLiving", "cad")
|
final val Class_RenderLiving = Array("net/minecraft/client/renderer/entity/RenderLiving")
|
||||||
final val Class_TileEntity = Array("net/minecraft/tileentity/TileEntity", "avh")
|
final val Class_TileEntity = Array("net/minecraft/tileentity/TileEntity")
|
||||||
final val Field_leashNBTTag = Array("leashNBTTag", "field_110170_bx", "bG")
|
final val Field_leashNBTTag = Array("leashNBTTag", "field_110170_bx")
|
||||||
final val Field_leashedToEntity = Array("leashedToEntity", "field_110168_bw", "bF")
|
final val Field_leashedToEntity = Array("leashedToEntity", "field_110168_bw")
|
||||||
final val Method_recreateLeash = Array("recreateLeash", "func_110165_bF", "de")
|
final val Method_recreateLeash = Array("recreateLeash", "func_110165_bF")
|
||||||
final val Method_recreateLeashDesc = Array("()V")
|
final val Method_recreateLeashDesc = Array("()V")
|
||||||
final val Method_renderLeash = Array("renderLeash", "func_110827_b", "b")
|
final val Method_renderLeash = Array("renderLeash", "func_110827_b")
|
||||||
final val Method_renderLeashDesc = Array("(L"+Class_EntityLiving(1)+";DDDFF)V", "(Lnet/minecraft/entity/EntityLiving;DDDFF)V")
|
final val Method_renderLeashDesc = Array("(Lnet/minecraft/entity/EntityLiving;DDDFF)V")
|
||||||
final val Method_validate = Array("validate", "func_145829_t")
|
final val Method_validate = Array("validate", "func_145829_t")
|
||||||
final val Method_invalidate = Array("invalidate", "func_145843_s")
|
final val Method_invalidate = Array("invalidate", "func_145843_s")
|
||||||
final val Method_onChunkUnload = Array("onChunkUnload", "func_76623_d")
|
final val Method_onChunkUnload = Array("onChunkUnload", "func_76623_d")
|
||||||
|
@ -4,11 +4,10 @@ import java.util
|
|||||||
|
|
||||||
import li.cil.oc.common.asm.ClassTransformer
|
import li.cil.oc.common.asm.ClassTransformer
|
||||||
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin
|
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin
|
||||||
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.MCVersion
|
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.{SortingIndex, TransformerExclusions}
|
||||||
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions
|
|
||||||
|
|
||||||
|
@SortingIndex(1001)
|
||||||
@TransformerExclusions(Array("li.cil.oc.common.asm"))
|
@TransformerExclusions(Array("li.cil.oc.common.asm"))
|
||||||
@MCVersion("1.12")
|
|
||||||
class TransformerLoader extends IFMLLoadingPlugin {
|
class TransformerLoader extends IFMLLoadingPlugin {
|
||||||
val instance = this
|
val instance = this
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public class ConverterIAlleles implements Converter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void convertAlleleSpecies(final IAlleleSpecies value, final Map<Object, Object> output) {
|
private void convertAlleleSpecies(final IAlleleSpecies value, final Map<Object, Object> output) {
|
||||||
output.put("name", value.getName());
|
output.put("name", value.getAlleleName());
|
||||||
output.put("uid", value.getUID());
|
output.put("uid", value.getUID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ public class ConverterIIndividual implements Converter {
|
|||||||
if (allele == null) return "missing";
|
if (allele == null) return "missing";
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
IAlleleConverter<IAllele> converter = (IAlleleConverter<IAllele>) converters.get(cls);
|
IAlleleConverter<IAllele> converter = (IAlleleConverter<IAllele>) converters.get(cls);
|
||||||
return converter != null ? converter.convert(allele) : allele.getName();
|
return converter != null ? converter.convert(allele) : allele.getAlleleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void addAlleleInfo(GenomeAccess access, Map<String, Object> result);
|
protected abstract void addAlleleInfo(GenomeAccess access, Map<String, Object> result);
|
||||||
|
@ -85,12 +85,12 @@ public class DriverBeeHouse extends DriverSidedTileEntity {
|
|||||||
|
|
||||||
final IAllele allele1 = mutation.getAllele0();
|
final IAllele allele1 = mutation.getAllele0();
|
||||||
if (allele1 != null) {
|
if (allele1 != null) {
|
||||||
mutationMap.put("allele1", allele1.getName());
|
mutationMap.put("allele1", allele1.getAlleleName());
|
||||||
}
|
}
|
||||||
|
|
||||||
final IAllele allele2 = mutation.getAllele1();
|
final IAllele allele2 = mutation.getAllele1();
|
||||||
if (allele2 != null) {
|
if (allele2 != null) {
|
||||||
mutationMap.put("allele2", allele2.getName());
|
mutationMap.put("allele2", allele2.getAlleleName());
|
||||||
}
|
}
|
||||||
|
|
||||||
mutationMap.put("chance", mutation.getBaseChance());
|
mutationMap.put("chance", mutation.getBaseChance());
|
||||||
@ -99,7 +99,7 @@ public class DriverBeeHouse extends DriverSidedTileEntity {
|
|||||||
|
|
||||||
final IAllele[] template = mutation.getTemplate();
|
final IAllele[] template = mutation.getTemplate();
|
||||||
if (template != null && template.length > 0) {
|
if (template != null && template.length > 0) {
|
||||||
mutationMap.put("result", template[0].getName());
|
mutationMap.put("result", template[0].getAlleleName());
|
||||||
}
|
}
|
||||||
result.add(mutationMap);
|
result.add(mutationMap);
|
||||||
}
|
}
|
||||||
@ -152,7 +152,7 @@ public class DriverBeeHouse extends DriverSidedTileEntity {
|
|||||||
|
|
||||||
final IAlleleSpecies species = (IAlleleSpecies) allele;
|
final IAlleleSpecies species = (IAlleleSpecies) allele;
|
||||||
final String uid = species.getUID().toLowerCase();
|
final String uid = species.getUID().toLowerCase();
|
||||||
final String localizedName = species.getName().toLowerCase();
|
final String localizedName = species.getAlleleName().toLowerCase();
|
||||||
if (localizedName.equals(childType) || uid.equals(childType)) {
|
if (localizedName.equals(childType) || uid.equals(childType)) {
|
||||||
result.add(mutation);
|
result.add(mutation);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user