Make all tests one side only, so we can test vanilla clients in dev env.

This commit is contained in:
LexManos committed 2016-11-22 12:12:13 -08:00
1 parent 8f03658f1f
commit 8719fa0263
32 files changed
+263 -221

No files matched your search

@@ -7,7 +7,7 @@ import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@Mod(modid = BreedingTest.MODID, name = "BreedingTest", version = "1.0")
@Mod(modid = BreedingTest.MODID, name = "BreedingTest", version = "1.0", acceptableRemoteVersions = "*")
public class BreedingTest
{
public static final String MODID = "breedingtest";
@@ -6,7 +6,7 @@ import net.minecraftforge.common.config.Config.*;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
@Mod(modid = ConfigTest.MODID, name = "ConfigTest", version = "1.0")
@Mod(modid = ConfigTest.MODID, name = "ConfigTest", version = "1.0", acceptableRemoteVersions = "*")
public class ConfigTest
{
public static final String MODID = "config_test";
@@ -8,7 +8,7 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.Event.Result;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@Mod(modid = DecorateEventDebug.MODID, name = DecorateEventDebug.NAME, version = DecorateEventDebug.VERSION)
@Mod(modid = DecorateEventDebug.MODID, name = DecorateEventDebug.NAME, version = DecorateEventDebug.VERSION, acceptableRemoteVersions = "*")
public class DecorateEventDebug
{
@@ -59,7 +59,7 @@ import net.minecraftforge.items.wrapper.CombinedInvWrapper;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@Mod(modid = DynBucketTest.MODID, name = "DynBucketTest", version = "0.1", dependencies = "after:" + ModelFluidDebug.MODID)
@Mod(modid = DynBucketTest.MODID, name = "DynBucketTest", version = "0.1", dependencies = "after:" + ModelFluidDebug.MODID, acceptableRemoteVersions = "*")
public class DynBucketTest
{
public static final String MODID = "dynbuckettest";
@@ -7,43 +7,43 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
@Mod(modid = "enumplanttypetest", name = "EnumPlantTypeTest", version = "1.0")
public class EnumPlantTypeTest
@Mod(modid = "enumplanttypetest", name = "EnumPlantTypeTest", version = "1.0", acceptableRemoteVersions = "*")
public class EnumPlantTypeTest
{
private static Logger LOGGER = LogManager.getLogger();
@Mod.EventHandler
public void onInit(FMLInitializationEvent event)
{
BiomeType biomeType = null;
try
{
biomeType = BiomeType.getType("FAKE");
}
catch (NullPointerException npe)
{
LOGGER.warn("EnumHelper in BiomeType is working incorrectly!", npe);
}
finally
{
if (biomeType == null || !biomeType.name().equals("FAKE"))
LOGGER.warn("EnumHelper in BiomeType is working incorrectly!");
}
EnumPlantType plantType = null;
if (plantType == null || !plantType.name().equals("FAKE"))
;
try
{
plantType = EnumPlantType.getPlantType("FAKE");
}
catch (NullPointerException npe)
{
LOGGER.warn("EnumHelper in EnumPlantType is working incorrectly!", npe);
}
finally
{
if (plantType == null || !plantType.name().equals("FAKE"))
LOGGER.warn("EnumHelper in EnumPlantType is working incorrectly!");
}
}
private static Logger LOGGER = LogManager.getLogger();
@Mod.EventHandler
public void onInit(FMLInitializationEvent event)
{
BiomeType biomeType = null;
try
{
biomeType = BiomeType.getType("FAKE");
}
catch (NullPointerException npe)
{
LOGGER.warn("EnumHelper in BiomeType is working incorrectly!", npe);
}
finally
{
if (biomeType == null || !biomeType.name().equals("FAKE"))
LOGGER.warn("EnumHelper in BiomeType is working incorrectly!");
}
EnumPlantType plantType = null;
if (plantType == null || !plantType.name().equals("FAKE"))
;
try
{
plantType = EnumPlantType.getPlantType("FAKE");
}
catch (NullPointerException npe)
{
LOGGER.warn("EnumHelper in EnumPlantType is working incorrectly!", npe);
}
finally
{
if (plantType == null || !plantType.name().equals("FAKE"))
LOGGER.warn("EnumHelper in EnumPlantType is working incorrectly!");
}
}
}
@@ -26,7 +26,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import com.google.common.base.Function;
import com.google.common.collect.Maps;
@Mod(modid = ForgeBlockStatesLoaderDebug.MODID, name = "ForgeBlockStatesLoader", version = "1.0")
@Mod(modid = ForgeBlockStatesLoaderDebug.MODID, name = "ForgeBlockStatesLoader", version = "1.0", acceptableRemoteVersions = "*")
@Mod.EventBusSubscriber
public class ForgeBlockStatesLoaderDebug {
public static final String MODID = "forgeblockstatesloader";
@@ -22,7 +22,7 @@ import java.util.Random;
import javax.annotation.Nullable;
@Mod(modid = ItemLayerModelDebug.MODID, name = "ForgeDebugItemLayerModel", version = ItemLayerModelDebug.VERSION)
@Mod(modid = ItemLayerModelDebug.MODID, name = "ForgeDebugItemLayerModel", version = ItemLayerModelDebug.VERSION, acceptableRemoteVersions = "*")
public class ItemLayerModelDebug
{
public static final String MODID = "forgedebugitemlayermodel";
@@ -26,7 +26,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import static org.lwjgl.opengl.GL11.*;
@Mod(modid = ItemTileDebug.MODID, name = "ForgeDebugItemTile", version = "1.0")
@Mod(modid = ItemTileDebug.MODID, name = "ForgeDebugItemTile", version = "1.0", acceptableRemoteVersions = "*")
public class ItemTileDebug
{
public static final String MODID = "forgedebugitemtile";
@@ -17,7 +17,7 @@ import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@Mod(modid = LootTablesDebug.MODID, name = "Loot Table Debug", version = "1.0")
@Mod(modid = LootTablesDebug.MODID, name = "Loot Table Debug", version = "1.0", acceptableRemoteVersions = "*")
public class LootTablesDebug {
public static final String MODID = "loot_table_debug";
private static final ResourceLocation CUSTOM_LOOT = LootTableList.register(new ResourceLocation(MODID, "custom_loot"));
@@ -60,7 +60,7 @@ import com.google.common.collect.ImmutableMap;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@Mod(modid = ModelAnimationDebug.MODID, name = "ForgeDebugModelAnimation", version = ModelAnimationDebug.VERSION)
@Mod(modid = ModelAnimationDebug.MODID, name = "ForgeDebugModelAnimation", version = ModelAnimationDebug.VERSION, acceptableRemoteVersions = "*")
public class ModelAnimationDebug
{
public static final String MODID = "forgedebugmodelanimation";
@@ -49,7 +49,7 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
import com.google.common.collect.ImmutableList;
import com.google.common.primitives.Ints;
@Mod(modid = ModelBakeEventDebug.MODID, name = "ForgeDebugModelBakeEvent", version = ModelBakeEventDebug.VERSION)
@Mod(modid = ModelBakeEventDebug.MODID, name = "ForgeDebugModelBakeEvent", version = ModelBakeEventDebug.VERSION, acceptableRemoteVersions = "*")
public class ModelBakeEventDebug
{
public static final String MODID = "forgedebugmodelbakeevent";
@@ -21,7 +21,7 @@ import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
@Mod(modid = ModelFluidDebug.MODID, name = "ForgeDebugModelFluid", version = ModelFluidDebug.VERSION)
@Mod(modid = ModelFluidDebug.MODID, name = "ForgeDebugModelFluid", version = ModelFluidDebug.VERSION, acceptableRemoteVersions = "*")
public class ModelFluidDebug
{
public static final String MODID = "forgedebugmodelfluid";
@@ -57,7 +57,7 @@ import net.minecraftforge.fml.relauncher.Side;
import com.google.common.collect.Lists;
@Mod(modid = ModelLoaderRegistryDebug.MODID, name = "ForgeDebugModelLoaderRegistry", version = ModelLoaderRegistryDebug.VERSION)
@Mod(modid = ModelLoaderRegistryDebug.MODID, name = "ForgeDebugModelLoaderRegistry", version = ModelLoaderRegistryDebug.VERSION, acceptableRemoteVersions = "*")
public class ModelLoaderRegistryDebug
{
public static final String MODID = "forgedebugmodelloaderregistry";
@@ -16,7 +16,7 @@ import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
@Mod(modid = MultiLayerModelDebug.MODID, name = "ForgeDebugMultiLayerModel", version = MultiLayerModelDebug.VERSION)
@Mod(modid = MultiLayerModelDebug.MODID, name = "ForgeDebugMultiLayerModel", version = MultiLayerModelDebug.VERSION, acceptableRemoteVersions = "*")
public class MultiLayerModelDebug
{
public static final String MODID = "forgedebugmultilayermodel";
@@ -7,7 +7,7 @@ import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameData;
@Mod( modid = NoPotionEffectRenderTest.modID, name = "No Potion Effect Render Test", version = "0.0.0" )
@Mod( modid = NoPotionEffectRenderTest.modID, name = "No Potion Effect Render Test", version = "0.0.0", acceptableRemoteVersions = "*" )
public class NoPotionEffectRenderTest {
public static final String modID = "nopotioneffect";
@@ -13,7 +13,7 @@ import net.minecraftforge.fml.common.registry.IForgeRegistry;
import net.minecraftforge.fml.common.registry.IForgeRegistryEntry;
import net.minecraftforge.fml.common.registry.RegistryBuilder;
@Mod(modid= ObjectHolderTest.MODID, name = "ObjectHolderTests", version = "1.0")
@Mod(modid= ObjectHolderTest.MODID, name = "ObjectHolderTests", version = "1.0", acceptableRemoteVersions = "*")
public class ObjectHolderTest
{
public static final String MODID = "objectholdertest";
@@ -19,7 +19,7 @@ import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameData;
@Mod(modid = PotionRegistryDebug.MODID, name = "ForgePotionRegistry", version = "1.0")
@Mod(modid = PotionRegistryDebug.MODID, name = "ForgePotionRegistry", version = "1.0", acceptableRemoteVersions = "*")
public class PotionRegistryDebug {
public static final String MODID = "forgepotionregistry";
@@ -19,64 +19,64 @@ import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.MinecraftForge;
@Mod(modid = TextureDump.MODID, name = "Forge Texture Atlas Dump", version = TextureDump.VERSION, clientSideOnly = true)
@Mod(modid = TextureDump.MODID, name = "Forge Texture Atlas Dump", version = TextureDump.VERSION, clientSideOnly = true, acceptableRemoteVersions = "*")
public class TextureDump
{
public static final String MODID = "forge_texture_dump";
public static final String VERSION = "1.0";
public static final String MODID = "forge_texture_dump";
public static final String VERSION = "1.0";
public static final boolean ENABLE = true;
public static final boolean ENABLE = true;
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
if (ENABLE)
{
MinecraftForge.EVENT_BUS.register(this);
}
}
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
if (ENABLE)
{
MinecraftForge.EVENT_BUS.register(this);
}
}
@SubscribeEvent
public void postTextureStitch(TextureStitchEvent.Post e) throws Exception
{
TextureMap map = e.getMap();
String name = map.getBasePath().replace('/', '_');
int mip = map.getMipmapLevels();
saveGlTexture(name, map.getGlTextureId(), mip);
}
@SubscribeEvent
public void postTextureStitch(TextureStitchEvent.Post e) throws Exception
{
TextureMap map = e.getMap();
String name = map.getBasePath().replace('/', '_');
int mip = map.getMipmapLevels();
saveGlTexture(name, map.getGlTextureId(), mip);
}
public static void saveGlTexture(String name, int textureId, int mipmapLevels)
{
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureId);
public static void saveGlTexture(String name, int textureId, int mipmapLevels)
{
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureId);
GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
for (int level = 0; level <= mipmapLevels; level++)
{
int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, level, GL11.GL_TEXTURE_WIDTH);
int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, level, GL11.GL_TEXTURE_HEIGHT);
int size = width * height;
for (int level = 0; level <= mipmapLevels; level++)
{
int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, level, GL11.GL_TEXTURE_WIDTH);
int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, level, GL11.GL_TEXTURE_HEIGHT);
int size = width * height;
BufferedImage bufferedimage = new BufferedImage(width, height, 2);
File output = new File("texture_atlas_dump_" + name + "_mipmap_" + level + ".png");
BufferedImage bufferedimage = new BufferedImage(width, height, 2);
File output = new File("texture_atlas_dump_" + name + "_mipmap_" + level + ".png");
IntBuffer buffer = BufferUtils.createIntBuffer(size);
int[] data = new int[size];
IntBuffer buffer = BufferUtils.createIntBuffer(size);
int[] data = new int[size];
GL11.glGetTexImage(GL11.GL_TEXTURE_2D, level, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, buffer);
buffer.get(data);
bufferedimage.setRGB(0, 0, width, height, data, 0, width);
GL11.glGetTexImage(GL11.GL_TEXTURE_2D, level, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, buffer);
buffer.get(data);
bufferedimage.setRGB(0, 0, width, height, data, 0, width);
try
{
ImageIO.write(bufferedimage, "png", output);
FMLLog.info("[TextureDump] Exported png to: %s", output.getAbsolutePath());
}
catch (IOException ioexception)
{
FMLLog.info("[TextureDump] Unable to write: ", ioexception);
}
}
}
try
{
ImageIO.write(bufferedimage, "png", output);
FMLLog.info("[TextureDump] Exported png to: %s", output.getAbsolutePath());
}
catch (IOException ioexception)
{
FMLLog.info("[TextureDump] Unable to write: ", ioexception);
}
}
}
}