Permalink
Browse files

Removed ASMTweaker and replaced it with AT. (#2636)

Added appeng_at.cfg and updated build.gradle to correctly include the AT when building.
Deleted the now useless ASMTweaker.
Moved the coremod from package transformer to coremod as a better matching name.
Updated the old 1.7.10 code using reflection to drop it where forge or vanilla now exposes that functionality directly.
  • Loading branch information...
1 parent a665200 commit 887339f7b864adcc20dd33f718d11e4bfa16b89e @yueh yueh committed on GitHub Nov 26, 2016
View
@@ -103,7 +103,7 @@ Providing as many details as possible does help us to find and resolve the issue
- Eclipse: execute `gradlew eclipse`
5. For add-on developer: Core-Mod Detection
- In order to have FML detect AE from your dev environment, add the following VM Option to your run profile
- - `-Dfml.coreMods.load=appeng.transformer.AppEngCore`
+ - `-Dfml.coreMods.load=appeng.coremod.AppEngCore`
## Contribution
View
@@ -53,6 +53,7 @@ archivesBaseName = aebasename
jar {
manifest {
attributes 'FMLCorePluginContainsFMLMod': 'true'
+ attributes 'FMLAT': 'appeng_at.cfg'
}
from sourceSets.api.output
@@ -63,10 +64,11 @@ jar {
include "assets/**"
include "mcmod.info"
include "pack.mcmeta"
+ include "META-INF/appeng_at.cfg"
}
minecraft {
- coreMod = "appeng.transformer.AppEngCore"
+ coreMod = "appeng.coremod.AppEngCore"
version = minecraft_version + "-" + forge_version
@@ -117,4 +119,7 @@ processResources
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
+
+ // move access transformer to META-INF
+ rename '(.+_at.cfg)', 'META-INF/$1'
}
@@ -62,6 +62,7 @@
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketAssemblerAnimation;
import appeng.core.sync.packets.PacketValueConfig;
+import appeng.coremod.MissingCoreMod;
import appeng.entity.EntityFloatingItem;
import appeng.entity.EntityTinyTNTPrimed;
import appeng.entity.RenderFloatingItem;
@@ -70,7 +71,6 @@
import appeng.hooks.TickHandler;
import appeng.hooks.TickHandler.PlayerColor;
import appeng.server.ServerHelper;
-import appeng.transformer.MissingCoreMod;
import appeng.util.Platform;
@@ -539,16 +539,7 @@ else if( this.dbl_whichItem != null )
@Override
protected boolean checkHotbarKeys( final int keyCode )
{
- final Slot theSlot;
-
- try
- {
- theSlot = ObfuscationReflectionHelper.getPrivateValue( GuiContainer.class, this, "theSlot", "field_147006_u", "f" );
- }
- catch( final Throwable t )
- {
- return false;
- }
+ final Slot theSlot = this.getSlotUnderMouse();
if( this.mc.thePlayer.inventory.getItemStack() == null && theSlot != null )
{
@@ -701,7 +692,8 @@ private String getInventoryName()
/**
* This overrides the base-class method through some access transformer hackery...
*/
- public void drawSlot( final Slot s )
+ @Override
+ public void drawSlot( Slot s )
{
if( s instanceof SlotME )
{
@@ -720,7 +712,7 @@ public void drawSlot( final Slot s )
this.itemRender.zLevel = 0.0F;
// Annoying but easier than trying to splice into render item
- this.safeDrawSlot( new Size1Slot( s ) );
+ super.drawSlot( new Size1Slot( s ) );
stackSizeRenderer.renderStackSize( fontRendererObj, ( (SlotME) s ).getAEStack(), s.getStack(), s.xDisplayPosition, s.yDisplayPosition );
@@ -822,11 +814,11 @@ public void drawSlot( final Slot s )
if( s instanceof AppEngSlot )
{
( (AppEngSlot) s ).setDisplay( true );
- this.safeDrawSlot( s );
+ super.drawSlot( s );
}
else
{
- this.safeDrawSlot( s );
+ super.drawSlot( s );
}
return;
@@ -837,25 +829,14 @@ public void drawSlot( final Slot s )
}
}
// do the usual for non-ME Slots.
- this.safeDrawSlot( s );
+ super.drawSlot( s );
}
protected boolean isPowered()
{
return true;
}
- private void safeDrawSlot( final Slot s )
- {
- try
- {
- GuiContainer.class.getDeclaredMethod( "func_146977_a_original", Slot.class ).invoke( this, s );
- }
- catch( final Exception err )
- {
- }
- }
-
public void bindTexture( final String file )
{
final ResourceLocation loc = new ResourceLocation( AppEng.MOD_ID, "textures/" + file );
@@ -16,7 +16,7 @@
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
-package appeng.transformer;
+package appeng.coremod;
import java.util.Map;
@@ -64,13 +64,13 @@ public void load( final FMLInitializationEvent event )
@Override
public String[] getASMTransformerClass()
{
- return new String[] { "appeng.transformer.asm.ASMIntegration" };
+ return new String[] { "appeng.coremod.asm.ASMIntegration" };
}
@Override
public String getModContainerClass()
{
- return "appeng.transformer.AppEngCore";
+ return "appeng.coremod.AppEngCore";
}
@Nullable
@@ -89,7 +89,7 @@ public void injectData( final Map<String, Object> data )
@Override
public String getAccessTransformerClass()
{
- return "appeng.transformer.asm.ASMTweaker";
+ return null;
}
@Override
@@ -16,7 +16,7 @@
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
-package appeng.transformer;
+package appeng.coremod;
import net.minecraft.client.gui.FontRenderer;
@@ -68,7 +68,7 @@ public void drawScreen( final GuiErrorScreen errorScreen, final FontRenderer fon
this.drawCenteredString( fontRenderer, "In a developer environment add the following too your args,", errorScreen.width / 2, offset, COLOR_WHITE );
offset += SCREEN_OFFSET;
- this.drawCenteredString( fontRenderer, "-Dfml.coreMods.load=appeng.transformer.AppEngCore", errorScreen.width / 2, offset, SHADOW_WHITE );
+ this.drawCenteredString( fontRenderer, "-Dfml.coreMods.load=appeng.coremod.AppEngCore", errorScreen.width / 2, offset, SHADOW_WHITE );
}
else
{
@@ -16,7 +16,7 @@
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
-package appeng.transformer.annotations;
+package appeng.coremod.annotations;
import java.lang.annotation.ElementType;
@@ -16,7 +16,7 @@
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
-package appeng.transformer.asm;
+package appeng.coremod.asm;
import java.util.Iterator;
@@ -34,10 +34,10 @@
import net.minecraft.launchwrapper.IClassTransformer;
import net.minecraftforge.fml.relauncher.FMLRelaunchLog;
+import appeng.coremod.annotations.Integration;
import appeng.helpers.Reflected;
import appeng.integration.IntegrationRegistry;
import appeng.integration.IntegrationType;
-import appeng.transformer.annotations.Integration;
@Reflected
@@ -71,7 +71,7 @@ public ASMIntegration()
@Override
public byte[] transform( final String name, final String transformedName, final byte[] basicClass )
{
- if( basicClass == null || transformedName.startsWith( "appeng.transformer" ) )
+ if( basicClass == null || transformedName.startsWith( "appeng.coremod" ) )
{
return basicClass;
}
@@ -26,10 +26,10 @@
import ic2.api.item.ISpecialElectricItem;
import appeng.api.config.PowerUnits;
+import appeng.coremod.annotations.Integration.Interface;
+import appeng.coremod.annotations.Integration.InterfaceList;
+import appeng.coremod.annotations.Integration.Method;
import appeng.integration.IntegrationType;
-import appeng.transformer.annotations.Integration.Interface;
-import appeng.transformer.annotations.Integration.InterfaceList;
-import appeng.transformer.annotations.Integration.Method;
@InterfaceList( value = {
@@ -24,8 +24,8 @@
import cofh.api.energy.IEnergyContainerItem;
import appeng.api.config.PowerUnits;
+import appeng.coremod.annotations.Integration.Interface;
import appeng.integration.IntegrationType;
-import appeng.transformer.annotations.Integration.Interface;
@Interface( iface = "cofh.api.energy.IEnergyContainerItem", iname = IntegrationType.RFItem )
@@ -33,12 +33,12 @@
import ic2.api.energy.tile.IEnergySource;
import appeng.api.config.PowerUnits;
+import appeng.coremod.annotations.Integration.Interface;
+import appeng.coremod.annotations.Integration.InterfaceList;
import appeng.integration.IntegrationType;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
import appeng.me.cache.helpers.TunnelCollection;
-import appeng.transformer.annotations.Integration.Interface;
-import appeng.transformer.annotations.Integration.InterfaceList;
import appeng.util.Platform;
@@ -44,8 +44,8 @@
//import appeng.api.networking.events.MENetworkPowerStatusChange;
//import appeng.integration.IntegrationRegistry;
//import appeng.integration.IntegrationType;
-//import appeng.transformer.annotations.Integration.Interface;
-//import appeng.transformer.annotations.Integration.InterfaceList;
+//import appeng.coremod.annotations.Integration.Interface;
+//import appeng.coremod.annotations.Integration.InterfaceList;
//
//
//@InterfaceList( value = { @Interface( iface = "li.cil.oc.api.network.Environment", iname = IntegrationType.OpenComputers ), @Interface( iface = "li.cil.oc.api.network.SidedEnvironment", iname = IntegrationType.OpenComputers ) } )
@@ -36,8 +36,8 @@
//import appeng.integration.IntegrationType;
//import appeng.integration.modules.helpers.NullRFHandler;
//import appeng.me.GridAccessException;
-//import appeng.transformer.annotations.Integration.Interface;
-//import appeng.transformer.annotations.Integration.InterfaceList;
+//import appeng.coremod.annotations.Integration.Interface;
+//import appeng.coremod.annotations.Integration.InterfaceList;
//import appeng.util.Platform;
//
//
@@ -24,8 +24,8 @@
import cofh.api.energy.IEnergyReceiver;
import appeng.api.config.PowerUnits;
+import appeng.coremod.annotations.Integration.Interface;
import appeng.integration.IntegrationType;
-import appeng.transformer.annotations.Integration.Interface;
@Interface( iname = IntegrationType.RF, iface = "cofh.api.energy.IEnergyReceiver" )
Oops, something went wrong.

0 comments on commit 887339f

Please sign in to comment.