Small cleanup

This commit is contained in:
glowredman committed 2022-12-21 22:37:33 +01:00
1 parent d5f332d48b
commit 4dd731102d
9 files changed
+55 -147

No files matched your search

@@ -12,31 +12,24 @@ public class DCLoadingPlugin implements IFMLLoadingPlugin{
@Override
public String[] getASMTransformerClass() {
// TODO Auto-generated method stub
return new String[]{DCASMManager.class.getName()};
}
@Override
public String getModContainerClass() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getSetupClass() {
// TODO Auto-generated method stub
return null;
}
@Override
public void injectData(Map<String, Object> data) {
// TODO Auto-generated method stub
}
public void injectData(Map<String, Object> data) {}
@Override
public String getAccessTransformerClass() {
// TODO Auto-generated method stub
return null;
}
@@ -8,14 +8,14 @@ import net.minecraft.util.ResourceLocation;
public class GuiButton_ChangeGUI extends GuiButton{
public GuiButton_ChangeGUI(int p_i1021_1_, int p_i1021_2_, int p_i1021_3_,int p_i1021_4_, int p_i1021_5_, String p_i1021_6_) {
super(p_i1021_1_, p_i1021_2_, p_i1021_3_, p_i1021_4_, p_i1021_5_, p_i1021_6_);
public GuiButton_ChangeGUI(int stateName, int id, int p_i1021_3_,int p_i1021_4_, int p_i1021_5_, String p_i1021_6_) {
super(stateName, id, p_i1021_3_, p_i1021_4_, p_i1021_5_, p_i1021_6_);
}
@Override
public void func_146113_a(SoundHandler p_146113_1_)
public void func_146113_a(SoundHandler soundHandlerIn)
{
p_146113_1_.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
Minecraft.getMinecraft().displayGuiScreen(new GuiMenuList(Minecraft.getMinecraft().currentScreen));
}
+24 -24
View File
@@ -15,53 +15,53 @@ public abstract class GuiElement {
public abstract int getY();
public void drawTexturedModalRect(int p_73729_1_, int p_73729_2_, int p_73729_3_, int p_73729_4_, int p_73729_5_, int p_73729_6_)
public void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height)
{
float f = 0.00390625F;
float f1 = 0.00390625F;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double)(p_73729_1_ + 0), (double)(p_73729_2_ + p_73729_6_), (double)this.zLevel, (double)((float)(p_73729_3_ + 0) * f), (double)((float)(p_73729_4_ + p_73729_6_) * f1));
tessellator.addVertexWithUV((double)(p_73729_1_ + p_73729_5_), (double)(p_73729_2_ + p_73729_6_), (double)this.zLevel, (double)((float)(p_73729_3_ + p_73729_5_) * f), (double)((float)(p_73729_4_ + p_73729_6_) * f1));
tessellator.addVertexWithUV((double)(p_73729_1_ + p_73729_5_), (double)(p_73729_2_ + 0), (double)this.zLevel, (double)((float)(p_73729_3_ + p_73729_5_) * f), (double)((float)(p_73729_4_ + 0) * f1));
tessellator.addVertexWithUV((double)(p_73729_1_ + 0), (double)(p_73729_2_ + 0), (double)this.zLevel, (double)((float)(p_73729_3_ + 0) * f), (double)((float)(p_73729_4_ + 0) * f1));
tessellator.addVertexWithUV((double)(x + 0), (double)(y + height), (double)this.zLevel, (double)((float)(textureX + 0) * f), (double)((float)(textureY + height) * f1));
tessellator.addVertexWithUV((double)(x + width), (double)(y + height), (double)this.zLevel, (double)((float)(textureX + width) * f), (double)((float)(textureY + height) * f1));
tessellator.addVertexWithUV((double)(x + width), (double)(y + 0), (double)this.zLevel, (double)((float)(textureX + width) * f), (double)((float)(textureY + 0) * f1));
tessellator.addVertexWithUV((double)(x + 0), (double)(y + 0), (double)this.zLevel, (double)((float)(textureX + 0) * f), (double)((float)(textureY + 0) * f1));
tessellator.draw();
}
public void drawTexturedModelRectFromIcon(int p_94065_1_, int p_94065_2_, IIcon p_94065_3_, int p_94065_4_, int p_94065_5_)
public void drawTexturedModelRectFromIcon(int x, int y, IIcon icon, int width, int height)
{
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double)(p_94065_1_ + 0), (double)(p_94065_2_ + p_94065_5_), (double)this.zLevel, (double)p_94065_3_.getMinU(), (double)p_94065_3_.getMaxV());
tessellator.addVertexWithUV((double)(p_94065_1_ + p_94065_4_), (double)(p_94065_2_ + p_94065_5_), (double)this.zLevel, (double)p_94065_3_.getMaxU(), (double)p_94065_3_.getMaxV());
tessellator.addVertexWithUV((double)(p_94065_1_ + p_94065_4_), (double)(p_94065_2_ + 0), (double)this.zLevel, (double)p_94065_3_.getMaxU(), (double)p_94065_3_.getMinV());
tessellator.addVertexWithUV((double)(p_94065_1_ + 0), (double)(p_94065_2_ + 0), (double)this.zLevel, (double)p_94065_3_.getMinU(), (double)p_94065_3_.getMinV());
tessellator.addVertexWithUV((double)(x + 0), (double)(y + height), (double)this.zLevel, (double)icon.getMinU(), (double)icon.getMaxV());
tessellator.addVertexWithUV((double)(x + width), (double)(y + height), (double)this.zLevel, (double)icon.getMaxU(), (double)icon.getMaxV());
tessellator.addVertexWithUV((double)(x + width), (double)(y + 0), (double)this.zLevel, (double)icon.getMaxU(), (double)icon.getMinV());
tessellator.addVertexWithUV((double)(x + 0), (double)(y + 0), (double)this.zLevel, (double)icon.getMinU(), (double)icon.getMinV());
tessellator.draw();
}
public static void func_146110_a(int p_146110_0_, int p_146110_1_, float p_146110_2_, float p_146110_3_, int p_146110_4_, int p_146110_5_, float p_146110_6_, float p_146110_7_)
public static void func_146110_a(int x, int y, float u, float v, int width, int height, float textureWidth, float textureHeight)
{
float f4 = 1.0F / p_146110_6_;
float f5 = 1.0F / p_146110_7_;
float f4 = 1.0F / textureWidth;
float f5 = 1.0F / textureHeight;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double)p_146110_0_, (double)(p_146110_1_ + p_146110_5_), 0.0D, (double)(p_146110_2_ * f4), (double)((p_146110_3_ + (float)p_146110_5_) * f5));
tessellator.addVertexWithUV((double)(p_146110_0_ + p_146110_4_), (double)(p_146110_1_ + p_146110_5_), 0.0D, (double)((p_146110_2_ + (float)p_146110_4_) * f4), (double)((p_146110_3_ + (float)p_146110_5_) * f5));
tessellator.addVertexWithUV((double)(p_146110_0_ + p_146110_4_), (double)p_146110_1_, 0.0D, (double)((p_146110_2_ + (float)p_146110_4_) * f4), (double)(p_146110_3_ * f5));
tessellator.addVertexWithUV((double)p_146110_0_, (double)p_146110_1_, 0.0D, (double)(p_146110_2_ * f4), (double)(p_146110_3_ * f5));
tessellator.addVertexWithUV((double)x, (double)(y + height), 0.0D, (double)(u * f4), (double)((v + (float)height) * f5));
tessellator.addVertexWithUV((double)(x + width), (double)(y + height), 0.0D, (double)((u + (float)width) * f4), (double)((v + (float)height) * f5));
tessellator.addVertexWithUV((double)(x + width), (double)y, 0.0D, (double)((u + (float)width) * f4), (double)(v * f5));
tessellator.addVertexWithUV((double)x, (double)y, 0.0D, (double)(u * f4), (double)(v * f5));
tessellator.draw();
}
public static void func_152125_a(int p_152125_0_, int p_152125_1_, float p_152125_2_, float p_152125_3_, int p_152125_4_, int p_152125_5_, int p_152125_6_, int p_152125_7_, float p_152125_8_, float p_152125_9_)
public static void func_152125_a(int x, int y, float u, float v, int uWidth, int vHeight, int width, int height, float tileWidth, float tileHeight)
{
float f4 = 1.0F / p_152125_8_;
float f5 = 1.0F / p_152125_9_;
float f4 = 1.0F / tileWidth;
float f5 = 1.0F / tileHeight;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double)p_152125_0_, (double)(p_152125_1_ + p_152125_7_), 0.0D, (double)(p_152125_2_ * f4), (double)((p_152125_3_ + (float)p_152125_5_) * f5));
tessellator.addVertexWithUV((double)(p_152125_0_ + p_152125_6_), (double)(p_152125_1_ + p_152125_7_), 0.0D, (double)((p_152125_2_ + (float)p_152125_4_) * f4), (double)((p_152125_3_ + (float)p_152125_5_) * f5));
tessellator.addVertexWithUV((double)(p_152125_0_ + p_152125_6_), (double)p_152125_1_, 0.0D, (double)((p_152125_2_ + (float)p_152125_4_) * f4), (double)(p_152125_3_ * f5));
tessellator.addVertexWithUV((double)p_152125_0_, (double)p_152125_1_, 0.0D, (double)(p_152125_2_ * f4), (double)(p_152125_3_ * f5));
tessellator.addVertexWithUV((double)x, (double)(y + height), 0.0D, (double)(u * f4), (double)((v + (float)vHeight) * f5));
tessellator.addVertexWithUV((double)(x + width), (double)(y + height), 0.0D, (double)((u + (float)uWidth) * f4), (double)((v + (float)vHeight) * f5));
tessellator.addVertexWithUV((double)(x + width), (double)y, 0.0D, (double)((u + (float)uWidth) * f4), (double)(v * f5));
tessellator.addVertexWithUV((double)x, (double)y, 0.0D, (double)(u * f4), (double)(v * f5));
tessellator.draw();
}
@@ -84,7 +84,7 @@ public class GuiMainMenuOld extends GuiMainMenu implements IMainMenu{
}
@Override
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
Tessellator tessellator = Tessellator.instance;
short short1 = 274;
@@ -133,23 +133,23 @@ public class GuiMainMenuOld extends GuiMainMenu implements IMainMenu{
for (k1 = 0; k1 < this.buttonList.size(); ++k1)
{
drawButton(((GuiButton)this.buttonList.get(k1)),this.mc, p_73863_1_, p_73863_2_);
drawButton(((GuiButton)this.buttonList.get(k1)),this.mc, mouseX, mouseY);
}
for (k1 = 0; k1 < this.labelList.size(); ++k1)
{
((GuiLabel)this.labelList.get(k1)).func_146159_a(this.mc, p_73863_1_, p_73863_2_);
((GuiLabel)this.labelList.get(k1)).func_146159_a(this.mc, mouseX, mouseY);
}
}
public void drawButton(GuiButton button,Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_)
public void drawButton(GuiButton button,Minecraft mc, int mouseX, int mouseY)
{
if (button.enabled)
{
FontRenderer fontrenderer = p_146112_1_.fontRenderer;
p_146112_1_.getTextureManager().bindTexture(buttonTextures);
FontRenderer fontrenderer = mc.fontRenderer;
mc.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
boolean field_146123_n = p_146112_2_ >= button.xPosition && p_146112_3_ >= button.yPosition && p_146112_2_ < button.xPosition + button.width && p_146112_3_ < button.yPosition + button.height;
boolean field_146123_n = mouseX >= button.xPosition && mouseY >= button.yPosition && mouseX < button.xPosition + button.width && mouseY < button.yPosition + button.height;
int k = button.getHoverState(field_146123_n);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
@@ -1,10 +1,5 @@
package DummyCore.Core;
import java.lang.reflect.Method;
import java.util.Arrays;
import net.minecraft.command.CommandHandler;
import net.minecraft.server.MinecraftServer;
import net.minecraftforge.common.MinecraftForge;
import DummyCore.Utils.CommandTransfer;
import DummyCore.Utils.DummyConfig;
import DummyCore.Utils.DummyDataUtils;
@@ -17,16 +12,18 @@ import DummyCore.Utils.NetProxy_Server;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.relauncher.Side;
import java.lang.reflect.Method;
import net.minecraft.command.CommandHandler;
import net.minecraft.server.MinecraftServer;
import net.minecraftforge.common.MinecraftForge;
/**
* @author Modbder
@@ -46,79 +43,9 @@ public class CoreInitialiser{
public static NetProxy_Server proxy;
public static final DummyPacketHandler packetHandler = new DummyPacketHandler();
/*
@Subscribe
public void constructMod(FMLConstructionEvent event)
{
System.out.println(event);
System.out.println(this);
System.out.println(languageAdapter);
System.out.println(event.getASMHarvestedData().getAnnotationsFor(this));
Set<ASMData> targets = event.getASMHarvestedData().getAnnotationsFor(this).get(SidedProxy.class.getName());
System.out.println(targets.size());
System.out.println(targets);
System.out.println(targets.isEmpty());
NetworkRegistry.INSTANCE.register(this, this.getClass(), null, event.getASMHarvestedData());
ProxyInjector.inject(this, event.getASMHarvestedData(), FMLCommonHandler.instance().getSide(), languageAdapter);
}
*/
public CoreInitialiser()
{
/*
super(initMetadata());
instance = this;
languageAdapter = new ILanguageAdapter.JavaAdapter();
*/
}
/*
@Override
public boolean registerBus(EventBus bus, LoadController controller)
{
bus.register(instance);
return true;
}
@Override
public Object getMod()
{
return instance;
}
*/
public static ModMetadata initMetadata()
{
ModMetadata meta = new ModMetadata();
meta.autogenerated = false;
meta.modId = modid;
meta.name = modname;
meta.version = version;
meta.credits = "Modbder";
meta.authorList= Arrays.asList(new String[] {
"Dummy Thinking Team; Modbder; TheDen2099"
});
meta.description="Dummy Core is a required package to launch mods made by Dummy Thinking team.";
return meta;
}
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
ModMetadata meta = e.getModMetadata();
meta.autogenerated = false;
meta.modId = modid;
meta.name = modname;
meta.version = version;
meta.credits = "Modbder";
meta.authorList= Arrays.asList(new String[] {
"Dummy Thinking Team; Modbder; TheDen2099"
});
meta.description="Dummy Core is a required package to launch mods made by Dummy Thinking team.";
if(instance == null) instance = this;
network = NetworkRegistry.INSTANCE.newSimpleChannel("DummyCore");
@@ -162,13 +89,6 @@ public class CoreInitialiser{
proxy.registerInit();
}
@Deprecated
@EventHandler
public void onServerStart(FMLServerAboutToStartEvent e)
{
//DummyDataUtils.load(e);
}
@EventHandler
public void onServerStop(FMLServerStoppedEvent e)
{
@@ -76,7 +76,6 @@ public final class CreativePageItems extends CreativeTabs{
@Override
public Item getTabIconItem() {
// TODO Auto-generated method stub
return (Item) Item.itemRegistry.getObject("minecraft:iron_axe");
}
}
@@ -8,21 +8,18 @@ public class CommandTransfer extends CommandBase {
@Override
public String getCommandName() {
// TODO Auto-generated method stub
return "DummyCore.Transfer";
}
@Override
public String getCommandUsage(ICommandSender p_71518_1_) {
// TODO Auto-generated method stub
public String getCommandUsage(ICommandSender sender) {
return "/DummyCore.Transfer <player> <dimensionID>";
}
@Override
public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
// TODO Auto-generated method stub
int var3 = parseIntWithMin(p_71515_1_, p_71515_2_[1], Integer.MIN_VALUE);
EntityPlayerMP player = p_71515_2_.length == 0 ? getCommandSenderAsPlayer(p_71515_1_) : getPlayer(p_71515_1_, p_71515_2_[0]);
public void processCommand(ICommandSender sender, String[] args) {
int var3 = parseIntWithMin(sender, args[1], Integer.MIN_VALUE);
EntityPlayerMP player = args.length == 0 ? getCommandSenderAsPlayer(sender) : getPlayer(sender, args[0]);
player.travelToDimension(var3);
}
@@ -173,7 +173,6 @@ public class DummyEventHandler {
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return;
}
+11 -11
View File
@@ -662,24 +662,24 @@ public class MiscUtils {
/**
* Actually draws a textured rectangle
* @param p_73729_1_ - first vertex U
* @param p_73729_2_ - first vertex V
* @param p_73729_3_ - second vertex U
* @param p_73729_4_ - second vertex V
* @param p_73729_5_ - third vertex U
* @param p_73729_6_ - third vertex V
* @param x - first vertex U
* @param y - first vertex V
* @param textureX - second vertex U
* @param textureY - second vertex V
* @param width - third vertex U
* @param height - third vertex V
* @param zLevel - the zlevel on the GUI
*/
public static void drawTexturedModalRect(int p_73729_1_, int p_73729_2_, int p_73729_3_, int p_73729_4_, int p_73729_5_, int p_73729_6_, int zLevel)
public static void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height, int zLevel)
{
float f = 0.00390625F;
float f1 = 0.00390625F;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double)(p_73729_1_ + 0), (double)(p_73729_2_ + p_73729_6_), (double)zLevel, (double)((float)(p_73729_3_ + 0) * f), (double)((float)(p_73729_4_ + p_73729_6_) * f1));
tessellator.addVertexWithUV((double)(p_73729_1_ + p_73729_5_), (double)(p_73729_2_ + p_73729_6_), (double)zLevel, (double)((float)(p_73729_3_ + p_73729_5_) * f), (double)((float)(p_73729_4_ + p_73729_6_) * f1));
tessellator.addVertexWithUV((double)(p_73729_1_ + p_73729_5_), (double)(p_73729_2_ + 0), (double)zLevel, (double)((float)(p_73729_3_ + p_73729_5_) * f), (double)((float)(p_73729_4_ + 0) * f1));
tessellator.addVertexWithUV((double)(p_73729_1_ + 0), (double)(p_73729_2_ + 0), (double)zLevel, (double)((float)(p_73729_3_ + 0) * f), (double)((float)(p_73729_4_ + 0) * f1));
tessellator.addVertexWithUV((double)(x + 0), (double)(y + height), (double)zLevel, (double)((float)(textureX + 0) * f), (double)((float)(textureY + height) * f1));
tessellator.addVertexWithUV((double)(x + width), (double)(y + height), (double)zLevel, (double)((float)(textureX + width) * f), (double)((float)(textureY + height) * f1));
tessellator.addVertexWithUV((double)(x + width), (double)(y + 0), (double)zLevel, (double)((float)(textureX + width) * f), (double)((float)(textureY + 0) * f1));
tessellator.addVertexWithUV((double)(x + 0), (double)(y + 0), (double)zLevel, (double)((float)(textureX + 0) * f), (double)((float)(textureY + 0) * f1));
tessellator.draw();
}