mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 15:33:18 +00:00
More compile cleanups. (#5139)
This commit is contained in:
1 parent
dbf649225a
commit
3f743887e7
71 files changed
+901
-411
No files matched your search
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
package net.minecraftforge.fml.common;
|
||||
|
||||
/* TODO ReflectionHelper
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.minecraftforge.fml.common.asm.deobf.FMLDeobfuscatingRemapper;
|
||||
@@ -31,7 +31,7 @@ import net.minecraftforge.fml.relauncher.ReflectionHelper.UnableToFindFieldExcep
|
||||
*
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
* /
|
||||
public class ObfuscationReflectionHelper
|
||||
{
|
||||
public static <T, E> T getPrivateValue(Class<? super E> classToAccess, E instance, int fieldIndex)
|
||||
@@ -42,7 +42,7 @@ public class ObfuscationReflectionHelper
|
||||
}
|
||||
catch (UnableToAccessFieldException e)
|
||||
{
|
||||
FMLLog.log.error("There was a problem getting field index {} from {}", classToAccess.getName(), e);
|
||||
LOGGER.error("There was a problem getting field index {} from {}", classToAccess.getName(), e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -67,12 +67,12 @@ public class ObfuscationReflectionHelper
|
||||
}
|
||||
catch (UnableToFindFieldException e)
|
||||
{
|
||||
FMLLog.log.error("Unable to locate any field {} on type {}", Arrays.toString(fieldNames), classToAccess.getName(), e);
|
||||
LOGGER.error("Unable to locate any field {} on type {}", Arrays.toString(fieldNames), classToAccess.getName(), e);
|
||||
throw e;
|
||||
}
|
||||
catch (UnableToAccessFieldException e)
|
||||
{
|
||||
FMLLog.log.error("Unable to access any field {} on type {}", classToAccess.getName(), e);
|
||||
LOGGER.error("Unable to access any field {} on type {}", classToAccess.getName(), e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class ObfuscationReflectionHelper
|
||||
}
|
||||
catch (UnableToAccessFieldException e)
|
||||
{
|
||||
FMLLog.log.error("There was a problem setting field index {} on type {}", classToAccess.getName(), e);
|
||||
LOGGER.error("There was a problem setting field index {} on type {}", classToAccess.getName(), e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -98,13 +98,14 @@ public class ObfuscationReflectionHelper
|
||||
}
|
||||
catch (UnableToFindFieldException e)
|
||||
{
|
||||
FMLLog.log.error("Unable to locate any field {} on type {}", classToAccess.getName(), e);
|
||||
LOGGER.error("Unable to locate any field {} on type {}", classToAccess.getName(), e);
|
||||
throw e;
|
||||
}
|
||||
catch (UnableToAccessFieldException e)
|
||||
{
|
||||
FMLLog.log.error("Unable to set any field {} on type {}", classToAccess.getName(), e);
|
||||
LOGGER.error("Unable to set any field {} on type {}", classToAccess.getName(), e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
+2
-1
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
package net.minecraftforge.fml.common.asm.transformers;
|
||||
|
||||
/* TODO Class transformers
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
@@ -167,3 +167,4 @@ public class SoundEngineFixTransformer implements IClassTransformer
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
@@ -31,6 +31,7 @@ import net.minecraftforge.registries.ForgeRegistryEntry;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.entity.passive.EntityVillager.ITradeList;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.RegistryNamespaced;
|
||||
@@ -43,18 +44,17 @@ import javax.annotation.Nullable;
|
||||
*/
|
||||
public class VillagerRegistry
|
||||
{
|
||||
/*
|
||||
|
||||
public static final RegistryObject<VillagerProfession> FARMER = RegistryObject.of("minecraft:farmer", ()->VillagerProfession.class);
|
||||
private static final VillagerRegistry INSTANCE = new VillagerRegistry();
|
||||
|
||||
/* TODO village creation
|
||||
private Map<Class<?>, IVillageCreationHandler> villageCreationHandlers = Maps.newHashMap();
|
||||
|
||||
*/
|
||||
private VillagerRegistry()
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
*/
|
||||
/**
|
||||
* Allow access to the {@link net.minecraft.world.gen.structure.StructureVillagePieces} array controlling new village
|
||||
* creation so you can insert your own new village pieces
|
||||
@@ -100,13 +100,12 @@ public class VillagerRegistry
|
||||
Village buildComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List<StructureComponent> pieces, Random random, int p1,
|
||||
int p2, int p3, EnumFacing facing, int p5);
|
||||
}
|
||||
|
||||
*/
|
||||
public static VillagerRegistry instance()
|
||||
{
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
*/
|
||||
/**
|
||||
* Register a new village creation handler
|
||||
*
|
||||
@@ -132,7 +131,7 @@ public class VillagerRegistry
|
||||
{
|
||||
return instance().villageCreationHandlers.get(villagePiece.villagePieceClass).buildComponent(villagePiece, startPiece, pieces, random, p1, p2, p3, facing, p5);
|
||||
}
|
||||
|
||||
*/
|
||||
RegistryNamespaced<ResourceLocation, VillagerProfession> REGISTRY = GameData.getWrapper(VillagerProfession.class);
|
||||
|
||||
private void register(VillagerProfession prof, int id)
|
||||
@@ -178,9 +177,9 @@ public class VillagerRegistry
|
||||
"minecraft:textures/entity/zombie_villager/zombie_smith.png");
|
||||
{
|
||||
register(prof, 3);
|
||||
(new VillagerCareer(prof, "armor")).init(VanillaTrades.trades[3][0]);
|
||||
(new VillagerCareer(prof, "weapon")).init(VanillaTrades.trades[3][1]);
|
||||
(new VillagerCareer(prof, "tool")).init(VanillaTrades.trades[3][2]);
|
||||
(new VillagerCareer(prof, "armorer")).init(VanillaTrades.trades[3][0]);
|
||||
(new VillagerCareer(prof, "weapon_smith")).init(VanillaTrades.trades[3][1]);
|
||||
(new VillagerCareer(prof, "tool_smith")).init(VanillaTrades.trades[3][2]);
|
||||
}
|
||||
prof = new VillagerProfession("minecraft:butcher",
|
||||
"minecraft:textures/entity/villager/butcher.png",
|
||||
@@ -188,7 +187,7 @@ public class VillagerRegistry
|
||||
{
|
||||
register(prof, 4);
|
||||
(new VillagerCareer(prof, "butcher")).init(VanillaTrades.trades[4][0]);
|
||||
(new VillagerCareer(prof, "leather")).init(VanillaTrades.trades[4][1]);
|
||||
(new VillagerCareer(prof, "leatherworker")).init(VanillaTrades.trades[4][1]);
|
||||
}
|
||||
prof = new VillagerProfession("minecraft:nitwit",
|
||||
"minecraft:textures/entity/villager/villager.png",
|
||||
@@ -312,13 +311,12 @@ public class VillagerRegistry
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
/**
|
||||
/**
|
||||
* Hook called when spawning a Villager, sets it's profession to a random registered profession.
|
||||
*
|
||||
* @param entity The new entity
|
||||
* @param rand The world's RNG
|
||||
*//*
|
||||
*/
|
||||
|
||||
public static void setRandomProfession(EntityVillager entity, Random rand)
|
||||
{
|
||||
@@ -369,5 +367,5 @@ public class VillagerRegistry
|
||||
//It is nasty I know but it's vanilla.
|
||||
private static final ITradeList[][][][] trades = EntityVillager.GET_TRADES_DONT_USE();
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -22,12 +22,12 @@ package net.minecraftforge.fml.common.toposort;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.fml.client.GuiSortingProblem;
|
||||
import net.minecraftforge.fml.client.IDisplayableError;
|
||||
import net.minecraftforge.fml.common.EnhancedRuntimeException;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.ModContainer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.client.IDisplayableError;
|
||||
import net.minecraftforge.fml.client.gui.GuiSortingProblem;
|
||||
import net.minecraftforge.fml.common.EnhancedRuntimeException;
|
||||
|
||||
public class ModSortingException extends EnhancedRuntimeException implements IDisplayableError
|
||||
{
|
||||
@@ -76,14 +76,14 @@ public class ModSortingException extends EnhancedRuntimeException implements IDi
|
||||
stream.println("The first mod in the cycle is " + exceptionData.getFirstBadNode());
|
||||
stream.println("The mod cycle involves:");
|
||||
for (ModContainer mc : exceptionData.getVisitedNodes())
|
||||
{
|
||||
{/* TODO Mod dependencies
|
||||
stream.println(String.format("\t%s : before: %s, after: %s", mc.toString(), mc.getDependants(), mc.getDependencies()));
|
||||
}
|
||||
*/}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public GuiScreen createGui()
|
||||
{
|
||||
return new GuiSortingProblem(this);
|
||||
|
||||
Reference in new issue
Block a user