mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-10-26 14:24:14 +00:00
Compare commits
9
Commits
1.5.26-GTNH
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdc57215e3 | ||
|
|
9f42531f37 | ||
|
|
95453b430e | ||
|
|
3635266bd5 | ||
|
|
fedee1ba43 | ||
|
|
6f183b615e | ||
|
|
15b257d120 | ||
|
|
4ead9f53fb | ||
|
|
305e09ae4f |
No files matched your search
@@ -10,6 +10,7 @@ dependencies {
|
|||||||
compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.4.12:dev") {transitive = false}
|
compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.4.12:dev") {transitive = false}
|
||||||
compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.1:dev") {transitive = false}
|
compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.1:dev") {transitive = false}
|
||||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.11-GTNH:dev') {transitive = false}
|
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.11-GTNH:dev') {transitive = false}
|
||||||
|
compileOnly("com.github.GTNewHorizons:Botania:1.13.36-GTNH:dev") {transitive = false}
|
||||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.461:dev") {transitive = false}
|
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.461:dev") {transitive = false}
|
||||||
compileOnly("com.github.GTNewHorizons:Backhand:1.8.8:dev") {transitive = false}
|
compileOnly("com.github.GTNewHorizons:Backhand:1.8.8:dev") {transitive = false}
|
||||||
|
|
||||||
@@ -18,4 +19,5 @@ dependencies {
|
|||||||
|
|
||||||
compileOnly('curse.maven:automagy-222153:2285272')
|
compileOnly('curse.maven:automagy-222153:2285272')
|
||||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.25:dev')
|
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.25:dev')
|
||||||
|
runtimeOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.118-GTNH:dev")
|
||||||
}
|
}
|
||||||
@@ -186,6 +186,11 @@ modrinthRelations =
|
|||||||
# Leave this empty if you don't want to publish on CurseForge.
|
# Leave this empty if you don't want to publish on CurseForge.
|
||||||
curseForgeProjectId =
|
curseForgeProjectId =
|
||||||
|
|
||||||
|
# Comma-separated supported CurseForge environments: client, server (case-insensitive).
|
||||||
|
# Use client or server for mods that only support one environment. Defaults to client,server.
|
||||||
|
# These tags describe where the mod can run, not whether installation is required on both sides.
|
||||||
|
curseForgeEnvironments = client,server
|
||||||
|
|
||||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||||
# Syntax: type1:name1;type2:name2;...
|
# Syntax: type1:name1;type2:name2;...
|
||||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#This file is generated by updateDaemonJvm
|
#This file is generated by updateDaemonJvm
|
||||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect
|
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
|
||||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect
|
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
|
||||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect
|
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
|
||||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
|
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
|
||||||
toolchainVersion=25
|
toolchainVersion=25
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
|
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.34'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -26,7 +26,9 @@ import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
|||||||
version = References.VERSION,
|
version = References.VERSION,
|
||||||
canBeDeactivated = false,
|
canBeDeactivated = false,
|
||||||
guiFactory = References.GUIFACTORY,
|
guiFactory = References.GUIFACTORY,
|
||||||
dependencies = "after:NotEnoughItems;" + "after:ThermalExpansion;" + "after:ThermalFoundation;")
|
dependencies = "after:NotEnoughItems;" + "after:ThermalExpansion;"
|
||||||
|
+ "after:ThermalFoundation;"
|
||||||
|
+ "required-after:gtnhlib@[0.9.47,);")
|
||||||
public class DraconicEvolution {
|
public class DraconicEvolution {
|
||||||
|
|
||||||
@Mod.Instance(References.MODID)
|
@Mod.Instance(References.MODID)
|
||||||
|
|||||||
@@ -2,8 +2,12 @@ package com.brandon3055.draconicevolution.api;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import net.minecraft.util.ChunkCoordinates;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||||
import com.brandon3055.draconicevolution.common.world.ChaosWorldGenHandler;
|
import com.brandon3055.draconicevolution.common.world.ChaosWorldGenHandler;
|
||||||
import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator;
|
import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator;
|
||||||
@@ -67,4 +71,25 @@ public class GeneratorOverride {
|
|||||||
public static void setOreEnabledInEnd(boolean cometsEnabled) {
|
public static void setOreEnabledInEnd(boolean cometsEnabled) {
|
||||||
DraconicWorldGenerator.oreEnabledInEnd = cometsEnabled;
|
DraconicWorldGenerator.oreEnabledInEnd = cometsEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns coordinates of the nearest chaos island for the given chunk, or {@code null}
|
||||||
|
* <p>
|
||||||
|
* This is for mods who need to know where chaos islands generate, for example to avoid overlapping their own world
|
||||||
|
* features.
|
||||||
|
*
|
||||||
|
* @param chunkX chunk X position
|
||||||
|
* @param chunkZ chunk Z position
|
||||||
|
* @return Chaos Island Center coordinates, or {@code null} if none generates for that cell
|
||||||
|
*/
|
||||||
|
public static @Nullable ChunkCoordinates getNearestChaosIslandCenter(int chunkX, int chunkZ) {
|
||||||
|
if (!DraconicWorldGenerator.chaosIslandsEnabled || !ConfigHandler.generateChaosIslands) return null;
|
||||||
|
|
||||||
|
DataUtils.XZPair<Integer, Integer> center = ChaosWorldGenHandler.getClosestChaosSpawn(chunkX, chunkZ);
|
||||||
|
|
||||||
|
// tHe island in (0, 0) is never generated
|
||||||
|
if (center.x == 0 && center.z == 0) return null;
|
||||||
|
|
||||||
|
return new ChunkCoordinates(center.x, 80, center.z);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+3
-2
@@ -28,6 +28,7 @@ import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIBase;
|
|||||||
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
|
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
|
||||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||||
import com.brandon3055.draconicevolution.common.items.weapons.BowHandler;
|
import com.brandon3055.draconicevolution.common.items.weapons.BowHandler;
|
||||||
|
import com.brandon3055.draconicevolution.common.items.weapons.IEnergyContainerBowItem;
|
||||||
import com.brandon3055.draconicevolution.common.lib.References;
|
import com.brandon3055.draconicevolution.common.lib.References;
|
||||||
import com.brandon3055.draconicevolution.common.network.ContributorPacket;
|
import com.brandon3055.draconicevolution.common.network.ContributorPacket;
|
||||||
import com.brandon3055.draconicevolution.common.network.ItemConfigPacket;
|
import com.brandon3055.draconicevolution.common.network.ItemConfigPacket;
|
||||||
@@ -310,11 +311,11 @@ public class GUIToolConfig extends GUIBase {
|
|||||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||||
|
|
||||||
if (slot > -1) editingItem = player.inventory.getStackInSlot(slot);
|
if (slot > -1) editingItem = player.inventory.getStackInSlot(slot);
|
||||||
if (slot > -1 && editingItem != null && editingItem.getUnlocalizedName().toLowerCase().contains("bow")) {
|
if (slot > -1 && editingItem != null && editingItem.getItem() instanceof IEnergyContainerBowItem) {
|
||||||
BowHandler.BowProperties properties = new BowHandler.BowProperties(editingItem, player);
|
BowHandler.BowProperties properties = new BowHandler.BowProperties(editingItem, player);
|
||||||
|
|
||||||
if (!properties.canFire() && properties.cantFireMessage != null
|
if (!properties.canFire() && properties.cantFireMessage != null
|
||||||
&& !properties.cantFireMessage.equals("msg.de.outOfArrows.name")) {
|
&& !properties.cantFireMessage.equals("msg.de.outOfArrows.txt")) {
|
||||||
fontRendererObj.drawSplitString(
|
fontRendererObj.drawSplitString(
|
||||||
StatCollector.translateToLocal(properties.cantFireMessage),
|
StatCollector.translateToLocal(properties.cantFireMessage),
|
||||||
0,
|
0,
|
||||||
|
|||||||
@@ -139,6 +139,17 @@ public final class HudHandler {
|
|||||||
showShieldHud = false;
|
showShieldHud = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!shouldDisplayArmorHud(summary)) {
|
||||||
|
showShieldHud = false;
|
||||||
|
armorStatsFadeOut = 0F;
|
||||||
|
maxShieldPoints = 0F;
|
||||||
|
shieldPoints = 0F;
|
||||||
|
shieldPercentCharge = 0;
|
||||||
|
shieldEntropy = 0F;
|
||||||
|
rfCharge = 0;
|
||||||
|
rfTotal = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
showShieldHud = armorStatsFadeOut > 0F;
|
showShieldHud = armorStatsFadeOut > 0F;
|
||||||
|
|
||||||
if (maxShieldPoints != summary.maxProtectionPoints || shieldPoints != summary.protectionPoints
|
if (maxShieldPoints != summary.maxProtectionPoints || shieldPoints != summary.protectionPoints
|
||||||
@@ -155,6 +166,10 @@ public final class HudHandler {
|
|||||||
rfTotal = summary.totalEnergyStored;
|
rfTotal = summary.totalEnergyStored;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean shouldDisplayArmorHud(ArmorSummary summary) {
|
||||||
|
return summary.maxProtectionPoints > 0F || summary.maxTotalEnergyStorage > 0;
|
||||||
|
}
|
||||||
|
|
||||||
private void drawArmorHUD(int x, int y, boolean rotated, double scale) {
|
private void drawArmorHUD(int x, int y, boolean rotated, double scale) {
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import java.util.Arrays;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ public class ResourceHandler {
|
|||||||
private static ResourceLocation particles = new ResourceLocation(
|
private static ResourceLocation particles = new ResourceLocation(
|
||||||
References.RESOURCESPREFIX + "textures/particle/particles.png");
|
References.RESOURCESPREFIX + "textures/particle/particles.png");
|
||||||
private static Map<String, ResourceLocation> cachedResources = new HashMap<String, ResourceLocation>();
|
private static Map<String, ResourceLocation> cachedResources = new HashMap<String, ResourceLocation>();
|
||||||
public static Map<String, CustomResourceLocation> downloadedImages = new HashMap<String, CustomResourceLocation>();
|
public static Map<String, CustomResourceLocation> downloadedImages = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private static String savePath;
|
private static String savePath;
|
||||||
private static File saveFolder;
|
private static File saveFolder;
|
||||||
@@ -64,7 +65,6 @@ public class ResourceHandler {
|
|||||||
if (downloadThread.isReloadRequired()) LogHelper.info("Image Download Finished");
|
if (downloadThread.isReloadRequired()) LogHelper.info("Image Download Finished");
|
||||||
downloadStatus = downloadThread.wasSuccessful ? 1 : 2;
|
downloadStatus = downloadThread.wasSuccessful ? 1 : 2;
|
||||||
FMLCommonHandler.instance().bus().unregister(this);
|
FMLCommonHandler.instance().bus().unregister(this);
|
||||||
addRSPack(event != null);
|
|
||||||
downloadThread = null;
|
downloadThread = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,6 +74,10 @@ public class ResourceHandler {
|
|||||||
|
|
||||||
if (event != null) savePath = event.getModConfigurationDirectory().getParentFile().getAbsolutePath()
|
if (event != null) savePath = event.getModConfigurationDirectory().getParentFile().getAbsolutePath()
|
||||||
+ "/config/draconicevolution";
|
+ "/config/draconicevolution";
|
||||||
|
|
||||||
|
// Register the namespace before FML's final reload; folder-pack files are resolved on demand.
|
||||||
|
getImagesFolder();
|
||||||
|
addRSPack();
|
||||||
GUIManual.loadPages();
|
GUIManual.loadPages();
|
||||||
|
|
||||||
downloadThread = new DownloadThread(GUIManual.imageURLs);
|
downloadThread = new DownloadThread(GUIManual.imageURLs);
|
||||||
@@ -83,7 +87,7 @@ public class ResourceHandler {
|
|||||||
public static class DownloadThread extends Thread {
|
public static class DownloadThread extends Thread {
|
||||||
|
|
||||||
private List<String> imageURLs;
|
private List<String> imageURLs;
|
||||||
private boolean isFinished = false;
|
private volatile boolean isFinished = false;
|
||||||
private boolean wasSuccessful = true;
|
private boolean wasSuccessful = true;
|
||||||
private boolean reloadRequired = false;
|
private boolean reloadRequired = false;
|
||||||
|
|
||||||
@@ -171,7 +175,7 @@ public class ResourceHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addRSPack(boolean refreash) {
|
private static void addRSPack() {
|
||||||
File rspack = new File(getConfigFolder(), "/resources");
|
File rspack = new File(getConfigFolder(), "/resources");
|
||||||
if (!rspack.exists()) return;
|
if (!rspack.exists()) return;
|
||||||
|
|
||||||
@@ -200,7 +204,6 @@ public class ResourceHandler {
|
|||||||
|
|
||||||
f.set(Minecraft.getMinecraft(), defaultResourcePacks);
|
f.set(Minecraft.getMinecraft(), defaultResourcePacks);
|
||||||
LogHelper.info("RS Added");
|
LogHelper.info("RS Added");
|
||||||
if (refreash) Minecraft.getMinecraft().refreshResources();
|
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ public class ModelRenderOBJ extends ModelRenderer {
|
|||||||
this.compileDisplayList(scale);
|
this.compileDisplayList(scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ResourceHandler.bindTexture(texture);
|
||||||
GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ);
|
GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ);
|
||||||
|
|
||||||
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
|
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
|
||||||
@@ -84,7 +85,6 @@ public class ModelRenderOBJ extends ModelRenderer {
|
|||||||
GL11.glNewList(this.displayList, GL11.GL_COMPILE);
|
GL11.glNewList(this.displayList, GL11.GL_COMPILE);
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
ResourceHandler.bindTexture(texture);
|
|
||||||
// scale = 1F/15F;
|
// scale = 1F/15F;
|
||||||
GL11.glScalef(scale, scale, scale);
|
GL11.glScalef(scale, scale, scale);
|
||||||
GL11.glRotatef(180, -1, 0, 1);
|
GL11.glRotatef(180, -1, 0, 1);
|
||||||
@@ -102,6 +102,7 @@ public class ModelRenderOBJ extends ModelRenderer {
|
|||||||
this.compileDisplayList(scale);
|
this.compileDisplayList(scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ResourceHandler.bindTexture(texture);
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
|
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
|
||||||
if (this.rotateAngleY != 0.0F) {
|
if (this.rotateAngleY != 0.0F) {
|
||||||
|
|||||||
+10
-4
@@ -15,6 +15,12 @@ import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
|||||||
|
|
||||||
public class RenderMobSoul implements IItemRenderer {
|
public class RenderMobSoul implements IItemRenderer {
|
||||||
|
|
||||||
|
public static volatile boolean applyTimeRotation = true;
|
||||||
|
|
||||||
|
public static float getRotationAngle() {
|
||||||
|
return (float) (Minecraft.getSystemTime() / -10);
|
||||||
|
}
|
||||||
|
|
||||||
private final Minecraft mc;
|
private final Minecraft mc;
|
||||||
private final String[] randomEntities = new String[] { "Pig", "Sheep", "Enderman", "Zombie", "Creeper", "Cow",
|
private final String[] randomEntities = new String[] { "Pig", "Sheep", "Enderman", "Zombie", "Creeper", "Cow",
|
||||||
"Chicken", "Ozelot", "Witch", "Wolf", "MushroomCow", "Squid", "EntityHorse", "Spider", "Skeleton", "Blaze",
|
"Chicken", "Ozelot", "Witch", "Wolf", "MushroomCow", "Squid", "EntityHorse", "Spider", "Skeleton", "Blaze",
|
||||||
@@ -58,7 +64,7 @@ public class RenderMobSoul implements IItemRenderer {
|
|||||||
GL11.glScalef(13F, 13F, 13F);
|
GL11.glScalef(13F, 13F, 13F);
|
||||||
GL11.glTranslated(1.2, 2.2, 0);
|
GL11.glTranslated(1.2, 2.2, 0);
|
||||||
GL11.glRotatef(180F, 1F, 0F, 0F);
|
GL11.glRotatef(180F, 1F, 0F, 0F);
|
||||||
GL11.glRotatef(mc.getSystemTime() / -10, 0F, 1F, 0F);
|
if (applyTimeRotation) GL11.glRotatef(getRotationAngle(), 0F, 1F, 0F);
|
||||||
GL11.glRotatef(-20F, 1F, 0F, 0F);
|
GL11.glRotatef(-20F, 1F, 0F, 0F);
|
||||||
RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F);
|
RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
@@ -67,7 +73,7 @@ public class RenderMobSoul implements IItemRenderer {
|
|||||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||||
GL11.glTranslated(2, 0.5, 0);
|
GL11.glTranslated(2, 0.5, 0);
|
||||||
GL11.glRotatef(20F, 0F, 0F, 1F);
|
GL11.glRotatef(20F, 0F, 0F, 1F);
|
||||||
GL11.glRotatef(mc.getSystemTime() / -10, 0F, 1F, 0F);
|
if (applyTimeRotation) GL11.glRotatef(getRotationAngle(), 0F, 1F, 0F);
|
||||||
GL11.glRotatef(-20F, 1F, 0F, 0F);
|
GL11.glRotatef(-20F, 1F, 0F, 0F);
|
||||||
RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F);
|
RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
@@ -76,14 +82,14 @@ public class RenderMobSoul implements IItemRenderer {
|
|||||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||||
GL11.glTranslated(1, 0.5, 0);
|
GL11.glTranslated(1, 0.5, 0);
|
||||||
GL11.glRotatef(20F, 0F, 0F, 1F);
|
GL11.glRotatef(20F, 0F, 0F, 1F);
|
||||||
GL11.glRotatef(mc.getSystemTime() / -10, 0F, 1F, 0F);
|
if (applyTimeRotation) GL11.glRotatef(getRotationAngle(), 0F, 1F, 0F);
|
||||||
GL11.glRotatef(-20F, 1F, 0F, 0F);
|
GL11.glRotatef(-20F, 1F, 0F, 0F);
|
||||||
RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F);
|
RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
} else {
|
} else {
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glScalef(1.5F, 1.5F, 1.5F);
|
GL11.glScalef(1.5F, 1.5F, 1.5F);
|
||||||
GL11.glRotatef(mc.getSystemTime() / -10, 0F, 1F, 0F);
|
if (applyTimeRotation) GL11.glRotatef(getRotationAngle(), 0F, 1F, 0F);
|
||||||
GL11.glRotatef(-20F, 1F, 0F, 0F);
|
GL11.glRotatef(-20F, 1F, 0F, 0F);
|
||||||
GL11.glEnable(GL11.GL_BLEND);
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|||||||
+10
-8
@@ -22,24 +22,28 @@ import com.brandon3055.draconicevolution.common.tileentities.TilePlacedItem;
|
|||||||
*/
|
*/
|
||||||
public class RenderTilePlacedItem extends TileEntitySpecialRenderer {
|
public class RenderTilePlacedItem extends TileEntitySpecialRenderer {
|
||||||
|
|
||||||
|
private static final float MOBSOUL_CENTER_X = 0.5F;
|
||||||
|
private static final float MOBSOUL_CENTER_Y = 0.3F;
|
||||||
|
private static final float MOBSOUL_CENTER_Z = 0.5F;
|
||||||
|
|
||||||
private final EntityItem cachedEntity = new EntityItem(null, 0, 0, 0, new ItemStack(Items.apple));
|
private final EntityItem cachedEntity = new EntityItem(null, 0, 0, 0, new ItemStack(Items.apple));
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float timeSinceLastTick) {
|
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float timeSinceLastTick) {
|
||||||
if (!(te instanceof TilePlacedItem tile)) return;
|
if (!(te instanceof TilePlacedItem tile)) return;
|
||||||
if (tile.getStack() == null) return;
|
ItemStack stack = tile.getStack();
|
||||||
|
// I think without this check it could have thrown a NPE if an item being displayed was removed
|
||||||
|
if (stack == null || stack.getItem() == null) return;
|
||||||
|
if (tile.getWorldObj() == null) return;
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
|
|
||||||
GL11.glTranslated(x, y, z);
|
GL11.glTranslated(x, y, z);
|
||||||
renderItem(tile);
|
renderItem(tile);
|
||||||
GL11.glPopAttrib();
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderItem(TilePlacedItem tile) {
|
public void renderItem(TilePlacedItem tile) {
|
||||||
ItemStack stack = tile.getStack();
|
ItemStack stack = tile.getStack();
|
||||||
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||||
// itemEntity.getEntityItem().stackSize = 1;
|
|
||||||
final Item item = stack.getItem();
|
final Item item = stack.getItem();
|
||||||
boolean is3D = item.isFull3D();
|
boolean is3D = item.isFull3D();
|
||||||
boolean isBlock = item instanceof ItemBlock;
|
boolean isBlock = item instanceof ItemBlock;
|
||||||
@@ -58,7 +62,7 @@ public class RenderTilePlacedItem extends TileEntitySpecialRenderer {
|
|||||||
GL11.glRotatef(tile.rotation, 0F, 0F, 1F);
|
GL11.glRotatef(tile.rotation, 0F, 0F, 1F);
|
||||||
GL11.glTranslatef(0.0F, -0.21F, 0.0F);
|
GL11.glTranslatef(0.0F, -0.21F, 0.0F);
|
||||||
} else if (item instanceof MobSoul) {
|
} else if (item instanceof MobSoul) {
|
||||||
GL11.glTranslatef(0.5F, 0.3F, 0.5F);
|
GL11.glTranslatef(MOBSOUL_CENTER_X, MOBSOUL_CENTER_Y, MOBSOUL_CENTER_Z);
|
||||||
} else {
|
} else {
|
||||||
GL11.glRotatef(90F, -1F, 0F, 0F);
|
GL11.glRotatef(90F, -1F, 0F, 0F);
|
||||||
GL11.glTranslatef(0.5F, -0.65F, 0.02F);
|
GL11.glTranslatef(0.5F, -0.65F, 0.02F);
|
||||||
@@ -68,7 +72,6 @@ public class RenderTilePlacedItem extends TileEntitySpecialRenderer {
|
|||||||
GL11.glTranslatef(0.0F, -0.18F, 0.0F);
|
GL11.glTranslatef(0.0F, -0.18F, 0.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
|
|
||||||
RenderItem.renderInFrame = true;
|
RenderItem.renderInFrame = true;
|
||||||
try {
|
try {
|
||||||
this.cachedEntity.setEntityItemStack(stack);
|
this.cachedEntity.setEntityItemStack(stack);
|
||||||
@@ -78,9 +81,8 @@ public class RenderTilePlacedItem extends TileEntitySpecialRenderer {
|
|||||||
} finally {
|
} finally {
|
||||||
this.cachedEntity.setEntityItemStack(null);
|
this.cachedEntity.setEntityItemStack(null);
|
||||||
this.cachedEntity.setWorld(null);
|
this.cachedEntity.setWorld(null);
|
||||||
|
RenderItem.renderInFrame = false;
|
||||||
}
|
}
|
||||||
RenderItem.renderInFrame = false;
|
|
||||||
GL11.glPopAttrib();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void metaAdjustItemTool(int meta) {
|
private void metaAdjustItemTool(int meta) {
|
||||||
|
|||||||
@@ -39,9 +39,11 @@ import com.gtnewhorizon.gtnhlib.GTNHLib;
|
|||||||
|
|
||||||
import baubles.api.BaubleType;
|
import baubles.api.BaubleType;
|
||||||
import baubles.api.IBauble;
|
import baubles.api.IBauble;
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.Optional;
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import vazkii.botania.common.block.subtile.functional.SubTileSolegnolia;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by brandon3055 on 9/3/2016.
|
* Created by brandon3055 on 9/3/2016.
|
||||||
@@ -50,6 +52,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||||||
@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles")
|
@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles")
|
||||||
public class Magnet extends ItemDE implements IBauble, IConfigurableItem {
|
public class Magnet extends ItemDE implements IBauble, IConfigurableItem {
|
||||||
|
|
||||||
|
private static final boolean BOTANIA_LOADED = Loader.isModLoaded("Botania");
|
||||||
|
|
||||||
private IIcon draconium;
|
private IIcon draconium;
|
||||||
private IIcon awakened;
|
private IIcon awakened;
|
||||||
|
|
||||||
@@ -61,8 +65,10 @@ public class Magnet extends ItemDE implements IBauble, IConfigurableItem {
|
|||||||
DELAY,
|
DELAY,
|
||||||
NEVER;
|
NEVER;
|
||||||
|
|
||||||
|
public static final SelfPickUpMode[] VALUES = values();
|
||||||
|
|
||||||
public SelfPickUpMode next() {
|
public SelfPickUpMode next() {
|
||||||
final SelfPickUpMode[] values = SelfPickUpMode.values();
|
final SelfPickUpMode[] values = SelfPickUpMode.VALUES;
|
||||||
return values[(this.ordinal() + 1) % values.length];
|
return values[(this.ordinal() + 1) % values.length];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -118,6 +124,9 @@ public class Magnet extends ItemDE implements IBauble, IConfigurableItem {
|
|||||||
if (IConfigurableItem.ProfileHelper.getBoolean(stack, References.MAGNET_SNEAK, true) && entity.isSneaking()) {
|
if (IConfigurableItem.ProfileHelper.getBoolean(stack, References.MAGNET_SNEAK, true) && entity.isSneaking()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (BOTANIA_LOADED && SubTileSolegnolia.hasSolegnoliaAround(player)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int range = stack.getItemDamage() == 0 ? 8 : 32;
|
int range = stack.getItemDamage() == 0 ? 8 : 32;
|
||||||
List<EntityItem> items = world.getEntitiesWithinAABB(
|
List<EntityItem> items = world.getEntitiesWithinAABB(
|
||||||
@@ -265,7 +274,7 @@ public class Magnet extends ItemDE implements IBauble, IConfigurableItem {
|
|||||||
|
|
||||||
private static SelfPickUpMode getSelfPickupStatus(ItemStack itemStack) {
|
private static SelfPickUpMode getSelfPickupStatus(ItemStack itemStack) {
|
||||||
final short mode = getSelfPickupStatusShort(itemStack);
|
final short mode = getSelfPickupStatusShort(itemStack);
|
||||||
return SelfPickUpMode.values()[mode];
|
return SelfPickUpMode.VALUES[mode];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void toggleSelfPickupStatus(ItemStack itemStack) {
|
public static void toggleSelfPickupStatus(ItemStack itemStack) {
|
||||||
|
|||||||
+5
-5
@@ -158,8 +158,8 @@ public class BowHandler {
|
|||||||
|
|
||||||
public int calculateEnergyCost() {
|
public int calculateEnergyCost() {
|
||||||
updateValues();
|
updateValues();
|
||||||
double rfCost = (bow.getItem() instanceof IEnergyContainerWeaponItem)
|
double rfCost = (bow.getItem() instanceof IEnergyContainerBowItem)
|
||||||
? ((IEnergyContainerWeaponItem) bow.getItem()).getEnergyPerAttack()
|
? ((IEnergyContainerBowItem) bow.getItem()).getEnergyPerAttack()
|
||||||
: 80;
|
: 80;
|
||||||
|
|
||||||
rfCost *= 1 + arrowDamage;
|
rfCost *= 1 + arrowDamage;
|
||||||
@@ -175,7 +175,7 @@ public class BowHandler {
|
|||||||
updateValues();
|
updateValues();
|
||||||
|
|
||||||
if (player == null) return false;
|
if (player == null) return false;
|
||||||
if (!(bow.getItem() instanceof IEnergyContainerWeaponItem)) {
|
if (!(bow.getItem() instanceof IEnergyContainerBowItem)) {
|
||||||
cantFireMessage = "[Error] This bow is not a valid energy container (This is a bug, Please report on the Draconic Evolution github)";
|
cantFireMessage = "[Error] This bow is not a valid energy container (This is a bug, Please report on the Draconic Evolution github)";
|
||||||
return false;
|
return false;
|
||||||
} else if (!energyBolt && shockWavePower > 0) {
|
} else if (!energyBolt && shockWavePower > 0) {
|
||||||
@@ -184,7 +184,7 @@ public class BowHandler {
|
|||||||
} else if (energyBolt && explosionPower > 0) {
|
} else if (energyBolt && explosionPower > 0) {
|
||||||
cantFireMessage = "msg.de.explosiveNotForEnergyBolts.txt";
|
cantFireMessage = "msg.de.explosiveNotForEnergyBolts.txt";
|
||||||
return false;
|
return false;
|
||||||
} else if (calculateEnergyCost() > ((IEnergyContainerWeaponItem) bow.getItem()).getEnergyStored(bow)
|
} else if (calculateEnergyCost() > ((IEnergyContainerBowItem) bow.getItem()).getEnergyStored(bow)
|
||||||
&& !player.capabilities.isCreativeMode) {
|
&& !player.capabilities.isCreativeMode) {
|
||||||
cantFireMessage = "msg.de.insufficientPowerToFire.txt";
|
cantFireMessage = "msg.de.insufficientPowerToFire.txt";
|
||||||
return false;
|
return false;
|
||||||
@@ -223,7 +223,7 @@ public class BowHandler {
|
|||||||
public boolean consumeArrowAndEnergy() {
|
public boolean consumeArrowAndEnergy() {
|
||||||
|
|
||||||
if (!player.capabilities.isCreativeMode)
|
if (!player.capabilities.isCreativeMode)
|
||||||
((IEnergyContainerWeaponItem) bow.getItem()).extractEnergy(bow, calculateEnergyCost(), false);
|
((IEnergyContainerBowItem) bow.getItem()).extractEnergy(bow, calculateEnergyCost(), false);
|
||||||
|
|
||||||
if (!energyBolt && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, bow) == 0
|
if (!energyBolt && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, bow) == 0
|
||||||
&& !player.capabilities.isCreativeMode) {
|
&& !player.capabilities.isCreativeMode) {
|
||||||
|
|||||||
+1
-1
@@ -39,7 +39,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class DraconicBow extends ItemBow
|
public class DraconicBow extends ItemBow
|
||||||
implements IInventoryTool, IUpgradableItem, IEnergyContainerWeaponItem, IHudDisplayItem {
|
implements IInventoryTool, IUpgradableItem, IEnergyContainerBowItem, IHudDisplayItem {
|
||||||
|
|
||||||
public static final String[] bowPullIconNameArray = new String[] { "pulling_0", "pulling_1", "pulling_2" };
|
public static final String[] bowPullIconNameArray = new String[] { "pulling_0", "pulling_1", "pulling_2" };
|
||||||
|
|
||||||
|
|||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package com.brandon3055.draconicevolution.common.items.weapons;
|
||||||
|
|
||||||
|
public interface IEnergyContainerBowItem extends IEnergyContainerWeaponItem {
|
||||||
|
}
|
||||||
@@ -39,7 +39,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class WyvernBow extends ItemBow
|
public class WyvernBow extends ItemBow
|
||||||
implements IInventoryTool, IUpgradableItem, IEnergyContainerWeaponItem, IHudDisplayItem {
|
implements IInventoryTool, IUpgradableItem, IEnergyContainerBowItem, IHudDisplayItem {
|
||||||
|
|
||||||
public static final String[] bowPullIconNameArray = new String[] { "pulling_0", "pulling_1", "pulling_2" };
|
public static final String[] bowPullIconNameArray = new String[] { "pulling_0", "pulling_1", "pulling_2" };
|
||||||
|
|
||||||
|
|||||||
+11
@@ -7,6 +7,7 @@ import net.minecraft.network.NetworkManager;
|
|||||||
import net.minecraft.network.Packet;
|
import net.minecraft.network.Packet;
|
||||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
|
|
||||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||||
@@ -20,6 +21,16 @@ public class TilePlacedItem extends TileEntity {
|
|||||||
public ItemStack stack;
|
public ItemStack stack;
|
||||||
public float rotation = 0F;
|
public float rotation = 0F;
|
||||||
private boolean hasUpdated = false;
|
private boolean hasUpdated = false;
|
||||||
|
private AxisAlignedBB renderBoundingBox;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getRenderBoundingBox() {
|
||||||
|
if (renderBoundingBox == null) {
|
||||||
|
renderBoundingBox = AxisAlignedBB
|
||||||
|
.getBoundingBox(xCoord - 2, yCoord - 2, zCoord - 2, xCoord + 2, yCoord + 2, zCoord + 2);
|
||||||
|
}
|
||||||
|
return renderBoundingBox;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity() {
|
public void updateEntity() {
|
||||||
|
|||||||
Reference in new issue
Block a user