mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Remove old paulscode libraries.
Re-work EnumHelper and ObjectHolder systems to bypass JITer of final fields. Other cleanups.
This commit is contained in:
1 parent
2798080f60
commit
12869710de
55 files changed
+495
-5859
No files matched your search
@@ -1,78 +0,0 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2018.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.client;
|
||||
|
||||
import net.minecraft.client.audio.MusicTicker;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.Util.EnumOS;
|
||||
import net.minecraft.world.GameType;
|
||||
import net.minecraft.client.settings.GameSettings.Options;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class EnumHelperClient extends EnumHelper
|
||||
{
|
||||
private static Class<?>[][] clientTypes =
|
||||
{
|
||||
{GameType.class, int.class, String.class, String.class},
|
||||
{Options.class, String.class, boolean.class, boolean.class},
|
||||
{EnumOS.class},
|
||||
{MusicTicker.MusicType.class, SoundEvent.class, int.class, int.class}
|
||||
};
|
||||
|
||||
@Nullable
|
||||
public static GameType addGameType(String name, int id, String displayName, String shortName)
|
||||
{
|
||||
return addEnum(GameType.class, name, id, displayName, shortName);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Options addOptions(String name, String langName, boolean isSlider, boolean isToggle)
|
||||
{
|
||||
return addEnum(Options.class, name, langName, isSlider, isToggle);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Options addOptions(String name, String langName, boolean isSlider, boolean isToggle, float valMin, float valMax, float valStep)
|
||||
{
|
||||
return addEnum(Options.class, name,
|
||||
new Class<?>[]{String.class, boolean.class, boolean.class, float.class, float.class, float.class},
|
||||
langName, isSlider, isToggle, valMin, valMax, valStep);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static EnumOS addOS2(String name)
|
||||
{
|
||||
return addEnum(EnumOS.class, name);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static MusicTicker.MusicType addMusicType(String name, SoundEvent sound, int minDelay, int maxDelay)
|
||||
{
|
||||
return addEnum(MusicTicker.MusicType.class, name, sound, minDelay, maxDelay);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static <T extends Enum<? >> T addEnum(Class<T> enumType, String enumName, Object... paramValues)
|
||||
{
|
||||
return addEnum(clientTypes, enumType, enumName, paramValues);
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ import java.nio.ByteBuffer;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.vecmath.Matrix3f;
|
||||
@@ -40,6 +41,7 @@ import javax.vecmath.Vector4f;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.GameSettings;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.audio.SoundHandler;
|
||||
@@ -48,15 +50,12 @@ import net.minecraft.client.gui.BossInfoClient;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiMainMenu;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.BlockFaceUV;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
@@ -72,16 +71,13 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage;
|
||||
import net.minecraft.client.resources.FoliageColorReloadListener;
|
||||
import net.minecraft.client.resources.GrassColorReloadListener;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
import net.minecraft.client.resources.LanguageManager;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.client.util.SearchTreeManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -101,7 +97,6 @@ import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.registry.IRegistry;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraftforge.client.event.ColorHandlerEvent;
|
||||
@@ -111,7 +106,6 @@ import net.minecraftforge.client.event.FOVUpdateEvent;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.client.event.InputUpdateEvent;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.event.MouseEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderHandEvent;
|
||||
import net.minecraftforge.client.event.RenderSpecificHandEvent;
|
||||
@@ -132,25 +126,17 @@ import net.minecraftforge.common.model.IModelPart;
|
||||
import net.minecraftforge.common.model.ITransformation;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
import net.minecraftforge.fml.VersionChecker;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.lwjgl.BufferUtils;
|
||||
|
||||
import java.util.Optional;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
public class ForgeHooksClient
|
||||
{
|
||||
//private static final ResourceLocation ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png");
|
||||
|
||||
static TextureManager engine()
|
||||
{
|
||||
return FMLClientHandler.instance().getClient().renderEngine;
|
||||
}
|
||||
|
||||
public static String getArmorTexture(Entity entity, ItemStack armor, String _default, EntityEquipmentSlot slot, String type)
|
||||
{
|
||||
String result = armor.getItem().getArmorTexture(armor, entity, slot, type);
|
||||
@@ -406,18 +392,18 @@ public class ForgeHooksClient
|
||||
m.setIdentity();
|
||||
m.setTranslation(TRSRTransformation.toVecmath(transform.translation));
|
||||
t.setIdentity();
|
||||
t.rotY(transform.rotation.y);
|
||||
t.rotY(transform.rotation.func_195900_b());
|
||||
m.mul(t);
|
||||
t.setIdentity();
|
||||
t.rotX(transform.rotation.x);
|
||||
t.rotX(transform.rotation.func_195899_a());
|
||||
m.mul(t);
|
||||
t.setIdentity();
|
||||
t.rotZ(transform.rotation.z);
|
||||
t.rotZ(transform.rotation.func_195902_c());
|
||||
m.mul(t);
|
||||
t.setIdentity();
|
||||
t.m00 = transform.scale.x;
|
||||
t.m11 = transform.scale.y;
|
||||
t.m22 = transform.scale.z;
|
||||
t.m00 = transform.scale.func_195899_a();
|
||||
t.m11 = transform.scale.func_195900_b();
|
||||
t.m22 = transform.scale.func_195902_c();
|
||||
m.mul(t);
|
||||
return m;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user