Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdc57215e3 | ||
|
|
9f42531f37 | ||
|
|
95453b430e | ||
|
|
3635266bd5 | ||
|
|
fedee1ba43 | ||
|
|
6f183b615e | ||
|
|
15b257d120 | ||
|
|
4ead9f53fb | ||
|
|
305e09ae4f | ||
|
|
9009b1372a | ||
|
|
8dc27474ec | ||
|
|
4c016707a4 | ||
|
|
abbe4c1017 | ||
|
|
c067e59981 | ||
|
|
7f87295901 | ||
|
|
e564437ed7 | ||
|
|
f483529855 | ||
|
|
da451de69f | ||
|
|
8b8082cd7b | ||
|
|
92c2bacc74 | ||
|
|
7620d7ff02 | ||
|
|
bd995e6d5a | ||
|
|
05ebbf6936 | ||
|
|
51b047c1eb |
No files matched your search
@@ -0,0 +1,17 @@
|
||||
name: Optimize images
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
push:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
jobs:
|
||||
optimize-images:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
|
||||
secrets: inherit
|
||||
@@ -2,16 +2,22 @@
|
||||
|
||||
dependencies {
|
||||
api("curse.maven:cofh-lib-220333:2388748")
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.9.6:dev")
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.9.53:dev")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.4:api") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:OpenComputers:1.12.12-GTNH:api") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.55-GTNH:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.4.10:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.14:api") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:OpenComputers:1.12.38-GTNH:api") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.93-GTNH: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:Baubles-Expanded:2.2.6-GTNH:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.225: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:Backhand:1.8.8:dev") {transitive = false}
|
||||
|
||||
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false}
|
||||
compileOnly("curse.maven:computercraft-67504:2269339") {transitive = false}
|
||||
|
||||
compileOnly('curse.maven:automagy-222153:2285272')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.25:dev')
|
||||
runtimeOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.118-GTNH:dev")
|
||||
}
|
||||
@@ -39,9 +39,33 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
# Enables modern Java syntax support. Valid values:
|
||||
# - false: No modern syntax, Java 8 only
|
||||
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||
# - modern: Native modern Java bytecode, no downgrading
|
||||
enableModernJavaSyntax = jabel
|
||||
|
||||
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||
# and should *not* be used in most situations. -1 disables this.
|
||||
# forceToolchainVersion = -1
|
||||
|
||||
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||
# downgradeTargetVersion = 8
|
||||
|
||||
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||
|
||||
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||
# - shade: Shade minimized stubs into the jar
|
||||
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||
# - (empty): Warning reminding you to configure stubs
|
||||
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||
# jvmDowngraderStubsProvider =
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
@@ -162,6 +186,11 @@ modrinthRelations =
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
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.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||
@@ -209,3 +238,6 @@ customArchiveBaseName = Draconic-Evolution
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
# Non-GTNH properties
|
||||
org.gradle.configuration-cache = true
|
||||
org.gradle.parallel = true
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
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/876dbbf00bf4ef6190f7da074cee903a/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/876dbbf00bf4ef6190f7da074cee903a/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/4d0277c49991306ac78048580fe34bcf/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/876dbbf00bf4ef6190f7da074cee903a/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/aa99913fa6d767d899ffc96082da01ca/redirect
|
||||
toolchainVersion=25
|
||||
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -172,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
|
||||
@@ -70,11 +70,10 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.49'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.34'
|
||||
}
|
||||
|
||||
|
||||
@@ -3,18 +3,21 @@ package com.brandon3055.draconicevolution;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.ClientProxy;
|
||||
import com.brandon3055.draconicevolution.client.creativetab.DETab;
|
||||
import com.brandon3055.draconicevolution.common.CommonProxy;
|
||||
import com.brandon3055.draconicevolution.common.lib.OreDoublingRegistry;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
|
||||
@Mod(
|
||||
@@ -23,7 +26,9 @@ import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
version = References.VERSION,
|
||||
canBeDeactivated = false,
|
||||
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 {
|
||||
|
||||
@Mod.Instance(References.MODID)
|
||||
@@ -51,10 +56,20 @@ public class DraconicEvolution {
|
||||
|
||||
public static Enchantment reaperEnchant;
|
||||
|
||||
public static final boolean isAutomagyLoaded = Loader.isModLoaded("Automagy");
|
||||
public static final boolean isEioLoaded = Loader.isModLoaded("EnderIO");
|
||||
|
||||
public DraconicEvolution() {
|
||||
LogHelper.info("Hello Minecraft!!!");
|
||||
}
|
||||
|
||||
public static ClientProxy clientProxy() {
|
||||
if (proxy.isClient()) {
|
||||
return ((ClientProxy) proxy);
|
||||
}
|
||||
throw new IllegalStateException("Accessed ClientProxy from dedicated server");
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public static void preInit(final FMLPreInitializationEvent event) {
|
||||
if (debug) LogHelper.info("Initialization");
|
||||
@@ -73,6 +88,12 @@ public class DraconicEvolution {
|
||||
proxy.postInit(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void onServerStopped(final FMLServerStoppedEvent event) {
|
||||
if (debug) System.out.println("onServerStopped()");
|
||||
proxy.onServerStopped(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void processMessage(FMLInterModComms.IMCEvent event) {
|
||||
for (FMLInterModComms.IMCMessage m : event.getMessages()) {
|
||||
|
||||
@@ -2,8 +2,12 @@ package com.brandon3055.draconicevolution.api;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
import com.brandon3055.draconicevolution.common.world.ChaosWorldGenHandler;
|
||||
import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator;
|
||||
@@ -67,4 +71,25 @@ public class GeneratorOverride {
|
||||
public static void setOreEnabledInEnd(boolean 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);
|
||||
}
|
||||
}
|
||||
@@ -2,23 +2,30 @@ package com.brandon3055.draconicevolution.client;
|
||||
|
||||
import static com.brandon3055.draconicevolution.integration.nei.IMCForNEI.IMCSender;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import com.brandon3055.draconicevolution.client.handler.HudHandler;
|
||||
import com.brandon3055.draconicevolution.client.handler.ItemDisplayManager;
|
||||
import com.brandon3055.draconicevolution.client.handler.ParticleHandler;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.keybinding.KeyBindings;
|
||||
import com.brandon3055.draconicevolution.client.handler.ShieldRenderHandler;
|
||||
import com.brandon3055.draconicevolution.client.keybinding.KeyInputHandler;
|
||||
import com.brandon3055.draconicevolution.client.render.IRenderTweak;
|
||||
import com.brandon3055.draconicevolution.client.render.block.RenderCrystal;
|
||||
@@ -80,6 +87,7 @@ import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileChaosShard;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileCustomSpawner;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDislocatorInhibitor;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
|
||||
@@ -104,11 +112,22 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
public final class ClientProxy extends CommonProxy {
|
||||
|
||||
private static final boolean debug = DraconicEvolution.debug;
|
||||
public static String downloadLocation;
|
||||
|
||||
private final Map<World, List<TileDislocatorInhibitor>> clientInhibitorsMap = new HashMap<>();
|
||||
private ClientEventHandler clientHandler;
|
||||
private KeyInputHandler keybindHandler;
|
||||
private ItemDisplayManager itemDisplay;
|
||||
private ShieldRenderHandler shieldRenderer;
|
||||
|
||||
public ClientProxy() {
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
@@ -121,15 +140,24 @@ public class ClientProxy extends CommonProxy {
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
FMLCommonHandler.instance().bus().register(new KeyInputHandler());
|
||||
FMLCommonHandler.instance().bus().register(new ClientEventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new HudHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new ClientEventHandler());
|
||||
KeyBindings.init();
|
||||
this.keybindHandler = new KeyInputHandler();
|
||||
FMLCommonHandler.instance().bus().register(this.keybindHandler);
|
||||
this.clientHandler = new ClientEventHandler();
|
||||
FMLCommonHandler.instance().bus().register(this.clientHandler);
|
||||
MinecraftForge.EVENT_BUS.register(this.clientHandler);
|
||||
final HudHandler hudHandler = new HudHandler();
|
||||
FMLCommonHandler.instance().bus().register(hudHandler);
|
||||
MinecraftForge.EVENT_BUS.register(hudHandler);
|
||||
registerRenderIDs();
|
||||
registerRendering();
|
||||
ResourceHandler.instance.tick(null);
|
||||
IMCSender();
|
||||
this.itemDisplay = new ItemDisplayManager(60);
|
||||
FMLCommonHandler.instance().bus().register(this.itemDisplay);
|
||||
MinecraftForge.EVENT_BUS.register(this.itemDisplay);
|
||||
this.shieldRenderer = new ShieldRenderHandler();
|
||||
FMLCommonHandler.instance().bus().register(this.shieldRenderer);
|
||||
MinecraftForge.EVENT_BUS.register(this.shieldRenderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -138,7 +166,24 @@ public class ClientProxy extends CommonProxy {
|
||||
ResourceHandler.instance.tick(null);
|
||||
}
|
||||
|
||||
public void registerRendering() {
|
||||
@SubscribeEvent
|
||||
public void onClientDisconnect(final FMLNetworkEvent.ClientDisconnectionFromServerEvent event) {
|
||||
this.clientInhibitorsMap.clear();
|
||||
this.itemDisplay.startDrawing(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
if (event.world.isRemote) {
|
||||
this.clientInhibitorsMap.remove(event.world);
|
||||
} else {
|
||||
super.onWorldUnload(event);
|
||||
}
|
||||
}
|
||||
|
||||
private void registerRendering() {
|
||||
// spotless:off
|
||||
// Item Renderers
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBow, new RenderBow());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBow());
|
||||
@@ -159,84 +204,29 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
|
||||
if (!ConfigHandler.useOldD2DToolTextures) {
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ModItems.draconicSword,
|
||||
new RenderTool(
|
||||
"models/tools/DraconicSword.obj",
|
||||
"textures/models/tools/DraconicSword.png",
|
||||
(IRenderTweak) ModItems.draconicSword));
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ModItems.wyvernPickaxe,
|
||||
new RenderTool(
|
||||
"models/tools/Pickaxe.obj",
|
||||
"textures/models/tools/Pickaxe.png",
|
||||
(IRenderTweak) ModItems.wyvernPickaxe));
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ModItems.draconicPickaxe,
|
||||
new RenderTool(
|
||||
"models/tools/DraconicPickaxe.obj",
|
||||
"textures/models/tools/DraconicPickaxe.png",
|
||||
(IRenderTweak) ModItems.draconicPickaxe));
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ModItems.draconicAxe,
|
||||
new RenderTool(
|
||||
"models/tools/DraconicLumberAxe.obj",
|
||||
"textures/models/tools/DraconicLumberAxe.png",
|
||||
(IRenderTweak) ModItems.draconicAxe));
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ModItems.wyvernShovel,
|
||||
new RenderTool(
|
||||
"models/tools/Shovel.obj",
|
||||
"textures/models/tools/Shovel.png",
|
||||
(IRenderTweak) ModItems.wyvernShovel));
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ModItems.draconicShovel,
|
||||
new RenderTool(
|
||||
"models/tools/DraconicShovel.obj",
|
||||
"textures/models/tools/DraconicShovel.png",
|
||||
(IRenderTweak) ModItems.draconicShovel));
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ModItems.wyvernSword,
|
||||
new RenderTool(
|
||||
"models/tools/Sword.obj",
|
||||
"textures/models/tools/Sword.png",
|
||||
(IRenderTweak) ModItems.wyvernSword));
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ModItems.draconicDestructionStaff,
|
||||
new RenderTool(
|
||||
"models/tools/DraconicStaffOfPower.obj",
|
||||
"textures/models/tools/DraconicStaffOfPower.png",
|
||||
(IRenderTweak) ModItems.draconicDestructionStaff));
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
ModItems.draconicHoe,
|
||||
new RenderTool(
|
||||
"models/tools/DraconicHoe.obj",
|
||||
"textures/models/tools/DraconicHoe.png",
|
||||
(IRenderTweak) ModItems.draconicHoe));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.draconicSword, new RenderTool("models/tools/DraconicSword.obj", "textures/models/tools/DraconicSword.png", (IRenderTweak) ModItems.draconicSword));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernPickaxe, new RenderTool("models/tools/Pickaxe.obj", "textures/models/tools/Pickaxe.png", (IRenderTweak) ModItems.wyvernPickaxe));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.draconicPickaxe, new RenderTool("models/tools/DraconicPickaxe.obj", "textures/models/tools/DraconicPickaxe.png", (IRenderTweak) ModItems.draconicPickaxe));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.draconicAxe, new RenderTool("models/tools/DraconicLumberAxe.obj", "textures/models/tools/DraconicLumberAxe.png", (IRenderTweak) ModItems.draconicAxe));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernShovel, new RenderTool("models/tools/Shovel.obj", "textures/models/tools/Shovel.png", (IRenderTweak) ModItems.wyvernShovel));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.draconicShovel, new RenderTool("models/tools/DraconicShovel.obj", "textures/models/tools/DraconicShovel.png", (IRenderTweak) ModItems.draconicShovel));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernSword, new RenderTool("models/tools/Sword.obj", "textures/models/tools/Sword.png", (IRenderTweak) ModItems.wyvernSword));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.draconicDestructionStaff, new RenderTool("models/tools/DraconicStaffOfPower.obj", "textures/models/tools/DraconicStaffOfPower.png", (IRenderTweak) ModItems.draconicDestructionStaff));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.draconicHoe, new RenderTool("models/tools/DraconicHoe.obj", "textures/models/tools/DraconicHoe.png", (IRenderTweak) ModItems.draconicHoe));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBowModel(true));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBow, new RenderBowModel(false));
|
||||
}
|
||||
|
||||
MinecraftForgeClient
|
||||
.registerItemRenderer(Item.getItemFromBlock(ModBlocks.draconiumChest), new RenderDraconiumChest());
|
||||
MinecraftForgeClient
|
||||
.registerItemRenderer(Item.getItemFromBlock(ModBlocks.particleGenerator), new RenderParticleGen());
|
||||
MinecraftForgeClient
|
||||
.registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyInfuser), new RenderEnergyInfuser());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.draconiumChest), new RenderDraconiumChest());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.particleGenerator), new RenderParticleGen());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyInfuser), new RenderEnergyInfuser());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyCrystal), new RenderCrystal());
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
Item.getItemFromBlock(ModBlocks.reactorStabilizer),
|
||||
new RenderReactorStabilizer());
|
||||
MinecraftForgeClient.registerItemRenderer(
|
||||
Item.getItemFromBlock(ModBlocks.reactorEnergyInjector),
|
||||
new RenderReactorEnergyInjector());
|
||||
MinecraftForgeClient
|
||||
.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorCore), new RenderReactorCore());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.earthBlock), new RenderEarthItem());
|
||||
MinecraftForgeClient
|
||||
.registerItemRenderer(Item.getItemFromBlock(ModBlocks.chaosCrystal), new RenderChaosShard());
|
||||
MinecraftForgeClient
|
||||
.registerItemRenderer(Item.getItemFromBlock(ModBlocks.upgradeModifier), new RenderUpgradeModifier());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorStabilizer), new RenderReactorStabilizer());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorEnergyInjector), new RenderReactorEnergyInjector());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorCore), new RenderReactorCore());
|
||||
if (ModBlocks.earthBlock != null) MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.earthBlock), new RenderEarthItem());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.chaosCrystal), new RenderChaosShard());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.upgradeModifier), new RenderUpgradeModifier());
|
||||
|
||||
// ISimpleBlockRendering
|
||||
RenderingRegistry.registerBlockHandler(new RenderTeleporterStand());
|
||||
@@ -248,7 +238,7 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCustomSpawner.class, new RenderTileCustomSpawner());
|
||||
// ClientRegistry.bindTileEntitySpecialRenderer(TileTestBlock.class, new RenderTileCrystal());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyStorageCore.class, new RenderTileEnergyStorageCore());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEarth.class, new RenderTileEarth());
|
||||
if (ModBlocks.earthBlock != null) ClientRegistry.bindTileEntitySpecialRenderer(TileEarth.class, new RenderTileEarth());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyPylon.class, new RenderTileEnergyPylon());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePlacedItem.class, new RenderTilePlacedItem());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileDissEnchanter.class, new RenderTileDissEnchanter());
|
||||
@@ -259,8 +249,7 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileWirelessEnergyTransceiver.class, new RenderTileCrystal());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorCore.class, new RenderTileReactorCore());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorStabilizer.class, new RenderTileReactorStabilizer());
|
||||
ClientRegistry
|
||||
.bindTileEntitySpecialRenderer(TileReactorEnergyInjector.class, new RenderTileReactorEnergyInjector());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorEnergyInjector.class, new RenderTileReactorEnergyInjector());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileChaosShard.class, new RenderTileChaosShard());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileUpgradeModifier.class, new RenderTileUpgradeModifier());
|
||||
|
||||
@@ -272,14 +261,14 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChaosCrystal.class, new RenderChaosCrystal());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChaosVortex.class, new RenderEntityChaosVortex());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCustomArrow.class, new RenderEntityCustomArrow());
|
||||
// spotless:on
|
||||
}
|
||||
|
||||
public void registerRenderIDs() {
|
||||
private void registerRenderIDs() {
|
||||
References.idTeleporterStand = RenderingRegistry.getNextAvailableRenderId();
|
||||
References.idPortal = RenderingRegistry.getNextAvailableRenderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleEnergyBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz,
|
||||
int powerFlow, boolean advanced, ParticleEnergyBeam oldBeam, boolean render, int beamType) {
|
||||
if (!worldObj.isRemote) return null;
|
||||
@@ -301,7 +290,6 @@ public class ClientProxy extends CommonProxy {
|
||||
return beam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleEnergyField energyField(World worldObj, double x, double y, double z, int type, boolean advanced,
|
||||
ParticleEnergyField oldBeam, boolean render) {
|
||||
if (!worldObj.isRemote) return null;
|
||||
@@ -323,7 +311,6 @@ public class ClientProxy extends CommonProxy {
|
||||
return beam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleReactorBeam reactorBeam(TileEntity tile, ParticleReactorBeam oldBeam, boolean render) {
|
||||
if (!tile.getWorldObj().isRemote || !(tile instanceof IReactorPart)) return null;
|
||||
ParticleReactorBeam beam = oldBeam;
|
||||
@@ -344,13 +331,12 @@ public class ClientProxy extends CommonProxy {
|
||||
return beam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle(Object particle, int range) {
|
||||
if (particle instanceof EntityFX && ((EntityFX) particle).worldObj.isRemote)
|
||||
ParticleHandler.spawnCustomParticle((EntityFX) particle, range);
|
||||
public void spawnParticle(EntityFX particle, int range) {
|
||||
if (particle.worldObj.isRemote) {
|
||||
ParticleHandler.spawnCustomParticle(particle, range);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISound playISound(ISound sound) {
|
||||
FMLClientHandler.instance().getClient().getSoundHandler().playSound(sound);
|
||||
return sound;
|
||||
@@ -361,11 +347,6 @@ public class ClientProxy extends CommonProxy {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MinecraftServer getMCServer() {
|
||||
return super.getMCServer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getClientWorld() {
|
||||
return Minecraft.getMinecraft().theWorld;
|
||||
@@ -390,4 +371,61 @@ public class ClientProxy extends CommonProxy {
|
||||
public EntityPlayer getClientPlayer() {
|
||||
return Minecraft.getMinecraft().thePlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClient() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public KeyInputHandler getKeybindHandler() {
|
||||
return keybindHandler;
|
||||
}
|
||||
|
||||
public void displayItem(ItemStack stack) {
|
||||
this.itemDisplay.startDrawing(stack);
|
||||
}
|
||||
|
||||
public int getElapsedTicks() {
|
||||
return this.clientHandler.getElapsedTicks();
|
||||
}
|
||||
|
||||
public float getEnergyCrystalAlpha() {
|
||||
return this.clientHandler.getEnergyCrystalAlpha();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tryRepositionPlayerOnMount(int entityId) {
|
||||
this.clientHandler.tryRepositionPlayerOnMount(entityId);
|
||||
}
|
||||
|
||||
public void renderShield(EntityPlayer player, float shieldPowerF) {
|
||||
this.shieldRenderer.renderShield(player, shieldPowerF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerInhibitor(TileDislocatorInhibitor tile) {
|
||||
if (tile.hasWorldObj() && tile.getWorldObj().isRemote) {
|
||||
registerInhibitor(this.clientInhibitorsMap, tile);
|
||||
} else {
|
||||
super.registerInhibitor(tile);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterInhibitor(TileDislocatorInhibitor tile) {
|
||||
if (tile.hasWorldObj() && tile.getWorldObj().isRemote) {
|
||||
unregisterInhibitor(this.clientInhibitorsMap, tile);
|
||||
} else {
|
||||
super.unregisterInhibitor(tile);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockedByInhibitor(World world, EntityItem item) {
|
||||
if (world.isRemote) {
|
||||
return isBlockedByInhibitor(this.clientInhibitorsMap, world, item);
|
||||
} else {
|
||||
return super.isBlockedByInhibitor(world, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,11 +66,8 @@ public class GUIDislocatorInhibitor extends GuiContainer implements INEIGuiHandl
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocal("tile.draconicevolution:dislocatorInhibitor.name"),
|
||||
7,
|
||||
5,
|
||||
0x222222);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.main.title"), 7, 5, 0x222222);
|
||||
drawGuiText();
|
||||
drawGreyOutSlots();
|
||||
drawButtonIcons();
|
||||
@@ -200,7 +197,12 @@ public class GUIDislocatorInhibitor extends GuiContainer implements INEIGuiHandl
|
||||
25,
|
||||
0x000000,
|
||||
false);
|
||||
fontRendererObj.drawString(String.valueOf(range), range < 10 ? 78 : 75, 25, 0x000000, false);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", range),
|
||||
range < 10 ? 78 : 75,
|
||||
25,
|
||||
0x000000,
|
||||
false);
|
||||
}
|
||||
|
||||
private void drawButtonIcons() {
|
||||
|
||||
@@ -52,13 +52,18 @@ public class GUIDissEnchanter extends GuiContainer {
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("tile.draconicevolution:dissEnchanter.name"),
|
||||
StatCollector.translateToLocal("gui.de.dissEnchanter.main.title"),
|
||||
88,
|
||||
4,
|
||||
0x00FFFF);
|
||||
|
||||
fontRendererObj.drawString("Item", 5, 40, 0x0000ff);
|
||||
fontRendererObj.drawString("Damage: " + (40 - tile.bookPower) + "%", 5, 49, 0x0000ff);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.dissEnchanter.itemDamage1"), 5, 40, 0x0000ff);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector
|
||||
.translateToLocalFormatted("gui.de.dissEnchanter.itemDamage2", (40 - tile.bookPower) + "%"),
|
||||
5,
|
||||
49,
|
||||
0x0000ff);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,6 +99,7 @@ public class GUIDissEnchanter extends GuiContainer {
|
||||
if (flag && player.experienceLevel < tile.dissenchantCost && !player.capabilities.isCreativeMode) flag = false;
|
||||
((GuiButtonAHeight) buttonList.get(0)).enabled = flag;
|
||||
((GuiButtonAHeight) buttonList.get(0)).packedFGColour = cachRecipeValid ? 0x000000 : 0xdf0000;
|
||||
((GuiButtonAHeight) buttonList.get(0)).displayString = "Cost: " + tile.dissenchantCost;
|
||||
((GuiButtonAHeight) buttonList.get(0)).displayString = StatCollector
|
||||
.translateToLocalFormatted("gui.de.dissEnchanter.cost", tile.dissenchantCost);
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
fontRendererObj.drawString(tile.getInventoryName(), 4, 4, 0x222222);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.draconiumChest.main.title"), 4, 4, 0x222222);
|
||||
// fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("button.de.chestAutoFeed.txt"), 4, 180,
|
||||
// 0x00FFFF);
|
||||
|
||||
|
||||
@@ -83,7 +83,11 @@ public class GUIEnergyInfuser extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
fontRendererObj.drawStringWithShadow("Energy Infuser", 49, -9, 0x00FFFF);
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("gui.de.energyInfuser.main.title"),
|
||||
49,
|
||||
-9,
|
||||
0x00FFFF);
|
||||
|
||||
// bindTexture(texture);
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class GUIFlowGate extends GuiScreen {
|
||||
|
||||
drawDefaultBackground();
|
||||
ResourceHandler.bindResource("textures/gui/ToolConfig.png");
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 197, 88);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 198, 89);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocal("gui.de.flowGate.name"),
|
||||
guiCrt - (fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.flowGate.name")) / 2),
|
||||
|
||||
@@ -76,7 +76,7 @@ public class GUIGenerator extends GuiContainer {
|
||||
18 - (int) (fuel * 13)); // Power bar
|
||||
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("tile.draconicevolution:generator.name"),
|
||||
StatCollector.translateToLocal("gui.de.generator.main.title"),
|
||||
guiLeft + 64,
|
||||
guiTop,
|
||||
0x00FFFF);
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -82,7 +83,11 @@ public class GUIGrinder extends GuiContainer {
|
||||
18 - (int) (fuel * 13)); // Power bar
|
||||
if (tile.isExternallyPowered()) drawTexturedModalRect(guiLeft + 100, guiTop + 37, xSize, 66, 13, 13);
|
||||
|
||||
fontRendererObj.drawStringWithShadow("Grinder", guiLeft + 71, guiTop, 0x00FFFF);
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("gui.de.grinder.main.title"),
|
||||
guiLeft + 71,
|
||||
guiTop,
|
||||
0x00FFFF);
|
||||
|
||||
int x = X - guiLeft;
|
||||
int y = Y - guiTop;
|
||||
|
||||
@@ -86,7 +86,8 @@ public class GUIParticleGenerator extends GuiScreen {
|
||||
@Override
|
||||
public void drawLabel(FontRenderer fontRenderer, int x, int y) {
|
||||
fontRenderer.drawString(label, x, y, 0x000000);
|
||||
fontRenderer.drawString(String.valueOf(value), x, y + 10, 0x000000);
|
||||
fontRenderer
|
||||
.drawString(StatCollector.translateToLocalFormatted("gui.de.numbers", value), x, y + 10, 0x000000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +142,11 @@ public class GUIParticleGenerator extends GuiScreen {
|
||||
public void drawLabel(FontRenderer fontRenderer, int x, int y) {
|
||||
float roundedValue = Math.round(value * scale) / scale;
|
||||
fontRenderer.drawString(label, x, y, 0x000000);
|
||||
fontRenderer.drawString(String.valueOf(roundedValue), x, y + 10, 0x000000);
|
||||
fontRenderer.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", roundedValue),
|
||||
x,
|
||||
y + 10,
|
||||
0x000000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -75,7 +76,7 @@ public class GUIPlayerDetector extends GuiContainer {
|
||||
public void drawScreen(int x, int y, float partialTicks) {
|
||||
super.drawScreen(x, y, partialTicks);
|
||||
ArrayList<String> lines = new ArrayList<>();
|
||||
lines.add("Camouflage");
|
||||
lines.add(StatCollector.translateToLocal("gui.de.playerDetector.camouflage"));
|
||||
if ((x - guiLeft > 142 && x - guiLeft < 160) && (y - guiTop > 19 && y - guiTop < 37)
|
||||
&& container.shouldShowInventory()) {
|
||||
drawHoveringText(lines, x, y, fontRendererObj);
|
||||
@@ -88,15 +89,30 @@ public class GUIPlayerDetector extends GuiContainer {
|
||||
super.initGui();
|
||||
buttonList.clear();
|
||||
if (!isInEditMode) {
|
||||
String mode = isInWhitelistMode ? "White List" : "Black List";
|
||||
String mode = isInWhitelistMode ? StatCollector.translateToLocal("gui.de.playerDetector.whiteList")
|
||||
: StatCollector.translateToLocal("gui.de.playerDetector.blackList");
|
||||
int center = width / 2;
|
||||
buttonList.add(new GuiButton(0, center - 20 - 20, guiTop + 20, 20, 20, "+"));
|
||||
buttonList.add(new GuiButton(1, center + 20, guiTop + 20, 20, 20, "-"));
|
||||
buttonList.add(new GuiButton(3, center - 40, guiTop + 45, 60, 20, mode));
|
||||
buttonList.add(new GuiButton(4, center + 20, guiTop + 45, 20, 20, "!"));
|
||||
buttonList.add(new GuiButton(6, center - 40, guiTop + 70, 80, 20, "Invert Output"));
|
||||
buttonList.add(
|
||||
new GuiButton(
|
||||
6,
|
||||
center - 40,
|
||||
guiTop + 70,
|
||||
80,
|
||||
20,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.invertOutput")));
|
||||
} else {
|
||||
buttonList.add(new GuiButton(5, guiLeft - 40, guiTop + ySize - 20, 40, 20, "Back"));
|
||||
buttonList.add(
|
||||
new GuiButton(
|
||||
5,
|
||||
guiLeft - 40,
|
||||
guiTop + ySize - 20,
|
||||
40,
|
||||
20,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.back")));
|
||||
}
|
||||
|
||||
selectedNameText = new GuiTextField(fontRendererObj, 4, -12, 168, 12);
|
||||
@@ -186,7 +202,12 @@ public class GUIPlayerDetector extends GuiContainer {
|
||||
private void drawGuiText() {
|
||||
if (isInEditMode) {
|
||||
if (selectedMameIndex != -1) {
|
||||
drawCenteredString(fontRendererObj, "Press Enter to save", xSize / 2, -22, 0xFF0000);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.pressEnter"),
|
||||
xSize / 2,
|
||||
-22,
|
||||
0xFF0000);
|
||||
}
|
||||
for (int row = 0; row < 21; row++) {
|
||||
for (int column = 0; column < 2; column++) {
|
||||
@@ -200,11 +221,31 @@ public class GUIPlayerDetector extends GuiContainer {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
drawCenteredString(fontRendererObj, "Advanced Player Detector", xSize / 2, 5, 0x00FFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.main.title"),
|
||||
xSize / 2,
|
||||
5,
|
||||
0x00FFFF);
|
||||
|
||||
fontRendererObj.drawString("Range:", 73, 21, 0x000000, false);
|
||||
fontRendererObj.drawString("Output Inverted: " + isOutputInverted, 33, 97, 0x000000, false);
|
||||
fontRendererObj.drawString(String.valueOf(range), range < 10 ? 85 : 82, 31, 0x000000, false);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.range") + ":",
|
||||
73,
|
||||
21,
|
||||
0x000000,
|
||||
false);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.playerDetector.outputInvert", isOutputInverted),
|
||||
33,
|
||||
97,
|
||||
0x000000,
|
||||
false);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", range),
|
||||
range < 10 ? 85 : 82,
|
||||
31,
|
||||
0x000000,
|
||||
false);
|
||||
}
|
||||
selectedNameText.drawTextBox();
|
||||
}
|
||||
|
||||
@@ -86,7 +86,12 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
drawCenteredString(fontRendererObj, tile.getBlockType().getLocalizedName(), xSize / 2, -9, 0x00FFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.upgradeModifier.main.title"),
|
||||
xSize / 2,
|
||||
-9,
|
||||
0x00FFFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -238,13 +243,25 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
0x00ff00);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.cap.txt"), guiLeft + 4, guiTop + 16, 0x000000);
|
||||
fontRendererObj.drawString(">" + coreSlots, guiLeft + 4, guiTop + 25, 0x000000);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", ">" + coreSlots),
|
||||
guiLeft + 4,
|
||||
guiTop + 25,
|
||||
0x000000);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.installed.txt"), guiLeft + 4, guiTop + 37, 0x000000);
|
||||
fontRendererObj.drawString(">" + usedSlots, guiLeft + 4, guiTop + 46, 0x000000);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", ">" + usedSlots),
|
||||
guiLeft + 4,
|
||||
guiTop + 46,
|
||||
0x000000);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.free.txt"), guiLeft + 4, guiTop + 58, 0x000000);
|
||||
fontRendererObj.drawString(">" + (coreSlots - usedSlots), guiLeft + 4, guiTop + 67, 0x000000);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", ">" + (coreSlots - usedSlots)),
|
||||
guiLeft + 4,
|
||||
guiTop + 67,
|
||||
0x000000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -53,23 +54,32 @@ public class GUIWeatherController extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.charges") + ": " + charges, 90, 25, 0x000000);
|
||||
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
drawCenteredString(fontRendererObj, "Weather Controller", xSize / 2, -15, 0x2a4ed0);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.weatherController.main.title"),
|
||||
xSize / 2,
|
||||
-15,
|
||||
0x2a4ed0);
|
||||
}
|
||||
|
||||
public static final String RAIN_ON_TEXT = "Turn rain on";
|
||||
public static final String RAIN_OFF_TEXT = "Turn rain off";
|
||||
public static final String STORM_TEXT = "Thunder Storm";
|
||||
public static final String RAIN_ON_TEXT = "gui.de.rain.on";
|
||||
public static final String RAIN_OFF_TEXT = "gui.de.rain.off";
|
||||
public static final String STORM_TEXT = "gui.de.rain.storm";
|
||||
public static String text;
|
||||
|
||||
private String getModeText(int mode) {
|
||||
if (mode == 0) return StatCollector.translateToLocal(RAIN_OFF_TEXT);
|
||||
else if (mode == 1) return StatCollector.translateToLocal(RAIN_ON_TEXT);
|
||||
else return StatCollector.translateToLocal(STORM_TEXT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
buttonList.clear();
|
||||
if (tileWC.mode == 0) text = RAIN_OFF_TEXT;
|
||||
else if (tileWC.mode == 1) text = RAIN_ON_TEXT;
|
||||
else text = STORM_TEXT;
|
||||
text = getModeText(tileWC.mode);
|
||||
// ID
|
||||
buttonList.add(new GuiButton(0, guiLeft + 85, guiTop, 85, 20, text));
|
||||
}
|
||||
@@ -78,9 +88,8 @@ public class GUIWeatherController extends GuiContainer {
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
if (button.id == 0) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket((byte) 0, true));
|
||||
if (button.displayString.equals(STORM_TEXT)) button.displayString = RAIN_OFF_TEXT;
|
||||
else if (button.displayString.equals(RAIN_OFF_TEXT)) button.displayString = RAIN_ON_TEXT;
|
||||
else button.displayString = STORM_TEXT;
|
||||
tileWC.mode = (tileWC.mode + 1) % 3;
|
||||
button.displayString = getModeText(tileWC.mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIBase;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
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.network.ContributorPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.ItemConfigPacket;
|
||||
@@ -310,11 +311,11 @@ public class GUIToolConfig extends GUIBase {
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
||||
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);
|
||||
|
||||
if (!properties.canFire() && properties.cantFireMessage != null
|
||||
&& !properties.cantFireMessage.equals("msg.de.outOfArrows.name")) {
|
||||
&& !properties.cantFireMessage.equals("msg.de.outOfArrows.txt")) {
|
||||
fontRendererObj.drawSplitString(
|
||||
StatCollector.translateToLocal(properties.cantFireMessage),
|
||||
0,
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.brandon3055.draconicevolution.client.handler;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -10,124 +7,71 @@ import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.IAttributeInstance;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.FOVUpdateEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.ArmorSummary;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.DraconicArmor;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.WyvernArmor;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.BowHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.DraconicBow;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.WyvernBow;
|
||||
import com.brandon3055.draconicevolution.common.network.MountUpdatePacket;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 28/10/2014.
|
||||
*/
|
||||
public class ClientEventHandler {
|
||||
public final class ClientEventHandler {
|
||||
|
||||
public static Map<EntityPlayer, DataUtils.XZPair<Float, Integer>> playerShieldStatus = new HashMap<>();
|
||||
private static final Random RANDOM = new Random();
|
||||
|
||||
public static int elapsedTicks;
|
||||
private static float previousFOB = 0f;
|
||||
public static float previousSensitivity = 0;
|
||||
public static boolean bowZoom = false;
|
||||
public static boolean lastTickBowZoom = false;
|
||||
public static int tickSet = 0;
|
||||
public static ItemDisplayManager statusDisplayManager = new ItemDisplayManager(60);
|
||||
private static int remountTicksRemaining = 0;
|
||||
private static int remountEntityID = 0;
|
||||
public static float energyCrystalAlphaValue = 0f;
|
||||
public static float energyCrystalAlphaTarget = 0f;
|
||||
public static boolean playerHoldingWrench = false;
|
||||
public static Minecraft mc;
|
||||
private static Random rand = new Random();
|
||||
private static IModelCustom shieldSphere;
|
||||
|
||||
public ClientEventHandler() {
|
||||
shieldSphere = AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/shieldSphere.obj"));
|
||||
}
|
||||
private int elapsedTicks;
|
||||
private int remountTicksRemaining = 0;
|
||||
private int remountEntityID = 0;
|
||||
private float energyCrystalAlphaValue = 0f;
|
||||
private float energyCrystalAlphaTarget = 0f;
|
||||
|
||||
@SubscribeEvent
|
||||
public void tickEnd(TickEvent.ClientTickEvent event) {
|
||||
if (event.phase != TickEvent.Phase.START || event.type != TickEvent.Type.CLIENT || event.side != Side.CLIENT)
|
||||
if (event.phase != TickEvent.Phase.START) {
|
||||
return;
|
||||
|
||||
for (Iterator<Map.Entry<EntityPlayer, DataUtils.XZPair<Float, Integer>>> i = playerShieldStatus.entrySet()
|
||||
.iterator(); i.hasNext();) {
|
||||
Map.Entry<EntityPlayer, DataUtils.XZPair<Float, Integer>> entry = i.next();
|
||||
if (elapsedTicks - entry.getValue().getValue() > 5) i.remove();
|
||||
}
|
||||
|
||||
if (mc == null) mc = Minecraft.getMinecraft();
|
||||
else if (mc.theWorld != null) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc.theWorld != null) {
|
||||
elapsedTicks++;
|
||||
HudHandler.clientTick();
|
||||
|
||||
if (bowZoom && !lastTickBowZoom) {
|
||||
previousSensitivity = Minecraft.getMinecraft().gameSettings.mouseSensitivity;
|
||||
Minecraft.getMinecraft().gameSettings.mouseSensitivity = previousSensitivity / 3;
|
||||
} else if (!bowZoom && lastTickBowZoom) {
|
||||
Minecraft.getMinecraft().gameSettings.mouseSensitivity = previousSensitivity;
|
||||
}
|
||||
|
||||
lastTickBowZoom = bowZoom;
|
||||
if (elapsedTicks - tickSet > 10) bowZoom = false;
|
||||
|
||||
if (energyCrystalAlphaValue < energyCrystalAlphaTarget) energyCrystalAlphaValue += 0.01f;
|
||||
if (energyCrystalAlphaValue > energyCrystalAlphaTarget) energyCrystalAlphaValue -= 0.01f;
|
||||
|
||||
if (Math.abs(energyCrystalAlphaTarget - energyCrystalAlphaValue) <= 0.02f)
|
||||
energyCrystalAlphaTarget = rand.nextFloat();
|
||||
|
||||
playerHoldingWrench = mc.thePlayer.getHeldItem() != null
|
||||
&& mc.thePlayer.getHeldItem().getItem() == ModItems.wrench;
|
||||
if (Math.abs(energyCrystalAlphaTarget - energyCrystalAlphaValue) <= 0.02f) {
|
||||
energyCrystalAlphaTarget = RANDOM.nextFloat();
|
||||
}
|
||||
|
||||
searchForPlayerMount();
|
||||
}
|
||||
|
||||
statusDisplayManager.tick();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderGameOverlayEvent(final RenderGameOverlayEvent.Post event) {
|
||||
if (event.type == RenderGameOverlayEvent.ElementType.ALL) {
|
||||
statusDisplayManager.drawItemStack(event.resolution);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOW)
|
||||
public void fovUpdate(FOVUpdateEvent event) {
|
||||
|
||||
// region Bow FOV Update
|
||||
if (event.entity.getHeldItem() != null
|
||||
&& (event.entity.getHeldItem().getItem() instanceof WyvernBow
|
||||
|| event.entity.getHeldItem().getItem() instanceof DraconicBow)
|
||||
final ItemStack heldItem = event.entity.getHeldItem();
|
||||
if (heldItem != null && (heldItem.getItem() instanceof WyvernBow || heldItem.getItem() instanceof DraconicBow)
|
||||
&& Minecraft.getMinecraft().gameSettings.keyBindUseItem.getIsKeyPressed()) {
|
||||
|
||||
BowHandler.BowProperties properties = new BowHandler.BowProperties(
|
||||
event.entity.getHeldItem(),
|
||||
event.entity);
|
||||
BowHandler.BowProperties properties = new BowHandler.BowProperties(heldItem, event.entity);
|
||||
|
||||
event.newfov = ((6 - properties.zoomModifier) / 6) * event.fov;
|
||||
|
||||
@@ -142,9 +86,9 @@ public class ClientEventHandler {
|
||||
// endregion
|
||||
|
||||
// region Armor move speed FOV effect cancellation
|
||||
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(event.entity);
|
||||
final ArmorSummary summary = ArmorSummary.get(event.entity);
|
||||
|
||||
if (summery != null && summery.speedModifier > 0) {
|
||||
if (summary != null && summary.speedModifier > 0) {
|
||||
IAttributeInstance iattributeinstance = event.entity
|
||||
.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
|
||||
float f = (float) ((iattributeinstance.getAttributeValue()
|
||||
@@ -172,7 +116,7 @@ public class ClientEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public static void tryRepositionPlayerOnMount(int id) {
|
||||
public void tryRepositionPlayerOnMount(int id) {
|
||||
if (remountTicksRemaining == 500) return;
|
||||
remountTicksRemaining = 500;
|
||||
remountEntityID = id;
|
||||
@@ -186,7 +130,7 @@ public class ClientEventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void renderArmorEvent(RenderPlayerEvent.SetArmorModel event) {
|
||||
if (ConfigHandler.useOriginal3DArmorModel || ConfigHandler.useOldArmorModel || event.isCanceled()) return;
|
||||
if (ConfigHandler.useOriginal3DArmorModel || ConfigHandler.useOldArmorModel) return;
|
||||
if (event.stack != null
|
||||
&& (event.stack.getItem() instanceof DraconicArmor || event.stack.getItem() instanceof WyvernArmor)) {
|
||||
ItemArmor itemarmor = (ItemArmor) event.stack.getItem();
|
||||
@@ -199,52 +143,11 @@ public class ClientEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void renderPlayerEvent(RenderPlayerEvent.Post event) {
|
||||
if (playerShieldStatus.containsKey(event.entityPlayer)) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
ResourceHandler.bindResource("textures/models/shieldSphere.png");
|
||||
public int getElapsedTicks() {
|
||||
return elapsedTicks;
|
||||
}
|
||||
|
||||
float p = playerShieldStatus.get(event.entityPlayer).getKey();
|
||||
|
||||
EntityPlayer viewingPlayer = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
int i = 5 - (elapsedTicks - playerShieldStatus.get(event.entityPlayer).getValue());
|
||||
|
||||
GL11.glColor4f(1F - p, 0F, p, i / 5F);
|
||||
|
||||
if (viewingPlayer != event.entityPlayer) {
|
||||
double translationXLT = event.entityPlayer.prevPosX - viewingPlayer.prevPosX;
|
||||
double translationYLT = event.entityPlayer.prevPosY - viewingPlayer.prevPosY;
|
||||
double translationZLT = event.entityPlayer.prevPosZ - viewingPlayer.prevPosZ;
|
||||
|
||||
double translationX = translationXLT
|
||||
+ (((event.entityPlayer.posX - viewingPlayer.posX) - translationXLT) * event.partialRenderTick);
|
||||
double translationY = translationYLT
|
||||
+ (((event.entityPlayer.posY - viewingPlayer.posY) - translationYLT) * event.partialRenderTick);
|
||||
double translationZ = translationZLT
|
||||
+ (((event.entityPlayer.posZ - viewingPlayer.posZ) - translationZLT) * event.partialRenderTick);
|
||||
|
||||
GL11.glTranslated(translationX, translationY + 1.1, translationZ);
|
||||
} else {
|
||||
GL11.glTranslated(0, -0.5, 0);
|
||||
}
|
||||
|
||||
GL11.glScaled(1, 1.5, 1);
|
||||
|
||||
shieldSphere.renderAll();
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
public float getEnergyCrystalAlpha() {
|
||||
return energyCrystalAlphaValue;
|
||||
}
|
||||
}
|
||||
@@ -19,45 +19,41 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.brandon3055.draconicevolution.client.gui.GuiHudConfig;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.ArmorSummary;
|
||||
import com.brandon3055.draconicevolution.common.utils.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utils.IHudDisplayItem;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 26/01/2015.
|
||||
*/
|
||||
public class HudHandler {
|
||||
public final class HudHandler {
|
||||
|
||||
private static List<String> hudList = null;
|
||||
private static List<String> ltHudList = null;
|
||||
private static float toolTipFadeOut = 0F;
|
||||
private static float armorStatsFadeOut = 0F;
|
||||
private static boolean showShieldHud = false;
|
||||
private static int shieldPercentCharge = 0;
|
||||
private static float shieldPoints = 0F;
|
||||
private static float maxShieldPoints = 0F;
|
||||
private static float shieldEntropy = 0F;
|
||||
private static int rfCharge = 0;
|
||||
private static long rfTotal = 0;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
private List<String> hudList = null;
|
||||
private List<String> ltHudList = null;
|
||||
private float toolTipFadeOut = 0F;
|
||||
private float armorStatsFadeOut = 0F;
|
||||
private boolean showShieldHud = false;
|
||||
private int shieldPercentCharge = 0;
|
||||
private float shieldPoints = 0F;
|
||||
private float maxShieldPoints = 0F;
|
||||
private float shieldEntropy = 0F;
|
||||
private int rfCharge = 0;
|
||||
private long rfTotal = 0;
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void drawHUD(RenderGameOverlayEvent.Post event) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (event.type != RenderGameOverlayEvent.ElementType.ALL || mc.gameSettings.showDebugInfo
|
||||
|| mc.currentScreen instanceof GuiChat)
|
||||
|| mc.currentScreen instanceof GuiChat) {
|
||||
return;
|
||||
}
|
||||
|
||||
ScaledResolution resolution = event.resolution;
|
||||
width = resolution.getScaledWidth();
|
||||
height = resolution.getScaledHeight();
|
||||
final int width = resolution.getScaledWidth();
|
||||
final int height = resolution.getScaledHeight();
|
||||
FontRenderer fontRenderer = mc.fontRenderer;
|
||||
|
||||
if (ConfigHandler.hudSettings[10] == 1 && hudList != null && toolTipFadeOut > 0) {
|
||||
@@ -86,13 +82,20 @@ public class HudHandler {
|
||||
}
|
||||
}
|
||||
|
||||
// x, y, x, y, scale, scale, fademode, fademode, rotateArmor, armorText
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void clientTick() {
|
||||
@SubscribeEvent
|
||||
public void tickEnd(TickEvent.ClientTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END && Minecraft.getMinecraft().theWorld != null) {
|
||||
this.clientTick();
|
||||
}
|
||||
}
|
||||
|
||||
private void clientTick() {
|
||||
if (ConfigHandler.hudSettings[6] > 0 && toolTipFadeOut > 1F - ((float) ConfigHandler.hudSettings[6] * 0.25F)) {
|
||||
toolTipFadeOut -= 0.1F;
|
||||
}
|
||||
if (hudList != null && (ltHudList == null || !hudList.equals(ltHudList))) toolTipFadeOut = 5F;
|
||||
if (hudList != null && !hudList.equals(ltHudList)) {
|
||||
toolTipFadeOut = 5F;
|
||||
}
|
||||
if (ConfigHandler.hudSettings[7] > 0
|
||||
&& armorStatsFadeOut > 1F - ((float) ConfigHandler.hudSettings[7] * 0.25F)) {
|
||||
armorStatsFadeOut -= 0.1F;
|
||||
@@ -108,7 +111,7 @@ public class HudHandler {
|
||||
|
||||
if (mc.currentScreen != null) {
|
||||
if (mc.currentScreen instanceof GuiHudConfig) {
|
||||
hudList = new ArrayList<String>();
|
||||
hudList = new ArrayList<>();
|
||||
hudList.add(StatCollector.translateToLocal("info.de.hudDisplayConfigTxt1.txt"));
|
||||
hudList.add("");
|
||||
hudList.add("");
|
||||
@@ -130,26 +133,41 @@ public class HudHandler {
|
||||
.getDisplayData(mc.theWorld, mop.blockX, mop.blockY, mop.blockZ);
|
||||
}
|
||||
|
||||
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(mc.thePlayer);
|
||||
final ArmorSummary summary = ArmorSummary.get(mc.thePlayer);
|
||||
|
||||
if (summery == null) {
|
||||
if (summary == null) {
|
||||
showShieldHud = false;
|
||||
return;
|
||||
}
|
||||
if (!shouldDisplayArmorHud(summary)) {
|
||||
showShieldHud = false;
|
||||
armorStatsFadeOut = 0F;
|
||||
maxShieldPoints = 0F;
|
||||
shieldPoints = 0F;
|
||||
shieldPercentCharge = 0;
|
||||
shieldEntropy = 0F;
|
||||
rfCharge = 0;
|
||||
rfTotal = 0;
|
||||
return;
|
||||
}
|
||||
showShieldHud = armorStatsFadeOut > 0F;
|
||||
|
||||
if (maxShieldPoints != summery.maxProtectionPoints || shieldPoints != summery.protectionPoints
|
||||
|| shieldEntropy != summery.entropy
|
||||
|| rfTotal != summery.totalEnergyStored)
|
||||
if (maxShieldPoints != summary.maxProtectionPoints || shieldPoints != summary.protectionPoints
|
||||
|| shieldEntropy != summary.entropy
|
||||
|| rfTotal != summary.totalEnergyStored)
|
||||
armorStatsFadeOut = 5F;
|
||||
|
||||
maxShieldPoints = summery.maxProtectionPoints;
|
||||
shieldPoints = summery.protectionPoints;
|
||||
shieldPercentCharge = (int) (summery.protectionPoints / summery.maxProtectionPoints * 100D);
|
||||
shieldEntropy = summery.entropy;
|
||||
rfCharge = (int) ((double) summery.totalEnergyStored / Math.max((double) summery.maxTotalEnergyStorage, 1D)
|
||||
maxShieldPoints = summary.maxProtectionPoints;
|
||||
shieldPoints = summary.protectionPoints;
|
||||
shieldPercentCharge = (int) (summary.protectionPoints / summary.maxProtectionPoints * 100D);
|
||||
shieldEntropy = summary.entropy;
|
||||
rfCharge = (int) ((double) summary.totalEnergyStored / Math.max((double) summary.maxTotalEnergyStorage, 1D)
|
||||
* 100D);
|
||||
rfTotal = summery.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) {
|
||||
|
||||
@@ -2,54 +2,64 @@ package com.brandon3055.draconicevolution.client.handler;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
|
||||
public final class ItemDisplayManager {
|
||||
|
||||
private static final RenderItem renderItem = new RenderItem();
|
||||
private static final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
private static final TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
|
||||
|
||||
private final int ticks;
|
||||
private ItemStack itemStack;
|
||||
private int ticksCounter;
|
||||
private static final RenderItem renderItem = new RenderItem();
|
||||
private static final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
private static final TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
|
||||
|
||||
public ItemDisplayManager(int ticks) {
|
||||
this.ticks = ticks;
|
||||
}
|
||||
|
||||
public void startDrawing(ItemStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
this.itemStack = itemStack == null ? null : itemStack.copy();
|
||||
ticksCounter = ticks;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
if (--ticksCounter == 0) {
|
||||
itemStack = null;
|
||||
@SubscribeEvent
|
||||
public void tickEnd(TickEvent.ClientTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
if (--ticksCounter == 0) {
|
||||
itemStack = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void drawItemStack(ScaledResolution resolution) {
|
||||
if (ticksCounter > 0 && itemStack != null && itemStack.getItem() != null) {
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
@SubscribeEvent
|
||||
public void renderGameOverlayEvent(RenderGameOverlayEvent.Post event) {
|
||||
if (event.type == RenderGameOverlayEvent.ElementType.ALL) {
|
||||
if (ticksCounter > 0 && itemStack != null && itemStack.getItem() != null) {
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
final int y = resolution.getScaledHeight();
|
||||
GL11.glTranslatef(7.0f, y * 0.25f, 0);
|
||||
renderItem.renderItemAndEffectIntoGUI(fontRenderer, textureManager, itemStack, 0, 0);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
final int y = event.resolution.getScaledHeight();
|
||||
GL11.glTranslatef(7.0f, y * 0.25f, 0);
|
||||
renderItem.renderItemAndEffectIntoGUI(fontRenderer, textureManager, itemStack, 0, 0);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.brandon3055.draconicevolution.client.handler;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.render.particle.ParticleDistortion;
|
||||
|
||||
@@ -10,16 +9,14 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ParticleHandler {
|
||||
|
||||
private static Minecraft mc = Minecraft.getMinecraft();
|
||||
private static World theWorld = mc.theWorld;
|
||||
public final class ParticleHandler {
|
||||
|
||||
public static EntityFX spawnParticle(String particleName, double x, double y, double z, double motionX,
|
||||
double motionY, double motionZ, float scale) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc != null && mc.renderViewEntity != null && mc.effectRenderer != null) {
|
||||
int var14 = mc.gameSettings.particleSetting;
|
||||
if (var14 == 1 && theWorld.rand.nextInt(3) == 0) {
|
||||
if (var14 == 1 && mc.theWorld.rand.nextInt(3) == 0) {
|
||||
var14 = 2;
|
||||
}
|
||||
double var15 = mc.renderViewEntity.posX - x;
|
||||
@@ -34,7 +31,7 @@ public class ParticleHandler {
|
||||
} else {
|
||||
if (particleName.equals("distortionParticle")) {
|
||||
var21 = new ParticleDistortion(
|
||||
theWorld,
|
||||
mc.theWorld,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
@@ -56,9 +53,10 @@ public class ParticleHandler {
|
||||
}
|
||||
|
||||
public static EntityFX spawnCustomParticle(EntityFX particle, double vewRange) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc != null && mc.renderViewEntity != null && mc.effectRenderer != null) {
|
||||
int var14 = mc.gameSettings.particleSetting;
|
||||
if (var14 == 1 && theWorld.rand.nextInt(3) == 0) {
|
||||
if (var14 == 1 && mc.theWorld.rand.nextInt(3) == 0) {
|
||||
var14 = 2;
|
||||
}
|
||||
if (!isInRange(particle.posX, particle.posY, particle.posZ, vewRange)) {
|
||||
@@ -74,14 +72,12 @@ public class ParticleHandler {
|
||||
}
|
||||
|
||||
public static boolean isInRange(double x, double y, double z, double vewRange) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc == null || mc.renderViewEntity == null || mc.effectRenderer == null) return false;
|
||||
|
||||
double var15 = mc.renderViewEntity.posX - x;
|
||||
double var17 = mc.renderViewEntity.posY - y;
|
||||
double var19 = mc.renderViewEntity.posZ - z;
|
||||
if (var15 * var15 + var17 * var17 + var19 * var19 > vewRange * vewRange) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return !(var15 * var15 + var17 * var17 + var19 * var19 > vewRange * vewRange);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
@@ -48,7 +49,7 @@ public class ResourceHandler {
|
||||
private static ResourceLocation particles = new ResourceLocation(
|
||||
References.RESOURCESPREFIX + "textures/particle/particles.png");
|
||||
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 File saveFolder;
|
||||
@@ -64,7 +65,6 @@ public class ResourceHandler {
|
||||
if (downloadThread.isReloadRequired()) LogHelper.info("Image Download Finished");
|
||||
downloadStatus = downloadThread.wasSuccessful ? 1 : 2;
|
||||
FMLCommonHandler.instance().bus().unregister(this);
|
||||
addRSPack(event != null);
|
||||
downloadThread = null;
|
||||
}
|
||||
}
|
||||
@@ -74,6 +74,10 @@ public class ResourceHandler {
|
||||
|
||||
if (event != null) savePath = event.getModConfigurationDirectory().getParentFile().getAbsolutePath()
|
||||
+ "/config/draconicevolution";
|
||||
|
||||
// Register the namespace before FML's final reload; folder-pack files are resolved on demand.
|
||||
getImagesFolder();
|
||||
addRSPack();
|
||||
GUIManual.loadPages();
|
||||
|
||||
downloadThread = new DownloadThread(GUIManual.imageURLs);
|
||||
@@ -83,7 +87,7 @@ public class ResourceHandler {
|
||||
public static class DownloadThread extends Thread {
|
||||
|
||||
private List<String> imageURLs;
|
||||
private boolean isFinished = false;
|
||||
private volatile boolean isFinished = false;
|
||||
private boolean wasSuccessful = true;
|
||||
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");
|
||||
if (!rspack.exists()) return;
|
||||
|
||||
@@ -200,7 +204,6 @@ public class ResourceHandler {
|
||||
|
||||
f.set(Minecraft.getMinecraft(), defaultResourcePacks);
|
||||
LogHelper.info("RS Added");
|
||||
if (refreash) Minecraft.getMinecraft().refreshResources();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.brandon3055.draconicevolution.client.handler;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public final class ShieldRenderHandler {
|
||||
|
||||
private static final IModelCustom SHIELD_SPHERE = AdvancedModelLoader
|
||||
.loadModel(ResourceHandler.getResource("models/shieldSphere.obj"));
|
||||
|
||||
private final HashMap<EntityPlayer, DataUtils.XZPair<Float, Integer>> shieldStatus = new HashMap<>();
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
if (event.world.isRemote) {
|
||||
this.shieldStatus.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void tickEnd(TickEvent.ClientTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END && !shieldStatus.isEmpty()) {
|
||||
final int ticks = DraconicEvolution.clientProxy().getElapsedTicks();
|
||||
shieldStatus.entrySet().removeIf(entry -> ticks - entry.getValue().getValue() > 5);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void renderPlayerEvent(RenderPlayerEvent.Post event) {
|
||||
final DataUtils.XZPair<Float, Integer> pair = shieldStatus.get(event.entityPlayer);
|
||||
if (pair != null) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
ResourceHandler.bindResource("textures/models/shieldSphere.png");
|
||||
|
||||
final float p = pair.getKey();
|
||||
final EntityPlayer viewingPlayer = Minecraft.getMinecraft().thePlayer;
|
||||
final int ticks = DraconicEvolution.clientProxy().getElapsedTicks();
|
||||
final int i = 5 - (ticks - pair.getValue());
|
||||
|
||||
GL11.glColor4f(1F - p, 0F, p, i / 5F);
|
||||
|
||||
if (viewingPlayer != event.entityPlayer) {
|
||||
double translationXLT = event.entityPlayer.prevPosX - viewingPlayer.prevPosX;
|
||||
double translationYLT = event.entityPlayer.prevPosY - viewingPlayer.prevPosY;
|
||||
double translationZLT = event.entityPlayer.prevPosZ - viewingPlayer.prevPosZ;
|
||||
|
||||
double translationX = translationXLT
|
||||
+ (((event.entityPlayer.posX - viewingPlayer.posX) - translationXLT) * event.partialRenderTick);
|
||||
double translationY = translationYLT
|
||||
+ (((event.entityPlayer.posY - viewingPlayer.posY) - translationYLT) * event.partialRenderTick);
|
||||
double translationZ = translationZLT
|
||||
+ (((event.entityPlayer.posZ - viewingPlayer.posZ) - translationZLT) * event.partialRenderTick);
|
||||
|
||||
GL11.glTranslated(translationX, translationY + 1.1, translationZ);
|
||||
} else {
|
||||
GL11.glTranslated(0, -0.5, 0);
|
||||
}
|
||||
|
||||
GL11.glScaled(1, 1.5, 1);
|
||||
|
||||
SHIELD_SPHERE.renderAll();
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
public void renderShield(EntityPlayer player, float shieldPowerF) {
|
||||
final int ticks = DraconicEvolution.clientProxy().getElapsedTicks();
|
||||
this.shieldStatus.put(player, new DataUtils.XZPair<>(shieldPowerF, ticks));
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.brandon3055.draconicevolution.client.keybinding;
|
||||
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.integration.ModHelper;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 14/08/2014.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public final class KeyBindings {
|
||||
|
||||
public static final KeyBinding placeItem;
|
||||
public static final KeyBinding toolConfig;
|
||||
public static final KeyBinding toolProfileChange;
|
||||
public static final KeyBinding toggleFlight;
|
||||
public static final KeyBinding toggleMagnet;
|
||||
public static KeyBinding toggleMagnetSelfPickup;
|
||||
|
||||
static {
|
||||
placeItem = new KeyBinding("key.placeItem", Keyboard.KEY_V, References.MODNAME);
|
||||
toolConfig = new KeyBinding("key.toolConfig", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toolProfileChange = new KeyBinding("key.toolProfileChange", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toggleFlight = new KeyBinding("key.toggleFlight", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toggleMagnet = new KeyBinding("key.toggleMagnet", Keyboard.KEY_NONE, References.MODNAME);
|
||||
if (ModHelper.isHodgepodgeLoaded) toggleMagnetSelfPickup = new KeyBinding(
|
||||
"key.toggleMagnetSelfPickup",
|
||||
Keyboard.KEY_NONE,
|
||||
References.MODNAME);
|
||||
}
|
||||
|
||||
private KeyBindings() {}
|
||||
|
||||
public static void init() {
|
||||
ClientRegistry.registerKeyBinding(placeItem);
|
||||
ClientRegistry.registerKeyBinding(toolConfig);
|
||||
ClientRegistry.registerKeyBinding(toolProfileChange);
|
||||
ClientRegistry.registerKeyBinding(toggleFlight);
|
||||
ClientRegistry.registerKeyBinding(toggleMagnet);
|
||||
if (ModHelper.isHodgepodgeLoaded) ClientRegistry.registerKeyBinding(toggleMagnetSelfPickup);
|
||||
}
|
||||
}
|
||||
@@ -8,15 +8,18 @@ import javax.annotation.Nonnull;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.Magnet;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.baseclasses.ToolHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.MagnetTogglePacket;
|
||||
import com.brandon3055.draconicevolution.common.network.MagnetToggleSelfPickupPacket;
|
||||
@@ -27,6 +30,7 @@ import com.brandon3055.draconicevolution.common.utils.InventoryUtils;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.integration.ModHelper;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -35,24 +39,56 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
/**
|
||||
* Created by Brandon on 14/08/2014.
|
||||
*/
|
||||
public class KeyInputHandler {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public final class KeyInputHandler {
|
||||
|
||||
private final KeyBinding placeItem;
|
||||
private final KeyBinding toolConfig;
|
||||
private final KeyBinding toolProfileChange;
|
||||
private final KeyBinding toggleFlight;
|
||||
private final KeyBinding toggleMagnet;
|
||||
private final KeyBinding toggleMagnetSelfPickup;
|
||||
|
||||
public KeyInputHandler() {
|
||||
placeItem = new KeyBinding("key.placeItem", Keyboard.KEY_V, References.MODNAME);
|
||||
toolConfig = new KeyBinding("key.toolConfig", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toolProfileChange = new KeyBinding("key.toolProfileChange", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toggleFlight = new KeyBinding("key.toggleFlight", Keyboard.KEY_NONE, References.MODNAME);
|
||||
toggleMagnet = new KeyBinding("key.toggleMagnet", Keyboard.KEY_NONE, References.MODNAME);
|
||||
if (ModHelper.isHodgepodgeLoaded) {
|
||||
toggleMagnetSelfPickup = new KeyBinding(
|
||||
"key.toggleMagnetSelfPickup",
|
||||
Keyboard.KEY_NONE,
|
||||
References.MODNAME);
|
||||
} else {
|
||||
toggleMagnetSelfPickup = null;
|
||||
}
|
||||
ClientRegistry.registerKeyBinding(placeItem);
|
||||
ClientRegistry.registerKeyBinding(toolConfig);
|
||||
ClientRegistry.registerKeyBinding(toolProfileChange);
|
||||
ClientRegistry.registerKeyBinding(toggleFlight);
|
||||
ClientRegistry.registerKeyBinding(toggleMagnet);
|
||||
if (toggleMagnetSelfPickup != null) {
|
||||
ClientRegistry.registerKeyBinding(toggleMagnetSelfPickup);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onKeyInput(InputEvent.KeyInputEvent event) {
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
if (KeyBindings.placeItem.isPressed()) {
|
||||
if (this.placeItem.isPressed()) {
|
||||
handlePlaceItemKey();
|
||||
} else if (KeyBindings.toolConfig.isPressed()) {
|
||||
} else if (this.toolConfig.isPressed()) {
|
||||
handleToolConfigKey();
|
||||
} else if (KeyBindings.toolProfileChange.isPressed() && player != null && player.getItemInUse() == null) {
|
||||
} else if (this.toolProfileChange.isPressed() && player != null && player.getItemInUse() == null) {
|
||||
handleToolProfileChangeKey(player);
|
||||
} else if (KeyBindings.toggleFlight.isPressed() && player != null) {
|
||||
} else if (this.toggleFlight.isPressed() && player != null) {
|
||||
handleToggleFlightKey(player);
|
||||
} else if (KeyBindings.toggleMagnet.isPressed()) {
|
||||
} else if (this.toggleMagnet.isPressed()) {
|
||||
handleToggleMagnetKey(player);
|
||||
} else if (ModHelper.isHodgepodgeLoaded && KeyBindings.toggleMagnetSelfPickup.isPressed()) {
|
||||
} else if (this.toggleMagnetSelfPickup != null && this.toggleMagnetSelfPickup.isPressed()) {
|
||||
handleToggleMagnetSelfPickup(player);
|
||||
}
|
||||
}
|
||||
@@ -62,17 +98,17 @@ public class KeyInputHandler {
|
||||
public void onMouseInput(InputEvent.MouseInputEvent event) {
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
if (KeyBindings.placeItem.isPressed()) {
|
||||
if (this.placeItem.isPressed()) {
|
||||
handlePlaceItemKey();
|
||||
} else if (KeyBindings.toolConfig.isPressed()) {
|
||||
} else if (this.toolConfig.isPressed()) {
|
||||
handleToolConfigKey();
|
||||
} else if (KeyBindings.toolProfileChange.isPressed() && player != null) {
|
||||
} else if (this.toolProfileChange.isPressed() && player != null) {
|
||||
handleToolProfileChangeKey(player);
|
||||
} else if (KeyBindings.toggleFlight.isPressed() && player != null) {
|
||||
} else if (this.toggleFlight.isPressed() && player != null) {
|
||||
handleToggleFlightKey(player);
|
||||
} else if (KeyBindings.toggleMagnet.isPressed()) {
|
||||
} else if (this.toggleMagnet.isPressed()) {
|
||||
handleToggleMagnetKey(player);
|
||||
} else if (ModHelper.isHodgepodgeLoaded && KeyBindings.toggleMagnetSelfPickup.isPressed()) {
|
||||
} else if (this.toggleMagnetSelfPickup != null && this.toggleMagnetSelfPickup.isPressed()) {
|
||||
handleToggleMagnetSelfPickup(player);
|
||||
}
|
||||
|
||||
@@ -160,4 +196,8 @@ public class KeyInputHandler {
|
||||
if (c == 150 && i < 0) return 152;
|
||||
return c + i;
|
||||
}
|
||||
|
||||
public int toolConfigKeycode() {
|
||||
return this.toolConfig.getKeyCode();
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,12 @@ package com.brandon3055.draconicevolution.client.model;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.integration.ModHelper;
|
||||
|
||||
import xonin.backhand.api.core.BackhandUtils;
|
||||
|
||||
public class ModelDraconicArmor extends ModelBiped {
|
||||
|
||||
@@ -173,7 +177,14 @@ public class ModelDraconicArmor extends ModelBiped {
|
||||
bipedRightLeg.rotateAngleZ = 0F;
|
||||
|
||||
setRotationAngles(0, 0, 0, 0, 0, 0, null);
|
||||
} else super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
} else {
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
if (entity instanceof EntityPlayer) {
|
||||
if (ModHelper.isBackhandLoaded) {
|
||||
BackhandHelper.applyFix(this, (EntityPlayer) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.bipedHead.render(1F / 13F);
|
||||
this.bipedRightArm.render(1F / 15F);
|
||||
@@ -205,4 +216,14 @@ public class ModelDraconicArmor extends ModelBiped {
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
}
|
||||
|
||||
private static class BackhandHelper {
|
||||
|
||||
public static void applyFix(ModelDraconicArmor model, EntityPlayer player) {
|
||||
if (BackhandUtils.getOffhandItem(player) != null) {
|
||||
model.bipedLeftArm.rotateAngleX = model.bipedLeftArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F);
|
||||
model.bipedLeftArm.rotateAngleY = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,7 @@ public class ModelRenderOBJ extends ModelRenderer {
|
||||
this.compileDisplayList(scale);
|
||||
}
|
||||
|
||||
ResourceHandler.bindTexture(texture);
|
||||
GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ);
|
||||
|
||||
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.glPushMatrix();
|
||||
ResourceHandler.bindTexture(texture);
|
||||
// scale = 1F/15F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glRotatef(180, -1, 0, 1);
|
||||
@@ -102,6 +102,7 @@ public class ModelRenderOBJ extends ModelRenderer {
|
||||
this.compileDisplayList(scale);
|
||||
}
|
||||
|
||||
ResourceHandler.bindTexture(texture);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
|
||||
if (this.rotateAngleY != 0.0F) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.entity.Entity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
|
||||
/**
|
||||
* DragonWings - brandon3055 Created using Tabula 5.0.0
|
||||
@@ -70,7 +70,8 @@ public class ModelContributorWings extends ModelBase {
|
||||
float baseRot = 0.45906584F;
|
||||
float outerRot = 0.61086524F;
|
||||
|
||||
float animation = (float) Math.sin(((float) ClientEventHandler.elapsedTicks + partialTick) / 20);
|
||||
final int ticks = DraconicEvolution.clientProxy().getElapsedTicks();
|
||||
float animation = (float) Math.sin(((float) ticks + partialTick) / 20);
|
||||
|
||||
if (entity.isSneaking()) {
|
||||
this.leftBaseStem.rotateAngleX = 0.5F;
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityDragonHeart;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
@@ -27,10 +27,11 @@ public class RenderDragonHeart extends Render {
|
||||
|
||||
private void doRender(EntityDragonHeart entity, double x, double y, double z, float f) {
|
||||
|
||||
float sine = (float) Math.abs(Math.cos(ClientEventHandler.elapsedTicks / 1000D));
|
||||
final int ticks = DraconicEvolution.clientProxy().getElapsedTicks();
|
||||
float sine = (float) Math.abs(Math.cos(ticks / 1000D));
|
||||
|
||||
{ // Draw Item
|
||||
// GL11.glRotatef((((float) ClientEventHandler.elapsedTicks) + f) * entity.rotationSpeed, 0f, 1f, 0f);
|
||||
// GL11.glRotatef((((float) ticks) + f) * entity.rotationSpeed, 0f, 1f, 0f);
|
||||
GL11.glRotatef(entity.rotation + f * entity.rotationInc, 0f, 1f, 0f);
|
||||
EntityItem itemEntity = new EntityItem(entity.worldObj, 0, 0, 0, new ItemStack(ModItems.dragonHeart));
|
||||
itemEntity.hoverStart = 0.0F;
|
||||
|
||||
@@ -15,6 +15,12 @@ import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
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 String[] randomEntities = new String[] { "Pig", "Sheep", "Enderman", "Zombie", "Creeper", "Cow",
|
||||
"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.glTranslated(1.2, 2.2, 0);
|
||||
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);
|
||||
RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F);
|
||||
GL11.glPopMatrix();
|
||||
@@ -67,7 +73,7 @@ public class RenderMobSoul implements IItemRenderer {
|
||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||
GL11.glTranslated(2, 0.5, 0);
|
||||
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);
|
||||
RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F);
|
||||
GL11.glPopMatrix();
|
||||
@@ -76,14 +82,14 @@ public class RenderMobSoul implements IItemRenderer {
|
||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||
GL11.glTranslated(1, 0.5, 0);
|
||||
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);
|
||||
RenderManager.instance.renderEntityWithPosYaw(mob, 0, 0, 0, 0F, 1F);
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
GL11.glPushMatrix();
|
||||
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.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
package com.brandon3055.draconicevolution.client.render.particle;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
@@ -28,19 +30,19 @@ public class ParticleEnergyBeam extends EntityFX {
|
||||
/**
|
||||
* Beam Target X
|
||||
*/
|
||||
private double tX = 0.0D;
|
||||
private double tX;
|
||||
/**
|
||||
* Beam Target Y
|
||||
*/
|
||||
private double tY = 0.0D;
|
||||
private double tY;
|
||||
/**
|
||||
* Beam Target Z
|
||||
*/
|
||||
private double tZ = 0.0D;
|
||||
private double tZ;
|
||||
/**
|
||||
* Modified Target X
|
||||
*/
|
||||
private boolean advanced;
|
||||
private final boolean advanced;
|
||||
|
||||
private boolean renderParticle = true;
|
||||
private float length = 0.0F;
|
||||
@@ -52,10 +54,10 @@ public class ParticleEnergyBeam extends EntityFX {
|
||||
|
||||
// todo make sure not dyrectly up or down on y axis, Set dead when player goes out of range, PaRTICLE eNGINE
|
||||
|
||||
private static ResourceLocation beamTextureBasic = new ResourceLocation(
|
||||
private static final ResourceLocation beamTextureBasic = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/models/EnergyBeamBlue.png");
|
||||
private static ResourceLocation beamTextureAdvanced = new ResourceLocation(
|
||||
private static final ResourceLocation beamTextureAdvanced = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/models/EnergyBeamRed.png");
|
||||
|
||||
@@ -192,9 +194,9 @@ public class ParticleEnergyBeam extends EntityFX {
|
||||
GL11.glRotatef(t * 90.0F, 0.0F, -1.0F, 0.0F);
|
||||
}
|
||||
|
||||
if (ClientEventHandler.playerHoldingWrench) {
|
||||
var44 = -0.15D * (double) 1;
|
||||
var17 = 0.15D * (double) 1;
|
||||
if (isPlayerHoldingWrench()) {
|
||||
var44 = -0.15D;
|
||||
var17 = 0.15D;
|
||||
|
||||
// GL11.glColor4f(1f, 1f, 1f, 1f);
|
||||
// GL11.glTranslated(0.1, 0, 0);
|
||||
@@ -234,4 +236,13 @@ public class ParticleEnergyBeam extends EntityFX {
|
||||
public void setFlow(int flow) {
|
||||
this.flow = flow;
|
||||
}
|
||||
|
||||
private static boolean isPlayerHoldingWrench() {
|
||||
final EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
if (player != null) {
|
||||
final ItemStack heldItem = player.getHeldItem();
|
||||
return heldItem != null && heldItem.getItem() == ModItems.wrench;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyRelay;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyTransceiver;
|
||||
@@ -65,7 +65,8 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
float innerLight = 100f;
|
||||
float outerLight = 140f + ClientEventHandler.energyCrystalAlphaValue * 40F;
|
||||
final float crystalAlpha = DraconicEvolution.clientProxy().getEnergyCrystalAlpha();
|
||||
float outerLight = 140f + crystalAlpha * 40F;
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, innerLight, innerLight);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
|
||||
@@ -79,7 +80,7 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
|
||||
if (tileEntity.getPowerTier() == 0) bindTexture(crystalBlueAlpha);
|
||||
else bindTexture(crystalRedAlpha);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.5f + ClientEventHandler.energyCrystalAlphaValue * 0.5f);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.5f + crystalAlpha * 0.5f);
|
||||
|
||||
modelCrystal.renderAll();
|
||||
|
||||
@@ -131,7 +132,8 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
|
||||
// RenderHelper.disableStandardItemLighting();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
float innerLight = 100f;
|
||||
float outerLight = 140f + ClientEventHandler.energyCrystalAlphaValue * 40F;
|
||||
final float crystalAlpha = DraconicEvolution.clientProxy().getEnergyCrystalAlpha();
|
||||
float outerLight = 140f + crystalAlpha * 40F;
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, innerLight, innerLight);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
|
||||
@@ -145,7 +147,7 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
|
||||
if (tileEntity.getPowerTier() == 0) bindTexture(crystalBlueAlpha);
|
||||
else bindTexture(crystalRedAlpha);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.5f + ClientEventHandler.energyCrystalAlphaValue * 0.5f);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.5f + crystalAlpha * 0.5f);
|
||||
|
||||
modelCrystalTransceiver.renderAll();
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -18,10 +19,7 @@ import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter;
|
||||
|
||||
public class RenderTileDissEnchanter extends TileEntitySpecialRenderer {
|
||||
|
||||
// private final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(),
|
||||
// "textures/models/EnergyInfuserTextureSheet.png");
|
||||
|
||||
// private static float pxl = 1F / 256F;
|
||||
private final EntityItem cachedEntity = new EntityItem(null, 0, 0, 0, new ItemStack(Items.apple));
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
@@ -71,10 +69,7 @@ public class RenderTileDissEnchanter extends TileEntitySpecialRenderer {
|
||||
if (tile.getStackInSlot(i) != null) {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
ItemStack stack = tile.getStackInSlot(i).copy();
|
||||
stack.stackSize = 1;
|
||||
EntityItem itemEntity = new EntityItem(tile.getWorldObj(), 0, 0, 0, stack);
|
||||
itemEntity.hoverStart = 0.0F;
|
||||
ItemStack stack = tile.getStackInSlot(i);
|
||||
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glScalef(1F, 1F, 1F);
|
||||
@@ -85,7 +80,18 @@ public class RenderTileDissEnchanter extends TileEntitySpecialRenderer {
|
||||
}
|
||||
|
||||
RenderItem.renderInFrame = true;
|
||||
RenderManager.instance.renderEntityWithPosYaw(itemEntity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
final int stackSize = stack.stackSize;
|
||||
try {
|
||||
stack.stackSize = 1;
|
||||
this.cachedEntity.setEntityItemStack(stack);
|
||||
this.cachedEntity.setWorld(tile.getWorldObj());
|
||||
this.cachedEntity.hoverStart = 0.0F;
|
||||
RenderManager.instance.renderEntityWithPosYaw(this.cachedEntity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
} finally {
|
||||
stack.stackSize = stackSize;
|
||||
this.cachedEntity.setEntityItemStack(null);
|
||||
this.cachedEntity.setWorld(null);
|
||||
}
|
||||
RenderItem.renderInFrame = false;
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -32,9 +32,8 @@ public class RenderTileEarth extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float timeSinceLastTick) {
|
||||
if (!(tile instanceof TileEarth)) return;
|
||||
if (!(tile instanceof TileEarth tileEarth)) return;
|
||||
|
||||
TileEarth tileEarth = (TileEarth) tile;
|
||||
float scale = 0.01f * tileEarth.getSize();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -17,11 +18,11 @@ import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
|
||||
|
||||
public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final float pxl = 1F / 256F;
|
||||
private final ResourceLocation texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/models/EnergyInfuserTextureSheet.png");
|
||||
|
||||
private static float pxl = 1F / 256F;
|
||||
private final EntityItem cachedEntity = new EntityItem(null, 0, 0, 0, new ItemStack(Items.apple));
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
@@ -238,8 +239,6 @@ public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
ItemStack stack = tile.getStackInSlot(0);
|
||||
EntityItem itemEntity = new EntityItem(tile.getWorldObj(), 0, 0, 0, tile.getStackInSlot(0));
|
||||
itemEntity.hoverStart = 0.0F;
|
||||
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glScalef(1F, 1F, 1F);
|
||||
@@ -252,7 +251,15 @@ public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer {
|
||||
}
|
||||
|
||||
RenderItem.renderInFrame = true;
|
||||
RenderManager.instance.renderEntityWithPosYaw(itemEntity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
try {
|
||||
this.cachedEntity.setEntityItemStack(stack);
|
||||
this.cachedEntity.setWorld(tile.getWorldObj());
|
||||
this.cachedEntity.hoverStart = 0.0F;
|
||||
RenderManager.instance.renderEntityWithPosYaw(this.cachedEntity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
} finally {
|
||||
this.cachedEntity.setEntityItemStack(null);
|
||||
this.cachedEntity.setWorld(null);
|
||||
}
|
||||
RenderItem.renderInFrame = false;
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.brandon3055.draconicevolution.client.render.tile;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemBow;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -22,37 +22,38 @@ import com.brandon3055.draconicevolution.common.tileentities.TilePlacedItem;
|
||||
*/
|
||||
public class RenderTilePlacedItem extends TileEntitySpecialRenderer {
|
||||
|
||||
public RenderTilePlacedItem() {}
|
||||
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));
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float timeSinceLastTick) {
|
||||
if (te == null || !(te instanceof TilePlacedItem)) return;
|
||||
TilePlacedItem tile = (TilePlacedItem) te;
|
||||
if (tile.getStack() == null) return;
|
||||
if (!(te instanceof TilePlacedItem tile)) 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.glPushAttrib(GL11.GL_ENABLE_BIT);
|
||||
GL11.glTranslated(x, y, z);
|
||||
renderItem(tile);
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderItem(TilePlacedItem tile) {
|
||||
ItemStack stack = tile.getStack();
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
EntityItem itemEntity = new EntityItem(tile.getWorldObj(), 0, 0, 0, stack);
|
||||
int meta = world.getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||
// itemEntity.getEntityItem().stackSize = 1;
|
||||
itemEntity.hoverStart = 0.0F;
|
||||
boolean is3D = stack.getItem().isFull3D();
|
||||
boolean isBlock = stack.getItem() instanceof ItemBlock;
|
||||
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||
final Item item = stack.getItem();
|
||||
boolean is3D = item.isFull3D();
|
||||
boolean isBlock = item instanceof ItemBlock;
|
||||
|
||||
if (isBlock) {
|
||||
GL11.glTranslatef(0.5F, 0.25F, 0.5F);
|
||||
GL11.glScalef(1.5F, 1.5F, 1.5F);
|
||||
metaAdjustBlock(meta);
|
||||
GL11.glRotatef(tile.rotation, 0F, 1F, 0F);
|
||||
} else if (is3D || stack.getItem() instanceof ItemArmor || stack.getItem() instanceof ItemBow) {
|
||||
} else if (is3D || item instanceof ItemArmor || item instanceof ItemBow) {
|
||||
GL11.glScalef(2F, 2F, 2F);
|
||||
GL11.glRotatef(90F, -1F, 0F, 0F);
|
||||
GL11.glTranslatef(0.25F, -0.45F, 0.02F);
|
||||
@@ -60,9 +61,8 @@ public class RenderTilePlacedItem extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef(0.0F, 0.21F, 0.0F);
|
||||
GL11.glRotatef(tile.rotation, 0F, 0F, 1F);
|
||||
GL11.glTranslatef(0.0F, -0.21F, 0.0F);
|
||||
} else if (stack.getItem() instanceof MobSoul) {
|
||||
|
||||
GL11.glTranslatef(0.5F, 0.3F, 0.5F);
|
||||
} else if (item instanceof MobSoul) {
|
||||
GL11.glTranslatef(MOBSOUL_CENTER_X, MOBSOUL_CENTER_Y, MOBSOUL_CENTER_Z);
|
||||
} else {
|
||||
GL11.glRotatef(90F, -1F, 0F, 0F);
|
||||
GL11.glTranslatef(0.5F, -0.65F, 0.02F);
|
||||
@@ -72,11 +72,17 @@ public class RenderTilePlacedItem extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef(0.0F, -0.18F, 0.0F);
|
||||
}
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
|
||||
RenderItem.renderInFrame = true;
|
||||
RenderManager.instance.renderEntityWithPosYaw(itemEntity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
RenderItem.renderInFrame = false;
|
||||
GL11.glPopAttrib();
|
||||
try {
|
||||
this.cachedEntity.setEntityItemStack(stack);
|
||||
this.cachedEntity.setWorld(tile.getWorldObj());
|
||||
this.cachedEntity.hoverStart = 0.0F;
|
||||
RenderManager.instance.renderEntityWithPosYaw(this.cachedEntity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
} finally {
|
||||
this.cachedEntity.setEntityItemStack(null);
|
||||
this.cachedEntity.setWorld(null);
|
||||
RenderItem.renderInFrame = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void metaAdjustItemTool(int meta) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.brandon3055.draconicevolution.client.render.tile;
|
||||
|
||||
import java.awt.Point;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
@@ -10,6 +8,7 @@ import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -33,11 +32,11 @@ import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
*/
|
||||
public class RenderTileTeleporterStand extends TileEntitySpecialRenderer {
|
||||
|
||||
ModelTeleporterStand model = new ModelTeleporterStand();
|
||||
|
||||
private final ModelTeleporterStand model = new ModelTeleporterStand();
|
||||
private final ResourceLocation texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/models/TeleporterStand.png");
|
||||
private final EntityItem cachedEntity = new EntityItem(null, 0, 0, 0, new ItemStack(Items.apple));
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
|
||||
@@ -69,27 +68,29 @@ public class RenderTileTeleporterStand extends TileEntitySpecialRenderer {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderItem(TileEntity tile, ItemStack item, float f) {
|
||||
if (item.getItem() == null) return;
|
||||
public void renderItem(TileEntity tile, ItemStack stack, float f) {
|
||||
if (stack.getItem() == null) return;
|
||||
GL11.glPushMatrix();
|
||||
|
||||
EntityItem itemEntity = new EntityItem(tile.getWorldObj(), 0, 0, 0, item);
|
||||
itemEntity.hoverStart = 0.0F;
|
||||
|
||||
if (item.getItem() instanceof TeleporterMKII) {
|
||||
if (stack.getItem() instanceof TeleporterMKII) {
|
||||
GL11.glTranslatef(0F, 0.18F, 0.864F);
|
||||
GL11.glRotated(180, 0, 0, 1);
|
||||
GL11.glRotated(30, 1, 0, 0);
|
||||
GL11.glScalef(1F, 1F, 1F);
|
||||
} else {
|
||||
GL11.glTranslatef(0F, 0.22F, 0.84F);
|
||||
GL11.glRotated(180, 0, 0, 1);
|
||||
GL11.glRotated(30, 1, 0, 0);
|
||||
GL11.glScalef(1F, 1F, 1F);
|
||||
}
|
||||
GL11.glRotated(180, 0, 0, 1);
|
||||
GL11.glRotated(30, 1, 0, 0);
|
||||
GL11.glScalef(1F, 1F, 1F);
|
||||
|
||||
RenderItem.renderInFrame = true;
|
||||
RenderManager.instance.renderEntityWithPosYaw(itemEntity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
try {
|
||||
this.cachedEntity.setEntityItemStack(stack);
|
||||
this.cachedEntity.setWorld(tile.getWorldObj());
|
||||
this.cachedEntity.hoverStart = 0.0F;
|
||||
RenderManager.instance.renderEntityWithPosYaw(this.cachedEntity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
} finally {
|
||||
this.cachedEntity.setEntityItemStack(null);
|
||||
this.cachedEntity.setWorld(null);
|
||||
}
|
||||
RenderItem.renderInFrame = false;
|
||||
|
||||
GL11.glPopMatrix();
|
||||
@@ -126,9 +127,6 @@ public class RenderTileTeleporterStand extends TileEntitySpecialRenderer {
|
||||
GL11.glRotated(180, 0, 1, 0);
|
||||
GL11.glTranslated(0, -40, 0);
|
||||
|
||||
Point.Double p1 = new Point.Double(tileentity.xCoord + 0.5, tileentity.zCoord + 0.5);
|
||||
Point.Double p2 = new Point.Double(player.posX, player.posZ);
|
||||
|
||||
double xDiff = player.posX - (tileentity.xCoord + 0.5);
|
||||
double yDiff = player.posY - (tileentity.yCoord + 0.5);
|
||||
double zDiff = player.posZ - (tileentity.zCoord + 0.5);
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -16,7 +17,8 @@ import com.brandon3055.draconicevolution.common.tileentities.TileUpgradeModifier
|
||||
|
||||
public class RenderTileUpgradeModifier extends TileEntitySpecialRenderer {
|
||||
|
||||
private static float pxl = 1F / 256F;
|
||||
private static final float pxl = 1F / 256F;
|
||||
private final EntityItem cachedEntity = new EntityItem(null, 0, 0, 0, new ItemStack(Items.apple));
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
@@ -207,8 +209,6 @@ public class RenderTileUpgradeModifier extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
ItemStack stack = tile.getStackInSlot(0);
|
||||
EntityItem itemEntity = new EntityItem(tile.getWorldObj(), 0, 0, 0, tile.getStackInSlot(0));
|
||||
itemEntity.hoverStart = 0.0F;
|
||||
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glScalef(1F, 1F, 1F);
|
||||
@@ -220,7 +220,15 @@ public class RenderTileUpgradeModifier extends TileEntitySpecialRenderer {
|
||||
}
|
||||
|
||||
RenderItem.renderInFrame = true;
|
||||
RenderManager.instance.renderEntityWithPosYaw(itemEntity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
try {
|
||||
this.cachedEntity.setEntityItemStack(stack);
|
||||
this.cachedEntity.setWorld(tile.getWorldObj());
|
||||
this.cachedEntity.hoverStart = 0.0F;
|
||||
RenderManager.instance.renderEntityWithPosYaw(this.cachedEntity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
} finally {
|
||||
this.cachedEntity.setEntityItemStack(null);
|
||||
this.cachedEntity.setWorld(null);
|
||||
}
|
||||
RenderItem.renderInFrame = false;
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
package com.brandon3055.draconicevolution.common;
|
||||
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.creativetab.DETab;
|
||||
import com.brandon3055.draconicevolution.client.gui.GuiHandler;
|
||||
import com.brandon3055.draconicevolution.client.render.particle.ParticleEnergyBeam;
|
||||
import com.brandon3055.draconicevolution.client.render.particle.ParticleEnergyField;
|
||||
import com.brandon3055.draconicevolution.client.render.particle.ParticleReactorBeam;
|
||||
import com.brandon3055.draconicevolution.common.achievements.Achievements;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityChaosBolt;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityChaosCrystal;
|
||||
@@ -33,6 +36,7 @@ import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.CraftingHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.FMLEventHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.MinecraftForgeEventHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.OreDoublingRegistry;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.magic.EnchantmentReaper;
|
||||
@@ -102,6 +106,8 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -109,12 +115,28 @@ import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
private Achievements achievements;
|
||||
private CustomArmorHandler armorHandler;
|
||||
private DragonChunkLoader dragonChunkLoader;
|
||||
private final Map<World, List<TileDislocatorInhibitor>> serverInhibitorsMap = new HashMap<>();
|
||||
|
||||
public CommonProxy() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
FileHandler.init(event);
|
||||
ProcessHandler.init();
|
||||
ConfigHandler.init(event.getSuggestedConfigurationFile());
|
||||
BalanceConfigHandler.init(event.getModConfigurationDirectory());
|
||||
registerEventListeners(event.getSide());
|
||||
MinecraftForge.EVENT_BUS.register(new MinecraftForgeEventHandler());
|
||||
this.achievements = new Achievements();
|
||||
MinecraftForge.EVENT_BUS.register(this.achievements);
|
||||
FMLCommonHandler.instance().bus().register(this.achievements);
|
||||
FMLCommonHandler.instance().bus().register(new FMLEventHandler());
|
||||
this.armorHandler = new CustomArmorHandler();
|
||||
MinecraftForge.EVENT_BUS.register(armorHandler);
|
||||
FMLCommonHandler.instance().bus().register(armorHandler);
|
||||
ModBlocks.init();
|
||||
ModItems.init();
|
||||
ContributorHandler.init();
|
||||
@@ -124,7 +146,7 @@ public class CommonProxy {
|
||||
|
||||
DraconicEvolution.reaperEnchant = new EnchantmentReaper(ConfigHandler.reaperEnchantID);
|
||||
|
||||
Achievements.addModAchievements();
|
||||
this.achievements.addModAchievements();
|
||||
LogHelper.info("Finished PreInitialization");
|
||||
}
|
||||
|
||||
@@ -136,18 +158,30 @@ public class CommonProxy {
|
||||
DETab.initialize();
|
||||
PotionHandler.init();
|
||||
CCOCIntegration.init();
|
||||
DragonChunkLoader.init();
|
||||
this.dragonChunkLoader = new DragonChunkLoader();
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(DraconicEvolution.instance, this.dragonChunkLoader);
|
||||
LogHelper.info("Finished Initialization");
|
||||
}
|
||||
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
BalanceConfigHandler.finishLoading();
|
||||
OreDoublingRegistry.init();
|
||||
Achievements.registerAchievementPane();
|
||||
this.achievements.registerAchievementPane();
|
||||
LogHelper.info("Finished PostInitialization");
|
||||
}
|
||||
|
||||
public void initializeNetwork() {
|
||||
public void onServerStopped(FMLServerStoppedEvent event) {
|
||||
this.serverInhibitorsMap.clear();
|
||||
this.dragonChunkLoader.onServerStopped();
|
||||
this.armorHandler.onServerStopped();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
this.serverInhibitorsMap.remove(event.world);
|
||||
}
|
||||
|
||||
private void initializeNetwork() {
|
||||
// spotless:off
|
||||
DraconicEvolution.network = NetworkRegistry.INSTANCE.newSimpleChannel(DraconicEvolution.networkChannelName);
|
||||
DraconicEvolution.network.registerMessage(ButtonPacket.Handler.class, ButtonPacket.class, 0, Side.SERVER);
|
||||
@@ -178,7 +212,7 @@ public class CommonProxy {
|
||||
// spotless:on
|
||||
}
|
||||
|
||||
public void registerTileEntities() {
|
||||
private void registerTileEntities() {
|
||||
// spotless:off
|
||||
GameRegistry.registerTileEntity(TileWeatherController.class, References.RESOURCESPREFIX + "TileWeatherController");
|
||||
GameRegistry.registerTileEntity(TileSunDial.class, References.RESOURCESPREFIX + "TileSunDial");
|
||||
@@ -191,7 +225,7 @@ public class CommonProxy {
|
||||
GameRegistry.registerTileEntity(TileCustomSpawner.class, References.RESOURCESPREFIX + "TileCustomSpawner");
|
||||
GameRegistry.registerTileEntity(TileGenerator.class, References.RESOURCESPREFIX + "TileGenerator");
|
||||
GameRegistry.registerTileEntity(TileEnergyStorageCore.class, References.RESOURCESPREFIX + "TileEnergyStorageCore");
|
||||
GameRegistry.registerTileEntity(TileEarth.class, References.RESOURCESPREFIX + "TileEarth");
|
||||
if (ModBlocks.earthBlock != null) GameRegistry.registerTileEntity(TileEarth.class, References.RESOURCESPREFIX + "TileEarth");
|
||||
GameRegistry.registerTileEntity(TileInvisibleMultiblock.class, References.RESOURCESPREFIX + "TileInvisibleMultiblock");
|
||||
GameRegistry.registerTileEntity(TileEnergyPylon.class, References.RESOURCESPREFIX + "TileEnergyPylon");
|
||||
GameRegistry.registerTileEntity(TileEnderResurrection.class, References.RESOURCESPREFIX + "TileEnderResurrection");
|
||||
@@ -216,13 +250,6 @@ public class CommonProxy {
|
||||
// spotless:on
|
||||
}
|
||||
|
||||
public void registerEventListeners(Side s) {
|
||||
MinecraftForge.EVENT_BUS.register(new MinecraftForgeEventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new Achievements());
|
||||
FMLCommonHandler.instance().bus().register(new Achievements());
|
||||
FMLCommonHandler.instance().bus().register(new FMLEventHandler());
|
||||
}
|
||||
|
||||
public void registerGuiHandeler() {
|
||||
new GuiHandler();
|
||||
}
|
||||
@@ -268,26 +295,6 @@ public class CommonProxy {
|
||||
// spotless:on
|
||||
}
|
||||
|
||||
public ParticleEnergyBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz,
|
||||
int powerFlow, boolean advanced, ParticleEnergyBeam oldBeam, boolean render, int beamType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ParticleEnergyField energyField(World worldObj, double x, double y, double z, int type, boolean advanced,
|
||||
ParticleEnergyField oldBeam, boolean render) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ParticleReactorBeam reactorBeam(TileEntity tile, ParticleReactorBeam oldBeam, boolean render) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void spawnParticle(Object particle, int range) {}
|
||||
|
||||
public ISound playISound(ISound sound) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isDedicatedServer() {
|
||||
return true;
|
||||
}
|
||||
@@ -300,17 +307,6 @@ public class CommonProxy {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isOp(String paramString) {
|
||||
MinecraftServer localMinecraftServer = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
paramString = paramString.trim();
|
||||
for (String str : localMinecraftServer.getConfigurationManager().func_152606_n()) {
|
||||
if (paramString.equalsIgnoreCase(str)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isSpaceDown() {
|
||||
return false;
|
||||
}
|
||||
@@ -326,4 +322,70 @@ public class CommonProxy {
|
||||
public EntityPlayer getClientPlayer() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isClient() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void triggerAchievement(EntityPlayer player, String name) {
|
||||
this.achievements.triggerAchievement(player, name);
|
||||
}
|
||||
|
||||
public DragonChunkLoader getDragonChunkLoader() {
|
||||
return dragonChunkLoader;
|
||||
}
|
||||
|
||||
public void tryRepositionPlayerOnMount(int entityId) {}
|
||||
|
||||
public void registerInhibitor(TileDislocatorInhibitor tile) {
|
||||
if (tile.hasWorldObj()) {
|
||||
registerInhibitor(this.serverInhibitorsMap, tile);
|
||||
}
|
||||
}
|
||||
|
||||
protected static void registerInhibitor(Map<World, List<TileDislocatorInhibitor>> map,
|
||||
TileDislocatorInhibitor tile) {
|
||||
final List<TileDislocatorInhibitor> list = map.computeIfAbsent(tile.getWorldObj(), k -> new ArrayList<>());
|
||||
if (!list.contains(tile)) {
|
||||
list.add(tile);
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterInhibitor(TileDislocatorInhibitor tile) {
|
||||
if (tile.hasWorldObj()) {
|
||||
unregisterInhibitor(this.serverInhibitorsMap, tile);
|
||||
}
|
||||
}
|
||||
|
||||
protected static void unregisterInhibitor(Map<World, List<TileDislocatorInhibitor>> map,
|
||||
TileDislocatorInhibitor tile) {
|
||||
final List<TileDislocatorInhibitor> list = map.get(tile.getWorldObj());
|
||||
if (list != null) {
|
||||
list.remove(tile);
|
||||
if (list.isEmpty()) {
|
||||
map.remove(tile.getWorldObj());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isBlockedByInhibitor(World world, EntityItem item) {
|
||||
return isBlockedByInhibitor(this.serverInhibitorsMap, world, item);
|
||||
}
|
||||
|
||||
protected static boolean isBlockedByInhibitor(Map<World, List<TileDislocatorInhibitor>> map, World world,
|
||||
EntityItem item) {
|
||||
final List<TileDislocatorInhibitor> list = map.get(world);
|
||||
if (list == null) {
|
||||
return false;
|
||||
}
|
||||
// noinspection ForLoopReplaceableByForEach
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
final TileDislocatorInhibitor tile = list.get(i);
|
||||
if (tile.shouldBeActive() && tile.isInRange(item.posX, item.posY, item.posZ)
|
||||
&& tile.isBlockingItem(item.getEntityItem())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class ModBlocks {
|
||||
customSpawner = new CustomSpawner();
|
||||
generator = new Generator();
|
||||
energyStorageCore = new EnergyStorageCore();
|
||||
earthBlock = new Earth();
|
||||
if (!ConfigHandler.disableEarthBlock) earthBlock = new Earth();
|
||||
draconiumBlock = new DraconiumBlock();
|
||||
invisibleMultiblock = new InvisibleMultiblock();
|
||||
energyPylon = new EnergyPylon();
|
||||
|
||||
@@ -21,38 +21,31 @@ import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
*/
|
||||
public class Achievements {
|
||||
|
||||
private static AchievementPage achievementsPage;
|
||||
private static HashMap<String, Achievement> achievementsList = new HashMap<String, Achievement>();
|
||||
private static HashMap<String, AchievementCondition> achievementItems = new HashMap<String, AchievementCondition>();
|
||||
private final HashMap<String, Achievement> achievementsList = new HashMap<>();
|
||||
private final HashMap<String, AchievementCondition> achievementItems = new HashMap<>();
|
||||
|
||||
public static void addAchievement(String name, Achievement achievement, ItemStack stack, String triggerCondition) {
|
||||
private void addAchievement(String name, Achievement achievement, ItemStack stack, String triggerCondition) {
|
||||
if (stack == null || stack.getItem() == null) return;
|
||||
achievementsList.put(name, achievement.registerStat());
|
||||
achievementItems.put(stack.getUnlocalizedName(), new AchievementCondition(name, triggerCondition));
|
||||
}
|
||||
|
||||
public static void addAchievement(String name, Achievement achievement, String triggerCondition) {
|
||||
private void addAchievement(String name, Achievement achievement, String triggerCondition) {
|
||||
addAchievement(name, achievement, achievement.theItemStack, triggerCondition);
|
||||
}
|
||||
|
||||
public static void addAchievement(String name, Achievement achievement) {
|
||||
addAchievement(name, achievement, achievement.theItemStack, "null");
|
||||
}
|
||||
|
||||
public static Achievement getAchievement(String name) {
|
||||
private Achievement getAchievement(String name) {
|
||||
return achievementsList.get(name);
|
||||
}
|
||||
|
||||
public static void triggerAchievement(EntityPlayer player, String name) {
|
||||
|
||||
public void triggerAchievement(EntityPlayer player, String name) {
|
||||
Achievement ach = getAchievement(name);
|
||||
|
||||
if (ach != null) {
|
||||
player.triggerAchievement(ach);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addModAchievements() {
|
||||
public void addModAchievements() {
|
||||
int x = 5;
|
||||
addAchievement(
|
||||
"draconicevolution.dust",
|
||||
@@ -442,11 +435,11 @@ public class Achievements {
|
||||
"craft");
|
||||
}
|
||||
|
||||
public static void registerAchievementPane() {
|
||||
public void registerAchievementPane() {
|
||||
Achievement[] achievements = new Achievement[achievementsList.size()];
|
||||
|
||||
achievements = achievementsList.values().toArray(achievements);
|
||||
achievementsPage = new AchievementPage(
|
||||
AchievementPage achievementsPage = new AchievementPage(
|
||||
StatCollector.translateToLocal("draconicevolution.achievementPage.name"),
|
||||
achievements);
|
||||
AchievementPage.registerAchievementPage(achievementsPage);
|
||||
@@ -458,7 +451,7 @@ public class Achievements {
|
||||
stack.stackSize = 1;
|
||||
if (achievementItems.containsKey(stack.getUnlocalizedName())
|
||||
&& achievementItems.get(stack.getUnlocalizedName()).isCorrectCondition("pickup")) {
|
||||
triggerAchievement(event.entityPlayer, achievementItems.get(stack.getUnlocalizedName()).getName());
|
||||
triggerAchievement(event.entityPlayer, achievementItems.get(stack.getUnlocalizedName()).name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,7 +461,7 @@ public class Achievements {
|
||||
stack.stackSize = 1;
|
||||
if (achievementItems.containsKey(stack.getUnlocalizedName())
|
||||
&& achievementItems.get(stack.getUnlocalizedName()).isCorrectCondition("craft")) {
|
||||
triggerAchievement(event.player, achievementItems.get(stack.getUnlocalizedName()).getName());
|
||||
triggerAchievement(event.player, achievementItems.get(stack.getUnlocalizedName()).name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -478,13 +471,13 @@ public class Achievements {
|
||||
stack.stackSize = 1;
|
||||
if (achievementItems.containsKey(stack.getUnlocalizedName())
|
||||
&& achievementItems.get(stack.getUnlocalizedName()).isCorrectCondition("smelt")) {
|
||||
triggerAchievement(event.player, achievementItems.get(stack.getUnlocalizedName()).getName());
|
||||
triggerAchievement(event.player, achievementItems.get(stack.getUnlocalizedName()).name);
|
||||
}
|
||||
}
|
||||
|
||||
private static class AchievementCondition {
|
||||
|
||||
private final String name;
|
||||
public final String name;
|
||||
public final String condition;
|
||||
|
||||
public AchievementCondition(String name, String condition) {
|
||||
@@ -495,9 +488,5 @@ public class Achievements {
|
||||
public boolean isCorrectCondition(String s) {
|
||||
return s.equals(condition);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,18 +94,6 @@ public class DislocatorInhibitor extends BlockDE implements ITileEntityProvider
|
||||
updateRedstoneStatus(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) {
|
||||
TileEntity tile = worldIn.getTileEntity(x, y, z);
|
||||
if (tile != null) {
|
||||
if (tile instanceof TileDislocatorInhibitor) {
|
||||
((TileDislocatorInhibitor) tile).unregister();
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(worldIn, x, y, z, blockBroken, meta);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.brandon3055.draconicevolution.common.blocks.machine;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -98,6 +99,22 @@ public class DissEnchanter extends BlockCustomDrop {
|
||||
@Override
|
||||
protected void getCustomTileEntityDrops(TileEntity te, List<ItemStack> droppes) {}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) {
|
||||
boolean powered = worldIn.isBlockIndirectlyGettingPowered(x, y, z)
|
||||
|| worldIn.isBlockIndirectlyGettingPowered(x, y - 1, z);
|
||||
int meta = worldIn.getBlockMetadata(x, y, z);
|
||||
boolean metaUnpowered = (meta & 8) == 0;
|
||||
|
||||
if (powered && metaUnpowered) {
|
||||
if (worldIn.getTileEntity(x, y, z) instanceof TileDissEnchanter tde) tde.buttonClick(null);
|
||||
worldIn.setBlockMetadataWithNotify(x, y, z, meta | 8, 4);
|
||||
return;
|
||||
}
|
||||
if (powered || metaUnpowered) return;
|
||||
worldIn.setBlockMetadataWithNotify(x, y, z, meta & -9, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
@@ -8,6 +8,9 @@ import net.minecraft.world.World;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.render.particle.Particles;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 30/9/2015.
|
||||
*/
|
||||
@@ -62,37 +65,17 @@ public class EntityChaosBolt extends Entity {
|
||||
|
||||
if (ticks == 10 && !burst) {
|
||||
if (worldObj.isRemote) {
|
||||
DraconicEvolution.proxy.spawnParticle(
|
||||
new Particles.ChaosBoltParticle(worldObj, posX, posY, posZ, shardX, shardY, shardZ, 10),
|
||||
32);
|
||||
spawnParticles(10);
|
||||
}
|
||||
setDead();
|
||||
} else if (ticks > 10) {
|
||||
if (ticks < 25) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
if (worldObj.isRemote) DraconicEvolution.proxy.spawnParticle(
|
||||
new Particles.ChaosBoltParticle(worldObj, posX, posY, posZ, shardX, shardY, shardZ, 0),
|
||||
32);
|
||||
if (worldObj.isRemote) {
|
||||
spawnParticles(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ticks > 40 && !worldObj.isRemote) {
|
||||
// if (ticks % 5 == 0)
|
||||
// {
|
||||
// double dist = Utills.getDistanceAtoB(posX, posY, posZ, shardX, shardY, shardZ);
|
||||
// Vec3 dir = Vec3.createVectorHelper((shardX - posX) / dist, (shardY - posY) / dist, (shardZ -
|
||||
// posZ) / dist);
|
||||
// MovingObjectPosition movingobjectposition =
|
||||
// this.worldObj.//func_147447_a(Vec3.createVectorHelper(posX, posY, posZ), dir, false, true, false);
|
||||
// Entity entity = movingobjectposition.entityHit; //WorldUtil.rayTraceEntities(worldObj,
|
||||
// Vec3.createVectorHelper(posX, posY, posZ), dir, 20);
|
||||
//
|
||||
// LogHelper.info(movingobjectposition);
|
||||
// if (entity instanceof EntityLivingBase) {
|
||||
// entity.hurtResistantTime = 0;
|
||||
// entity.attackEntityFrom(chaosBurst, 50F);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
if (ticks > 60) {
|
||||
@@ -102,6 +85,13 @@ public class EntityChaosBolt extends Entity {
|
||||
ticks++;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void spawnParticles(int mode) {
|
||||
DraconicEvolution.clientProxy().spawnParticle(
|
||||
new Particles.ChaosBoltParticle(worldObj, posX, posY, posZ, shardX, shardY, shardZ, mode),
|
||||
32);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound compound) {
|
||||
// if (compound.hasKey("ShardPos")){
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.brandon3055.draconicevolution.common.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -25,10 +24,10 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileChaosShard;
|
||||
import com.brandon3055.draconicevolution.common.utils.DamageSourceChaos;
|
||||
import com.brandon3055.draconicevolution.common.utils.DragonChunkLoader;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
/**
|
||||
@@ -92,7 +91,7 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
public float circlePosition = 0;
|
||||
public float circleDirection = 1;
|
||||
|
||||
public EnumBehaviour behaviour = EnumBehaviour.ROAMING;
|
||||
private EnumBehaviour behaviour = EnumBehaviour.ROAMING;
|
||||
|
||||
public EntityChaosGuardian(World par1World) {
|
||||
super(par1World);
|
||||
@@ -171,13 +170,17 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
dataWatcher.updateObject(23, crystalZ);
|
||||
updateTarget();
|
||||
|
||||
if (worldObj.getClosestPlayer(posX, posY, posZ, 500) == null && getDistance(homeX, homeY, homeZ) < 100)
|
||||
DragonChunkLoader.stopLoading(this);
|
||||
else {
|
||||
if (getHealth() > 0) DragonChunkLoader.updateLoaded(this);
|
||||
if (getDistance(homeX, homeY, homeZ) < 100 && worldObj.getClosestPlayer(posX, posY, posZ, 500) == null) {
|
||||
DraconicEvolution.proxy.getDragonChunkLoader().stopLoading(this);
|
||||
} else {
|
||||
if (getHealth() > 0) {
|
||||
DraconicEvolution.proxy.getDragonChunkLoader().updateLoaded(this);
|
||||
}
|
||||
}
|
||||
|
||||
if (deathTicks > 0) DragonChunkLoader.stopLoading(this);
|
||||
if (deathTicks > 0) {
|
||||
DraconicEvolution.proxy.getDragonChunkLoader().stopLoading(this);
|
||||
}
|
||||
|
||||
customAIUpdate();
|
||||
if (behaviour == EnumBehaviour.FIREBOMB
|
||||
@@ -651,14 +654,11 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
.expand(100, 100, 100))
|
||||
: null;
|
||||
|
||||
if (targets != null && targets.size() > 0) {
|
||||
Iterator<EntityPlayer> i = targets.iterator();
|
||||
while (i.hasNext()) {
|
||||
if (i.next().capabilities.isCreativeMode) i.remove();
|
||||
}
|
||||
if (targets != null && !targets.isEmpty()) {
|
||||
targets.removeIf(entityPlayer -> entityPlayer.capabilities.isCreativeMode);
|
||||
}
|
||||
|
||||
if (attackTarget == null && targets != null && targets.size() > 0)
|
||||
if (attackTarget == null && targets != null && !targets.isEmpty())
|
||||
attackTarget = targets.get(rand.nextInt(targets.size()));
|
||||
if (attackTarget == null) return;
|
||||
|
||||
@@ -896,7 +896,7 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
List<EntityPlayer> targets = worldObj
|
||||
.getEntitiesWithinAABB(EntityPlayer.class, boundingBox.expand(150, 150, 150));
|
||||
target = null;
|
||||
while (targets.size() > 0 && target == null) {
|
||||
while (!targets.isEmpty() && target == null) {
|
||||
EntityPlayer potentialTarget = targets.get(rand.nextInt(targets.size()));
|
||||
if (worldObj.rayTraceBlocks(
|
||||
Vec3.createVectorHelper(posX, posY, posZ),
|
||||
@@ -994,7 +994,7 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
return true;
|
||||
}
|
||||
|
||||
private static enum EnumBehaviour {
|
||||
private enum EnumBehaviour {
|
||||
|
||||
/**
|
||||
* Will roam around home until a player is spotted
|
||||
|
||||
@@ -13,6 +13,8 @@ import com.brandon3055.draconicevolution.common.network.GenericParticlePacket;
|
||||
import com.brandon3055.draconicevolution.common.utils.handlers.ProcessHandler;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 3/10/2015.
|
||||
@@ -40,20 +42,21 @@ public class EntityChaosVortex extends Entity {
|
||||
if (!worldObj.isRemote) dataWatcher.updateObject(20, ticksExisted);
|
||||
else ticksExisted = dataWatcher.getWatchableObjectInt(20);
|
||||
|
||||
if (ticksExisted < 30 && ticksExisted % 5 == 0 && worldObj.isRemote) DraconicEvolution.proxy
|
||||
.spawnParticle(new Particles.ChaosExpansionParticle(worldObj, posX, posY, posZ, false), 512);
|
||||
if (ticksExisted >= 100 && ticksExisted < 130 && ticksExisted % 5 == 0 && worldObj.isRemote)
|
||||
DraconicEvolution.proxy
|
||||
.spawnParticle(new Particles.ChaosExpansionParticle(worldObj, posX, posY, posZ, true), 512);
|
||||
if (ticksExisted < 30 && ticksExisted % 5 == 0 && worldObj.isRemote) {
|
||||
spawnChaosParticles(false);
|
||||
}
|
||||
if (ticksExisted >= 100 && ticksExisted < 130 && ticksExisted % 5 == 0 && worldObj.isRemote) {
|
||||
spawnChaosParticles(true);
|
||||
}
|
||||
if (ticksExisted < 100) return;
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
double x = posX - 18 + rand.nextDouble() * 36;
|
||||
double y = posY - 8 + rand.nextDouble() * 16;
|
||||
double z = posZ - 18 + rand.nextDouble() * 36;
|
||||
if (worldObj.isRemote) DraconicEvolution.proxy.spawnParticle(
|
||||
new Particles.AdvancedSeekerParticle(worldObj, x, y, z, posX, posY, posZ, 2, 1f, 1f, 1f, 100),
|
||||
128);
|
||||
if (worldObj.isRemote) {
|
||||
spawnSeekerParticles(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
if (ticksExisted > 130 && worldObj.isRemote && ticksExisted % 2 == 0) shakeScreen();
|
||||
@@ -68,6 +71,19 @@ public class EntityChaosVortex extends Entity {
|
||||
if (ticksExisted > 620) setDead();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void spawnChaosParticles(boolean shrink) {
|
||||
DraconicEvolution.clientProxy()
|
||||
.spawnParticle(new Particles.ChaosExpansionParticle(worldObj, posX, posY, posZ, shrink), 512);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void spawnSeekerParticles(double x, double y, double z) {
|
||||
DraconicEvolution.clientProxy().spawnParticle(
|
||||
new Particles.AdvancedSeekerParticle(worldObj, x, y, z, posX, posY, posZ, 2, 1f, 1f, 1f, 100),
|
||||
128);
|
||||
}
|
||||
|
||||
private void shakeScreen() {
|
||||
double intensity = (ticksExisted - 130) / 100D;
|
||||
if (intensity > 1D) intensity = 1D;
|
||||
|
||||
@@ -15,6 +15,7 @@ public class ConfigHandler {
|
||||
public static Configuration config;
|
||||
|
||||
// GENERAL
|
||||
public static boolean disableEarthBlock;
|
||||
public static int teleporterUsesPerPearl;
|
||||
public static int soulDropChance;
|
||||
public static int passiveSoulDropChance;
|
||||
@@ -104,6 +105,9 @@ public class ConfigHandler {
|
||||
// 0:Default, 1:Disable recipe, 2:Disable completely").getInt(0);
|
||||
// disableXrayBlock = config.get(Configuration.CATEGORY_GENERAL, "Disable Xray Block", 0, "Disable
|
||||
// Distortion Flame 0:Default, 1:Disable recipe, 2:Disable completely").getInt(0);
|
||||
disableEarthBlock = config
|
||||
.get(Configuration.CATEGORY_GENERAL, "Disable Earth block", false, "Disables the Earth block")
|
||||
.getBoolean(false);
|
||||
teleporterUsesPerPearl = config.get(
|
||||
Configuration.CATEGORY_GENERAL,
|
||||
"Teleporter Uses PerPearl",
|
||||
|
||||
@@ -36,10 +36,10 @@ import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
*/
|
||||
public class ContributorHandler {
|
||||
|
||||
public static Map<String, Contributor> contributors = new LinkedHashMap<String, Contributor>();
|
||||
public static Map<String, Contributor> contributors = new LinkedHashMap<>();
|
||||
public static boolean successfulLoad = false;
|
||||
private static DLThread thread;
|
||||
private static ModelContributorWings wings = new ModelContributorWings();
|
||||
private static final ModelContributorWings wings = new ModelContributorWings();
|
||||
|
||||
public static void init() {
|
||||
thread = new DLThread();
|
||||
@@ -58,8 +58,8 @@ public class ContributorHandler {
|
||||
}
|
||||
|
||||
public static boolean isPlayerContributor(EntityPlayer player) {
|
||||
return contributors.containsKey(player.getCommandSenderName())
|
||||
&& contributors.get(player.getCommandSenderName()).isUserValid(player);
|
||||
final Contributor contributor = contributors.get(player.getCommandSenderName());
|
||||
return contributor != null && contributor.isUserValid(player);
|
||||
}
|
||||
|
||||
private static void renderWings(RenderPlayerEvent event) {
|
||||
@@ -175,14 +175,14 @@ public class ContributorHandler {
|
||||
Contributor contributor = new Contributor();
|
||||
|
||||
while (reader.hasNext()) {
|
||||
String name = reader.nextName();
|
||||
|
||||
if (name.equals("name")) contributor.name = reader.nextString();
|
||||
else if (name.equals("ign")) contributor.ign = reader.nextString();
|
||||
else if (name.equals("contribution")) contributor.contribution = reader.nextString();
|
||||
else if (name.equals("details")) contributor.details = reader.nextString();
|
||||
else if (name.equals("website")) contributor.website = reader.nextString();
|
||||
else if (name.equals("contributionLevel")) contributor.contributionLevel = reader.nextInt();
|
||||
switch (reader.nextName()) {
|
||||
case "name" -> contributor.name = reader.nextString();
|
||||
case "ign" -> contributor.ign = reader.nextString();
|
||||
case "contribution" -> contributor.contribution = reader.nextString();
|
||||
case "details" -> contributor.details = reader.nextString();
|
||||
case "website" -> contributor.website = reader.nextString();
|
||||
case "contributionLevel" -> contributor.contributionLevel = reader.nextInt();
|
||||
}
|
||||
}
|
||||
|
||||
contributors.put(contributor.ign, contributor);
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.ArmorSummary;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
@@ -26,13 +26,6 @@ public class FMLEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
if (event.phase != TickEvent.Phase.START) return;
|
||||
|
||||
CustomArmorHandler.onPlayerTick(event);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void serverTickEvent(TickEvent event) {
|
||||
ContributorHandler.tick();
|
||||
@@ -41,8 +34,8 @@ public class FMLEventHandler {
|
||||
@SubscribeEvent
|
||||
public void playerLogin(PlayerEvent.PlayerLoggedInEvent event) {
|
||||
if (!event.player.onGround) {
|
||||
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(event.player);
|
||||
if (summery != null && summery.flight[0]) {
|
||||
final ArmorSummary summary = ArmorSummary.get(event.player);
|
||||
if (summary != null && summary.flight[0]) {
|
||||
event.player.capabilities.isFlying = true;
|
||||
event.player.sendPlayerAbilities();
|
||||
}
|
||||
|
||||
@@ -34,11 +34,8 @@ import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.EntityEvent;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
@@ -48,11 +45,10 @@ import net.minecraftforge.event.world.WorldEvent;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.achievements.Achievements;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityCustomDragon;
|
||||
import com.brandon3055.draconicevolution.common.entity.EntityDragonHeart;
|
||||
import com.brandon3055.draconicevolution.common.entity.ExtendedPlayer;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.ArmorSummary;
|
||||
import com.brandon3055.draconicevolution.common.network.MountUpdatePacket;
|
||||
import com.brandon3055.draconicevolution.common.network.SpeedRequestPacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGrinder;
|
||||
@@ -71,22 +67,22 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class MinecraftForgeEventHandler {
|
||||
|
||||
Random random = new Random();
|
||||
private static final Random random = new Random();
|
||||
private static Method becomeAngryAt;
|
||||
private static final Field persistenceRequired;
|
||||
|
||||
public static double maxSpeed = 10F;
|
||||
public static int ticksSinceRequest = 0;
|
||||
public static boolean speedNeedsUpdating = true;
|
||||
|
||||
private Field persistenceRequired = null;
|
||||
|
||||
public MinecraftForgeEventHandler() {
|
||||
static {
|
||||
Field f = null;
|
||||
try {
|
||||
persistenceRequired = ReflectionHelper
|
||||
.findField(EntityLiving.class, "field_82179_bU", "persistenceRequired");
|
||||
f = ReflectionHelper.findField(EntityLiving.class, "field_82179_bU", "persistenceRequired");
|
||||
} catch (Exception e) {
|
||||
LogHelper.error("Unable to find field \"persistenceRequired\"");
|
||||
}
|
||||
persistenceRequired = f;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -131,38 +127,15 @@ public class MinecraftForgeEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingHurt(LivingHurtEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer) {
|
||||
CustomArmorHandler.onPlayerHurt(event);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOW)
|
||||
public void onLivingDeath(LivingDeathEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer) {
|
||||
CustomArmorHandler.onPlayerDeath(event);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingJumpEvent(LivingEvent.LivingJumpEvent event) {
|
||||
if (!(event.entityLiving instanceof EntityPlayer)) return;
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(player);
|
||||
|
||||
if (summery != null && summery.jumpModifier > 0) {
|
||||
player.motionY += (double) (summery.jumpModifier * 0.1F);
|
||||
if (!(event.entityLiving instanceof EntityPlayer player)) return;
|
||||
final ArmorSummary summary = ArmorSummary.get(player);
|
||||
if (summary != null && summary.jumpModifier > 0) {
|
||||
player.motionY += (summary.jumpModifier * 0.1F);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOW)
|
||||
public void onLivingAttack(LivingAttackEvent event) {
|
||||
if (!(event.entityLiving instanceof EntityPlayer)) return;
|
||||
|
||||
CustomArmorHandler.onPlayerAttacked(event);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDropEvent(LivingDropsEvent event) {
|
||||
if (!event.entity.worldObj.isRemote
|
||||
@@ -222,7 +195,7 @@ public class MinecraftForgeEventHandler {
|
||||
EntityLivingBase entity = event.entityLiving;
|
||||
Entity attacker = event.source.getEntity();
|
||||
|
||||
if (attacker == null || !(attacker instanceof EntityPlayer)) {
|
||||
if (!(attacker instanceof EntityPlayer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -243,7 +216,7 @@ public class MinecraftForgeEventHandler {
|
||||
ItemNBTHelper.setInteger(soul, "SkeletonType", ((EntitySkeleton) entity).getSkeletonType());
|
||||
}
|
||||
world.spawnEntityInWorld(new EntityItem(world, entity.posX, entity.posY, entity.posZ, soul));
|
||||
Achievements.triggerAchievement((EntityPlayer) attacker, "draconicevolution.soul");
|
||||
DraconicEvolution.proxy.triggerAchievement((EntityPlayer) attacker, "draconicevolution.soul");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,16 +378,15 @@ public class MinecraftForgeEventHandler {
|
||||
public void getBreakSpeed(PlayerEvent.BreakSpeed event) {
|
||||
if (event.entityPlayer != null) {
|
||||
float newDigSpeed = event.originalSpeed;
|
||||
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery()
|
||||
.getSummery(event.entityPlayer);
|
||||
if (summery == null) return;
|
||||
final ArmorSummary summary = ArmorSummary.get(event.entityPlayer);
|
||||
if (summary == null) return;
|
||||
|
||||
if (event.entityPlayer.isInsideOfMaterial(Material.water)) {
|
||||
if (summery.flight[0]) newDigSpeed *= 5f;
|
||||
if (summary.flight[0]) newDigSpeed *= 5f;
|
||||
}
|
||||
|
||||
if (!event.entityPlayer.onGround) {
|
||||
if (summery.flight[0]) newDigSpeed *= 5f;
|
||||
if (summary.flight[0]) newDigSpeed *= 5f;
|
||||
}
|
||||
|
||||
if (event.newSpeed > 1) {
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.brandon3055.draconicevolution.common.items.armor;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.utils.IUpgradableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
|
||||
public final class ArmorSummary {
|
||||
|
||||
private ArmorSummary() {}
|
||||
|
||||
public static ArmorSummary get(EntityPlayer player) {
|
||||
// TODO if allocation is a problem replace with
|
||||
// a cached reusable thread local
|
||||
return new ArmorSummary().process(player);
|
||||
}
|
||||
|
||||
/*---- Shield ----*/
|
||||
/**
|
||||
* Max protection points from all equipped armor peaces
|
||||
*/
|
||||
public float maxProtectionPoints = 0F;
|
||||
/**
|
||||
* Total protection points from all equipped armor peaces
|
||||
*/
|
||||
public float protectionPoints = 0F;
|
||||
/**
|
||||
* Number of quipped armor peaces
|
||||
*/
|
||||
public int peaces = 0;
|
||||
/**
|
||||
* Point Allocation, The number of points on each peace
|
||||
*/
|
||||
public float[] allocation;
|
||||
/**
|
||||
* How many points have been drained from each armor peace
|
||||
*/
|
||||
public float[] pointsDown;
|
||||
/**
|
||||
* The armor peaces (Index will contain null if peace is not present)
|
||||
*/
|
||||
public ItemStack[] armorStacks;
|
||||
/**
|
||||
* Mean Fatigue
|
||||
*/
|
||||
public float entropy = 0F;
|
||||
/**
|
||||
* Mean Recovery Points
|
||||
*/
|
||||
public int meanRecoveryPoints = 0;
|
||||
/**
|
||||
* Total RF stored in the armor
|
||||
*/
|
||||
public long totalEnergyStored = 0;
|
||||
/**
|
||||
* Total Max RF storage for the armor
|
||||
*/
|
||||
public long maxTotalEnergyStorage = 0;
|
||||
/**
|
||||
* RF stored in each armor peace
|
||||
*/
|
||||
public int[] energyAllocation;
|
||||
/*---- Effects ----*/
|
||||
public boolean[] flight = new boolean[] { false, false, false };
|
||||
public float flightVModifier = 0F;
|
||||
public float speedModifier = 0F;
|
||||
public float jumpModifier = 0F;
|
||||
public float fireResistance = 0F;
|
||||
public float flightSpeedModifier = 0;
|
||||
public boolean hasHillStep = false;
|
||||
public boolean hasDraconic = false;
|
||||
|
||||
private ArmorSummary process(EntityPlayer player) {
|
||||
final ItemStack[] armorSlots = player.inventory.armorInventory;
|
||||
float totalEntropy = 0;
|
||||
int totalRecoveryPoints = 0;
|
||||
boolean needInit = true;
|
||||
|
||||
for (int i = 0; i < armorSlots.length; i++) {
|
||||
final ItemStack stack = armorSlots[i];
|
||||
if (stack == null || !(stack.getItem() instanceof ICustomArmor armor)) continue;
|
||||
if (needInit) {
|
||||
needInit = false;
|
||||
allocation = new float[armorSlots.length];
|
||||
armorStacks = new ItemStack[armorSlots.length];
|
||||
pointsDown = new float[armorSlots.length];
|
||||
energyAllocation = new int[armorSlots.length];
|
||||
}
|
||||
peaces++;
|
||||
allocation[i] = ItemNBTHelper.getFloat(stack, "ProtectionPoints", 0);
|
||||
protectionPoints += allocation[i];
|
||||
totalEntropy += ItemNBTHelper.getFloat(stack, "ShieldEntropy", 0);
|
||||
armorStacks[i] = stack;
|
||||
totalRecoveryPoints += IUpgradableItem.EnumUpgrade.SHIELD_RECOVERY.getUpgradePoints(stack);
|
||||
final float maxPoints = armor.getProtectionPoints(stack);
|
||||
pointsDown[i] = maxPoints - allocation[i];
|
||||
maxProtectionPoints += maxPoints;
|
||||
energyAllocation[i] = armor.getEnergyStored(stack);
|
||||
totalEnergyStored += energyAllocation[i];
|
||||
maxTotalEnergyStorage += armor.getMaxEnergyStored(stack);
|
||||
if (stack.getItem() instanceof DraconicArmor) hasDraconic = true;
|
||||
|
||||
fireResistance += armor.getFireResistance(stack);
|
||||
|
||||
switch (i) {
|
||||
case 2:
|
||||
flight = armor.hasFlight(stack);
|
||||
if (flight[0]) {
|
||||
flightVModifier = armor.getFlightVModifier(stack, player);
|
||||
flightSpeedModifier = armor.getFlightSpeedModifier(stack, player);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
speedModifier = armor.getSpeedModifier(stack, player);
|
||||
break;
|
||||
case 0:
|
||||
hasHillStep = armor.hasHillStep(stack, player);
|
||||
jumpModifier = armor.getJumpModifier(stack, player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (peaces == 0) return null;
|
||||
|
||||
entropy = totalEntropy / peaces;
|
||||
meanRecoveryPoints = totalRecoveryPoints / peaces;
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.brandon3055.draconicevolution.common.items.armor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.ai.attributes.IAttribute;
|
||||
@@ -17,89 +17,65 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.network.ShieldHitPacket;
|
||||
import com.brandon3055.draconicevolution.common.utils.IUpgradableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
import com.brandon3055.draconicevolution.integration.ModHelper;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 13/11/2014.
|
||||
*/
|
||||
public class CustomArmorHandler {
|
||||
public final class CustomArmorHandler {
|
||||
|
||||
public static final UUID WALK_SPEED_UUID = UUID.fromString("0ea6ce8e-d2e8-11e5-ab30-625662870761");
|
||||
private static final UUID WALK_SPEED_UUID = UUID.fromString("0ea6ce8e-d2e8-11e5-ab30-625662870761");
|
||||
private static final DamageSource ADMIN_KILL = new DamageSource("administrative.kill")
|
||||
.setDamageAllowedInCreativeMode().setDamageBypassesArmor().setDamageIsAbsolute();
|
||||
public static Map<EntityPlayer, Boolean> playersWithFlight = new WeakHashMap<EntityPlayer, Boolean>();
|
||||
public static List<String> playersWithUphillStep = new ArrayList<String>();
|
||||
|
||||
public static void onPlayerHurt(LivingHurtEvent event) {
|
||||
// EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
// ArmorSummery summery = new ArmorSummery().getSummery(player);
|
||||
// if (summery == null || summery.protectionPoints <= 0) return;
|
||||
// float newEntropy = Math.min(summery.entropy + Math.min(3, event.ammount/5) +
|
||||
// player.worldObj.rand.nextFloat(), 100F);
|
||||
//
|
||||
// //Divide the damage between the armor peaces based on how many of the protection points each peace has
|
||||
// float totalAbsorbed = 0;
|
||||
// for (int i = 0; i < summery.allocation.length; i++){
|
||||
// if (summery.allocation[i] == 0) continue;
|
||||
// ItemStack armorPeace = summery.armorStacks[i];
|
||||
//
|
||||
// float dmgShear = summery.allocation[i] / summery.protectionPoints;
|
||||
// float dmg = dmgShear * event.ammount;
|
||||
//
|
||||
// float absorbed = Math.min(dmg, summery.allocation[i]);
|
||||
// dmg -= absorbed;
|
||||
// totalAbsorbed += absorbed;
|
||||
// summery.allocation[i]-=absorbed;
|
||||
// ItemNBTHelper.setFloat(armorPeace, "ProtectionPoints", summery.allocation[i]);
|
||||
// ItemNBTHelper.setInteger(armorPeace, "ShieldHitTimer", 20);
|
||||
// ItemNBTHelper.setFloat(armorPeace, "ShieldEntropy", newEntropy);
|
||||
//
|
||||
//// if (dmg > 0 && absorbed >= dmgShear*20F){
|
||||
//// int energyCost = (int)(dmg * OVER_DRAIN_COST);
|
||||
//// int extracted = ((IEnergyContainerItem)armorPeace.getItem()).extractEnergy(armorPeace, energyCost,
|
||||
// false);
|
||||
//// dmg = (energyCost-extracted) / OVER_DRAIN_COST;
|
||||
//// totalAbsorbed += extracted / OVER_DRAIN_COST;
|
||||
//// ItemNBTHelper.setFloat(armorPeace, "ShieldEntropy", 100);
|
||||
//// }
|
||||
//
|
||||
//// LogHelper.info(dmg);
|
||||
// }
|
||||
//
|
||||
// event.ammount-=totalAbsorbed;
|
||||
// if (event.ammount <= 0) event.setCanceled(true);
|
||||
// player.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).removeModifier(new
|
||||
// AttributeModifier(KB_ATTRIB_UUID, SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
|
||||
// 100, 0));
|
||||
// LogHelper.info("hurt");
|
||||
// Collection that will be populated with client and server players when playing on integrated server
|
||||
private final Set<EntityPlayer> playersWithFlight = Collections.synchronizedSet(new HashSet<>());
|
||||
private boolean clientPlayerHasHillStep;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
if (event.world.isRemote) {
|
||||
clientPlayerHasHillStep = false;
|
||||
}
|
||||
if (!playersWithFlight.isEmpty()) {
|
||||
synchronized (playersWithFlight) {
|
||||
playersWithFlight.removeIf(p -> event.world == p.worldObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void onPlayerAttacked(LivingAttackEvent event) {
|
||||
if (event.isCanceled()) {
|
||||
public void onServerStopped() {
|
||||
this.playersWithFlight.clear();
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOW)
|
||||
public void onLivingAttack(LivingAttackEvent event) {
|
||||
if (!(event.entityLiving instanceof EntityPlayer player)) return;
|
||||
|
||||
final ArmorSummary summary = ArmorSummary.get(player);
|
||||
|
||||
float hitAmount = ModHelper.applyModDamageAdjustments(summary, event);
|
||||
|
||||
if (applyArmorDamageBlocking(event, summary)) {
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ArmorSummery summery = new ArmorSummery().getSummery(player);
|
||||
|
||||
float hitAmount = ModHelper.applyModDamageAdjustments(summery, event);
|
||||
|
||||
if (applyArmorDamageBlocking(event, summery)) {
|
||||
return;
|
||||
}
|
||||
if (summery == null || summery.protectionPoints <= 0 || event.source == ADMIN_KILL) {
|
||||
if (summary == null || summary.protectionPoints <= 0 || event.source == ADMIN_KILL) {
|
||||
return;
|
||||
}
|
||||
event.setCanceled(true);
|
||||
@@ -110,29 +86,29 @@ public class CustomArmorHandler {
|
||||
}
|
||||
if ((float) player.hurtResistantTime > (float) player.maxHurtResistantTime / 2.0F) return;
|
||||
|
||||
float newEntropy = Math.min(summery.entropy + 1 + (hitAmount / 20), 100F);
|
||||
float newEntropy = Math.min(summary.entropy + 1 + (hitAmount / 20), 100F);
|
||||
|
||||
// Divide the damage between the armor peaces based on how many of the protection points each peace has
|
||||
float totalAbsorbed = 0;
|
||||
int remainingPoints = 0;
|
||||
for (int i = 0; i < summery.allocation.length; i++) {
|
||||
if (summery.allocation[i] == 0) continue;
|
||||
ItemStack armorPeace = summery.armorStacks[i];
|
||||
float remainingPoints = 0;
|
||||
for (int i = 0; i < summary.allocation.length; i++) {
|
||||
if (summary.allocation[i] == 0) continue;
|
||||
ItemStack armorPeace = summary.armorStacks[i];
|
||||
|
||||
float dmgShear = summery.allocation[i] / summery.protectionPoints;
|
||||
float dmgShear = summary.allocation[i] / summary.protectionPoints;
|
||||
float dmg = dmgShear * hitAmount;
|
||||
|
||||
float absorbed = Math.min(dmg, summery.allocation[i]);
|
||||
float absorbed = Math.min(dmg, summary.allocation[i]);
|
||||
totalAbsorbed += absorbed;
|
||||
summery.allocation[i] -= absorbed;
|
||||
remainingPoints += summery.allocation[i];
|
||||
ItemNBTHelper.setFloat(armorPeace, "ProtectionPoints", summery.allocation[i]);
|
||||
summary.allocation[i] -= absorbed;
|
||||
remainingPoints += summary.allocation[i];
|
||||
ItemNBTHelper.setFloat(armorPeace, "ProtectionPoints", summary.allocation[i]);
|
||||
ItemNBTHelper.setFloat(armorPeace, "ShieldEntropy", newEntropy);
|
||||
}
|
||||
|
||||
if (summery.protectionPoints > 0) {
|
||||
if (summary.protectionPoints > 0) {
|
||||
DraconicEvolution.network.sendToAllAround(
|
||||
new ShieldHitPacket(player, summery.protectionPoints / summery.maxProtectionPoints),
|
||||
new ShieldHitPacket(player, summary.protectionPoints / summary.maxProtectionPoints),
|
||||
new NetworkRegistry.TargetPoint(player.dimension, player.posX, player.posY, player.posZ, 64));
|
||||
player.worldObj.playSoundEffect(
|
||||
player.posX + 0.5D,
|
||||
@@ -150,42 +126,46 @@ public class CustomArmorHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public static void onPlayerDeath(LivingDeathEvent event) {
|
||||
if (event.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
@SubscribeEvent(priority = EventPriority.LOW)
|
||||
public void onLivingDeath(LivingDeathEvent event) {
|
||||
if (!(event.entityLiving instanceof EntityPlayer player)) return;
|
||||
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ArmorSummery summery = new ArmorSummery().getSummery(player);
|
||||
final ArmorSummary summary = ArmorSummary.get(player);
|
||||
|
||||
if (summery == null || event.source == ADMIN_KILL) return;
|
||||
if (summary == null || event.source == ADMIN_KILL) return;
|
||||
|
||||
if (summery.protectionPoints > 500) {
|
||||
if (summary.protectionPoints > 500) {
|
||||
event.setCanceled(true);
|
||||
event.entityLiving.setHealth(10);
|
||||
// LogHelper.warn("Something is trying to bypass the draconic shield. [Culprit: {Damage Type=" +
|
||||
// event.source.damageType + ", Damage Class=" + event.source.toString() + "]");
|
||||
if (DraconicEvolution.debug) {
|
||||
LogHelper.warn(
|
||||
"Something is trying to bypass the draconic shield. [Culprit: {Damage Type="
|
||||
+ event.source.damageType
|
||||
+ ", Damage Class="
|
||||
+ event.source
|
||||
+ "]");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!summery.hasDraconic) return;
|
||||
if (!summary.hasDraconic) return;
|
||||
|
||||
int[] charge = new int[summery.armorStacks.length];
|
||||
int[] charge = new int[summary.armorStacks.length];
|
||||
int totalCharge = 0;
|
||||
for (int i = 0; i < summery.armorStacks.length; i++) {
|
||||
if (summery.armorStacks[i] != null) {
|
||||
charge[i] = ((IEnergyContainerItem) summery.armorStacks[i].getItem())
|
||||
.getEnergyStored(summery.armorStacks[i]);
|
||||
for (int i = 0; i < summary.armorStacks.length; i++) {
|
||||
if (summary.armorStacks[i] != null) {
|
||||
charge[i] = ((IEnergyContainerItem) summary.armorStacks[i].getItem())
|
||||
.getEnergyStored(summary.armorStacks[i]);
|
||||
totalCharge += charge[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (totalCharge < BalanceConfigHandler.draconicArmorBaseStorage) return;
|
||||
|
||||
for (int i = 0; i < summery.armorStacks.length; i++) {
|
||||
if (summery.armorStacks[i] != null) {
|
||||
((IEnergyContainerItem) summery.armorStacks[i].getItem()).extractEnergy(
|
||||
summery.armorStacks[i],
|
||||
for (int i = 0; i < summary.armorStacks.length; i++) {
|
||||
if (summary.armorStacks[i] != null) {
|
||||
((IEnergyContainerItem) summary.armorStacks[i].getItem()).extractEnergy(
|
||||
summary.armorStacks[i],
|
||||
(int) ((charge[i] / (double) totalCharge) * BalanceConfigHandler.draconicArmorBaseStorage),
|
||||
false);
|
||||
}
|
||||
@@ -198,107 +178,102 @@ public class CustomArmorHandler {
|
||||
player.setHealth(1);
|
||||
}
|
||||
|
||||
public static void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
|
||||
EntityPlayer player = event.player;
|
||||
ArmorSummery summery = new ArmorSummery().getSummery(player);
|
||||
|
||||
tickShield(summery, player);
|
||||
tickArmorEffects(summery, player);
|
||||
}
|
||||
|
||||
public static void tickShield(ArmorSummery summery, EntityPlayer player) {
|
||||
if (summery == null || (summery.maxProtectionPoints - summery.protectionPoints < 0.01 && summery.entropy == 0)
|
||||
|| player.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
float totalPointsToAdd = Math
|
||||
.min(summery.maxProtectionPoints - summery.protectionPoints, summery.maxProtectionPoints / 60F);
|
||||
totalPointsToAdd *= (1F - (summery.entropy / 100F));
|
||||
totalPointsToAdd = Math.min(
|
||||
totalPointsToAdd,
|
||||
summery.totalEnergyStored
|
||||
/ (summery.hasDraconic ? BalanceConfigHandler.draconicArmorEnergyPerProtectionPoint
|
||||
: BalanceConfigHandler.wyvernArmorEnergyPerProtectionPoint));
|
||||
if (totalPointsToAdd < 0F) totalPointsToAdd = 0F;
|
||||
|
||||
summery.entropy -= (summery.meanRecoveryPoints * 0.01F);
|
||||
if (summery.entropy < 0) summery.entropy = 0;
|
||||
|
||||
for (int i = 0; i < summery.armorStacks.length; i++) {
|
||||
ItemStack stack = summery.armorStacks[i];
|
||||
if (stack == null || summery.totalEnergyStored <= 0) continue;
|
||||
float maxForPeace = ((ICustomArmor) stack.getItem()).getProtectionPoints(stack);
|
||||
int energyAmount = ((ICustomArmor) summery.armorStacks[i].getItem()).getEnergyPerProtectionPoint();
|
||||
((IEnergyContainerItem) stack.getItem()).extractEnergy(
|
||||
stack,
|
||||
(int) (((double) summery.energyAllocation[i] / (double) summery.totalEnergyStored)
|
||||
* (totalPointsToAdd * energyAmount)),
|
||||
false);
|
||||
float pointsForPeace = (summery.pointsDown[i]
|
||||
/ Math.max(1, summery.maxProtectionPoints - summery.protectionPoints)) * totalPointsToAdd;
|
||||
summery.allocation[i] += pointsForPeace;
|
||||
if (summery.allocation[i] > maxForPeace || maxForPeace - summery.allocation[i] < 0.1F)
|
||||
summery.allocation[i] = maxForPeace;
|
||||
ItemNBTHelper.setFloat(stack, "ProtectionPoints", summery.allocation[i]);
|
||||
if (player.hurtResistantTime <= 0) ItemNBTHelper.setFloat(stack, "ShieldEntropy", summery.entropy);
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.START) {
|
||||
final EntityPlayer player = event.player;
|
||||
final ArmorSummary summary = ArmorSummary.get(player);
|
||||
tickShield(summary, player);
|
||||
tickArmorEffects(summary, player);
|
||||
}
|
||||
}
|
||||
|
||||
public static void tickArmorEffects(ArmorSummery summery, EntityPlayer player) {
|
||||
private void tickShield(ArmorSummary summary, EntityPlayer player) {
|
||||
if (summary == null || summary.maxProtectionPoints - summary.protectionPoints < 0.01 && summary.entropy == 0
|
||||
|| player.worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
float totalPointsToAdd = Math
|
||||
.min(summary.maxProtectionPoints - summary.protectionPoints, summary.maxProtectionPoints / 60F);
|
||||
totalPointsToAdd *= (1F - (summary.entropy / 100F));
|
||||
totalPointsToAdd = Math.min(
|
||||
totalPointsToAdd,
|
||||
summary.totalEnergyStored
|
||||
/ (summary.hasDraconic ? BalanceConfigHandler.draconicArmorEnergyPerProtectionPoint
|
||||
: BalanceConfigHandler.wyvernArmorEnergyPerProtectionPoint));
|
||||
if (totalPointsToAdd < 0F) totalPointsToAdd = 0F;
|
||||
|
||||
summary.entropy -= (summary.meanRecoveryPoints * 0.01F);
|
||||
if (summary.entropy < 0) summary.entropy = 0;
|
||||
|
||||
for (int i = 0; i < summary.armorStacks.length; i++) {
|
||||
ItemStack stack = summary.armorStacks[i];
|
||||
if (stack == null || summary.totalEnergyStored <= 0) continue;
|
||||
float maxForPeace = ((ICustomArmor) stack.getItem()).getProtectionPoints(stack);
|
||||
int energyAmount = ((ICustomArmor) summary.armorStacks[i].getItem()).getEnergyPerProtectionPoint();
|
||||
((IEnergyContainerItem) stack.getItem()).extractEnergy(
|
||||
stack,
|
||||
(int) (((double) summary.energyAllocation[i] / (double) summary.totalEnergyStored)
|
||||
* (totalPointsToAdd * energyAmount)),
|
||||
false);
|
||||
float pointsForPeace = (summary.pointsDown[i]
|
||||
/ Math.max(1, summary.maxProtectionPoints - summary.protectionPoints)) * totalPointsToAdd;
|
||||
summary.allocation[i] += pointsForPeace;
|
||||
if (summary.allocation[i] > maxForPeace || maxForPeace - summary.allocation[i] < 0.1F)
|
||||
summary.allocation[i] = maxForPeace;
|
||||
ItemNBTHelper.setFloat(stack, "ProtectionPoints", summary.allocation[i]);
|
||||
if (player.hurtResistantTime <= 0) ItemNBTHelper.setFloat(stack, "ShieldEntropy", summary.entropy);
|
||||
}
|
||||
}
|
||||
|
||||
private void tickArmorEffects(ArmorSummary summary, EntityPlayer player) {
|
||||
|
||||
// region/*----------------- Flight ------------------*/
|
||||
if (ConfigHandler.enableFlight) {
|
||||
if (summery != null && summery.flight[0]) {
|
||||
playersWithFlight.put(player, true);
|
||||
if (summary != null && summary.flight[0]) {
|
||||
playersWithFlight.add(player);
|
||||
player.capabilities.allowFlying = true;
|
||||
if (summery.flight[1]) player.capabilities.isFlying = true;
|
||||
if (summary.flight[1]) {
|
||||
player.capabilities.isFlying = true;
|
||||
}
|
||||
|
||||
if (player.worldObj.isRemote) setPlayerFlySpeed(player, 0.05F + (0.05F * summery.flightSpeedModifier));
|
||||
if (player.worldObj.isRemote) {
|
||||
player.capabilities.setFlySpeed(0.05F + (0.05F * summary.flightSpeedModifier));
|
||||
}
|
||||
|
||||
if ((!player.onGround && player.capabilities.isFlying) && player.motionY != 0
|
||||
&& summery.flightVModifier > 0) {
|
||||
// float percentIncrease = summery.flightVModifier;
|
||||
if (!player.onGround && player.capabilities.isFlying
|
||||
&& player.motionY != 0
|
||||
&& summary.flightVModifier > 0) {
|
||||
// float percentIncrease = summary.flightVModifier;
|
||||
|
||||
if (DraconicEvolution.proxy.isSpaceDown() && !DraconicEvolution.proxy.isShiftDown()) {
|
||||
// LogHelper.info(player.motionY);
|
||||
player.motionY = 0.225F * summery.flightVModifier;
|
||||
player.motionY = 0.225F * summary.flightVModifier;
|
||||
}
|
||||
|
||||
if (DraconicEvolution.proxy.isShiftDown() && !DraconicEvolution.proxy.isSpaceDown()) {
|
||||
player.motionY = -0.225F * summery.flightVModifier;
|
||||
player.motionY = -0.225F * summary.flightVModifier;
|
||||
}
|
||||
}
|
||||
|
||||
if (summery.flight[2] && player.moveForward == 0
|
||||
if (summary.flight[2] && player.moveForward == 0
|
||||
&& player.moveStrafing == 0
|
||||
&& player.capabilities.isFlying) {
|
||||
player.motionX *= 0.5;
|
||||
player.motionZ *= 0.5;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!playersWithFlight.containsKey(player)) {
|
||||
playersWithFlight.put(player, false);
|
||||
}
|
||||
|
||||
if (playersWithFlight.get(player) && !player.worldObj.isRemote) {
|
||||
playersWithFlight.put(player, false);
|
||||
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
player.capabilities.allowFlying = false;
|
||||
player.capabilities.isFlying = false;
|
||||
} else if (playersWithFlight.remove(player)) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
player.capabilities.allowFlying = false;
|
||||
player.capabilities.isFlying = false;
|
||||
if (!player.worldObj.isRemote) {
|
||||
player.sendPlayerAbilities();
|
||||
}
|
||||
}
|
||||
|
||||
if (player.worldObj.isRemote && playersWithFlight.get(player)) {
|
||||
playersWithFlight.put(player, false);
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
player.capabilities.allowFlying = false;
|
||||
player.capabilities.isFlying = false;
|
||||
}
|
||||
setPlayerFlySpeed(player, 0.05F);
|
||||
if (player.worldObj.isRemote) {
|
||||
player.capabilities.setFlySpeed(0.05F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -307,8 +282,8 @@ public class CustomArmorHandler {
|
||||
// region/*---------------- Swiftness ----------------*/
|
||||
|
||||
IAttribute speedAttr = SharedMonsterAttributes.movementSpeed;
|
||||
if (summery != null && summery.speedModifier > 0) {
|
||||
double value = summery.speedModifier;
|
||||
if (summary != null && summary.speedModifier > 0) {
|
||||
double value = summary.speedModifier;
|
||||
if (player.getEntityAttribute(speedAttr).getModifier(WALK_SPEED_UUID) == null) {
|
||||
player.getEntityAttribute(speedAttr).applyModifier(
|
||||
new AttributeModifier(WALK_SPEED_UUID, speedAttr.getAttributeUnlocalizedName(), value, 1));
|
||||
@@ -319,8 +294,9 @@ public class CustomArmorHandler {
|
||||
new AttributeModifier(WALK_SPEED_UUID, speedAttr.getAttributeUnlocalizedName(), value, 1));
|
||||
}
|
||||
|
||||
if (!player.onGround && player.ridingEntity == null)
|
||||
player.jumpMovementFactor = 0.02F + (0.02F * summery.speedModifier);
|
||||
if (!player.onGround && player.ridingEntity == null) {
|
||||
player.jumpMovementFactor = 0.02F + (0.02F * summary.speedModifier);
|
||||
}
|
||||
} else if (player.getEntityAttribute(speedAttr).getModifier(WALK_SPEED_UUID) != null) {
|
||||
player.getEntityAttribute(speedAttr)
|
||||
.removeModifier(player.getEntityAttribute(speedAttr).getModifier(WALK_SPEED_UUID));
|
||||
@@ -329,161 +305,50 @@ public class CustomArmorHandler {
|
||||
// endregion
|
||||
|
||||
// region/*---------------- HillStep -----------------*/
|
||||
if (summery != null && player.worldObj.isRemote) {
|
||||
boolean highStepListed = playersWithUphillStep.contains(player.getDisplayName()) && player.stepHeight >= 1f;
|
||||
boolean hasHighStep = summery.hasHillStep;
|
||||
|
||||
if (hasHighStep && !highStepListed) {
|
||||
playersWithUphillStep.add(player.getDisplayName());
|
||||
player.stepHeight = 1f;
|
||||
}
|
||||
|
||||
if (!hasHighStep && highStepListed) {
|
||||
playersWithUphillStep.remove(player.getDisplayName());
|
||||
player.stepHeight = 0.5F;
|
||||
}
|
||||
if (player.worldObj.isRemote) {
|
||||
handleHillStepClient(summary, player);
|
||||
}
|
||||
// endregion
|
||||
}
|
||||
|
||||
private static void setPlayerFlySpeed(EntityPlayer player, float speed) {
|
||||
player.capabilities.setFlySpeed(speed);
|
||||
@SideOnly(value = Side.CLIENT)
|
||||
private void handleHillStepClient(ArmorSummary summary, EntityPlayer player) {
|
||||
if (player == Minecraft.getMinecraft().thePlayer) {
|
||||
final boolean hasHillStep = player.stepHeight >= 1f && clientPlayerHasHillStep;
|
||||
final boolean shouldHaveHillStep = summary != null && summary.hasHillStep;
|
||||
|
||||
if (shouldHaveHillStep && !hasHillStep) {
|
||||
clientPlayerHasHillStep = true;
|
||||
player.stepHeight = 1f;
|
||||
}
|
||||
|
||||
if (!shouldHaveHillStep && hasHillStep) {
|
||||
clientPlayerHasHillStep = false;
|
||||
player.stepHeight = 0.5F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean applyArmorDamageBlocking(LivingAttackEvent event, ArmorSummery summery) {
|
||||
if (summery == null) return false;
|
||||
private static boolean applyArmorDamageBlocking(LivingAttackEvent event, ArmorSummary summary) {
|
||||
if (summary == null) return false;
|
||||
|
||||
if (event.source.isFireDamage() && summery.fireResistance >= 1F) {
|
||||
if (event.source.isFireDamage() && summary.fireResistance >= 1F) {
|
||||
event.setCanceled(true);
|
||||
event.entityLiving.extinguish();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (event.source.damageType.equals("fall") && summery.jumpModifier > 0F) {
|
||||
if (event.ammount < summery.jumpModifier * 5F) event.setCanceled(true);
|
||||
if (event.source.damageType.equals("fall") && summary.jumpModifier > 0F) {
|
||||
if (event.ammount < summary.jumpModifier * 5F) event.setCanceled(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((event.source.damageType.equals("inWall") || event.source.damageType.equals("drown"))
|
||||
&& summery.armorStacks[3] != null) {
|
||||
&& summary.armorStacks[3] != null) {
|
||||
if (event.ammount <= 2f) event.setCanceled(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class ArmorSummery {
|
||||
|
||||
/*---- Shield ----*/
|
||||
/**
|
||||
* Max protection points from all equipped armor peaces
|
||||
*/
|
||||
public float maxProtectionPoints = 0F;
|
||||
/**
|
||||
* Total protection points from all equipped armor peaces
|
||||
*/
|
||||
public float protectionPoints = 0F;
|
||||
/**
|
||||
* Number of quipped armor peaces
|
||||
*/
|
||||
public int peaces = 0;
|
||||
/**
|
||||
* Point Allocation, The number of points on each peace
|
||||
*/
|
||||
public float[] allocation;
|
||||
/**
|
||||
* How many points have been drained from each armor peace
|
||||
*/
|
||||
public float[] pointsDown;
|
||||
/**
|
||||
* The armor peaces (Index will contain null if peace is not present)
|
||||
*/
|
||||
public ItemStack[] armorStacks;
|
||||
/**
|
||||
* Mean Fatigue
|
||||
*/
|
||||
public float entropy = 0F;
|
||||
/**
|
||||
* Mean Recovery Points
|
||||
*/
|
||||
public int meanRecoveryPoints = 0;
|
||||
/**
|
||||
* Total RF stored in the armor
|
||||
*/
|
||||
public long totalEnergyStored = 0;
|
||||
/**
|
||||
* Total Max RF storage for the armor
|
||||
*/
|
||||
public long maxTotalEnergyStorage = 0;
|
||||
/**
|
||||
* RF stored in each armor peace
|
||||
*/
|
||||
public int[] energyAllocation;
|
||||
/*---- Effects ----*/
|
||||
public boolean[] flight = new boolean[] { false, false, false };
|
||||
public float flightVModifier = 0F;
|
||||
public float speedModifier = 0F;
|
||||
public float jumpModifier = 0F;
|
||||
public float fireResistance = 0F;
|
||||
public float flightSpeedModifier = 0;
|
||||
public boolean hasHillStep = false;
|
||||
public boolean hasDraconic = false;
|
||||
|
||||
public ArmorSummery getSummery(EntityPlayer player) {
|
||||
ItemStack[] armorSlots = player.inventory.armorInventory;
|
||||
float totalEntropy = 0;
|
||||
int totalRecoveryPoints = 0;
|
||||
|
||||
allocation = new float[armorSlots.length];
|
||||
armorStacks = new ItemStack[armorSlots.length];
|
||||
pointsDown = new float[armorSlots.length];
|
||||
energyAllocation = new int[armorSlots.length];
|
||||
|
||||
for (int i = 0; i < armorSlots.length; i++) {
|
||||
ItemStack stack = armorSlots[i];
|
||||
if (stack == null || !(stack.getItem() instanceof ICustomArmor)) continue;
|
||||
ICustomArmor armor = (ICustomArmor) stack.getItem();
|
||||
peaces++;
|
||||
allocation[i] = ItemNBTHelper.getFloat(stack, "ProtectionPoints", 0);
|
||||
protectionPoints += allocation[i];
|
||||
totalEntropy += ItemNBTHelper.getFloat(stack, "ShieldEntropy", 0);
|
||||
armorStacks[i] = stack;
|
||||
totalRecoveryPoints += IUpgradableItem.EnumUpgrade.SHIELD_RECOVERY.getUpgradePoints(stack);
|
||||
float maxPoints = armor.getProtectionPoints(stack);
|
||||
pointsDown[i] = maxPoints - allocation[i];
|
||||
maxProtectionPoints += maxPoints;
|
||||
energyAllocation[i] = armor.getEnergyStored(stack);
|
||||
totalEnergyStored += energyAllocation[i];
|
||||
maxTotalEnergyStorage += armor.getMaxEnergyStored(stack);
|
||||
if (stack.getItem() instanceof DraconicArmor) hasDraconic = true;
|
||||
|
||||
fireResistance += armor.getFireResistance(stack);
|
||||
|
||||
switch (i) {
|
||||
case 2:
|
||||
flight = armor.hasFlight(stack);
|
||||
if (flight[0]) {
|
||||
flightVModifier = armor.getFlightVModifier(stack, player);
|
||||
flightSpeedModifier = armor.getFlightSpeedModifier(stack, player);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
speedModifier = armor.getSpeedModifier(stack, player);
|
||||
break;
|
||||
case 0:
|
||||
hasHillStep = armor.hasHillStep(stack, player);
|
||||
jumpModifier = armor.getJumpModifier(stack, player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (peaces == 0) return null;
|
||||
|
||||
entropy = totalEntropy / peaces;
|
||||
meanRecoveryPoints = totalRecoveryPoints / peaces;
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@ import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.ItemDE;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDislocatorInhibitor;
|
||||
import com.brandon3055.draconicevolution.common.utils.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.InventoryUtils;
|
||||
@@ -40,9 +39,11 @@ import com.gtnewhorizon.gtnhlib.GTNHLib;
|
||||
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileSolegnolia;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 9/3/2016.
|
||||
@@ -51,6 +52,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles")
|
||||
public class Magnet extends ItemDE implements IBauble, IConfigurableItem {
|
||||
|
||||
private static final boolean BOTANIA_LOADED = Loader.isModLoaded("Botania");
|
||||
|
||||
private IIcon draconium;
|
||||
private IIcon awakened;
|
||||
|
||||
@@ -62,8 +65,10 @@ public class Magnet extends ItemDE implements IBauble, IConfigurableItem {
|
||||
DELAY,
|
||||
NEVER;
|
||||
|
||||
public static final SelfPickUpMode[] VALUES = values();
|
||||
|
||||
public SelfPickUpMode next() {
|
||||
final SelfPickUpMode[] values = SelfPickUpMode.values();
|
||||
final SelfPickUpMode[] values = SelfPickUpMode.VALUES;
|
||||
return values[(this.ordinal() + 1) % values.length];
|
||||
}
|
||||
}
|
||||
@@ -119,6 +124,9 @@ public class Magnet extends ItemDE implements IBauble, IConfigurableItem {
|
||||
if (IConfigurableItem.ProfileHelper.getBoolean(stack, References.MAGNET_SNEAK, true) && entity.isSneaking()) {
|
||||
return;
|
||||
}
|
||||
if (BOTANIA_LOADED && SubTileSolegnolia.hasSolegnoliaAround(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int range = stack.getItemDamage() == 0 ? 8 : 32;
|
||||
List<EntityItem> items = world.getEntitiesWithinAABB(
|
||||
@@ -136,7 +144,7 @@ public class Magnet extends ItemDE implements IBauble, IConfigurableItem {
|
||||
|
||||
for (EntityItem item : items) {
|
||||
if (item.getEntityItem() == null || ModHelper.isAE2EntityFloatingItem(item)
|
||||
|| TileDislocatorInhibitor.isBlockedByInhibitor(world, item)) {
|
||||
|| DraconicEvolution.proxy.isBlockedByInhibitor(world, item)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -266,7 +274,7 @@ public class Magnet extends ItemDE implements IBauble, IConfigurableItem {
|
||||
|
||||
private static SelfPickUpMode getSelfPickupStatus(ItemStack itemStack) {
|
||||
final short mode = getSelfPickupStatusShort(itemStack);
|
||||
return SelfPickUpMode.values()[mode];
|
||||
return SelfPickUpMode.VALUES[mode];
|
||||
}
|
||||
|
||||
public static void toggleSelfPickupStatus(ItemStack itemStack) {
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.keybinding.KeyBindings;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ToolModePacket;
|
||||
@@ -228,10 +227,13 @@ public class ToolBase extends RFItemBase {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addAditionalInformation(ItemStack stack, EntityPlayer player, List list, boolean extended) {
|
||||
String key;
|
||||
if (KeyBindings.toolConfig.getKeyCode() >= 0 && KeyBindings.toolConfig.getKeyCode() < Keyboard.KEYBOARD_SIZE)
|
||||
key = Keyboard.getKeyName(KeyBindings.toolConfig.getKeyCode());
|
||||
else key = Mouse.getButtonName(KeyBindings.toolConfig.getKeyCode() + 101);
|
||||
final int configKeyCode = DraconicEvolution.clientProxy().getKeybindHandler().toolConfigKeycode();
|
||||
final String key;
|
||||
if (configKeyCode >= 0 && configKeyCode < Keyboard.KEYBOARD_SIZE) {
|
||||
key = Keyboard.getKeyName(configKeyCode);
|
||||
} else {
|
||||
key = Mouse.getButtonName(configKeyCode + 101);
|
||||
}
|
||||
|
||||
list.add(
|
||||
StatCollector.translateToLocal("info.de.press.txt") + " "
|
||||
|
||||
@@ -158,8 +158,8 @@ public class BowHandler {
|
||||
|
||||
public int calculateEnergyCost() {
|
||||
updateValues();
|
||||
double rfCost = (bow.getItem() instanceof IEnergyContainerWeaponItem)
|
||||
? ((IEnergyContainerWeaponItem) bow.getItem()).getEnergyPerAttack()
|
||||
double rfCost = (bow.getItem() instanceof IEnergyContainerBowItem)
|
||||
? ((IEnergyContainerBowItem) bow.getItem()).getEnergyPerAttack()
|
||||
: 80;
|
||||
|
||||
rfCost *= 1 + arrowDamage;
|
||||
@@ -175,7 +175,7 @@ public class BowHandler {
|
||||
updateValues();
|
||||
|
||||
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)";
|
||||
return false;
|
||||
} else if (!energyBolt && shockWavePower > 0) {
|
||||
@@ -184,7 +184,7 @@ public class BowHandler {
|
||||
} else if (energyBolt && explosionPower > 0) {
|
||||
cantFireMessage = "msg.de.explosiveNotForEnergyBolts.txt";
|
||||
return false;
|
||||
} else if (calculateEnergyCost() > ((IEnergyContainerWeaponItem) bow.getItem()).getEnergyStored(bow)
|
||||
} else if (calculateEnergyCost() > ((IEnergyContainerBowItem) bow.getItem()).getEnergyStored(bow)
|
||||
&& !player.capabilities.isCreativeMode) {
|
||||
cantFireMessage = "msg.de.insufficientPowerToFire.txt";
|
||||
return false;
|
||||
@@ -223,7 +223,7 @@ public class BowHandler {
|
||||
public boolean consumeArrowAndEnergy() {
|
||||
|
||||
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
|
||||
&& !player.capabilities.isCreativeMode) {
|
||||
|
||||
@@ -39,7 +39,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
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" };
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
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" };
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.Magnet;
|
||||
import com.brandon3055.draconicevolution.common.utils.InventoryUtils;
|
||||
import com.brandon3055.draconicevolution.integration.ModHelper;
|
||||
@@ -49,7 +49,7 @@ public final class MagnetToggleAckPacket implements IMessage {
|
||||
if (magnetOptional.isPresent()) {
|
||||
ItemStack itemStack = magnetOptional.get();
|
||||
Magnet.setStatus(itemStack, message.status);
|
||||
ClientEventHandler.statusDisplayManager.startDrawing(itemStack.copy());
|
||||
DraconicEvolution.clientProxy().displayItem(itemStack);
|
||||
if (ModHelper.isGTNHLibLoaded) Magnet.renderHUDStatusChange();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.Magnet;
|
||||
import com.brandon3055.draconicevolution.common.utils.InventoryUtils;
|
||||
import com.brandon3055.draconicevolution.integration.ModHelper;
|
||||
@@ -49,7 +49,7 @@ public final class MagnetToggleSelfPickupAckPacket implements IMessage {
|
||||
if (magnetOptional.isPresent()) {
|
||||
ItemStack itemStack = magnetOptional.get();
|
||||
Magnet.setSelfPickupStatus(itemStack, message.status);
|
||||
ClientEventHandler.statusDisplayManager.startDrawing(itemStack.copy());
|
||||
DraconicEvolution.clientProxy().displayItem(itemStack);
|
||||
if (ModHelper.isGTNHLibLoaded) Magnet.renderHUDSelfPickupStatusChange();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.brandon3055.draconicevolution.common.network;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
@@ -45,7 +45,7 @@ public class MountUpdatePacket implements IMessage {
|
||||
return null;
|
||||
}
|
||||
|
||||
ClientEventHandler.tryRepositionPlayerOnMount(message.entityID);
|
||||
DraconicEvolution.proxy.tryRepositionPlayerOnMount(message.entityID);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
@@ -46,9 +45,9 @@ public class ShieldHitPacket implements IMessage {
|
||||
@Override
|
||||
public IMessage onMessage(ShieldHitPacket message, MessageContext ctx) {
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(message.playerID);
|
||||
if (entity instanceof EntityPlayer) ClientEventHandler.playerShieldStatus.put(
|
||||
(EntityPlayer) entity,
|
||||
new DataUtils.XZPair<>(message.shieldPowerF, ClientEventHandler.elapsedTicks));
|
||||
if (entity instanceof EntityPlayer player) {
|
||||
DraconicEvolution.clientProxy().renderShield(player, message.shieldPowerF);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,9 +55,9 @@ public class TileChaosShard extends TileEntity {
|
||||
|
||||
public void detonate() {
|
||||
if (!worldObj.isRemote
|
||||
&& locationHash != getLocationHash(xCoord, yCoord, zCoord, worldObj.provider.dimensionId))
|
||||
&& locationHash != getLocationHash(xCoord, yCoord, zCoord, worldObj.provider.dimensionId)) {
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
else {
|
||||
} else {
|
||||
EntityChaosVortex vortex = new EntityChaosVortex(worldObj);
|
||||
vortex.setPosition(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
|
||||
worldObj.spawnEntityInWorld(vortex);
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package com.brandon3055.draconicevolution.common.tileentities;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -16,8 +12,8 @@ import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerDislocatorInhibitor;
|
||||
|
||||
@@ -26,7 +22,6 @@ public class TileDislocatorInhibitor extends TileEntity implements IInventory {
|
||||
public static final int MAXIMUM_RANGE = 16;
|
||||
public static final int MINIMUM_RANGE = 1;
|
||||
public static final int FILTER_SLOTS = 8;
|
||||
public static final HashMap<World, HashSet<TileDislocatorInhibitor>> inhibitors = new HashMap<>();
|
||||
|
||||
private boolean redstoneActive = false;
|
||||
private ActivityControlType activityControlType = ActivityControlType.ALWAYS_ACTIVE;
|
||||
@@ -36,42 +31,27 @@ public class TileDislocatorInhibitor extends TileEntity implements IInventory {
|
||||
private boolean whitelist = false;
|
||||
private final ItemStack[] filter = new ItemStack[FILTER_SLOTS];
|
||||
|
||||
public static boolean isBlockedByInhibitor(World world, EntityItem item) {
|
||||
HashSet<TileDislocatorInhibitor> list = inhibitors.get(world);
|
||||
if (list == null) {
|
||||
return false;
|
||||
}
|
||||
for (TileDislocatorInhibitor inhibitor : list) {
|
||||
if (!inhibitor.shouldBeActive()) {
|
||||
continue;
|
||||
}
|
||||
if (!inhibitor.isBlockingItem(item.getEntityItem())) {
|
||||
continue;
|
||||
}
|
||||
if (inhibitor.isInRange(item.posX, item.posY, item.posZ)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!registered) {
|
||||
HashSet<TileDislocatorInhibitor> map = inhibitors.computeIfAbsent(this.worldObj, k -> new HashSet<>());
|
||||
map.add(this);
|
||||
DraconicEvolution.proxy.registerInhibitor(this);
|
||||
registered = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
this.unregister();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
this.unregister();
|
||||
}
|
||||
|
||||
public void unregister() {
|
||||
if (inhibitors.containsKey(this.worldObj)) {
|
||||
HashSet<TileDislocatorInhibitor> list = inhibitors.get(this.worldObj);
|
||||
list.remove(this);
|
||||
if (list.isEmpty()) {
|
||||
inhibitors.remove(this.worldObj);
|
||||
}
|
||||
}
|
||||
DraconicEvolution.proxy.unregisterInhibitor(this);
|
||||
}
|
||||
|
||||
public int getRange() {
|
||||
@@ -124,11 +104,12 @@ public class TileDislocatorInhibitor extends TileEntity implements IInventory {
|
||||
}
|
||||
|
||||
public boolean isInRange(double x, double y, double z) {
|
||||
return x >= this.xCoord - range && x <= this.xCoord + range + 1
|
||||
&& y >= this.yCoord - range
|
||||
&& y <= this.yCoord + range + 1
|
||||
&& z >= this.zCoord - range
|
||||
&& z <= this.zCoord + range + 1;
|
||||
final int r = range;
|
||||
return x >= this.xCoord - r && x <= this.xCoord + r + 1
|
||||
&& y >= this.yCoord - r
|
||||
&& y <= this.yCoord + r + 1
|
||||
&& z >= this.zCoord - r
|
||||
&& z <= this.zCoord + r + 1;
|
||||
}
|
||||
|
||||
public void setActivityControl(int index) {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.brandon3055.draconicevolution.common.tileentities;
|
||||
|
||||
import static com.brandon3055.draconicevolution.DraconicEvolution.isAutomagyLoaded;
|
||||
import static com.brandon3055.draconicevolution.DraconicEvolution.isEioLoaded;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
@@ -18,6 +22,11 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.gtnewhorizon.gtnhlib.geometry.CubeIterator;
|
||||
|
||||
import crazypants.enderio.machine.obelisk.xp.TileExperienceObelisk;
|
||||
import crazypants.enderio.xp.ExperienceContainer;
|
||||
import tuhljin.automagy.tiles.TileEntityJarXP;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 27/06/2014.
|
||||
@@ -89,7 +98,64 @@ public class TileDissEnchanter extends TileEntity implements ISidedInventory {
|
||||
|
||||
public void buttonClick(EntityPlayer player) {
|
||||
if (!isValidRecipe) return;
|
||||
if (player.experienceLevel < dissenchantCost && !player.capabilities.isCreativeMode) return;
|
||||
if (player != null) {
|
||||
if (player.experienceLevel < dissenchantCost && !player.capabilities.isCreativeMode) return;
|
||||
} else if (dissenchantCost > 0) {
|
||||
ArrayList<TileEntityJarXP> jarsToEmpty = new ArrayList<>();
|
||||
ArrayList<ExperienceContainer> obelisksToEmpty = new ArrayList<>();
|
||||
int xpCost = dissenchantCost < 16 ? dissenchantCost * 17
|
||||
: dissenchantCost < 30 ? Math.round(dissenchantCost * (1.5f * dissenchantCost - 29.5f)) + 360
|
||||
: Math.round(dissenchantCost * (3.5f * dissenchantCost - 151.5f)) + 2220;
|
||||
int xp;
|
||||
absorb: {
|
||||
if (isAutomagyLoaded) {
|
||||
CubeIterator iter = new CubeIterator(8);
|
||||
while (iter.hasNext()) {
|
||||
iter.next();
|
||||
if (worldObj.getTileEntity(
|
||||
iter.n + xCoord,
|
||||
iter.l + yCoord,
|
||||
iter.m + zCoord) instanceof TileEntityJarXP jar) {
|
||||
xp = jar.getXP();
|
||||
if (xp >= xpCost) {
|
||||
if (!worldObj.isRemote) {
|
||||
jarsToEmpty.forEach(j -> j.setXP(0));
|
||||
jar.setXP(xp - xpCost);
|
||||
}
|
||||
break absorb;
|
||||
}
|
||||
xpCost -= xp;
|
||||
jarsToEmpty.add(jar);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isEioLoaded) {
|
||||
CubeIterator iter = new CubeIterator(8);
|
||||
while (iter.hasNext()) {
|
||||
iter.next();
|
||||
if (worldObj.getTileEntity(
|
||||
iter.n + xCoord,
|
||||
iter.l + yCoord,
|
||||
iter.m + zCoord) instanceof TileExperienceObelisk obelisk) {
|
||||
ExperienceContainer cont = obelisk.getContainer();
|
||||
xp = cont.getExperienceTotal();
|
||||
if (xp >= xpCost) {
|
||||
if (!worldObj.isRemote) {
|
||||
jarsToEmpty.forEach(j -> j.setXP(0));
|
||||
obelisksToEmpty.forEach(o -> o.drain(null, Integer.MAX_VALUE, true));
|
||||
cont.drain(null, Integer.MAX_VALUE, true);
|
||||
cont.addExperience(Math.max(0, xp - xpCost));
|
||||
}
|
||||
break absorb;
|
||||
}
|
||||
xpCost -= xp;
|
||||
obelisksToEmpty.add(cont);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
ItemStack input = items[0];
|
||||
ItemStack enchantedBook = new ItemStack(Items.enchanted_book);
|
||||
Map enchants = EnchantmentHelper.getEnchantments(input);
|
||||
@@ -119,21 +185,21 @@ public class TileDissEnchanter extends TileEntity implements ISidedInventory {
|
||||
compound.removeTag(tagName);
|
||||
if (list.tagCount() > 0) input.setTagInfo(tagName, list);
|
||||
if (input.getItem() == Items.enchanted_book && list.tagCount() == 0) setInventorySlotContents(0, null);
|
||||
if (!player.capabilities.isCreativeMode) player.addExperienceLevel(-dissenchantCost);
|
||||
if (player != null && !player.capabilities.isCreativeMode) player.addExperienceLevel(-dissenchantCost);
|
||||
if (items[0] != null && ItemNBTHelper.getInteger(items[0], "RepairCost", 0) > 0) ItemNBTHelper.setInteger(
|
||||
items[0],
|
||||
"RepairCost",
|
||||
ItemNBTHelper.getInteger(items[0], "RepairCost", 0)
|
||||
- Math.min(2, ItemNBTHelper.getInteger(items[0], "RepairCost", 0)));
|
||||
if (!player.capabilities.isCreativeMode) decrStackSize(1, 1);
|
||||
if (player == null || !player.capabilities.isCreativeMode) decrStackSize(1, 1);
|
||||
int maxDamage = items[0] != null ? items[0].getMaxDamage() : 0;
|
||||
float damageF = (40f - bookPower) / 100f;
|
||||
int damage = (int) (damageF * (float) maxDamage);
|
||||
int damageResult = items[0] != null ? items[0].getItemDamage() + damage : 0;
|
||||
|
||||
if (!player.capabilities.isCreativeMode && damageResult > maxDamage && maxDamage > 0) {
|
||||
if ((player == null || !player.capabilities.isCreativeMode) && damageResult > maxDamage && maxDamage > 0) {
|
||||
setInventorySlotContents(0, null);
|
||||
} else if (!player.capabilities.isCreativeMode && maxDamage > 0 && items[0] != null) {
|
||||
} else if ((player == null || !player.capabilities.isCreativeMode) && maxDamage > 0 && items[0] != null) {
|
||||
items[0].setItemDamage(damageResult);
|
||||
}
|
||||
onInventoryChanged();
|
||||
@@ -231,13 +297,13 @@ public class TileDissEnchanter extends TileEntity implements ISidedInventory {
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
if (i == 1 && itemstack.getItem().equals(Items.book)) return true;
|
||||
return false;
|
||||
return i == 1 ? itemstack.getItem().equals(Items.book)
|
||||
: i == 0 ? EnchantmentHelper.getEnchantments(itemstack).size() != 0 : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int var1) {
|
||||
return new int[] { 1 };
|
||||
return var1 == 0 ? new int[] { 0, 2 } : new int[] { 0, 1 };
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -247,7 +313,7 @@ public class TileDissEnchanter extends TileEntity implements ISidedInventory {
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack item, int side) {
|
||||
return true;
|
||||
return slot != 0 || EnchantmentHelper.getEnchantments(item).size() == 0;
|
||||
}
|
||||
|
||||
// ===========================================================================================================//
|
||||
@@ -284,4 +350,5 @@ public class TileDissEnchanter extends TileEntity implements ISidedInventory {
|
||||
bookPower = compound.getFloat("ServivalChance");
|
||||
super.readFromNBT(compound);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
@@ -20,6 +21,16 @@ public class TilePlacedItem extends TileEntity {
|
||||
public ItemStack stack;
|
||||
public float rotation = 0F;
|
||||
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
|
||||
public void updateEntity() {
|
||||
|
||||
@@ -11,17 +11,14 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
|
||||
public class TileWeatherController extends TileEntity implements IInventory {
|
||||
|
||||
int tick = 0;
|
||||
boolean running = false;
|
||||
public boolean lastTickInput = false;
|
||||
public int mode = 0;
|
||||
private static final boolean debug = DraconicEvolution.debug;
|
||||
|
||||
private ItemStack[] items;
|
||||
private final ItemStack[] items;
|
||||
public int charges;
|
||||
|
||||
public TileWeatherController() {
|
||||
|
||||
@@ -47,19 +47,16 @@ public class TileEnergyRelay extends TileRemoteEnergyBase {
|
||||
super.updateEntity();
|
||||
|
||||
if (worldObj.isRemote) {
|
||||
ring = DraconicEvolution.proxy.energyField(
|
||||
worldObj,
|
||||
xCoord + 0.5,
|
||||
yCoord + 0.5,
|
||||
zCoord + 0.5,
|
||||
0,
|
||||
powerTier == 1,
|
||||
ring,
|
||||
inView > 0);
|
||||
return;
|
||||
spawnEnergyField();
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void spawnEnergyField() {
|
||||
ring = DraconicEvolution.clientProxy()
|
||||
.energyField(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 0, powerTier == 1, ring, inView > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound) {
|
||||
super.writeToNBT(compound);
|
||||
|
||||
@@ -78,7 +78,14 @@ public class TileEnergyTransceiver extends TileRemoteEnergyBase {
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.isRemote) particle = DraconicEvolution.proxy
|
||||
if (worldObj.isRemote) {
|
||||
spawnParticle();
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void spawnParticle() {
|
||||
particle = DraconicEvolution.clientProxy()
|
||||
.energyField(worldObj, getBeamX(), getBeamY(), getBeamZ(), 1, powerTier == 1, particle, inView > 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -100,19 +100,7 @@ public abstract class TileRemoteEnergyBase extends TileObjectSync implements IRe
|
||||
rType = 1;
|
||||
else rType = 0;
|
||||
}
|
||||
device.beam = DraconicEvolution.proxy.energyBeam(
|
||||
worldObj,
|
||||
getBeamX(),
|
||||
getBeamY(),
|
||||
getBeamZ(),
|
||||
remoteTile.getBeamX(),
|
||||
remoteTile.getBeamY(),
|
||||
remoteTile.getBeamZ(),
|
||||
(int) device.energyFlow,
|
||||
getPowerTier() == 1,
|
||||
device.beam,
|
||||
true,
|
||||
rType);
|
||||
updateBeam(device, remoteTile, rType);
|
||||
} else {
|
||||
double difference = getCapacity() - remoteTile.getCapacity();
|
||||
double energyToEqual = Math
|
||||
@@ -137,6 +125,23 @@ public abstract class TileRemoteEnergyBase extends TileObjectSync implements IRe
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void updateBeam(LinkedEnergyDevice device, IRemoteEnergyHandler remoteTile, int rType) {
|
||||
device.beam = DraconicEvolution.clientProxy().energyBeam(
|
||||
worldObj,
|
||||
getBeamX(),
|
||||
getBeamY(),
|
||||
getBeamZ(),
|
||||
remoteTile.getBeamX(),
|
||||
remoteTile.getBeamY(),
|
||||
remoteTile.getBeamZ(),
|
||||
(int) device.energyFlow,
|
||||
getPowerTier() == 1,
|
||||
device.beam,
|
||||
true,
|
||||
rType);
|
||||
}
|
||||
|
||||
protected void detectAndSendChanges(int index) {
|
||||
if (worldObj.isRemote) return;
|
||||
|
||||
|
||||
@@ -62,32 +62,13 @@ public class TileWirelessEnergyTransceiver extends TileRemoteEnergyBase {
|
||||
super.updateEntity();
|
||||
|
||||
if (worldObj.isRemote) {
|
||||
ring = DraconicEvolution.proxy.energyField(
|
||||
worldObj,
|
||||
xCoord + 0.5,
|
||||
yCoord + 0.5,
|
||||
zCoord + 0.5,
|
||||
2,
|
||||
powerTier == 1,
|
||||
ring,
|
||||
inView > 0);
|
||||
spawnEnergyField();
|
||||
|
||||
for (LinkedReceiver receiver : receiverList) {
|
||||
int particleValue = 200;
|
||||
if (receiver.particleEnergyCounter > particleValue) {
|
||||
receiver.particleEnergyCounter -= particleValue;
|
||||
|
||||
// todo detect box size
|
||||
DraconicEvolution.proxy.spawnParticle(
|
||||
new Particles.TransceiverParticle(
|
||||
worldObj,
|
||||
xCoord + 0.5,
|
||||
yCoord + 0.3 + (worldObj.rand.nextDouble() * 0.4),
|
||||
zCoord + 0.5,
|
||||
receiver.xCoord + worldObj.rand.nextDouble(),
|
||||
receiver.yCoord + worldObj.rand.nextDouble(),
|
||||
receiver.zCoord + worldObj.rand.nextDouble()),
|
||||
64);
|
||||
spawnParticles(receiver);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -120,6 +101,27 @@ public class TileWirelessEnergyTransceiver extends TileRemoteEnergyBase {
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void spawnEnergyField() {
|
||||
ring = DraconicEvolution.clientProxy()
|
||||
.energyField(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 2, powerTier == 1, ring, inView > 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void spawnParticles(LinkedReceiver receiver) {
|
||||
// todo detect box size
|
||||
DraconicEvolution.clientProxy().spawnParticle(
|
||||
new Particles.TransceiverParticle(
|
||||
worldObj,
|
||||
xCoord + 0.5,
|
||||
yCoord + 0.3 + (worldObj.rand.nextDouble() * 0.4),
|
||||
zCoord + 0.5,
|
||||
receiver.xCoord + worldObj.rand.nextDouble(),
|
||||
receiver.yCoord + worldObj.rand.nextDouble(),
|
||||
receiver.zCoord + worldObj.rand.nextDouble()),
|
||||
64);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveObjectFromServer(int index, Object object) {
|
||||
|
||||
@@ -92,7 +92,7 @@ public class TilePortalBlock extends TileEntity {
|
||||
}
|
||||
}
|
||||
}
|
||||
DraconicEvolution.proxy.spawnParticle(
|
||||
DraconicEvolution.clientProxy().spawnParticle(
|
||||
new Particles.PortalParticle(worldObj, sourceX, sourceY, sourceZ, targetX, targetY, targetZ),
|
||||
256);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public class TileReactorCore extends TileObjectSync implements IInventory {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void updateSound() {
|
||||
if (reactorSound == null) {
|
||||
reactorSound = (ReactorSound) DraconicEvolution.proxy.playISound(new ReactorSound(this));
|
||||
reactorSound = (ReactorSound) DraconicEvolution.clientProxy().playISound(new ReactorSound(this));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class TileReactorEnergyInjector extends TileEntity implements IReactorPar
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void updateBeam() {
|
||||
beam = DraconicEvolution.proxy.reactorBeam(this, beam, true);
|
||||
beam = DraconicEvolution.clientProxy().reactorBeam(this, beam, true);
|
||||
}
|
||||
|
||||
public void onPlaced() {
|
||||
|
||||
@@ -98,7 +98,7 @@ public class TileReactorStabilizer extends TileEntity
|
||||
beam = null;
|
||||
}
|
||||
if (isValid) {
|
||||
beam = DraconicEvolution.proxy.reactorBeam(this, beam, true);
|
||||
beam = DraconicEvolution.clientProxy().reactorBeam(this, beam, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,19 +18,13 @@ import com.brandon3055.draconicevolution.common.entity.EntityChaosGuardian;
|
||||
/**
|
||||
* Created by brandon3055 on 21/10/2015.
|
||||
*/
|
||||
public class DragonChunkLoader implements LoadingCallback {
|
||||
public final class DragonChunkLoader implements LoadingCallback {
|
||||
|
||||
public static DragonChunkLoader instance;
|
||||
public static Map<EntityChaosGuardian, Ticket> ticketList = new HashMap<>();
|
||||
public static boolean hasReportedIssue = false;
|
||||
private final Map<EntityChaosGuardian, Ticket> ticketList = new HashMap<>();
|
||||
private boolean hasReportedIssue = false;
|
||||
|
||||
public static void init() {
|
||||
instance = new DragonChunkLoader();
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(DraconicEvolution.instance, instance);
|
||||
}
|
||||
|
||||
public static void updateLoaded(EntityChaosGuardian guardian) {
|
||||
Ticket ticket;
|
||||
public void updateLoaded(EntityChaosGuardian guardian) {
|
||||
final Ticket ticket;
|
||||
|
||||
if (ticketList.containsKey(guardian)) {
|
||||
ticket = ticketList.get(guardian);
|
||||
@@ -90,7 +84,7 @@ public class DragonChunkLoader implements LoadingCallback {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void stopLoading(EntityChaosGuardian guardian) {
|
||||
public void stopLoading(EntityChaosGuardian guardian) {
|
||||
if (!ticketList.containsKey(guardian)) return;
|
||||
ForgeChunkManager.releaseTicket(ticketList.get(guardian));
|
||||
ticketList.remove(guardian);
|
||||
@@ -107,4 +101,8 @@ public class DragonChunkLoader implements LoadingCallback {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onServerStopped() {
|
||||
this.ticketList.clear();
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler.ArmorSummery;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.ArmorSummary;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
@@ -27,6 +27,7 @@ public class ModHelper {
|
||||
|
||||
public static boolean isGTNHLibLoaded;
|
||||
public static boolean isHodgepodgeLoaded;
|
||||
public static boolean isBackhandLoaded;
|
||||
|
||||
private static Item cleaver;
|
||||
private static Item avaritiaSword;
|
||||
@@ -40,6 +41,7 @@ public class ModHelper {
|
||||
isAE2Installed = Loader.isModLoaded("appliedenergistics2");
|
||||
isGTNHLibLoaded = Loader.isModLoaded("gtnhlib");
|
||||
isHodgepodgeLoaded = Loader.isModLoaded("hodgepodge");
|
||||
isBackhandLoaded = Loader.isModLoaded("backhand");
|
||||
|
||||
final String AE2_FITEM_CLASS = "appeng.entity.EntityFloatingItem";
|
||||
|
||||
@@ -65,8 +67,8 @@ public class ModHelper {
|
||||
&& player.getHeldItem().getItem().equals(avaritiaSword);
|
||||
}
|
||||
|
||||
public static float applyModDamageAdjustments(ArmorSummery summery, LivingAttackEvent event) {
|
||||
if (summery == null) return event.ammount;
|
||||
public static float applyModDamageAdjustments(ArmorSummary summary, LivingAttackEvent event) {
|
||||
if (summary == null) return event.ammount;
|
||||
EntityPlayer attacker = event.source.getEntity() instanceof EntityPlayer
|
||||
? (EntityPlayer) event.source.getEntity()
|
||||
: null;
|
||||
@@ -79,10 +81,10 @@ public class ModHelper {
|
||||
event.entityLiving.hurtResistantTime = 0;
|
||||
return 300F;
|
||||
} else if (event.source.isUnblockable() || event.source.canHarmInCreative()) {
|
||||
summery.entropy += 3;
|
||||
summary.entropy += 3;
|
||||
|
||||
if (summery.entropy > 100) {
|
||||
summery.entropy = 100;
|
||||
if (summary.entropy > 100) {
|
||||
summary.entropy = 100;
|
||||
}
|
||||
|
||||
return event.ammount * 2;
|
||||
|
||||
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 7.2 KiB |
@@ -427,7 +427,7 @@ item.draconicevolution:wyvernBow.lore=2Infusing Draconium in a mundane bow\nallo
|
||||
item.draconicevolution:wyvernHelm.lore=2Stronger than diamond\nyou can now withstand even greater blows
|
||||
item.draconicevolution:wyvernChest.lore=2Infusing the armor with Draconium\nyou vastly improve its resistance
|
||||
item.draconicevolution:wyvernLeggs.lore=2You feel even stronger and faster now\nthat you have infused diamond legs with Draconium
|
||||
item.draconicevolution:wyvernBoots.lore=2You learn to improve the boots\nDraconium seems to have given you greater\nagility
|
||||
item.draconicevolution:wyvernBoots.lore=2You learn to improve the boots\nDraconium seems to have given you greater agility
|
||||
|
||||
item.draconicevolution:draconicPickaxe.lore=2Great care and research has\nallowed you to mine even larger areas
|
||||
item.draconicevolution:draconicAxe.lore=2After lots of trial and error\nyou can now feel an entire tree with one try
|
||||
@@ -436,10 +436,10 @@ item.draconicevolution:draconicHoe.lore=2Draconium even improves farming\nentire
|
||||
item.draconicevolution:draconicSword.lore=2Wyvern was good, but draconic weapons\nare even more powerful and hit more enemies
|
||||
item.draconicevolution:draconicBow.lore=2The peak of ranged perfection faster shooting,\nexplosive arrows, what more could you want?
|
||||
|
||||
item.draconicevolution:draconicHelm.lore=2No longer do you fear the night\nyou now can see all the time regardless\nof what is out there
|
||||
item.draconicevolution:draconicHelm.lore=3No longer do you fear the night\nyou now can see all the time regardless\nof what is out there
|
||||
item.draconicevolution:draconicChest.lore=2Using the heart of a dragon\nyou are stronger and have the gift of flight
|
||||
item.draconicevolution:draconicLeggs.lore=2Even stronger armor\nthe soul of a dragon protects you and moves you even faster
|
||||
item.draconicevolution:draconicBoots.lore=2Stronger, faster, better than before\nthe heart of a dragon grants you\nhigher jumping
|
||||
item.draconicevolution:draconicBoots.lore=2Stronger, faster, better than before\nthe heart of a dragon grants you higher jumping
|
||||
|
||||
item.draconicevolution:draconicDistructionStaff.lore=2A long and ardous road, true power!\none tool to do it all, mine, battle, and death!
|
||||
|
||||
@@ -547,6 +547,36 @@ button.de.rotate.txt=Rotate
|
||||
button.de.numeric.txt=Numeric:
|
||||
|
||||
//Gui ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
gui.de.numbers=%s
|
||||
|
||||
gui.de.charges=Charges
|
||||
gui.de.rain.on=Turn rain on
|
||||
gui.de.rain.off=Turn rain off
|
||||
gui.de.rain.storm=Thunder Storm
|
||||
|
||||
gui.de.weatherController.main.title=Weather Controller
|
||||
gui.de.playerDetector.main.title=Advanced Player Detector
|
||||
gui.de.grinder.main.title=Grinder
|
||||
gui.de.energyInfuser.main.title=Energy Infuser
|
||||
gui.de.generator.main.title=Generator
|
||||
gui.de.dissEnchanter.main.title=Disenchanter
|
||||
gui.de.draconiumChest.main.title=Draconic Chest
|
||||
gui.de.upgradeModifier.main.title=Upgrade Modifier
|
||||
gui.de.dislocatorInhibitor.main.title=Dislocator Inhibitor
|
||||
|
||||
gui.de.playerDetector.whiteList=White List
|
||||
gui.de.playerDetector.blackList=Black List
|
||||
gui.de.playerDetector.camouflage=Camouflage
|
||||
gui.de.playerDetector.invertOutput=Invert Output
|
||||
gui.de.playerDetector.back=Back
|
||||
gui.de.playerDetector.pressEnter=Press Enter to save
|
||||
gui.de.playerDetector.range=Range
|
||||
gui.de.playerDetector.outputInvert=Output Inverted: %s
|
||||
|
||||
gui.de.dissEnchanter.itemDamage1=Item
|
||||
gui.de.dissEnchanter.itemDamage2=Damage: %s
|
||||
gui.de.dissEnchanter.cost=Cost: %s
|
||||
|
||||
gui.de.flowGate.name=Flow Control
|
||||
gui.de.flowGatePartialSignal.name=The actual flow will vary between the two given values depending on the strength of the redstone signal being supplied to the block.
|
||||
gui.de.flowGateCurrentFlow.name=Flow
|
||||
@@ -688,4 +718,4 @@ potion.de.flight.txt=Flight
|
||||
potion.de.highStep.txt=High Step
|
||||
potion.de.swiftness.txt=Swiftness
|
||||
potion.de.fireImmune.txt=Fire Immunity
|
||||
potion.de.jumpBoost.txt=Jump Boost
|
||||
potion.de.jumpBoost.txt=Jump Boost
|
||||
@@ -1,5 +1,5 @@
|
||||
//Tile Information ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
tile.draconicevolution:xRayBlock.name=透视方块
|
||||
tile.draconicevolution:xRayBlock.name=透视之火
|
||||
tile.draconicevolution:sunDial.name=日晷
|
||||
tile.draconicevolution:weatherController.name=气象控制器
|
||||
tile.draconicevolution:draconiumOre.name=龙矿
|
||||
@@ -10,13 +10,16 @@ tile.draconicevolution:particleGenerator.name=粒子发生器
|
||||
tile.draconicevolution:playerDetector.name=玩家探测器
|
||||
tile.draconicevolution:playerDetectorAdvanced.name=高级玩家探测器
|
||||
tile.draconicevolution:energyInfuser.name=能量注入器
|
||||
tile.draconicevolution:earth.name=地球
|
||||
tile.draconicevolution:customSpawner.name=稳定刷怪笼
|
||||
tile.draconicevolution:longRangeDislocator.name=长距离错位宝石
|
||||
tile.draconicevolution:longRangeDislocator1.name=创造错位宝石
|
||||
tile.draconicevolution:longRangeDislocator0.name=长距离错位宝石
|
||||
tile.draconicevolution:generator.name=发电机
|
||||
tile.draconicevolution:energyStorageCore.name=能量核心
|
||||
tile.draconicevolution:invisibleMultiblock.name=能量核心(隐藏)
|
||||
tile.draconicevolution:energyPylon.name=能量塔
|
||||
tile.draconicevolution:draconium.name=龙块
|
||||
tile.draconicevolution:draconium0.name=龙块
|
||||
tile.draconicevolution:draconium1.name=复活石
|
||||
tile.draconicevolution:draconium2.name=充能龙块
|
||||
@@ -28,6 +31,7 @@ tile.draconicevolution:draconicBlock.name=觉醒龙块
|
||||
tile.draconicevolution:infusedObsidian.name=注入龙力的黑曜石
|
||||
tile.draconicevolution:dislocatorReceptacle.name=错位容器
|
||||
tile.draconicevolution:portal.name=门
|
||||
tile.draconicevolution:flowGate.name=阀门
|
||||
tile.draconicevolution:flowGateFlux.name=能量阀门
|
||||
tile.draconicevolution:flowGateFluid.name=流体阀门
|
||||
tile.draconicevolution:reactorCore.name=反应堆核心
|
||||
@@ -35,13 +39,18 @@ tile.draconicevolution:reactorStabilizer.name=反应堆稳定器
|
||||
tile.draconicevolution:reactorEnergyInjector.name=反应堆能量喷射器
|
||||
tile.draconicevolution:chaosCrystal.name=混沌晶体
|
||||
tile.draconicevolution:upgradeModifier.name=升级调整器
|
||||
tile.draconicevolution:chaosShardAtmos.name=混沌碎片
|
||||
tile.draconicevolution:placedItem.name=放置的物品
|
||||
tile.draconicevolution:safetyFlame.name=安全的火焰
|
||||
|
||||
tile.draconicevolution:energyCrystal.name=能量中继器/收发器
|
||||
tile.draconicevolution:energyCrystal0.name=能量中继器
|
||||
tile.draconicevolution:energyCrystal1.name=高级能量中继器
|
||||
tile.draconicevolution:energyCrystal2.name=能量收发器
|
||||
tile.draconicevolution:energyCrystal3.name=高级能量收发器
|
||||
tile.draconicevolution:energyCrystal4.name=无线能量收发器
|
||||
tile.draconicevolution:energyCrystal5.name=高级无线收发器
|
||||
tile.draconicevolution:dislocatorInhibitor.name=磁力屏蔽器
|
||||
|
||||
|
||||
//Item Information ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -84,16 +93,20 @@ item.draconicevolution:enderArrow.name=末影箭
|
||||
item.draconicevolution:safetyMatch.name=安全火柴
|
||||
item.draconicevolution:safetyMatchBox.name=安全火柴盒
|
||||
item.draconicevolution:key.name=钥匙
|
||||
item.draconicevolution:draconiumEnergyCore.name=能量核心
|
||||
item.draconicevolution:draconiumEnergyCore0.name=双足飞龙能量核心
|
||||
item.draconicevolution:draconiumEnergyCore1.name=龙之能量核心
|
||||
item.draconicevolution:draconiumFluxCapacitor.name=通量电容器
|
||||
item.draconicevolution:draconiumFluxCapacitor0.name=双足飞龙通量电容器
|
||||
item.draconicevolution:draconiumFluxCapacitor1.name=龙之通量电容器
|
||||
item.draconicevolution:draconicIngot.name=觉醒龙锭
|
||||
item.draconicevolution:creativeStructureSpawner.name=结构生成器
|
||||
item.draconicevolution:creativeStructureSpawnerComet.name=生成彗星
|
||||
item.draconicevolution:creativeStructureSpawnerEnderIsland.name=生成末影岛
|
||||
item.draconicevolution:infoTablet.name=龙之研究信息板
|
||||
item.draconicevolution:wrench.name=连接扳手
|
||||
item.draconicevolution:dezilsMarshmallow.name=Dezil的棉花糖
|
||||
item.draconicevolution:reactorCraftingPart.name=反应堆稳定器
|
||||
item.draconicevolution:reactorCraftingPart.frame.name=反应堆稳定器支架
|
||||
item.draconicevolution:reactorCraftingPart.rotorInner.name=反应堆稳定器转子
|
||||
item.draconicevolution:reactorCraftingPart.rotorOuter.name=反应堆稳定器外转子
|
||||
@@ -101,13 +114,17 @@ item.draconicevolution:reactorCraftingPart.rotorAssembly.name=反应堆稳定器
|
||||
item.draconicevolution:reactorCraftingPart.stabilizerRing.name=反应堆稳定器聚能环
|
||||
item.draconicevolution:chaoticCore.name=混沌核心
|
||||
item.draconicevolution:chaosShard.name=混沌碎片
|
||||
item.draconicevolution:chaosFragment.name=混沌片段
|
||||
item.draconicevolution:chaosFragment0.name=微小混沌片段
|
||||
item.draconicevolution:chaosFragment1.name=小混沌片段
|
||||
item.draconicevolution:chaosFragment2.name=大混乱片段
|
||||
item.draconicevolution:chaosFragment2.name=大混沌片段
|
||||
item.draconicevolution:nugget.name=龙粒
|
||||
item.draconicevolution:nugget.draconium.name=龙粒
|
||||
item.draconicevolution:nugget.awakened.name=觉醒龙粒
|
||||
item.draconicevolution:magnet.name=物品错位器
|
||||
item.draconicevolution:magnet.wyvern.name=物品错位器
|
||||
item.draconicevolution:magnet.draconic.name=觉醒物品错位器
|
||||
item.draconicevolution:adminSpawnEgg.name=刷怪蛋
|
||||
|
||||
//Item Groups ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
itemGroup.toolsAndWeapons=龙之研究工具和武器
|
||||
@@ -130,11 +147,11 @@ msg.teleporterUnSet.txt=§c你在传送之前必须首先设置目的地(Shift +
|
||||
msg.teleporterBound.txt=§a传送器绑定到:
|
||||
msg.teleporterLowHealth.txt= 你生命值低
|
||||
msg.teleporterSentMob.txt=实体已被送到
|
||||
msg.teleporterEntityDimensional.txt=§c你不能把生物跨纬度传送!
|
||||
msg.teleporterEntityDimensional.txt=§c你不能跨维度传送生物!
|
||||
msg.teleporterAlreadySet.txt=§c[错误]传送石只能被绑定到一个位置!
|
||||
msg.teleporterOutOfFuel.txt=§c燃料耗尽! ! !
|
||||
msg.teleporterOutOfPearls.txt=§c末影珍珠耗尽! ! !
|
||||
msg.teleporterPlayerT1.txt=你需要一个更强大的错位宝石
|
||||
msg.teleporterPlayerT1.txt=你需要一个更强大的传送符咒
|
||||
msg.teleporterPlayerConsent.txt=玩家必须用潜行(Shift)同意他们
|
||||
msg.spawnerInfo1.txt=生物类型
|
||||
msg.spawnerInfo2.txt=需要玩家
|
||||
@@ -201,7 +218,7 @@ msg.de.reactorRSMode.7.txt=比较器模式: 燃料转换[反转]
|
||||
|
||||
//Tool Tips/other localizations ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
info.teleporterInfUnset1.txt=未绑定
|
||||
info.teleporterInfUnset2.txt=单机右键以绑定当前
|
||||
info.teleporterInfUnset2.txt=Shift+右键以绑定当前
|
||||
info.teleporterInfUnset3.txt=x, y, z 坐标
|
||||
info.teleporterInfUnset4.txt=以及你所面对的方向
|
||||
info.teleporterInfUnset5.txt=和你当前的次元
|
||||
@@ -230,9 +247,9 @@ info.de.obliterationMode.txt=删除模式
|
||||
info.de.obliterationModetrue.txt=激活
|
||||
info.de.obliterationModefalse.txt=未激活
|
||||
info.de.miningMode.txt=挖掘模式
|
||||
info.de.changeMiningMode.txt=按Shift并右键来改变挖掘模式
|
||||
info.de.changeMiningMode.txt=按住Shift并右键来改变挖掘模式
|
||||
info.de.toggleOblit.txt=右键切换 删除模式
|
||||
info.de.oblitInfo.txt=删除模式 破坏不重要的方块
|
||||
info.de.oblitInfo.txt=删除模式会销毁不重要的方块
|
||||
info.de.attackDamage.txt=攻击伤害
|
||||
info.de.bonusHealthDamage.txt=生物生命值
|
||||
info.de.press.txt=按下
|
||||
@@ -244,7 +261,7 @@ info.de.sword.txt=你敌人的力量使这把剑变得更强了!
|
||||
|
||||
info.de.safetyMatch.txt=生出一种不会把你的房子烧光的火
|
||||
|
||||
info.draconiumChestInfo1.txt=空手按住Shift右键
|
||||
info.draconiumChestInfo1.txt=空手Shift+右键
|
||||
info.draconiumChestInfo2.txt=以访问颜色设置
|
||||
|
||||
info.de.capacitorMode.txt=模式
|
||||
@@ -275,11 +292,20 @@ info.de.manual.contributorsButton.txt=贡献者
|
||||
info.de.manual.contributorsButtonInfo.txt=那些对龙之研究有贡献的人
|
||||
info.de.shiftRightClickToActivate.txt=Shift + 右键来激活
|
||||
info.de.blockRange.txt=方块范围
|
||||
info.de.status.txt=状态
|
||||
info.de.statusActive.txt=激活
|
||||
info.de.statusInactive.txt=停用
|
||||
info.de.selfPickup.txt=拾取自己的掉落物
|
||||
info.de.selfPickupAlways.txt=总是
|
||||
info.de.selfPickupDelay.txt=延迟
|
||||
info.de.selfPickupNever.txt=从不
|
||||
|
||||
info.de.manual.nav1.txt=导航提示
|
||||
info.de.manual.nav2.txt=按退格键(Backspace)回到上一页
|
||||
info.de.manual.nav3.txt=按住Shift快速浏览
|
||||
|
||||
info.de.dislocatorInhibitor.txt=磁力屏蔽器
|
||||
|
||||
//Energy Net
|
||||
info.de.modeIn.txt=模式:输入
|
||||
info.de.modeOut.txt=模式:输出
|
||||
@@ -292,6 +318,8 @@ info.infusedObsidian.txt=这个方块可以抵抗凋灵
|
||||
|
||||
enchantment.draconicevolution.reaperEnchant=收割者
|
||||
|
||||
nei.recipe.reactor.category=反应堆
|
||||
|
||||
//Achievements ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
draconicevolution.achievementPage.name=龙之研究
|
||||
|
||||
@@ -381,6 +409,7 @@ achievement.draconicevolution.manual=智慧已经满了!
|
||||
achievement.draconicevolution.manual.desc=创造龙之研究信息板
|
||||
|
||||
//InfoHelper ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
info.de.tier.txt=等级
|
||||
info.de.charge.txt=充能
|
||||
info.de.hold.txt=按住
|
||||
info.de.shift.txt=Shift
|
||||
@@ -390,29 +419,29 @@ info.de.forUpgrades.txt=查看有关属性
|
||||
info.de.useUpgradeModifier.txt=用升级调整器加强那些属性!
|
||||
|
||||
//Lore ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
item.draconicevolution:wyvernPickaxe.lore=普通的镐子太菜了,使用龙力,你能增加开采面积和开采速度
|
||||
item.draconicevolution:wyvernShovel.lore=一次一个方块?不是龙力的风格!更快,面积更大,这只是一个开始!
|
||||
item.draconicevolution:wyvernSword.lore=龙力开始解开剑的潜力,剑的范围和攻击力提高了
|
||||
item.draconicevolution:wyvernBow.lore=向一个普通的弓里注入龙力,你会射的更快更强
|
||||
item.draconicevolution:wyvernPickaxe.lore=2普通的镐子太菜了\n通过使用龙力,你提升了开采面积和开采速度
|
||||
item.draconicevolution:wyvernShovel.lore=2一次一个方块?不是龙力的风格!\n更快、面积更大,这只是一个开始!
|
||||
item.draconicevolution:wyvernSword.lore=2龙力开始解放剑的潜力\n剑的范围和攻击力提高了
|
||||
item.draconicevolution:wyvernBow.lore=2向普通的弓里注入龙力\n使你能够射得更快、更强
|
||||
|
||||
item.draconicevolution:wyvernHelm.lore=比钻石更强大,现在可以承受更大的打击
|
||||
item.draconicevolution:wyvernChest.lore=用龙力注入的钻石盔甲,大大增强了防御力
|
||||
item.draconicevolution:wyvernLeggs.lore=钻石护腿也注入了龙力,你现在感到更强更快
|
||||
item.draconicevolution:wyvernBoots.lore=你改善了靴子,它似乎让你更加敏捷
|
||||
item.draconicevolution:wyvernHelm.lore=2比钻石更强大\n现在你可以承受更强的打击了
|
||||
item.draconicevolution:wyvernChest.lore=2通过向盔甲里注入龙力\n你大大增强了它的防御力
|
||||
item.draconicevolution:wyvernLeggs.lore=2向钻石护腿中注入龙力后\n你感觉自己进一步变强变快了
|
||||
item.draconicevolution:wyvernBoots.lore=2你学会了改良靴子\n龙力似乎让你更加身手敏捷
|
||||
|
||||
item.draconicevolution:draconicPickaxe.lore=细心的研究,让你可以挖更大的区域
|
||||
item.draconicevolution:draconicAxe.lore=在大量的试验和错误中,你现在可以一下子砍下一整棵树
|
||||
item.draconicevolution:draconicShovel.lore=更好的效率,你现在可以挖更大的区域
|
||||
item.draconicevolution:draconicHoe.lore=龙力甚至能改善农业,只需点一下整个农田就能耕好
|
||||
item.draconicevolution:draconicSword.lore=双足飞龙是不错,但龙力武器攻击力更加强大,能击杀更多的敌人
|
||||
item.draconicevolution:draconicBow.lore=完美的距离,更快的射击频率,爆炸性的箭头,堪比机枪,你还有什么想要的吗?
|
||||
item.draconicevolution:draconicPickaxe.lore=2细心的研究\n为你带来了挖掘更大区域的能力
|
||||
item.draconicevolution:draconicAxe.lore=2在大量的试错后\n你现在可以一次砍下一整棵树
|
||||
item.draconicevolution:draconicShovel.lore=2效率进一步提升\n你现在可以挖更大的区域了
|
||||
item.draconicevolution:draconicHoe.lore=2龙力甚至能改善农业\n只需一次点击就能耕好整个农田
|
||||
item.draconicevolution:draconicSword.lore=2双足飞龙是不错,但龙力武器\n攻击力更加强大,还能击中更多的敌人
|
||||
item.draconicevolution:draconicBow.lore=2顶级的距离,更快的射击频率\n还有爆炸性的箭头,夫复何求?
|
||||
|
||||
item.draconicevolution:draconicHelm.lore=麻麻我再也不怕黑夜啦,你现在无论什么时候都看得见了
|
||||
item.draconicevolution:draconicChest.lore=龙心使得你更强大,拥有了飞行的能力
|
||||
item.draconicevolution:draconicLeggs.lore=更强的装备,龙力灵魂保护着你,使你跑得更快
|
||||
item.draconicevolution:draconicBoots.lore=更强,更快,更好,龙的心脏授予了你跳的更高的权力
|
||||
item.draconicevolution:draconicHelm.lore=2畏惧黑夜的日子一去不复返\n你现在无论什么时候都看得见了
|
||||
item.draconicevolution:draconicChest.lore=2龙心使你变得更加强大\n还拥有了飞行的能力
|
||||
item.draconicevolution:draconicLeggs.lore=2盔甲强度,更上一层楼\n龙的灵魂保护着你,使你跑得更快
|
||||
item.draconicevolution:draconicBoots.lore=2更强,更快,更好\n龙的心脏让你能够跳得更高
|
||||
|
||||
item.draconicevolution:draconicDistructionStaff.lore=通过一条又长又艰苦的路后,你发现了真正的力量!一个工具就能做所有事:挖矿、战斗和死亡!
|
||||
item.draconicevolution:draconicDistructionStaff.lore=2在漫长而艰辛的旅程后,你发现了真正的力量!\n一把工具就能执行一切任务:挖矿、战斗和死亡!
|
||||
|
||||
//Entity ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
entity.DraconicEvolution.EnderDragon.name=上古末影龙
|
||||
@@ -425,20 +454,21 @@ key.toolConfig=工具和装甲配置 GUI
|
||||
key.toolProfileChange=更改工具配置
|
||||
key.toggleFlight=切换创造飞行模式
|
||||
key.toggleMagnet=开关物品错位器
|
||||
key.toggleMagnetSelfPickup=切换磁铁拾取功能
|
||||
|
||||
//Damage ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
death.attack.chaos=被混沌守卫撕裂
|
||||
death.attack.damage.de.fusionExplode=被爆发的高能量融合物蒸发
|
||||
death.attack.chaosBurst=被暗能量毁灭
|
||||
death.attack.chaos=%1$s被混沌守卫撕裂
|
||||
death.attack.damage.de.fusionExplode=%1$s被爆发的高能量融合物蒸发
|
||||
death.attack.chaosBurst=%1$s被暗能量毁灭
|
||||
|
||||
death.attack.de.GuardianFireball=被混沌守卫燃烧炸死
|
||||
death.attack.de.GuardianEnergyBall=像一只小虫子一样被混沌守卫击溃
|
||||
death.attack.de.GuardianChaosBall=被混沌守卫的暗能量覆灭
|
||||
death.attack.de.GuardianFireball=%1$s被混沌守卫燃烧炸死
|
||||
death.attack.de.GuardianEnergyBall=%1$s像一只小虫子一样被混沌守卫击溃
|
||||
death.attack.de.GuardianChaosBall=%1$s被混沌守卫的暗能量覆灭
|
||||
|
||||
death.attack.chaosImplosion=被拉进一个能量漩涡,被永远的遗忘
|
||||
death.attack.chrystalMoved=太顽皮而被龙息惩罚
|
||||
death.attack.chaosImplosion=%1$s被拉进一个能量漩涡后泯灭了
|
||||
death.attack.chrystalMoved=%1$s太顽皮而被龙之研究惩罚了!
|
||||
|
||||
death.attack.administrative.kill=%1$s 被不可阻止的力量打倒了
|
||||
death.attack.administrative.kill=%1$s被不可阻止的力量打倒了
|
||||
|
||||
//Buttons ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
button.de.chestAutoFeed0.txt=关闭.关闭自动补充燃料
|
||||
@@ -484,6 +514,12 @@ button.de.EffectiveOnSprint.name=有效的冲刺
|
||||
button.de.GogglesOfRevealing.name=神奇的感觉
|
||||
button.de.ApiaristArmor.name=养蜂员护甲
|
||||
button.de.NaturalistArmor.name=自然科学家视角
|
||||
button.de.HazmatElectrical.name=电气危险防护
|
||||
button.de.HazmatBiological.name=生物危害防护
|
||||
button.de.HazmatFrost.name=霜冻危害防护
|
||||
button.de.HazmatGas.name=气体危害防护
|
||||
button.de.HazmatHeat.name=高温危害防护
|
||||
button.de.HazmatRadiological.name=辐射危害防护
|
||||
button.de.BowArrowSpeedModifier.name=弓箭速率调整器
|
||||
button.de.BowAutoFire.name=自动开火
|
||||
button.de.BowArrowDamage.name=基本伤害
|
||||
@@ -491,6 +527,8 @@ button.de.BowExplosionPower.name=爆炸性的力量
|
||||
button.de.BowShockWavePower.name=激波力量
|
||||
button.de.BowEnergyBolt.name=龙火之矢
|
||||
button.de.BowZoomModifier.name=放大
|
||||
button.de.Enabled.name=启用
|
||||
button.de.MagnetSneak.name=潜行时禁用
|
||||
|
||||
button.de.reactorCharge.txt=反应堆充能
|
||||
button.de.reactorStart.txt=激活
|
||||
@@ -525,6 +563,50 @@ gui.de.genRate.name=产生效率
|
||||
gui.de.fieldInputRate.name=场输入率
|
||||
gui.de.fuelConversion.name=燃料转化率
|
||||
|
||||
gui.de.particleGenerator.random.name=随机:
|
||||
gui.de.particleGenerator.red.name=红:
|
||||
gui.de.particleGenerator.green.name=绿:
|
||||
gui.de.particleGenerator.blue.name=蓝:
|
||||
gui.de.particleGenerator.motionX.name=移动 X:
|
||||
gui.de.particleGenerator.motionY.name=移动 Y:
|
||||
gui.de.particleGenerator.motionZ.name=移动 Z:
|
||||
gui.de.particleGenerator.scale.name=放缩:
|
||||
gui.de.particleGenerator.life.name=生命(T):
|
||||
gui.de.particleGenerator.spawnX.name=生成 X:
|
||||
gui.de.particleGenerator.spawnY.name=生成 Y:
|
||||
gui.de.particleGenerator.spawnZ.name=生成 Z:
|
||||
gui.de.particleGenerator.delay.name=延迟:
|
||||
gui.de.particleGenerator.fade.name=淡出:
|
||||
gui.de.particleGenerator.gravity.name=重力:
|
||||
gui.de.particleGenerator.pitch.name=俯仰:
|
||||
gui.de.particleGenerator.yaw.name=偏航:
|
||||
gui.de.particleGenerator.rotation.name=旋转:
|
||||
gui.de.particleGenerator.length.name=长度:
|
||||
|
||||
gui.de.particleGenerator.main.title=粒子发生器
|
||||
gui.de.particleGenerator.beam.title=光束发生器
|
||||
gui.de.particleGenerator.info.title=信息
|
||||
|
||||
gui.de.particleGenerator.hold.name=按住:
|
||||
gui.de.particleGenerator.info.name=i
|
||||
gui.de.particleGenerator.back.name=后退
|
||||
gui.de.particleGenerator.page.name=页码:%d
|
||||
gui.de.particleGenerator.blockCollision.name=方块碰撞: %s
|
||||
gui.de.particleGenerator.particleSelected.name=选择的粒子:%d
|
||||
gui.de.particleGenerator.enabled.name=启用:%s
|
||||
gui.de.particleGenerator.renderCore.name=渲染核心:%s
|
||||
gui.de.particleGenerator.saveSettings.name=记录数值
|
||||
|
||||
gui.de.particleGenerator.info.1= 粒子发生器是可以让你自由创建粒子特效的装饰性设备。\n 这个设备用起来非常简单,你只要修改界面上的一些字段(变量)就能改变生成的粒子的样式和行为。\n 这个方块仍在开发中,新的特性和粒子可能会在未来的版本中加入。\n 下面的列表包含了所有的字段以及它们的用途。
|
||||
gui.de.particleGenerator.info.2= 首先需要关注的是大多数字段后都跟着一个随机值,可以给字段加上一个从0到最大(或者最小)的随机值。\n -开头的三个字段(红,绿,蓝)控制粒子的颜色。大多数人应该都熟悉这套颜色系统,如果不熟悉的话就百度一下。注意:每个颜色的最大值不能超过255,因此颜色字段限制了随机值。例如如果颜色值被设置为255,而随机值被设置为20,那么实际值永远还是255。
|
||||
gui.de.particleGenerator.info.3= - 接下来的三个字段(移动X,Y,Z)控制粒子的方向和移动速度。\n -“生存时间”字段设定粒子消失前能存在多久(单位tick)。\n -“放缩”字段设定粒子的大小。\n -接下来的三个字段(生成 X,Y,Z)控制粒子的生成位置(相对于粒子发生器的位置)。
|
||||
gui.de.particleGenerator.info.4= -“延迟”字段设定每个粒子生成的延迟时间(单位tick),例如1=20/s,20=1/s,100=1/5s。\n -“淡出”字段设定粒子消失时的淡出时间(单位tick)。注意:这会加到粒子的生存时间上。\n -“重力”字段设定粒子如何被重力影响。\n -“方块碰撞”决定粒子是否会与方块碰撞。\n -“选择的粒子”可以在不同的可选的粒子间切换。
|
||||
gui.de.particleGenerator.info.5.title=红石控制\n\n
|
||||
gui.de.particleGenerator.info.5= 默认情况下需要红石信号来让发生器工作。\n 然而如果你空手按住shift右击发生器,会让它进入反转模式。\n 发生器的8个角上的小方块表示了当前的红石模式。
|
||||
gui.de.particleGenerator.info.6.title=计算机控制\n\n
|
||||
gui.de.particleGenerator.info.6= 发生器可以被计算机控制。\n 它提供了一些相对直白的API:\n\n setGeneratorProperty(property, value)\n getGeneratorState()\n resetGeneratorState()
|
||||
gui.de.particleGenerator.info.7= 发生器的整体状态可以通过getGeneratorState获得,使用setGeneratorProperty可以一次修改一个属性。属性名字是字符串,而且几乎都与英文版 GUI 上的标签相同。
|
||||
|
||||
gui.de.insert.txt=插入
|
||||
gui.de.extract.txt=提取
|
||||
gui.de.fuel.txt=燃料
|
||||
@@ -589,6 +671,16 @@ gui.de.ShieldRecovery.txt=护甲回复
|
||||
gui.de.MoveSpeed.txt=移动速度
|
||||
gui.de.JumpBoost.txt=跳跃提升
|
||||
|
||||
gui.de.dislocatorInhibitor.range.txt=范围:
|
||||
gui.de.dislocatorInhibitor.tooltip.range.increase.txt=增加范围
|
||||
gui.de.dislocatorInhibitor.tooltip.range.decrease.txt=减少范围
|
||||
gui.de.dislocatorInhibitor.tooltip.activity.always.txt=总是激活
|
||||
gui.de.dislocatorInhibitor.tooltip.activity.with.txt=红石信号激活
|
||||
gui.de.dislocatorInhibitor.tooltip.activity.without.txt=无红石信号时激活
|
||||
gui.de.dislocatorInhibitor.tooltip.activity.never.txt=总是停用
|
||||
gui.de.dislocatorInhibitor.tooltip.activity.cycle.txt=点击循环切换激活控制
|
||||
gui.de.dislocatorInhibitor.tooltip.whitelist.txt=过滤器内的物品不会被磁铁吸走
|
||||
gui.de.dislocatorInhibitor.tooltip.blacklist.txt=只有过滤器里的物品才会被磁铁吸走
|
||||
|
||||
//Potions ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
potion.de.effect.txt=效果
|
||||
@@ -597,5 +689,3 @@ potion.de.highStep.txt=自动跳跃
|
||||
potion.de.swiftness.txt=速度
|
||||
potion.de.fireImmune.txt=抗火
|
||||
potion.de.jumpBoost.txt=跳跃提升
|
||||
|
||||
item.draconicevolution:draconicAxe.lore=2经过多次尝试与失败后\n你现在可以一下就砍倒一整棵树
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.6 KiB |