Compare commits
No commits in common. "MC1.12" and "panelCleanup" have entirely different histories.
MC1.12
...
panelClean
493
build.gradle
493
build.gradle
|
@ -1,251 +1,242 @@
|
|||
import groovy.json.JsonOutput
|
||||
|
||||
def mainVersion = "1.7"
|
||||
def buildNumber = "38"
|
||||
|
||||
// For those who want the bleeding edge
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
apply plugin: 'idea'
|
||||
|
||||
/*
|
||||
// for people who want stable - not yet functional for MC 1.8.8 - we require the forgegradle 2.1 snapshot
|
||||
plugins {
|
||||
id "net.minecraftforge.gradle.forge" version "2.0.2"
|
||||
}
|
||||
*/
|
||||
version = "${mainVersion}-${buildNumber}"
|
||||
group= "malte0811"
|
||||
archivesBaseName = "IndustrialWires"
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
minecraft {
|
||||
version = "1.12.2-14.23.5.2847"
|
||||
runDir = "run"
|
||||
|
||||
replace '${version}', project.version
|
||||
mappings = "stable_39"
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name 'ic2'
|
||||
url 'http://maven.ic2.player.to/'
|
||||
}
|
||||
maven {
|
||||
name 'tr'
|
||||
url 'http://maven.modmuss50.me'
|
||||
}
|
||||
maven {
|
||||
name 'jared maven'
|
||||
url 'http://blamejared.com/maven'
|
||||
}
|
||||
maven { // Albedo/Mirage Lights
|
||||
url 'https://repo.elytradev.com/'
|
||||
}
|
||||
maven { // JEI & Tinkers
|
||||
name 'DVS1 Maven FS'
|
||||
url 'http://dvs1.progwml6.com/files/maven'
|
||||
}
|
||||
// dependencies of TR...
|
||||
maven {
|
||||
|
||||
url 'http://maven.mcmoddev.com'
|
||||
}
|
||||
maven {
|
||||
// HWYLA
|
||||
name "TehNut"
|
||||
url "http://tehnut.info/maven/"
|
||||
}
|
||||
repositories {//Curseforge maven for project red
|
||||
maven {
|
||||
name = "CurseForge"
|
||||
url = "https://minecraft.curseforge.com/api/maven/"
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "chickenbones"
|
||||
url = "http://chickenbones.net/maven"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'net.industrial-craft:industrialcraft-2:2.8.+'
|
||||
deobfCompile "blusunrize:ImmersiveEngineering:0.12-+"
|
||||
compileOnly "pl.asie.charset:charset:0.5.6.4.19:full"
|
||||
//Project red and runtime dependencies
|
||||
compileOnly "project-red-base:ProjectRed-1.12.2:4.9.1.92:Base"
|
||||
//runtime "project-red-integration:ProjectRed-1.12.2:4.9.1.92:integration"
|
||||
//runtime "forge-multipart-cbe:ForgeMultipart-1.12.2:2.5.0.69:universal"
|
||||
//runtime "codechicken:CodeChickenLib:1.12.2-3.2.1.349:universal"
|
||||
//runtime "codechicken:ChickenASM:1.12-1.0.2.7"
|
||||
//runtime "mrtjpcore:MrTJPCore-1.12.2:2.1.3.35:universal"
|
||||
//Tech Reborn
|
||||
compileOnly "TechReborn:TechReborn-1.12:2.6.9.7:universal"
|
||||
compileOnly "RebornCore:RebornCore-1.12:3.2.+:universal"
|
||||
//Others
|
||||
//TODO do something about this
|
||||
// compileOnly 'com.elytradev:mirage:2.0.1-SNAPSHOT'
|
||||
compileOnly "mezz.jei:jei_1.12:4.+"
|
||||
compileOnly "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.8.460"
|
||||
compile 'com.elytradev:mirage:2.0.3-rc3-SNAPSHOT'
|
||||
compile "gregtechce:gregtech:1.12.2:1.9.0.481"
|
||||
compile "magneticraft:Magneticraft_1.12:2.8.2:dev"
|
||||
|
||||
}
|
||||
|
||||
jar {
|
||||
from 'LICENSE'
|
||||
manifest {
|
||||
attributes 'Maven-Artifact': group+':'+archivesBaseName+':'+version
|
||||
attributes "FMLAT": "industrialwires_at.cfg"
|
||||
}
|
||||
}
|
||||
|
||||
task signMain(type: SignJar) {
|
||||
onlyIf {
|
||||
project.hasProperty('keyStore')
|
||||
}
|
||||
dependsOn reobfJar
|
||||
if (project.hasProperty('keyStore')) {
|
||||
keyStore = project.keyStore
|
||||
alias = project.storeAlias
|
||||
storePass = project.storePass
|
||||
keyPass = project.storePass
|
||||
inputFile = jar.archivePath
|
||||
outputFile = jar.archivePath
|
||||
}
|
||||
}
|
||||
|
||||
build.dependsOn signMain
|
||||
|
||||
processResources
|
||||
{
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
||||
//Code for automatic update JSON generation
|
||||
class GenerateUpdateJSON extends DefaultTask {
|
||||
static def IW_VERSION_PREFIX = "####Version "
|
||||
static def MC_VERSION_PREFIX = "###Minecraft "
|
||||
static def UNFINISHED_SUFFIX = " - UNFINISHED"
|
||||
static def RECOMMENDED = "-recommended"
|
||||
static def LATEST = "-latest"
|
||||
static def CF_URL = "https://minecraft.curseforge.com/projects/industrial-wires"
|
||||
|
||||
int compareVersions(String vA, String vB) {
|
||||
String[] vPartsA = vA.split("[\\D]")
|
||||
String[] vPartsB = vB.split("[\\D]")
|
||||
if (vPartsA.length==0&&vPartsB.length==0)
|
||||
return vA <=> vB
|
||||
else if (vPartsA.length==0)
|
||||
return -1
|
||||
else if (vPartsB.length==0)
|
||||
return 1
|
||||
|
||||
int length = Math.min(vPartsA.length, vPartsB.length)
|
||||
for (int i = 0;i<length;i++) {
|
||||
int pA = Integer.parseInt(vPartsA[i])
|
||||
int pB = Integer.parseInt(vPartsB[i])
|
||||
if (pA!=pB) {
|
||||
return pA<=>pB
|
||||
}
|
||||
}
|
||||
if (vPartsA.length != vPartsB.length)
|
||||
return vPartsA.length <=> vPartsB.length
|
||||
return vA <=> vB
|
||||
}
|
||||
|
||||
def addChangelog(Map<String, Map<String, String>> changelogForVersions, Map<String, String> promos,
|
||||
String currentMCVersion, String currentVersion, String currentChangelog) {
|
||||
if (!changelogForVersions.containsKey(currentMCVersion)) {
|
||||
promos.put(currentMCVersion+RECOMMENDED, currentVersion)
|
||||
promos.put(currentMCVersion+LATEST, currentVersion)
|
||||
changelogForVersions[currentMCVersion] = new TreeMap<>({String s1, String s2->
|
||||
compareVersions(s1, s2)})
|
||||
}
|
||||
changelogForVersions[currentMCVersion][currentVersion] = currentChangelog
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
def generate() {
|
||||
File changelog = new File("changelog.md")
|
||||
if (!changelog.exists())
|
||||
println "Changelog does not exist! Aborting!"
|
||||
else {
|
||||
String currentMCVersion = "";
|
||||
Map<String, Map<String, String>> changelogForVersions = new HashMap<>()
|
||||
Map<String, String> promos = new TreeMap<>({String s1, String s2->
|
||||
compareVersions(s1, s2)})
|
||||
String currentVersion = null
|
||||
String currentChangelog = ""
|
||||
changelog.eachLine {line ->
|
||||
if (line.startsWith(IW_VERSION_PREFIX)) {
|
||||
if (currentVersion!=null) {
|
||||
addChangelog(changelogForVersions, promos, currentMCVersion, currentVersion, currentChangelog)
|
||||
}
|
||||
if (!line.endsWith(UNFINISHED_SUFFIX)) {
|
||||
currentVersion = line.substring(IW_VERSION_PREFIX.length())
|
||||
} else {
|
||||
currentVersion = (String) null
|
||||
}
|
||||
currentChangelog = ""
|
||||
} else if (line.startsWith(MC_VERSION_PREFIX)) {
|
||||
if (currentVersion!=null) {
|
||||
addChangelog(changelogForVersions, promos, currentMCVersion, currentVersion, currentChangelog)
|
||||
}
|
||||
currentChangelog = ""
|
||||
currentVersion = (String) null
|
||||
currentMCVersion = line.substring(MC_VERSION_PREFIX.length())
|
||||
} else if (!line.isEmpty()) {
|
||||
if (currentChangelog.length()==0)
|
||||
currentChangelog += line
|
||||
else
|
||||
currentChangelog += "\n"+line
|
||||
}
|
||||
}
|
||||
Map<String, Object> mainMap = new TreeMap<>({String s1, String s2->
|
||||
compareVersions(s1, s2)})
|
||||
mainMap.putAll(changelogForVersions)
|
||||
mainMap["homepage"] = CF_URL
|
||||
mainMap["promos"] = promos
|
||||
def outJson = JsonOutput.toJson(mainMap)
|
||||
outJson = JsonOutput.prettyPrint(outJson)
|
||||
File outF = new File("changelog.json")
|
||||
outF.delete()
|
||||
outF << outJson
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task updateJson(type: GenerateUpdateJSON)
|
||||
|
||||
build.finalizedBy updateJson
|
||||
import groovy.json.JsonOutput
|
||||
|
||||
def mainVersion = "1.7"
|
||||
def buildNumber = "27"
|
||||
|
||||
// For those who want the bleeding edge
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
|
||||
/*
|
||||
// for people who want stable - not yet functional for MC 1.8.8 - we require the forgegradle 2.1 snapshot
|
||||
plugins {
|
||||
id "net.minecraftforge.gradle.forge" version "2.0.2"
|
||||
}
|
||||
*/
|
||||
version = "${mainVersion}-${buildNumber}"
|
||||
group= "malte0811"
|
||||
archivesBaseName = "IndustrialWires"
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
minecraft {
|
||||
version = "14.23.4.2745"
|
||||
runDir = "run"
|
||||
|
||||
replace '${version}', project.version
|
||||
mappings = "snapshot_20171003"
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name 'ic2'
|
||||
url 'http://maven.ic2.player.to/'
|
||||
}
|
||||
maven {
|
||||
name 'tr'
|
||||
url 'http://maven.modmuss50.me'
|
||||
}
|
||||
maven {
|
||||
name 'jared maven'
|
||||
url 'http://blamejared.com/maven'
|
||||
}
|
||||
maven { // Albedo/Mirage Lights
|
||||
url 'https://repo.elytradev.com/'
|
||||
}
|
||||
maven { // JEI & Tinkers
|
||||
name 'DVS1 Maven FS'
|
||||
url 'http://dvs1.progwml6.com/files/maven'
|
||||
}
|
||||
// dependencies of TR...
|
||||
maven {
|
||||
|
||||
url 'http://maven.mcmoddev.com'
|
||||
}
|
||||
maven {
|
||||
// HWYLA
|
||||
name "TehNut"
|
||||
url "http://tehnut.info/maven/"
|
||||
}
|
||||
repositories {//Curseforge maven for project red
|
||||
maven {
|
||||
name = "CurseForge"
|
||||
url = "https://minecraft.curseforge.com/api/maven/"
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "chickenbones"
|
||||
url = "http://chickenbones.net/maven"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
deobfCompile 'net.industrial-craft:industrialcraft-2:2.8.+'
|
||||
deobfCompile "blusunrize:ImmersiveEngineering:0.12-+"
|
||||
deobfCompile "project-red-base:ProjectRed-1.12.2:4.9.1.92:Base"
|
||||
runtime "project-red-integration:ProjectRed-1.12.2:4.9.1.92:integration"
|
||||
runtime "forge-multipart-cbe:ForgeMultipart-1.12.2:2.5.0.69:universal"
|
||||
runtime "codechicken:CodeChickenLib:1.12.2-3.2.1.349:universal"
|
||||
runtime "codechicken:ChickenASM:1.12-1.0.2.7"
|
||||
runtime "mrtjpcore:MrTJPCore-1.12.2:2.1.3.35:universal"
|
||||
compileOnly "TechReborn:TechReborn-1.12:2.6.+:dev"
|
||||
compileOnly "RebornCore:RebornCore-1.12:3.2.+:dev"
|
||||
compileOnly 'com.elytradev:mirage:2.0.1-SNAPSHOT'
|
||||
compileOnly "mezz.jei:jei_1.12:4.+"
|
||||
compileOnly "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.8.460"
|
||||
|
||||
}
|
||||
|
||||
jar {
|
||||
from 'LICENSE'
|
||||
manifest {
|
||||
attributes 'Maven-Artifact': group+':'+archivesBaseName+':'+version
|
||||
attributes "FMLAT": "industrialwires_at.cfg"
|
||||
}
|
||||
}
|
||||
|
||||
task signMain(type: SignJar) {
|
||||
onlyIf {
|
||||
project.hasProperty('keyStore')
|
||||
}
|
||||
dependsOn reobfJar
|
||||
if (project.hasProperty('keyStore')) {
|
||||
keyStore = project.keyStore
|
||||
alias = project.storeAlias
|
||||
storePass = project.storePass
|
||||
keyPass = project.storePass
|
||||
inputFile = jar.archivePath
|
||||
outputFile = jar.archivePath
|
||||
}
|
||||
}
|
||||
|
||||
build.dependsOn signMain
|
||||
|
||||
processResources
|
||||
{
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
||||
//Code for automatic update JSON generation
|
||||
class GenerateUpdateJSON extends DefaultTask {
|
||||
static def IW_VERSION_PREFIX = "####Version "
|
||||
static def MC_VERSION_PREFIX = "###Minecraft "
|
||||
static def UNFINISHED_SUFFIX = " - UNFINISHED"
|
||||
static def RECOMMENDED = "-recommended"
|
||||
static def LATEST = "-latest"
|
||||
static def CF_URL = "https://minecraft.curseforge.com/projects/industrial-wires"
|
||||
|
||||
int compareVersions(String vA, String vB) {
|
||||
String[] vPartsA = vA.split("[\\D]")
|
||||
String[] vPartsB = vB.split("[\\D]")
|
||||
if (vPartsA.length==0&&vPartsB.length==0)
|
||||
return vA <=> vB
|
||||
else if (vPartsA.length==0)
|
||||
return -1
|
||||
else if (vPartsB.length==0)
|
||||
return 1
|
||||
|
||||
int length = Math.min(vPartsA.length, vPartsB.length)
|
||||
for (int i = 0;i<length;i++) {
|
||||
int pA = Integer.parseInt(vPartsA[i])
|
||||
int pB = Integer.parseInt(vPartsB[i])
|
||||
if (pA!=pB) {
|
||||
return pA<=>pB
|
||||
}
|
||||
}
|
||||
if (vPartsA.length != vPartsB.length)
|
||||
return vPartsA.length <=> vPartsB.length
|
||||
return vA <=> vB
|
||||
}
|
||||
|
||||
def addChangelog(Map<String, Map<String, String>> changelogForVersions, Map<String, String> promos,
|
||||
String currentMCVersion, String currentVersion, String currentChangelog) {
|
||||
if (!changelogForVersions.containsKey(currentMCVersion)) {
|
||||
promos.put(currentMCVersion+RECOMMENDED, currentVersion)
|
||||
promos.put(currentMCVersion+LATEST, currentVersion)
|
||||
changelogForVersions[currentMCVersion] = new TreeMap<>({String s1, String s2->
|
||||
compareVersions(s1, s2)})
|
||||
}
|
||||
changelogForVersions[currentMCVersion][currentVersion] = currentChangelog
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
def generate() {
|
||||
File changelog = new File("changelog.md")
|
||||
if (!changelog.exists())
|
||||
println "Changelog does not exist! Aborting!"
|
||||
else {
|
||||
String currentMCVersion = "";
|
||||
Map<String, Map<String, String>> changelogForVersions = new HashMap<>()
|
||||
Map<String, String> promos = new TreeMap<>({String s1, String s2->
|
||||
compareVersions(s1, s2)})
|
||||
String currentVersion = null
|
||||
String currentChangelog = ""
|
||||
changelog.eachLine {line ->
|
||||
if (line.startsWith(IW_VERSION_PREFIX)) {
|
||||
if (currentVersion!=null) {
|
||||
addChangelog(changelogForVersions, promos, currentMCVersion, currentVersion, currentChangelog)
|
||||
}
|
||||
if (!line.endsWith(UNFINISHED_SUFFIX)) {
|
||||
currentVersion = line.substring(IW_VERSION_PREFIX.length())
|
||||
} else {
|
||||
currentVersion = (String) null
|
||||
}
|
||||
currentChangelog = ""
|
||||
} else if (line.startsWith(MC_VERSION_PREFIX)) {
|
||||
if (currentVersion!=null) {
|
||||
addChangelog(changelogForVersions, promos, currentMCVersion, currentVersion, currentChangelog)
|
||||
}
|
||||
currentChangelog = ""
|
||||
currentVersion = (String) null
|
||||
currentMCVersion = line.substring(MC_VERSION_PREFIX.length())
|
||||
} else if (!line.isEmpty()) {
|
||||
if (currentChangelog.length()==0)
|
||||
currentChangelog += line
|
||||
else
|
||||
currentChangelog += "\n"+line
|
||||
}
|
||||
}
|
||||
Map<String, Object> mainMap = new TreeMap<>({String s1, String s2->
|
||||
compareVersions(s1, s2)})
|
||||
mainMap.putAll(changelogForVersions)
|
||||
mainMap["homepage"] = CF_URL
|
||||
mainMap["promos"] = promos
|
||||
def outJson = JsonOutput.toJson(mainMap)
|
||||
outJson = JsonOutput.prettyPrint(outJson)
|
||||
File outF = new File("changelog.json")
|
||||
outF.delete()
|
||||
outF << outJson
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task updateJson(type: GenerateUpdateJSON)
|
||||
|
||||
build.finalizedBy updateJson
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
"1.10.2-recommended": "1.4-18",
|
||||
"1.11.2-latest": "1.5-19",
|
||||
"1.11.2-recommended": "1.5-19",
|
||||
"1.12.2-latest": "1.7-36",
|
||||
"1.12.2-recommended": "1.7-36"
|
||||
"1.12.2-latest": "1.7-27",
|
||||
"1.12.2-recommended": "1.7-27"
|
||||
},
|
||||
"1.10.2": {
|
||||
"1.1-3": " - fixed incompatibility with IE build 48\n - reduced the amount of calls to core IE classes to make such incompatibilities less likely\n - fixed localization of the creative tab",
|
||||
|
@ -37,15 +37,6 @@
|
|||
"1.6-24": " - Fixed an infinite energy bug\n - Changed the default value for maximum energy conversion",
|
||||
"1.6-25": " - Updated to IE build 77\n - IC2 wires cause damage\n - Added insulated versions of gold, copper and tin wires. Due to heat sensitive insulation the transfer capacity is half of the normal capacity\n - Added feedthrough insulators for all IC2 wire types\n - Wire coils now automatically \"merge\" when picked up\n - Config values are applied to the game directly now",
|
||||
"1.7-26": " - Added Mechanical Multiblocks (energy storage and EU<->FE conversion)\n - There will be an explanation video for these once I have time to make one\n - Fixed the small mechanical converter blowing up tin wires\n - Fixed wires not joining their outputs correctly\n - Fixed wire connectors not breaking when the block they're on is broken",
|
||||
"1.7-27": " - Fixed panel components causing issues on dedicated servers\n - Added an automatic update checker (Using the Forge update JSON)",
|
||||
"1.7-28": " - Added the Redstone Controller: Others, it allows control panels to interface with Project:Red and Charset wires\n - Rewrote the control panel redstone code\n - Added localization for IW's multiblocks\n - Fixed issues with zero-length mechanical multiblocks",
|
||||
"1.7-29": " - The wires can now transmit FE as well as EU, but not both at once\n - Fixed the Marx generator not charging beyond a quite low voltage",
|
||||
"1.7-30": " - Fixed crashes when IC2 isn't installed\n - Fixed connectors allowing too much power output\n - Added a config option for some of the wires' properties\n - Updated chinese translation (thanks @DepletedPrism)",
|
||||
"1.7-31": " - Fixed accidental conversion from FE to EU\n - Fixed connectors not blowing up as intended\n ",
|
||||
"1.7-32": " - Fixed connectors not rendering properly without IC2\n - Fixed parts of the mechanical multiblocks not rendering when Optifine is installed\n - Changed some values for the mechanical multiblock sound",
|
||||
"1.7-33": " - Fixed the Marx generator not processing ores\n - Fixed control panels and the Marx generator not working when connected directly\n - Added Russian translation (thanks @StolenSoda)",
|
||||
"1.7-34": " - Control panels can use the texture of any block now\n - Added a recipe to copy the settings of an unfinished control panel\n - The Marx generator now returns the wires used in its construction when disassembled\n - Fixed the RS controller for non-IE wires not keeping its IO state on world reload\n - Fixed control panels not working correctly with multiple controllers",
|
||||
"1.7-35": " - Fixed a crash when placing certain items in the crafting grid",
|
||||
"1.7-36": " - Added an RGB indicator light, controlled by 3 (independent) RS signals\n - Fixed a bug allowing for unfinished control panels to be duplicated\n - Fixed insulated and uninsulated wire producing the same wire coils\n - Fixed some issues (including a crash) with the IE RS controller on dedicated servers"
|
||||
"1.7-27": " - Fixed panel components causing issues on dedicated servers\n - Added an automatic update checker (Using the Forge update JSON)"
|
||||
}
|
||||
}
|
48
changelog.md
48
changelog.md
|
@ -1,51 +1,5 @@
|
|||
###Minecraft 1.12.2
|
||||
|
||||
####Version 1.7-36
|
||||
- Added an RGB indicator light, controlled by 3 (independent) RS signals
|
||||
- Fixed a bug allowing for unfinished control panels to be duplicated
|
||||
- Fixed insulated and uninsulated wire producing the same wire coils
|
||||
- Fixed some issues (including a crash) with the IE RS controller on dedicated servers
|
||||
|
||||
####Version 1.7-35
|
||||
- Fixed a crash when placing certain items in the crafting grid
|
||||
|
||||
####Version 1.7-34
|
||||
- Control panels can use the texture of any block now
|
||||
- Added a recipe to copy the settings of an unfinished control panel
|
||||
- The Marx generator now returns the wires used in its construction when disassembled
|
||||
- Fixed the RS controller for non-IE wires not keeping its IO state on world reload
|
||||
- Fixed control panels not working correctly with multiple controllers
|
||||
|
||||
####Version 1.7-33
|
||||
- Fixed the Marx generator not processing ores
|
||||
- Fixed control panels and the Marx generator not working when connected directly
|
||||
- Added Russian translation (thanks @StolenSoda)
|
||||
|
||||
####Version 1.7-32
|
||||
- Fixed connectors not rendering properly without IC2
|
||||
- Fixed parts of the mechanical multiblocks not rendering when Optifine is installed
|
||||
- Changed some values for the mechanical multiblock sound
|
||||
|
||||
####Version 1.7-31
|
||||
- Fixed accidental conversion from FE to EU
|
||||
- Fixed connectors not blowing up as intended
|
||||
|
||||
####Version 1.7-30
|
||||
- Fixed crashes when IC2 isn't installed
|
||||
- Fixed connectors allowing too much power output
|
||||
- Added a config option for some of the wires' properties
|
||||
- Updated chinese translation (thanks @DepletedPrism)
|
||||
|
||||
####Version 1.7-29
|
||||
- The wires can now transmit FE as well as EU, but not both at once
|
||||
- Fixed the Marx generator not charging beyond a quite low voltage
|
||||
|
||||
####Version 1.7-28
|
||||
- Added the Redstone Controller: Others, it allows control panels to interface with Project:Red and Charset wires
|
||||
- Rewrote the control panel redstone code
|
||||
- Added localization for IW's multiblocks
|
||||
- Fixed issues with zero-length mechanical multiblocks
|
||||
|
||||
####Version 1.7-27
|
||||
- Fixed panel components causing issues on dedicated servers
|
||||
- Added an automatic update checker (Using the Forge update JSON)
|
||||
|
@ -199,4 +153,4 @@
|
|||
- wire coils are crafted by placing any amount of IC2 cables and/or the corresponding wire coils in a crafting table now
|
||||
- added Glass Fiber Wire
|
||||
- changed license to GPL3
|
||||
- changed the amount of connectors/relays the recipes yield
|
||||
- changed the amount of connectors/relays the recipes yield
|
|
@ -12,21 +12,20 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires;
|
||||
package malte0811.industrialWires;
|
||||
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityPanelCreator;
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityRSPanel;
|
||||
import malte0811.industrialwires.blocks.converter.TileEntityMechMB;
|
||||
import malte0811.industrialwires.blocks.hv.TileEntityJacobsLadder;
|
||||
import malte0811.industrialwires.blocks.hv.TileEntityMarx;
|
||||
import malte0811.industrialwires.containers.ContainerPanelComponent;
|
||||
import malte0811.industrialwires.containers.ContainerPanelCreator;
|
||||
import malte0811.industrialwires.containers.ContainerRSPanelConn;
|
||||
import malte0811.industrialwires.containers.ContainerRenameKey;
|
||||
import malte0811.industrialwires.mech_mb.MechEnergy;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanelCreator;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityRSPanel;
|
||||
import malte0811.industrialWires.blocks.converter.TileEntityMechMB;
|
||||
import malte0811.industrialWires.blocks.hv.TileEntityJacobsLadder;
|
||||
import malte0811.industrialWires.blocks.hv.TileEntityMarx;
|
||||
import malte0811.industrialWires.containers.ContainerPanelComponent;
|
||||
import malte0811.industrialWires.containers.ContainerPanelCreator;
|
||||
import malte0811.industrialWires.containers.ContainerRSPanelConn;
|
||||
import malte0811.industrialWires.containers.ContainerRenameKey;
|
||||
import malte0811.industrialWires.mech_mb.MechEnergy;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumHand;
|
||||
|
@ -91,8 +90,4 @@ public class CommonProxy implements IGuiHandler {
|
|||
public boolean isSingleplayer() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isValidTextureSource(ItemStack stack) {
|
||||
return stack.getItem() instanceof ItemBlock;
|
||||
}
|
||||
}
|
|
@ -13,9 +13,9 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires;
|
||||
package malte0811.industrialWires;
|
||||
|
||||
import malte0811.industrialwires.items.ItemIC2Coil;
|
||||
import malte0811.industrialWires.items.ItemIC2Coil;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -32,6 +32,7 @@ public class EventHandler {
|
|||
InventoryPlayer playerInv = ev.getEntityPlayer().inventory;
|
||||
boolean changed = false;
|
||||
int lengthOnEntity = ItemIC2Coil.getLength(stack);
|
||||
IndustrialWires.logger.info(lengthOnEntity+", "+stack);
|
||||
final int lengthPerCoilOrig = lengthOnEntity/stack.getCount();
|
||||
for (int i = 0;i<playerInv.getSizeInventory();i++) {
|
||||
ItemStack inInv = playerInv.getStackInSlot(i);
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires;
|
||||
package malte0811.industrialWires;
|
||||
|
||||
import blusunrize.immersiveengineering.ImmersiveEngineering;
|
||||
import blusunrize.immersiveengineering.common.blocks.BlockIEBase;
|
|
@ -12,22 +12,22 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires;
|
||||
package malte0811.industrialWires;
|
||||
|
||||
import blusunrize.immersiveengineering.api.energy.wires.IImmersiveConnectable;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler;
|
||||
import malte0811.industrialwires.util.ConversionUtil;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public interface IMixedConnector extends IImmersiveConnectable {
|
||||
public interface IIC2Connector extends IImmersiveConnectable {
|
||||
/**
|
||||
* @return leftover energy.
|
||||
*/
|
||||
double insertEnergy(double joules, boolean simulate);
|
||||
double insertEnergy(double eu, boolean simulate);
|
||||
|
||||
@Override
|
||||
default float getDamageAmount(Entity e, ImmersiveNetHandler.Connection c)
|
||||
{
|
||||
return (float) Math.ceil(IImmersiveConnectable.super.getDamageAmount(e, c) * ConversionUtil.euPerJoule());//Same as IC2 uses
|
||||
return (float) Math.ceil(IImmersiveConnectable.super.getDamageAmount(e, c));//Same as IC2 uses
|
||||
}
|
||||
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires;
|
||||
package malte0811.industrialWires;
|
||||
|
||||
import blusunrize.immersiveengineering.common.Config.IEConfig;
|
||||
import net.minecraftforge.common.config.Config;
|
||||
|
@ -30,13 +30,6 @@ public class IWConfig {
|
|||
public static int[] maxLengthPerConn = {16, 16, 16, 32, 32};
|
||||
@Comment({"The maximum length of wire a coil item.", "Order: Tin, Copper, Gold, HV, Glass Fiber (as above)"})
|
||||
public static int[] maxLengthOnCoil = {1024, 1024, 1024, 2048, 2048};
|
||||
@Comment({"The factor between the IF transfer rate of the wires and the IF transfer rate corresponding to the EU transfer rate.",
|
||||
"The default value results in the same transfer rates as the standard IE wires"})
|
||||
public static double wireRatio = .5;
|
||||
@Comment({"The EU IO rates of the wires. Order is Tin, Copper, Gold, HV, Glass Fiber"})
|
||||
public static double[] ioRatesEU = {32, 128, 512, 2048, 8192};
|
||||
@Comment({"The EU loss rates of the wires (EU per block). Order is Tin, Copper, Gold, HV, Glass Fiber"})
|
||||
public static double[] euLossPerBlock = {.2, .2, .4, .8, .025};
|
||||
|
||||
@Comment({"Set this to false to completely disable any conversion between IF and EU (default: true)"})
|
||||
@RequiresMcRestart
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires;
|
||||
package malte0811.industrialWires;
|
||||
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires;
|
||||
package malte0811.industrialWires;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -37,7 +37,7 @@ public class IWPotions {
|
|||
setIconIndex(0, 0);
|
||||
this.setRegistryName(new ResourceLocation(IndustrialWires.MODID, "tinnitus"));
|
||||
ForgeRegistries.POTIONS.register(this);
|
||||
this.setPotionName("potion." + IndustrialWires.MODID + "." + getRegistryName().getPath());
|
||||
this.setPotionName("potion."+ IndustrialWires.MODID+"." + getRegistryName().getResourcePath());
|
||||
}
|
||||
|
||||
@Override
|
|
@ -13,9 +13,9 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires;
|
||||
package malte0811.industrialWires;
|
||||
|
||||
import malte0811.industrialwires.hv.MarxOreHandler;
|
||||
import malte0811.industrialWires.hv.MarxOreHandler;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.storage.WorldSavedData;
|
|
@ -12,37 +12,37 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires;
|
||||
package malte0811.industrialWires;
|
||||
|
||||
import blusunrize.immersiveengineering.ImmersiveEngineering;
|
||||
import blusunrize.immersiveengineering.api.MultiblockHandler;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.WireApi;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import malte0811.industrialwires.blocks.BlockIWBase;
|
||||
import malte0811.industrialwires.blocks.TEDataFixer;
|
||||
import malte0811.industrialwires.blocks.controlpanel.*;
|
||||
import malte0811.industrialwires.blocks.converter.*;
|
||||
import malte0811.industrialwires.blocks.hv.*;
|
||||
import malte0811.industrialwires.blocks.wire.*;
|
||||
import malte0811.industrialwires.compat.Compat;
|
||||
import malte0811.industrialwires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialwires.controlpanel.PanelUtils;
|
||||
import malte0811.industrialwires.crafting.Recipes;
|
||||
import malte0811.industrialwires.entities.EntityBrokenPart;
|
||||
import malte0811.industrialwires.hv.MarxOreHandler;
|
||||
import malte0811.industrialwires.hv.MultiblockMarx;
|
||||
import malte0811.industrialwires.items.ItemIC2Coil;
|
||||
import malte0811.industrialwires.items.ItemKey;
|
||||
import malte0811.industrialwires.items.ItemPanelComponent;
|
||||
import malte0811.industrialwires.mech_mb.EUCapability;
|
||||
import malte0811.industrialwires.mech_mb.MechMBPart;
|
||||
import malte0811.industrialwires.mech_mb.MultiblockMechMB;
|
||||
import malte0811.industrialwires.network.MessageGUIInteract;
|
||||
import malte0811.industrialwires.network.MessageItemSync;
|
||||
import malte0811.industrialwires.network.MessagePanelInteract;
|
||||
import malte0811.industrialwires.network.MessageTileSyncIW;
|
||||
import malte0811.industrialwires.util.CommandIW;
|
||||
import malte0811.industrialwires.util.MultiblockTemplateManual;
|
||||
import malte0811.industrialWires.blocks.BlockIWBase;
|
||||
import malte0811.industrialWires.blocks.TEDataFixer;
|
||||
import malte0811.industrialWires.blocks.controlpanel.*;
|
||||
import malte0811.industrialWires.blocks.converter.*;
|
||||
import malte0811.industrialWires.blocks.hv.*;
|
||||
import malte0811.industrialWires.blocks.wire.*;
|
||||
import malte0811.industrialWires.compat.Compat;
|
||||
import malte0811.industrialWires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialWires.controlpanel.PanelUtils;
|
||||
import malte0811.industrialWires.crafting.Recipes;
|
||||
import malte0811.industrialWires.entities.EntityBrokenPart;
|
||||
import malte0811.industrialWires.hv.MarxOreHandler;
|
||||
import malte0811.industrialWires.hv.MultiblockMarx;
|
||||
import malte0811.industrialWires.items.ItemIC2Coil;
|
||||
import malte0811.industrialWires.items.ItemKey;
|
||||
import malte0811.industrialWires.items.ItemPanelComponent;
|
||||
import malte0811.industrialWires.mech_mb.EUCapability;
|
||||
import malte0811.industrialWires.mech_mb.MechMBPart;
|
||||
import malte0811.industrialWires.mech_mb.MultiblockMechMB;
|
||||
import malte0811.industrialWires.network.MessageGUIInteract;
|
||||
import malte0811.industrialWires.network.MessageItemSync;
|
||||
import malte0811.industrialWires.network.MessagePanelInteract;
|
||||
import malte0811.industrialWires.network.MessageTileSyncIW;
|
||||
import malte0811.industrialWires.util.CommandIW;
|
||||
import malte0811.industrialWires.util.MultiblockTemplateManual;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -75,13 +75,13 @@ package malte0811.industrialwires;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static malte0811.industrialwires.blocks.wire.BlockTypes_IC2_Connector.*;
|
||||
import static malte0811.industrialwires.entities.EntityBrokenPart.MARKER_TEXTURE;
|
||||
import static malte0811.industrialwires.entities.EntityBrokenPart.RES_LOC_SERIALIZER;
|
||||
import static malte0811.industrialwires.mech_mb.MechMBPart.EXAMPLE_MECHMB_LOC;
|
||||
import static malte0811.industrialwires.wires.MixedWireType.*;
|
||||
import static malte0811.industrialWires.blocks.wire.BlockTypes_IC2_Connector.*;
|
||||
import static malte0811.industrialWires.entities.EntityBrokenPart.MARKER_TEXTURE;
|
||||
import static malte0811.industrialWires.entities.EntityBrokenPart.RES_LOC_SERIALIZER;
|
||||
import static malte0811.industrialWires.mech_mb.MechMBPart.EXAMPLE_MECHMB_LOC;
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.*;
|
||||
|
||||
@Mod(modid = IndustrialWires.MODID, version = IndustrialWires.VERSION, dependencies = "required-after:immersiveengineering@[0.12-86,);after:ic2;required-after:forge@[14.23.3.2694,)",
|
||||
@Mod(modid = IndustrialWires.MODID, version = IndustrialWires.VERSION, dependencies = "required-after:immersiveengineering@[0.12-77,);after:ic2",
|
||||
certificateFingerprint = "7e11c175d1e24007afec7498a1616bef0000027d",
|
||||
updateJSON = "https://raw.githubusercontent.com/malte0811/IndustrialWires/MC1.12/changelog.json")
|
||||
@Mod.EventBusSubscriber
|
||||
|
@ -140,9 +140,8 @@ public class IndustrialWires {
|
|||
public static IndustrialWires instance = new IndustrialWires();
|
||||
public static CreativeTabs creativeTab = new CreativeTabs(MODID) {
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack createIcon() {
|
||||
public ItemStack getTabIconItem() {
|
||||
if (coil!=null) {
|
||||
return new ItemStack(coil, 1, 2);
|
||||
} else {
|
||||
|
@ -150,7 +149,7 @@ public class IndustrialWires {
|
|||
}
|
||||
}
|
||||
};
|
||||
@SidedProxy(clientSide = "malte0811.industrialwires.client.ClientProxy", serverSide = "malte0811.industrialwires.CommonProxy")
|
||||
@SidedProxy(clientSide = "malte0811.industrialWires.client.ClientProxy", serverSide = "malte0811.industrialWires.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
public static boolean hasIC2;
|
||||
public static boolean hasTechReborn;
|
||||
|
@ -164,31 +163,32 @@ public class IndustrialWires {
|
|||
double ieThreshold = 12.74275;
|
||||
String ieVer = Loader.instance().getIndexedModList().get(ImmersiveEngineering.MODID).getDisplayVersion();
|
||||
int firstDash = ieVer.indexOf('-');
|
||||
String end = ieVer.substring(firstDash + 1);
|
||||
String end = ieVer.substring(firstDash+1);
|
||||
String start = ieVer.substring(0, firstDash);
|
||||
end = end.replaceAll("[^0-9]", "");
|
||||
start = start.replaceAll("[^0-9]", "");
|
||||
double ieVerDouble = Double.parseDouble(start + "." + end);
|
||||
isOldIE = ieVerDouble < ieThreshold;
|
||||
double ieVerDouble = Double.parseDouble(start+"."+end);
|
||||
isOldIE = ieVerDouble<ieThreshold;
|
||||
}
|
||||
logger = e.getModLog();
|
||||
new IWConfig();
|
||||
GameRegistry.registerTileEntity(TileEntityIC2ConnectorTin.class, new ResourceLocation(MODID, "ic2ConnectorTin"));
|
||||
GameRegistry.registerTileEntity(TileEntityIC2ConnectorCopper.class, new ResourceLocation(MODID, "ic2ConnectorCopper"));
|
||||
GameRegistry.registerTileEntity(TileEntityIC2ConnectorGold.class, new ResourceLocation(MODID, "ic2ConnectorGold"));
|
||||
GameRegistry.registerTileEntity(TileEntityIC2ConnectorHV.class, new ResourceLocation(MODID, "ic2ConnectorHV"));
|
||||
GameRegistry.registerTileEntity(TileEntityIC2ConnectorGlass.class, new ResourceLocation(MODID, "ic2ConnectorGlass"));
|
||||
if (hasIC2) {
|
||||
GameRegistry.registerTileEntity(TileEntityIC2ConnectorTin.class, new ResourceLocation(MODID, "ic2ConnectorTin"));
|
||||
GameRegistry.registerTileEntity(TileEntityIC2ConnectorCopper.class, new ResourceLocation(MODID, "ic2ConnectorCopper"));
|
||||
GameRegistry.registerTileEntity(TileEntityIC2ConnectorGold.class, new ResourceLocation(MODID, "ic2ConnectorGold"));
|
||||
GameRegistry.registerTileEntity(TileEntityIC2ConnectorHV.class, new ResourceLocation(MODID, "ic2ConnectorHV"));
|
||||
GameRegistry.registerTileEntity(TileEntityIC2ConnectorGlass.class, new ResourceLocation(MODID, "ic2ConnectorGlass"));
|
||||
|
||||
if (hasIC2 && IWConfig.enableConversion) {
|
||||
GameRegistry.registerTileEntity(TileEntityIEMotor.class, new ResourceLocation(MODID, "ieMotor"));
|
||||
GameRegistry.registerTileEntity(TileEntityMechICtoIE.class, new ResourceLocation(MODID, "mechIcToIe"));
|
||||
GameRegistry.registerTileEntity(TileEntityMechIEtoIC.class, new ResourceLocation(MODID, "mechIeToIc"));
|
||||
if (IWConfig.enableConversion) {
|
||||
GameRegistry.registerTileEntity(TileEntityIEMotor.class, new ResourceLocation(MODID, "ieMotor"));
|
||||
GameRegistry.registerTileEntity(TileEntityMechICtoIE.class, new ResourceLocation(MODID, "mechIcToIe"));
|
||||
GameRegistry.registerTileEntity(TileEntityMechIEtoIC.class, new ResourceLocation(MODID, "mechIeToIc"));
|
||||
}
|
||||
}
|
||||
GameRegistry.registerTileEntity(TileEntityMechMB.class, new ResourceLocation(MODID, "mechMB"));
|
||||
GameRegistry.registerTileEntity(TileEntityJacobsLadder.class, new ResourceLocation(MODID, "jacobsLadder"));
|
||||
GameRegistry.registerTileEntity(TileEntityMarx.class, new ResourceLocation(MODID, "marx_generator"));
|
||||
GameRegistry.registerTileEntity(TileEntityPanel.class, new ResourceLocation(MODID, "control_panel"));
|
||||
GameRegistry.registerTileEntity(TileEntityGeneralCP.class, new ResourceLocation(MODID, "gcp"));
|
||||
GameRegistry.registerTileEntity(TileEntityRSPanelIE.class, new ResourceLocation(MODID, "control_panel_rs"));
|
||||
GameRegistry.registerTileEntity(TileEntityRSPanelOthers.class, new ResourceLocation(MODID, "control_panel_rs_compat"));
|
||||
GameRegistry.registerTileEntity(TileEntityPanelCreator.class, new ResourceLocation(MODID, "panel_creator"));
|
||||
|
@ -214,7 +214,9 @@ public class IndustrialWires {
|
|||
if (IWConfig.enableConversion&&hasIC2) {
|
||||
event.getRegistry().register(new BlockMechanicalConverter());
|
||||
}
|
||||
event.getRegistry().register(new BlockIC2Connector());
|
||||
if (hasIC2) {
|
||||
event.getRegistry().register(new BlockIC2Connector());
|
||||
}
|
||||
event.getRegistry().register(new BlockJacobsLadder());
|
||||
event.getRegistry().register(new BlockPanel());
|
||||
event.getRegistry().register(new BlockHVMultiblocks());
|
||||
|
@ -228,7 +230,9 @@ public class IndustrialWires {
|
|||
event.getRegistry().register(b.createItemBlock());
|
||||
}
|
||||
|
||||
event.getRegistry().register(new ItemIC2Coil());
|
||||
if (hasIC2) {
|
||||
event.getRegistry().register(new ItemIC2Coil());
|
||||
}
|
||||
event.getRegistry().register(new ItemPanelComponent());
|
||||
event.getRegistry().register(new ItemKey());
|
||||
}
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEProperties;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.IImmersiveConnectable;
|
||||
|
@ -21,8 +21,8 @@ import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler;
|
|||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IPlayerInteraction;
|
||||
import blusunrize.immersiveengineering.common.util.Utils;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.util.MiscUtils;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.util.MiscUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
|
@ -55,7 +55,7 @@ public abstract class BlockIWBase extends Block {
|
|||
super(mat);
|
||||
setHardness(3.0F);
|
||||
setResistance(15.0F);
|
||||
setTranslationKey(IndustrialWires.MODID + "." + name);
|
||||
setUnlocalizedName(IndustrialWires.MODID + "." + name);
|
||||
setRegistryName(IndustrialWires.MODID, name);
|
||||
setCreativeTab(IndustrialWires.creativeTab);
|
||||
IndustrialWires.blocks.add(this);
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
|
@ -12,7 +12,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import blusunrize.immersiveengineering.api.energy.immersiveflux.IFluxConnection;
|
||||
import blusunrize.immersiveengineering.api.energy.immersiveflux.IFluxProvider;
|
|
@ -13,11 +13,11 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces;
|
||||
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;
|
||||
import malte0811.industrialwires.util.MiscUtils;
|
||||
import malte0811.industrialWires.util.MiscUtils;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IGeneralMultiblock;
|
||||
import net.minecraft.block.state.IBlockState;
|
|
@ -12,7 +12,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
public interface IMetaEnum {
|
||||
Object[] getValues();
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
|
@ -13,9 +13,9 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import malte0811.industrialwires.util.MBSideConfig;
|
||||
import malte0811.industrialWires.util.MBSideConfig;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
|
@ -12,10 +12,10 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -45,12 +45,12 @@ public class ItemBlockIW extends ItemBlock {
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTranslationKey(ItemStack stack) {
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
int meta = stack.getMetadata();
|
||||
if (values != null) {
|
||||
return block.getTranslationKey() + "." + values[meta].toString().toLowerCase();
|
||||
return block.getUnlocalizedName() + "." + values[meta].toString().toLowerCase();
|
||||
} else {
|
||||
return block.getTranslationKey();
|
||||
return block.getUnlocalizedName();
|
||||
}
|
||||
}
|
||||
|
|
@ -13,9 +13,9 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.datafix.IFixableData;
|
||||
|
|
@ -12,10 +12,10 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
|
@ -13,11 +13,11 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks;
|
||||
package malte0811.industrialWires.blocks;
|
||||
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IGeneralMultiblock;
|
||||
import malte0811.industrialwires.util.MiscUtils;
|
||||
import malte0811.industrialWires.util.MiscUtils;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
|
@ -78,7 +78,6 @@ public abstract class TileEntityIWMultiblock extends TileEntityIWBase implements
|
|||
T master = master(here);
|
||||
return master!=null?master:def;
|
||||
}
|
||||
|
||||
public void disassemble() {
|
||||
if (formed && !world.isRemote) {
|
||||
BlockPos startPos = getOrigin();
|
||||
|
@ -123,7 +122,7 @@ public abstract class TileEntityIWMultiblock extends TileEntityIWBase implements
|
|||
mirrored = in.getBoolean(MIRRORED);
|
||||
int[] offset = in.getIntArray(OFFSET);
|
||||
this.offset = new Vec3i(offset[0], offset[1], offset[2]);
|
||||
facing = EnumFacing.byHorizontalIndex(in.getInteger(FACING));
|
||||
facing = EnumFacing.getHorizontal(in.getInteger(FACING));
|
||||
}
|
||||
|
||||
public Vec3i getSize() {
|
|
@ -13,15 +13,15 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.controlpanel;
|
||||
package malte0811.industrialWires.blocks.controlpanel;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEProperties;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.BlockIWBase;
|
||||
import malte0811.industrialwires.blocks.IMetaEnum;
|
||||
import malte0811.industrialwires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialwires.controlpanel.PropertyComponents;
|
||||
import malte0811.industrialwires.util.MiscUtils;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.BlockIWBase;
|
||||
import malte0811.industrialWires.blocks.IMetaEnum;
|
||||
import malte0811.industrialWires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialWires.controlpanel.PropertyComponents;
|
||||
import malte0811.industrialWires.util.MiscUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
|
@ -268,7 +268,7 @@ public class BlockPanel extends BlockIWBase implements IMetaEnum {
|
|||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
|
||||
super.neighborChanged(state, worldIn, pos, blockIn, fromPos);
|
||||
if (!worldIn.isRemote) {
|
||||
TileEntityGeneralCP panel = MiscUtils.getLoadedTE(worldIn, pos, TileEntityGeneralCP.class);
|
||||
TileEntityGeneralCP panel = MiscUtils.getExistingTE(worldIn, pos, TileEntityGeneralCP.class);
|
||||
if (panel instanceof TileEntityComponentPanel) {
|
||||
((TileEntityComponentPanel) panel).updateRSInput();
|
||||
} else if (panel instanceof TileEntityRSPanelOthers) {
|
|
@ -13,9 +13,8 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.controlpanel;
|
||||
package malte0811.industrialWires.blocks.controlpanel;
|
||||
|
||||
import malte0811.industrialwires.compat.Compat;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
import java.util.Locale;
|
||||
|
@ -36,7 +35,7 @@ public enum BlockTypes_Panel implements IStringSerializable {
|
|||
|
||||
public boolean showInCreative() {
|
||||
if (this==OTHER_RS_WIRES) {
|
||||
return Compat.enableOtherRS;
|
||||
|
||||
}
|
||||
return this != SINGLE_COMP;
|
||||
}
|
|
@ -13,18 +13,18 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.controlpanel;
|
||||
package malte0811.industrialWires.blocks.controlpanel;
|
||||
|
||||
import blusunrize.immersiveengineering.api.tool.IConfigurableTool;
|
||||
import malte0811.industrialwires.blocks.ItemBlockIW;
|
||||
import malte0811.industrialWires.blocks.ItemBlockIW;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
import static malte0811.industrialwires.util.NBTKeys.ANGLE;
|
||||
import static malte0811.industrialwires.util.NBTKeys.HEIGHT;
|
||||
import static malte0811.industrialWires.util.NBTKeys.ANGLE;
|
||||
import static malte0811.industrialWires.util.NBTKeys.HEIGHT;
|
||||
|
||||
public class ItemBlockPanel extends ItemBlockIW implements IConfigurableTool {
|
||||
|
|
@ -13,12 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.controlpanel;
|
||||
package malte0811.industrialWires.blocks.controlpanel;
|
||||
|
||||
import malte0811.industrialwires.controlpanel.ControlPanelNetwork;
|
||||
import malte0811.industrialwires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialwires.controlpanel.PropertyComponents;
|
||||
import malte0811.industrialwires.items.ItemPanelComponent;
|
||||
import malte0811.industrialWires.controlpanel.ControlPanelNetwork;
|
||||
import malte0811.industrialWires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialWires.controlpanel.PropertyComponents;
|
||||
import malte0811.industrialWires.items.ItemPanelComponent;
|
||||
import net.minecraft.block.BlockRedstoneWire;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -30,7 +30,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import static malte0811.industrialwires.util.MiscUtils.apply;
|
||||
import static malte0811.industrialWires.util.MiscUtils.apply;
|
||||
|
||||
public class TileEntityComponentPanel extends TileEntityPanel {
|
||||
private byte rsOut = 0;
|
||||
|
@ -48,7 +48,7 @@ public class TileEntityComponentPanel extends TileEntityPanel {
|
|||
}
|
||||
|
||||
public void updateRSInput() {
|
||||
int value = world.getRedstonePowerFromNeighbors(pos);
|
||||
int value = world.isBlockIndirectlyGettingPowered(pos);
|
||||
if (value == 0) {
|
||||
for (EnumFacing f : EnumFacing.HORIZONTALS) {
|
||||
IBlockState state = world.getBlockState(pos.offset(f));
|
|
@ -13,12 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.controlpanel;
|
||||
package malte0811.industrialWires.blocks.controlpanel;
|
||||
|
||||
import malte0811.industrialwires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialwires.controlpanel.ControlPanelNetwork;
|
||||
import malte0811.industrialwires.controlpanel.ControlPanelNetwork.IOwner;
|
||||
import malte0811.industrialwires.util.MiscUtils;
|
||||
import malte0811.industrialWires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialWires.controlpanel.ControlPanelNetwork;
|
||||
import malte0811.industrialWires.controlpanel.ControlPanelNetwork.IOwner;
|
||||
import malte0811.industrialWires.util.MiscUtils;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -41,7 +41,7 @@ public class TileEntityGeneralCP extends TileEntityIWBase implements IOwner {
|
|||
if (canJoinNetwork()) {
|
||||
for (EnumFacing side : EnumFacing.VALUES) {
|
||||
BlockPos posSide = pos.offset(side);
|
||||
TileEntityGeneralCP neighbour = MiscUtils.getLoadedTE(world, posSide, TileEntityGeneralCP.class);
|
||||
TileEntityGeneralCP neighbour = MiscUtils.getExistingTE(world, posSide, TileEntityGeneralCP.class);
|
||||
if (neighbour != null && neighbour.canJoinNetwork()) {
|
||||
if (!isFinalNet) {
|
||||
panelNetwork = neighbour.panelNetwork;
|
|
@ -13,17 +13,17 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.controlpanel;
|
||||
package malte0811.industrialWires.blocks.controlpanel;
|
||||
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IPlayerInteraction;
|
||||
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.IBlockBoundsIW;
|
||||
import malte0811.industrialwires.controlpanel.*;
|
||||
import malte0811.industrialwires.controlpanel.ControlPanelNetwork.RSChannel;
|
||||
import malte0811.industrialwires.network.MessagePanelInteract;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.IBlockBoundsIW;
|
||||
import malte0811.industrialWires.controlpanel.*;
|
||||
import malte0811.industrialWires.controlpanel.ControlPanelNetwork.RSChannel;
|
||||
import malte0811.industrialWires.network.MessagePanelInteract;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -38,14 +38,13 @@ import net.minecraft.util.math.AxisAlignedBB;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static malte0811.industrialwires.util.MiscUtils.apply;
|
||||
import static malte0811.industrialWires.util.MiscUtils.apply;
|
||||
|
||||
public class TileEntityPanel extends TileEntityGeneralCP implements IDirectionalTile, IBlockBoundsIW, IPlayerInteraction,
|
||||
ITickable, IEBlockInterfaces.ITileDrop {
|
||||
|
@ -107,8 +106,8 @@ public class TileEntityPanel extends TileEntityGeneralCP implements IDirectional
|
|||
@Override
|
||||
public void readNBT(NBTTagCompound in, boolean updatePacket) {
|
||||
readFromItemNBT(in);
|
||||
components.setFacing(EnumFacing.byHorizontalIndex(in.getInteger("facing")));
|
||||
components.setTop(EnumFacing.byIndex(in.getInteger("top")));
|
||||
components.setFacing(EnumFacing.getHorizontal(in.getInteger("facing")));
|
||||
components.setTop(EnumFacing.getFront(in.getInteger("top")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -140,9 +139,6 @@ public class TileEntityPanel extends TileEntityGeneralCP implements IDirectional
|
|||
}
|
||||
}
|
||||
components.setHeight(nbt.getFloat("height"));
|
||||
if (nbt.hasKey("texture", Constants.NBT.TAG_COMPOUND)) {
|
||||
components.setTextureSource(new ItemStack(nbt.getCompoundTag("texture")));
|
||||
}
|
||||
components.setAngle(nbt.getFloat("angle"));
|
||||
}
|
||||
defAABB = null;
|
||||
|
@ -158,7 +154,6 @@ public class TileEntityPanel extends TileEntityGeneralCP implements IDirectional
|
|||
nbt.setTag("components", comps);
|
||||
nbt.setFloat("height", components.getHeight());
|
||||
nbt.setFloat("angle", components.getAngle());
|
||||
nbt.setTag("texture", components.getTextureSource().serializeNBT());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
@ -231,9 +226,9 @@ public class TileEntityPanel extends TileEntityGeneralCP implements IDirectional
|
|||
Matrix4 mat = components.getPanelTopTransformInverse();
|
||||
PanelComponent retPc = null;
|
||||
RayTraceResult retRay = null;
|
||||
Vec3d playerPosRelative = player.getPositionVector().add(-pos.getX(), player.getEyeHeight() - pos.getY(), -pos.getZ());
|
||||
Vec3d playerPosRelative = player.getPositionVector().addVector(-pos.getX(), player.getEyeHeight() - pos.getY(), -pos.getZ());
|
||||
Vec3d playerPosTransformed = mat.apply(playerPosRelative);
|
||||
Vec3d hitRel = hitAbs ? hitVec.add(-pos.getX(), -pos.getY(), -pos.getZ()) : hitVec;
|
||||
Vec3d hitRel = hitAbs ? hitVec.addVector(-pos.getX(), -pos.getY(), -pos.getZ()) : hitVec;
|
||||
RayTraceResult r = getBoundingBox().calculateIntercept(playerPosRelative, playerPosRelative.add(player.getLookVec().scale(200)));
|
||||
if (r != null && r.hitVec != null) {
|
||||
hitRel = r.hitVec;
|
|
@ -13,16 +13,16 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.controlpanel;
|
||||
package malte0811.industrialWires.blocks.controlpanel;
|
||||
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.IBlockBoundsIW;
|
||||
import malte0811.industrialwires.blocks.INetGUI;
|
||||
import malte0811.industrialwires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialwires.controlpanel.MessageType;
|
||||
import malte0811.industrialwires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialwires.controlpanel.PanelUtils;
|
||||
import malte0811.industrialwires.items.ItemPanelComponent;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.IBlockBoundsIW;
|
||||
import malte0811.industrialWires.blocks.INetGUI;
|
||||
import malte0811.industrialWires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialWires.controlpanel.MessageType;
|
||||
import malte0811.industrialWires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialWires.controlpanel.PanelUtils;
|
||||
import malte0811.industrialWires.items.ItemPanelComponent;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -115,12 +115,7 @@ public class TileEntityPanelCreator extends TileEntityIWBase implements INetGUI,
|
|||
}
|
||||
}
|
||||
if (valid) {
|
||||
NBTTagCompound panelNBT;
|
||||
if (inv.hasTagCompound()) {
|
||||
panelNBT = inv.getTagCompound().copy();
|
||||
} else {
|
||||
panelNBT = new NBTTagCompound();
|
||||
}
|
||||
NBTTagCompound panelNBT = new NBTTagCompound();
|
||||
writeToItemNBT(panelNBT, true);
|
||||
ItemStack panel = new ItemStack(IndustrialWires.panel, 1, BlockTypes_Panel.TOP.ordinal());
|
||||
panel.setTagCompound(panelNBT);
|
|
@ -13,10 +13,10 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.controlpanel;
|
||||
package malte0811.industrialWires.blocks.controlpanel;
|
||||
|
||||
import malte0811.industrialwires.blocks.INetGUI;
|
||||
import malte0811.industrialwires.controlpanel.ControlPanelNetwork;
|
||||
import malte0811.industrialWires.blocks.INetGUI;
|
||||
import malte0811.industrialWires.controlpanel.ControlPanelNetwork;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -41,12 +41,8 @@ public abstract class TileEntityRSPanel extends TileEntityGeneralCP implements I
|
|||
}
|
||||
|
||||
private void updateChannelsArray() {
|
||||
if (world == null || !world.isRemote) {
|
||||
panelNetwork.removeIOFor(this);
|
||||
for (byte i = 0; i < 16; i++) {
|
||||
channels[i] = new ControlPanelNetwork.RSChannel(controller, i);
|
||||
}
|
||||
setNetworkAndInit(panelNetwork);
|
||||
for (byte i = 0;i<16;i++) {
|
||||
channels[i] = new ControlPanelNetwork.RSChannel(controller, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,18 +58,12 @@ public abstract class TileEntityRSPanel extends TileEntityGeneralCP implements I
|
|||
@Override
|
||||
public void writeNBT(NBTTagCompound nbt, boolean updatePacket) {
|
||||
nbt.setByteArray("out", this.out);
|
||||
nbt.setByteArray("in", this.currInput);
|
||||
nbt.setInteger("rsId", controller);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readNBT(NBTTagCompound nbt, boolean updatePacket) {
|
||||
if (nbt.hasKey("out") && nbt.getByteArray("out").length == 16) {
|
||||
out = nbt.getByteArray("out");
|
||||
}
|
||||
if (nbt.hasKey("in") && nbt.getByteArray("in").length == 16) {
|
||||
currInput = nbt.getByteArray("in");
|
||||
}
|
||||
out = nbt.getByteArray("out");
|
||||
controller = nbt.getInteger("rsId");
|
||||
updateChannelsArray();
|
||||
}
|
||||
|
@ -81,8 +71,8 @@ public abstract class TileEntityRSPanel extends TileEntityGeneralCP implements I
|
|||
protected void markRSDirty() {
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
protected void onInputChanged(byte[] newIn) {
|
||||
|
||||
protected void inputUpdate(byte[] newIn) {
|
||||
if (!Arrays.equals(currInput, newIn)) {
|
||||
ControlPanelNetwork.RSChannelState[] newStates = new ControlPanelNetwork.RSChannelState[16];
|
||||
for (byte i = 0; i < 16; i++) {
|
||||
|
@ -100,6 +90,7 @@ public abstract class TileEntityRSPanel extends TileEntityGeneralCP implements I
|
|||
@Override
|
||||
public void setNetworkAndInit(ControlPanelNetwork newNet) {
|
||||
super.setNetworkAndInit(newNet);
|
||||
inputUpdate(currInput);
|
||||
Consumer<ControlPanelNetwork.RSChannelState> listener = state -> {
|
||||
if (out[state.getColor()] != state.getStrength()) {
|
||||
out[state.getColor()] = state.getStrength();
|
||||
|
@ -107,9 +98,6 @@ public abstract class TileEntityRSPanel extends TileEntityGeneralCP implements I
|
|||
}
|
||||
};
|
||||
panelNetwork.addListener(this, listener, channels);
|
||||
byte[] oldIn = currInput;
|
||||
currInput = new byte[16];
|
||||
onInputChanged(oldIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -121,7 +109,6 @@ public abstract class TileEntityRSPanel extends TileEntityGeneralCP implements I
|
|||
setNetworkAndInit(panelNetwork);
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
world.notifyBlockUpdate(pos, state, state, 3);
|
||||
updateChannelsArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -131,15 +118,4 @@ public abstract class TileEntityRSPanel extends TileEntityGeneralCP implements I
|
|||
|
||||
|
||||
protected abstract void updateOutput();
|
||||
|
||||
protected abstract void updateInput();
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
super.onLoad();
|
||||
if (!world.isRemote) {
|
||||
updateInput();
|
||||
updateOutput();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.controlpanel;
|
||||
package malte0811.industrialWires.blocks.controlpanel;
|
||||
|
||||
import blusunrize.immersiveengineering.api.TargetingInfo;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.IImmersiveConnectable;
|
||||
|
@ -22,29 +22,23 @@ import blusunrize.immersiveengineering.api.energy.wires.WireType;
|
|||
import blusunrize.immersiveengineering.api.energy.wires.redstone.IRedstoneConnector;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.redstone.RedstoneWireNetwork;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces;
|
||||
import blusunrize.immersiveengineering.common.util.Utils;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.IBlockBoundsIW;
|
||||
import malte0811.industrialWires.blocks.IBlockBoundsIW;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Set;
|
||||
|
||||
import static blusunrize.immersiveengineering.api.energy.wires.WireType.REDSTONE_CATEGORY;
|
||||
|
||||
public class TileEntityRSPanelIE extends TileEntityRSPanel
|
||||
public class TileEntityRSPanelIE extends TileEntityRSPanel//TODO what parts of TEIIC do I need?
|
||||
implements IRedstoneConnector, IEBlockInterfaces.IDirectionalTile, IBlockBoundsIW {
|
||||
private EnumFacing facing = EnumFacing.NORTH;
|
||||
@Nonnull
|
||||
|
@ -56,59 +50,21 @@ public class TileEntityRSPanelIE extends TileEntityRSPanel
|
|||
super.writeNBT(nbt, updatePacket);
|
||||
nbt.setBoolean("hasConn", hasConn);
|
||||
nbt.setInteger("facing", facing.getIndex());
|
||||
if (updatePacket) {
|
||||
writeConnsToNBT(nbt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readNBT(NBTTagCompound nbt, boolean updatePacket) {
|
||||
super.readNBT(nbt, updatePacket);
|
||||
if (nbt.hasKey("connectionList", Constants.NBT.TAG_LIST)) {
|
||||
loadConnsFromNBT(nbt);
|
||||
}
|
||||
hasConn = nbt.getBoolean("hasConn");
|
||||
facing = EnumFacing.VALUES[nbt.getInteger("facing")];
|
||||
aabb = null;
|
||||
}
|
||||
|
||||
//Copied from IE (TileEntityImmersiveConnectable)
|
||||
private void loadConnsFromNBT(NBTTagCompound nbt) {
|
||||
if (world != null && world.isRemote && !Minecraft.getMinecraft().isSingleplayer() && nbt != null) {
|
||||
NBTTagList connectionList = nbt.getTagList("connectionList", Constants.NBT.TAG_COMPOUND);
|
||||
ImmersiveNetHandler.INSTANCE.clearConnectionsOriginatingFrom(Utils.toCC(this), world);
|
||||
for (int i = 0; i < connectionList.tagCount(); i++) {
|
||||
NBTTagCompound conTag = connectionList.getCompoundTagAt(i);
|
||||
ImmersiveNetHandler.Connection con = ImmersiveNetHandler.Connection.readFromNBT(conTag);
|
||||
if (con != null) {
|
||||
ImmersiveNetHandler.INSTANCE.addConnection(world, Utils.toCC(this), con);
|
||||
} else
|
||||
IndustrialWires.logger.error("CLIENT read connection as null from {}", nbt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void writeConnsToNBT(NBTTagCompound nbt) {
|
||||
if (world != null && !world.isRemote && nbt != null) {
|
||||
NBTTagList connectionList = new NBTTagList();
|
||||
Set<ImmersiveNetHandler.Connection> conL = ImmersiveNetHandler.INSTANCE.getConnections(world, Utils.toCC(this));
|
||||
if (conL != null)
|
||||
for (ImmersiveNetHandler.Connection con : conL)
|
||||
connectionList.appendTag(con.writeToNBT());
|
||||
nbt.setTag("connectionList", connectionList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateOutput() {
|
||||
wireNetwork.updateValues();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateInput() {
|
||||
updateInput(wireNetwork.channelValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNetwork(@Nonnull RedstoneWireNetwork net) {
|
||||
wireNetwork = net;
|
||||
|
@ -122,7 +78,7 @@ public class TileEntityRSPanelIE extends TileEntityRSPanel
|
|||
|
||||
@Override
|
||||
public void onChange() {
|
||||
onInputChanged(wireNetwork.channelValues);
|
||||
inputUpdate(wireNetwork.channelValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -160,7 +116,9 @@ public class TileEntityRSPanelIE extends TileEntityRSPanel
|
|||
@Override
|
||||
public void connectCable(WireType wireType, TargetingInfo targetingInfo, IImmersiveConnectable other) {
|
||||
hasConn = true;
|
||||
RedstoneWireNetwork.updateConnectors(pos, world, wireNetwork);
|
||||
if (other instanceof IRedstoneConnector && ((IRedstoneConnector) other).getNetwork() != wireNetwork) {
|
||||
wireNetwork.mergeNetwork(((IRedstoneConnector) other).getNetwork());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -170,7 +128,7 @@ public class TileEntityRSPanelIE extends TileEntityRSPanel
|
|||
|
||||
@Override
|
||||
public boolean allowEnergyToPass(ImmersiveNetHandler.Connection connection) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -188,7 +146,7 @@ public class TileEntityRSPanelIE extends TileEntityRSPanel
|
|||
public Vec3d getConnectionOffset(ImmersiveNetHandler.Connection connection) {
|
||||
EnumFacing side = facing.getOpposite();
|
||||
double conRadius = connection.cableType.getRenderDiameter() / 2;
|
||||
return new Vec3d(.5 - conRadius * side.getXOffset(), .5 - conRadius * side.getYOffset(), .5 - conRadius * side.getZOffset());
|
||||
return new Vec3d(.5 - conRadius * side.getFrontOffsetX(), .5 - conRadius * side.getFrontOffsetY(), .5 - conRadius * side.getFrontOffsetZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -256,12 +214,4 @@ public class TileEntityRSPanelIE extends TileEntityRSPanel
|
|||
}
|
||||
return aabb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
if (world.isRemote && !Minecraft.getMinecraft().isSingleplayer()) {
|
||||
ImmersiveNetHandler.INSTANCE.clearAllConnectionsFor(pos, world, this, false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,20 +13,14 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.controlpanel;
|
||||
package malte0811.industrialWires.blocks.controlpanel;
|
||||
|
||||
import malte0811.industrialwires.compat.Compat;
|
||||
import malte0811.industrialwires.compat.CompatCapabilities.Charset;
|
||||
import malte0811.industrialWires.compat.Compat;
|
||||
import mrtjp.projectred.api.IBundledTile;
|
||||
import mrtjp.projectred.api.ProjectRedAPI;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Optional.Interface(iface = "mrtjp.projectred.api.IBundledTile", modid = ProjectRedAPI.modIDCore)
|
||||
public class TileEntityRSPanelOthers extends TileEntityRSPanel implements IBundledTile {
|
||||
|
||||
|
@ -44,40 +38,23 @@ public class TileEntityRSPanelOthers extends TileEntityRSPanel implements IBundl
|
|||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInput() {
|
||||
byte[] data = new byte[16];
|
||||
for (EnumFacing f:EnumFacing.VALUES) {
|
||||
byte[] tmp = Compat.getBundledRS.run(world, pos, f);
|
||||
byte[] tmp = Compat.getBundledRS.getBundledInput(world, pos, f);
|
||||
if (tmp!=null) {
|
||||
for (int i = 0; i<16; i++) {
|
||||
for (int i = 0;i<16;i++) {
|
||||
if (tmp[i]>data[i]) {
|
||||
data[i] = tmp[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onInputChanged(data);
|
||||
inputUpdate(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateOutput() {
|
||||
Compat.updateBundledRS.run(world, pos, null);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing) {
|
||||
if (capability==Charset.EMITTER_CAP) {
|
||||
return Charset.EMITTER_CAP.cast(()->Arrays.copyOf(out, 16));
|
||||
} else if (capability==Charset.RECEIVER_CAP) {
|
||||
return Charset.RECEIVER_CAP.cast(this::updateInput);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability(@Nonnull Capability<?> capability, @Nullable EnumFacing facing) {
|
||||
return capability==Charset.EMITTER_CAP||capability==Charset.RECEIVER_CAP;
|
||||
world.notifyNeighborsOfStateChange(pos, getBlockType(), true);
|
||||
}
|
||||
}
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.controlpanel;
|
||||
package malte0811.industrialWires.blocks.controlpanel;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
|
@ -12,11 +12,11 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks.converter;
|
||||
package malte0811.industrialWires.blocks.converter;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEProperties;
|
||||
import malte0811.industrialwires.blocks.BlockIWBase;
|
||||
import malte0811.industrialwires.blocks.IMetaEnum;
|
||||
import malte0811.industrialWires.blocks.BlockIWBase;
|
||||
import malte0811.industrialWires.blocks.IMetaEnum;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
|
@ -13,12 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.converter;
|
||||
package malte0811.industrialWires.blocks.converter;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEProperties;
|
||||
import malte0811.industrialwires.blocks.BlockIWMultiblock;
|
||||
import malte0811.industrialwires.blocks.IMetaEnum;
|
||||
import malte0811.industrialwires.blocks.IWProperties;
|
||||
import malte0811.industrialWires.blocks.BlockIWMultiblock;
|
||||
import malte0811.industrialWires.blocks.IMetaEnum;
|
||||
import malte0811.industrialWires.blocks.IWProperties;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
|
@ -12,7 +12,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks.converter;
|
||||
package malte0811.industrialWires.blocks.converter;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.converter;
|
||||
package malte0811.industrialWires.blocks.converter;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
|
@ -12,16 +12,16 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks.converter;
|
||||
package malte0811.industrialWires.blocks.converter;
|
||||
|
||||
import blusunrize.immersiveengineering.api.energy.IRotationAcceptor;
|
||||
import blusunrize.immersiveengineering.api.energy.immersiveflux.FluxStorage;
|
||||
import blusunrize.immersiveengineering.api.energy.immersiveflux.IFluxReceiver;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile;
|
||||
import malte0811.industrialwires.IWConfig.MechConversion;
|
||||
import malte0811.industrialwires.blocks.EnergyAdapter;
|
||||
import malte0811.industrialwires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialwires.util.ConversionUtil;
|
||||
import malte0811.industrialWires.IWConfig.MechConversion;
|
||||
import malte0811.industrialWires.blocks.EnergyAdapter;
|
||||
import malte0811.industrialWires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialWires.util.ConversionUtil;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -36,7 +36,7 @@ import javax.annotation.Nonnull;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static malte0811.industrialwires.util.NBTKeys.*;
|
||||
import static malte0811.industrialWires.util.NBTKeys.*;
|
||||
|
||||
public class TileEntityIEMotor extends TileEntityIWBase implements ITickable, IFluxReceiver, IDirectionalTile {
|
||||
private double rotBuffer = 0;
|
|
@ -12,14 +12,14 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks.converter;
|
||||
package malte0811.industrialWires.blocks.converter;
|
||||
|
||||
import blusunrize.immersiveengineering.api.energy.IRotationAcceptor;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile;
|
||||
import ic2.api.energy.tile.IKineticSource;
|
||||
import malte0811.industrialwires.IWConfig.MechConversion;
|
||||
import malte0811.industrialwires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialwires.util.ConversionUtil;
|
||||
import malte0811.industrialWires.IWConfig.MechConversion;
|
||||
import malte0811.industrialWires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialWires.util.ConversionUtil;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -29,8 +29,8 @@ import net.minecraft.util.math.BlockPos;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import static malte0811.industrialwires.util.NBTKeys.BUFFER;
|
||||
import static malte0811.industrialwires.util.NBTKeys.DIRECTION;
|
||||
import static malte0811.industrialWires.util.NBTKeys.BUFFER;
|
||||
import static malte0811.industrialWires.util.NBTKeys.DIRECTION;
|
||||
|
||||
public class TileEntityMechICtoIE extends TileEntityIWBase implements IDirectionalTile, ITickable {
|
||||
private EnumFacing dir = EnumFacing.DOWN;
|
|
@ -12,23 +12,23 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks.converter;
|
||||
package malte0811.industrialWires.blocks.converter;
|
||||
|
||||
import blusunrize.immersiveengineering.api.energy.IRotationAcceptor;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile;
|
||||
import ic2.api.energy.tile.IKineticSource;
|
||||
import malte0811.industrialwires.IWConfig.MechConversion;
|
||||
import malte0811.industrialwires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialwires.util.ConversionUtil;
|
||||
import malte0811.industrialWires.IWConfig.MechConversion;
|
||||
import malte0811.industrialWires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialWires.util.ConversionUtil;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import static malte0811.industrialwires.IWConfig.MechConversion.maxRotToKin;
|
||||
import static malte0811.industrialwires.util.NBTKeys.BUFFER;
|
||||
import static malte0811.industrialwires.util.NBTKeys.DIRECTION;
|
||||
import static malte0811.industrialWires.IWConfig.MechConversion.maxRotToKin;
|
||||
import static malte0811.industrialWires.util.NBTKeys.BUFFER;
|
||||
import static malte0811.industrialWires.util.NBTKeys.DIRECTION;
|
||||
|
||||
public class TileEntityMechIEtoIC extends TileEntityIWBase implements IDirectionalTile, IRotationAcceptor, IKineticSource {
|
||||
private EnumFacing dir = EnumFacing.DOWN;
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.converter;
|
||||
package malte0811.industrialWires.blocks.converter;
|
||||
|
||||
import blusunrize.immersiveengineering.api.ApiUtils;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IPlayerInteraction;
|
||||
|
@ -25,14 +25,14 @@ import ic2.api.energy.tile.IEnergyAcceptor;
|
|||
import ic2.api.energy.tile.IEnergyEmitter;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import ic2.api.energy.tile.IEnergySource;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.IBlockBoundsIW.IBlockBoundsDirectional;
|
||||
import malte0811.industrialwires.blocks.ISyncReceiver;
|
||||
import malte0811.industrialwires.blocks.TileEntityIWMultiblock;
|
||||
import malte0811.industrialwires.compat.Compat;
|
||||
import malte0811.industrialwires.mech_mb.*;
|
||||
import malte0811.industrialwires.network.MessageTileSyncIW;
|
||||
import malte0811.industrialwires.util.LocalSidedWorld;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.IBlockBoundsIW.IBlockBoundsDirectional;
|
||||
import malte0811.industrialWires.blocks.ISyncReceiver;
|
||||
import malte0811.industrialWires.blocks.TileEntityIWMultiblock;
|
||||
import malte0811.industrialWires.compat.Compat;
|
||||
import malte0811.industrialWires.mech_mb.*;
|
||||
import malte0811.industrialWires.network.MessageTileSyncIW;
|
||||
import malte0811.industrialWires.util.LocalSidedWorld;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
|
@ -58,12 +58,12 @@ import javax.annotation.Nullable;
|
|||
import java.util.*;
|
||||
|
||||
import static blusunrize.immersiveengineering.common.blocks.metal.BlockTypes_MetalDecoration0.HEAVY_ENGINEERING;
|
||||
import static malte0811.industrialwires.IEObjects.blockMetalDecoration0;
|
||||
import static malte0811.industrialwires.IndustrialWires.MMB_BREAKING;
|
||||
import static malte0811.industrialwires.mech_mb.EUCapability.ENERGY_IC2;
|
||||
import static malte0811.industrialwires.util.MiscUtils.getOffset;
|
||||
import static malte0811.industrialwires.util.MiscUtils.offset;
|
||||
import static malte0811.industrialwires.util.NBTKeys.*;
|
||||
import static malte0811.industrialWires.IEObjects.blockMetalDecoration0;
|
||||
import static malte0811.industrialWires.IndustrialWires.MMB_BREAKING;
|
||||
import static malte0811.industrialWires.mech_mb.EUCapability.ENERGY_IC2;
|
||||
import static malte0811.industrialWires.util.MiscUtils.getOffset;
|
||||
import static malte0811.industrialWires.util.MiscUtils.offset;
|
||||
import static malte0811.industrialWires.util.NBTKeys.*;
|
||||
|
||||
@net.minecraftforge.fml.common.Optional.InterfaceList({
|
||||
@net.minecraftforge.fml.common.Optional.Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "ic2"),
|
|
@ -13,11 +13,11 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.hv;
|
||||
package malte0811.industrialWires.blocks.hv;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEProperties;
|
||||
import malte0811.industrialwires.blocks.BlockIWBase;
|
||||
import malte0811.industrialwires.blocks.IMetaEnum;
|
||||
import malte0811.industrialWires.blocks.BlockIWBase;
|
||||
import malte0811.industrialWires.blocks.IMetaEnum;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
|
@ -13,12 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.hv;
|
||||
package malte0811.industrialWires.blocks.hv;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEProperties;
|
||||
import malte0811.industrialwires.blocks.BlockIWMultiblock;
|
||||
import malte0811.industrialwires.blocks.IMetaEnum;
|
||||
import malte0811.industrialwires.blocks.IWProperties;
|
||||
import malte0811.industrialWires.blocks.BlockIWMultiblock;
|
||||
import malte0811.industrialWires.blocks.IMetaEnum;
|
||||
import malte0811.industrialWires.blocks.IWProperties;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
|
@ -13,13 +13,13 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.hv;
|
||||
package malte0811.industrialWires.blocks.hv;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEProperties;
|
||||
import malte0811.industrialwires.blocks.BlockIWBase;
|
||||
import malte0811.industrialwires.blocks.IMetaEnum;
|
||||
import malte0811.industrialwires.blocks.IPlacementCheck;
|
||||
import malte0811.industrialwires.blocks.hv.TileEntityJacobsLadder.LadderSize;
|
||||
import malte0811.industrialWires.blocks.BlockIWBase;
|
||||
import malte0811.industrialWires.blocks.IMetaEnum;
|
||||
import malte0811.industrialWires.blocks.IPlacementCheck;
|
||||
import malte0811.industrialWires.blocks.hv.TileEntityJacobsLadder.LadderSize;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
|
@ -143,10 +143,9 @@ public class BlockJacobsLadder extends BlockIWBase implements IMetaEnum, IPlacem
|
|||
return new ItemStack(this, 1, getMetaFromState(state));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
|
||||
super.onEntityCollision(worldIn, pos, state, entityIn);
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
|
||||
super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn);
|
||||
TileEntity te = worldIn.getTileEntity(pos);
|
||||
if (te instanceof TileEntityJacobsLadder) {
|
||||
((TileEntityJacobsLadder) te).onEntityTouch(entityIn);
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.hv;
|
||||
package malte0811.industrialWires.blocks.hv;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.hv;
|
||||
package malte0811.industrialWires.blocks.hv;
|
||||
|
||||
import blusunrize.immersiveengineering.common.blocks.BlockIEBase;
|
||||
|
|
@ -13,15 +13,15 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.hv;
|
||||
package malte0811.industrialWires.blocks.hv;
|
||||
|
||||
import blusunrize.immersiveengineering.api.ApiUtils;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IPlayerInteraction;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.IBlockBoundsIW.IBlockBoundsDirectional;
|
||||
import malte0811.industrialwires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialwires.hv.IMarxTarget;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.IBlockBoundsIW.IBlockBoundsDirectional;
|
||||
import malte0811.industrialWires.blocks.TileEntityIWBase;
|
||||
import malte0811.industrialWires.hv.IMarxTarget;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -52,7 +52,7 @@ public class TileEntityDischargeMeter extends TileEntityIWBase implements IPlaye
|
|||
@Override
|
||||
public void readNBT(NBTTagCompound in, boolean updatePacket) {
|
||||
hasWire = in.getBoolean(HAS_WIRE);
|
||||
facing = EnumFacing.byHorizontalIndex(in.getByte(FACING));
|
||||
facing = EnumFacing.getHorizontal(in.getByte(FACING));
|
||||
lastDischarge = in.getDouble(LAST_DISCHARGE);
|
||||
aabb = null;
|
||||
}
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.hv;
|
||||
package malte0811.industrialWires.blocks.hv;
|
||||
|
||||
import blusunrize.immersiveengineering.api.ApiUtils;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces;
|
||||
|
@ -21,19 +21,20 @@ import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectio
|
|||
import blusunrize.immersiveengineering.common.blocks.TileEntityIEBase;
|
||||
import com.elytradev.mirage.lighting.IColoredLight;
|
||||
import com.elytradev.mirage.lighting.Light;
|
||||
import ic2.api.energy.event.EnergyTileLoadEvent;
|
||||
import ic2.api.energy.event.EnergyTileUnloadEvent;
|
||||
import ic2.api.energy.tile.IEnergyEmitter;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import malte0811.industrialwires.IWConfig;
|
||||
import malte0811.industrialwires.IWDamageSources;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.IBlockBoundsIW;
|
||||
import malte0811.industrialwires.blocks.IHasDummyBlocksIW;
|
||||
import malte0811.industrialwires.blocks.ISyncReceiver;
|
||||
import malte0811.industrialwires.compat.Compat;
|
||||
import malte0811.industrialwires.network.MessageTileSyncIW;
|
||||
import malte0811.industrialwires.util.Beziers;
|
||||
import malte0811.industrialwires.util.ConversionUtil;
|
||||
import malte0811.industrialwires.util.JouleEnergyStorage;
|
||||
import malte0811.industrialWires.IWConfig;
|
||||
import malte0811.industrialWires.IWDamageSources;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.IBlockBoundsIW;
|
||||
import malte0811.industrialWires.blocks.IHasDummyBlocksIW;
|
||||
import malte0811.industrialWires.blocks.ISyncReceiver;
|
||||
import malte0811.industrialWires.network.MessageTileSyncIW;
|
||||
import malte0811.industrialWires.util.Beziers;
|
||||
import malte0811.industrialWires.util.ConversionUtil;
|
||||
import malte0811.industrialWires.util.JouleEnergyStorage;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -52,6 +53,7 @@ import net.minecraft.util.math.AxisAlignedBB;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
|
@ -61,8 +63,8 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static malte0811.industrialwires.IndustrialWires.hasIC2;
|
||||
import static malte0811.industrialwires.util.MiscUtils.interpolate;
|
||||
import static malte0811.industrialWires.IndustrialWires.hasIC2;
|
||||
import static malte0811.industrialWires.util.MiscUtils.interpolate;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(modid = "ic2", iface = "ic2.api.energy.tile.IEnergySink"),
|
||||
|
@ -84,6 +86,7 @@ public class TileEntityJacobsLadder extends TileEntityIEBase implements ITickabl
|
|||
public int timeTillActive = -1;
|
||||
private double tStep = 0;
|
||||
private double consumtionJoule;
|
||||
private boolean addedToIC2Net = false;
|
||||
private int soundPhase;
|
||||
private Vec3d soundPos;
|
||||
public double salt;
|
||||
|
@ -108,12 +111,6 @@ public class TileEntityJacobsLadder extends TileEntityIEBase implements ITickabl
|
|||
40 * consumtionJoule);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
super.onLoad();
|
||||
Compat.loadIC2Tile.accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
ApiUtils.checkForNeedlessTicking(this);
|
||||
|
@ -121,6 +118,9 @@ public class TileEntityJacobsLadder extends TileEntityIEBase implements ITickabl
|
|||
return;
|
||||
}
|
||||
if (!world.isRemote) {
|
||||
if (hasIC2&&!addedToIC2Net) {
|
||||
addToIC2Net();
|
||||
}
|
||||
if ((controlControls[0][0] == null || timeTillActive == -1 || t >= 1)
|
||||
&& energy.getEnergyStoredJ() >= 2 * consumtionJoule) {
|
||||
for (int j = 0; j < size.movementPoints; j++) {
|
||||
|
@ -187,6 +187,12 @@ public class TileEntityJacobsLadder extends TileEntityIEBase implements ITickabl
|
|||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "ic2")
|
||||
private void addToIC2Net() {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
|
||||
addedToIC2Net = true;
|
||||
}
|
||||
|
||||
private void initArc(int delay) {
|
||||
if (controlMovement == null) {
|
||||
initControl();
|
||||
|
@ -457,22 +463,31 @@ public class TileEntityJacobsLadder extends TileEntityIEBase implements ITickabl
|
|||
@Override
|
||||
public void onChunkUnload() {
|
||||
if (hasIC2) {
|
||||
Compat.unloadIC2Tile.accept(this);
|
||||
removeFromIC2Net();
|
||||
}
|
||||
addedToIC2Net = false;
|
||||
super.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
if (hasIC2)
|
||||
Compat.unloadIC2Tile.accept(this);
|
||||
removeFromIC2Net();
|
||||
if (world.isRemote) {
|
||||
//stop sound
|
||||
IndustrialWires.proxy.playJacobsLadderSound(this, -1, soundPos);
|
||||
}
|
||||
addedToIC2Net = false;
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "ic2")
|
||||
private void removeFromIC2Net() {
|
||||
if (!world.isRemote && addedToIC2Net) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.blocks.hv;
|
||||
package malte0811.industrialWires.blocks.hv;
|
||||
|
||||
import blusunrize.immersiveengineering.api.ApiUtils;
|
||||
import blusunrize.immersiveengineering.api.IEProperties;
|
||||
|
@ -23,25 +23,24 @@ import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler;
|
|||
import blusunrize.immersiveengineering.api.energy.wires.WireType;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.redstone.IRedstoneConnector;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.redstone.RedstoneWireNetwork;
|
||||
import blusunrize.immersiveengineering.common.IESaveData;
|
||||
import blusunrize.immersiveengineering.common.blocks.BlockTypes_MetalsIE;
|
||||
import blusunrize.immersiveengineering.common.blocks.metal.*;
|
||||
import blusunrize.immersiveengineering.common.util.Utils;
|
||||
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;
|
||||
import com.elytradev.mirage.event.GatherLightsEvent;
|
||||
import com.elytradev.mirage.lighting.Light;
|
||||
import malte0811.industrialwires.*;
|
||||
import malte0811.industrialwires.blocks.IBlockBoundsIW;
|
||||
import malte0811.industrialwires.blocks.ISyncReceiver;
|
||||
import malte0811.industrialwires.blocks.IWProperties;
|
||||
import malte0811.industrialwires.blocks.TileEntityIWMultiblock;
|
||||
import malte0811.industrialwires.hv.IMarxTarget;
|
||||
import malte0811.industrialwires.hv.MarxOreHandler;
|
||||
import malte0811.industrialwires.network.MessageTileSyncIW;
|
||||
import malte0811.industrialwires.util.ConversionUtil;
|
||||
import malte0811.industrialwires.util.JouleEnergyStorage;
|
||||
import malte0811.industrialwires.util.MiscUtils;
|
||||
import malte0811.industrialwires.wires.MixedWireType;
|
||||
import malte0811.industrialWires.*;
|
||||
import malte0811.industrialWires.blocks.IBlockBoundsIW;
|
||||
import malte0811.industrialWires.blocks.ISyncReceiver;
|
||||
import malte0811.industrialWires.blocks.IWProperties;
|
||||
import malte0811.industrialWires.blocks.TileEntityIWMultiblock;
|
||||
import malte0811.industrialWires.hv.IMarxTarget;
|
||||
import malte0811.industrialWires.hv.MarxOreHandler;
|
||||
import malte0811.industrialWires.network.MessageTileSyncIW;
|
||||
import malte0811.industrialWires.util.ConversionUtil;
|
||||
import malte0811.industrialWires.util.JouleEnergyStorage;
|
||||
import malte0811.industrialWires.util.MiscUtils;
|
||||
import malte0811.industrialWires.wires.IC2Wiretype;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -71,10 +70,11 @@ import javax.annotation.Nullable;
|
|||
import java.util.*;
|
||||
|
||||
import static blusunrize.immersiveengineering.api.energy.wires.WireType.REDSTONE_CATEGORY;
|
||||
import static malte0811.industrialwires.blocks.hv.TileEntityMarx.FiringState.FIRE;
|
||||
import static malte0811.industrialwires.util.MiscUtils.offset;
|
||||
import static malte0811.industrialwires.util.NBTKeys.*;
|
||||
import static malte0811.industrialwires.wires.MixedWireType.IC2_HV_CAT;
|
||||
import static malte0811.industrialWires.blocks.hv.TileEntityMarx.FiringState.FIRE;
|
||||
import static malte0811.industrialWires.util.MiscUtils.getOffset;
|
||||
import static malte0811.industrialWires.util.MiscUtils.offset;
|
||||
import static malte0811.industrialWires.util.NBTKeys.*;
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.IC2_HV_CAT;
|
||||
import static net.minecraft.item.EnumDyeColor.*;
|
||||
|
||||
/**
|
||||
|
@ -88,7 +88,7 @@ import static net.minecraft.item.EnumDyeColor.*;
|
|||
* Pink: Fine top cap voltage
|
||||
*/
|
||||
@Mod.EventBusSubscriber
|
||||
public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable, ISyncReceiver, IBlockBoundsIW, IImmersiveConnectable, IMixedConnector,
|
||||
public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable, ISyncReceiver, IBlockBoundsIW, IImmersiveConnectable, IIC2Connector,
|
||||
IRedstoneConnector {
|
||||
//Only relevant client-side.
|
||||
private static final Set<TileEntityMarx> FIRING_GENERATORS = Collections.newSetFromMap(new WeakHashMap<>());
|
||||
|
@ -104,7 +104,7 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
public FiringState state = FiringState.CHARGING;
|
||||
public Discharge dischargeData;
|
||||
// Voltage=10*storedJ
|
||||
private JouleEnergyStorage storage = new JouleEnergyStorage(50_000, 20*32_000);
|
||||
private JouleEnergyStorage storage = new JouleEnergyStorage(5_000, 3_200);
|
||||
private boolean hasConnection;
|
||||
private double[] capVoltages;
|
||||
private int voltageControl = 0;
|
||||
|
@ -159,6 +159,8 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
return getPos().subtract(offset).offset(facing.getOpposite(), 3);
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public IBlockState getOriginalBlock() {
|
||||
int forward = getForward();
|
||||
|
@ -189,53 +191,6 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disassemble() {
|
||||
boolean active = formed && !world.isRemote;
|
||||
IndustrialWires.logger.info("Calling disassemble for {}, active {}", pos, active);
|
||||
super.disassemble();
|
||||
if (active) {
|
||||
final int forward = -1;
|
||||
BlockPos master = pos.subtract(offset);
|
||||
ItemStack coil = new ItemStack(IEObjects.itemWireCoil, 1, 2);
|
||||
WireType type = WireType.STEEL;
|
||||
TargetingInfo dummy = new TargetingInfo(EnumFacing.DOWN, 0, 0, 0);
|
||||
for (int up = 0; up < stageCount - 1; ++up) {
|
||||
for (int right = 0; right < 2; ++right) {
|
||||
BlockPos lowerPos = offset(master, facing, mirrored, right, forward, up);
|
||||
BlockPos upperPos = lowerPos.up();
|
||||
IndustrialWires.logger.info("Lower: {}, upper: {}, master: {}", lowerPos, upperPos, master);
|
||||
TileEntity lowerTE = world.getTileEntity(lowerPos);
|
||||
if (!(lowerTE instanceof IImmersiveConnectable)) {
|
||||
world.spawnEntity(new EntityItem(world, lowerPos.getX() + .5, lowerPos.getY() + .5,
|
||||
lowerPos.getZ() + .5, coil));
|
||||
continue;
|
||||
}
|
||||
TileEntity upperTE = world.getTileEntity(upperPos);
|
||||
if (!(upperTE instanceof IImmersiveConnectable)) {
|
||||
world.spawnEntity(new EntityItem(world, lowerPos.getX() + .5, lowerPos.getY() + .5,
|
||||
lowerPos.getZ() + .5, coil));
|
||||
continue;
|
||||
}
|
||||
IImmersiveConnectable lowerIIC = (IImmersiveConnectable) lowerTE;
|
||||
IImmersiveConnectable upperIIC = (IImmersiveConnectable) upperTE;
|
||||
ImmersiveNetHandler.Connection conn = ImmersiveNetHandler.INSTANCE.addAndGetConnection(world,
|
||||
lowerPos, upperPos, 1, type);
|
||||
lowerIIC.connectCable(type, dummy, upperIIC);
|
||||
upperIIC.connectCable(type, dummy, lowerIIC);
|
||||
ImmersiveNetHandler.INSTANCE.addBlockData(world, conn);
|
||||
IESaveData.setDirty(world.provider.getDimension());
|
||||
lowerTE.markDirty();
|
||||
IBlockState state = world.getBlockState(lowerPos);
|
||||
world.notifyBlockUpdate(lowerPos, state, state, 3);
|
||||
upperTE.markDirty();
|
||||
state = world.getBlockState(upperPos);
|
||||
world.notifyBlockUpdate(upperPos, state, state, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
ApiUtils.checkForNeedlessTicking(this);
|
||||
|
@ -329,11 +284,11 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
|
||||
private void handleOreProcessing(double energyStored) {
|
||||
BlockPos bottom = getBottomElectrode();
|
||||
List<BlockPos> toBreak = new ArrayList<>(stageCount - 2);
|
||||
Set<BlockPos> toBreak = new HashSet<>(stageCount-2);
|
||||
int ores = 0;
|
||||
for (int i = 1;i<stageCount-1;i++) {
|
||||
BlockPos blockHere = bottom.up(i);
|
||||
if (!world.isAirBlock(blockHere)) {
|
||||
if (!world.isAirBlock(blockHere) && canBreak(blockHere)) {
|
||||
toBreak.add(blockHere);
|
||||
ores++;
|
||||
}
|
||||
|
@ -372,7 +327,7 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
double tinnitusDistSqu = Math.sqrt(energyStored)/50;
|
||||
Vec3d v0 = getMiddle();
|
||||
AxisAlignedBB aabb = new AxisAlignedBB(v0.x, v0.y, v0.z, v0.x, v0.y, v0.z);
|
||||
aabb = aabb.grow(0, stageCount / 2. - 1, 0);
|
||||
aabb = aabb.grow(0, stageCount/2-1,0);
|
||||
aabb = aabb.grow(tinnitusDistSqu);
|
||||
List<Entity> fools = world.getEntitiesWithinAABB(Entity.class, aabb);
|
||||
damageDistSqu *= damageDistSqu;
|
||||
|
@ -414,6 +369,16 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
}
|
||||
}
|
||||
|
||||
//checks whether the given pos can't be broken because it is part of the generator
|
||||
private boolean canBreak(BlockPos pos) {
|
||||
BlockPos dischargePos = offset(this.pos, facing, mirrored, 1, 3, 0);
|
||||
Vec3i offset = getOffset(dischargePos, facing, mirrored, pos);
|
||||
if (offset.getZ()<1||offset.getZ()>=stageCount-1) {
|
||||
return false;
|
||||
}
|
||||
return Math.abs(offset.getX())>Math.abs(offset.getY());
|
||||
}
|
||||
|
||||
private int getRSSignalFromVoltage(double voltage) {
|
||||
return (int) (Math.round(255 * voltage / MAX_VOLTAGE)&0xff);
|
||||
}
|
||||
|
@ -567,14 +532,12 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
}
|
||||
|
||||
@Override
|
||||
public double insertEnergy(double joules, boolean simulate) {
|
||||
public double insertEnergy(double eu, boolean simulate) {
|
||||
TileEntityMarx master = master(this);
|
||||
if (master!=null) {
|
||||
double ret = master.storage.insert(joules, 1, simulate, master.leftover);
|
||||
if (!simulate) {
|
||||
master.leftover -= ret;
|
||||
}
|
||||
return joules -ret;
|
||||
double ret = master.storage.insert(eu, ConversionUtil.joulesPerEu(), simulate, master.leftover);
|
||||
master.leftover -= ret;
|
||||
return eu-ret;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
@ -585,9 +548,8 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
return pos;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canConnectCable(WireType cableType, TargetingInfo target, Vec3i offset) {
|
||||
public boolean canConnectCable(WireType cableType, TargetingInfo target) {
|
||||
if (hasConnection) {
|
||||
return false;
|
||||
}
|
||||
|
@ -601,18 +563,16 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
@Override
|
||||
public void connectCable(WireType cableType, TargetingInfo target, IImmersiveConnectable other) {
|
||||
hasConnection = true;
|
||||
if (WireType.REDSTONE_CATEGORY.equals(cableType.getCategory()))
|
||||
RedstoneWireNetwork.updateConnectors(pos, world, getNetwork());
|
||||
}
|
||||
|
||||
@Override
|
||||
public WireType getCableLimiter(TargetingInfo target) {
|
||||
return getRight()==0?WireType.REDSTONE:MixedWireType.HV;
|
||||
return getRight()==0?WireType.REDSTONE:IC2Wiretype.HV;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowEnergyToPass(ImmersiveNetHandler.Connection con) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -631,7 +591,7 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getConnectionOffset(ImmersiveNetHandler.Connection con) {
|
||||
public Vec3d getRaytraceOffset(IImmersiveConnectable link) {
|
||||
Matrix4 transf = getBaseTransform();
|
||||
if (getRight()==0) {
|
||||
return transf.apply(new Vec3d(.5, .5, 7/16D));
|
||||
|
@ -640,19 +600,24 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getConnectionOffset(ImmersiveNetHandler.Connection con) {
|
||||
return getRaytraceOffset(null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void validate()
|
||||
{
|
||||
super.validate();
|
||||
if (!world.isRemote)
|
||||
ApiUtils.addFutureServerTask(world, () -> ImmersiveNetHandler.INSTANCE.onTEValidated(this));
|
||||
ImmersiveNetHandler.INSTANCE.resetCachedIndirectConnections();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate()
|
||||
{
|
||||
super.invalidate();
|
||||
if (world.isRemote && !IndustrialWires.proxy.isSingleplayer())
|
||||
if (world.isRemote)
|
||||
ImmersiveNetHandler.INSTANCE.clearConnectionsOriginatingFrom(pos, world);
|
||||
}
|
||||
|
||||
|
@ -746,16 +711,16 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
.radius(5);
|
||||
List<Light> toAdd = new ArrayList<>(te.stageCount*2-3);
|
||||
if (te.dischargeData!=null&&te.dischargeData.energy>0) {
|
||||
toAdd.add(builder.pos(origin.add(0, 0, 0)).build());
|
||||
toAdd.add(builder.pos(origin.add(0, te.stageCount / 2, 0)).build());
|
||||
toAdd.add(builder.pos(origin.add(0, te.stageCount - 2, 0)).build());
|
||||
toAdd.add(builder.pos(origin.addVector(0, 0, 0)).build());
|
||||
toAdd.add(builder.pos(origin.addVector(0, te.stageCount/2, 0)).build());
|
||||
toAdd.add(builder.pos(origin.addVector(0, te.stageCount-2, 0)).build());
|
||||
}
|
||||
origin = new Vec3d(offset(te.pos, te.facing, te.mirrored, 1, 0, 0))
|
||||
.add(0, .75, 0)
|
||||
.addVector(0, .75, 0)
|
||||
.add(new Vec3d(te.facing.getDirectionVec()).scale(.25));
|
||||
builder.radius(.5F);
|
||||
for (int i = 0;i<te.stageCount-1;i+=te.stageCount/5) {
|
||||
toAdd.add(builder.pos(origin.add(0, i, 0)).build());
|
||||
toAdd.add(builder.pos(origin.addVector(0, i, 0)).build());
|
||||
}
|
||||
event.getLightList().addAll(toAdd);
|
||||
}
|
||||
|
@ -800,12 +765,12 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
|
|||
Vec3d diff = vertices[max].subtract(vertices[min]);
|
||||
Vec3d v0 = diff.crossProduct(side);
|
||||
transform.setIdentity();
|
||||
double diffLength = diff.length();
|
||||
double diffLength = diff.lengthVector();
|
||||
double noise = Math.sqrt(diffLength)*rand.nextDouble()*1/(1+Math.abs(stageCount/2.0-toGenerate))*.75;
|
||||
if ((max-min)%2==1) {
|
||||
noise *= (toGenerate-min)/(double)(max-min);
|
||||
}
|
||||
v0 = v0.scale((float) (noise / v0.length()));
|
||||
v0 = v0.scale((float) (noise/v0.lengthVector()));
|
||||
diff = diff.scale(1/diffLength);
|
||||
transform.rotate(Math.PI*2*rand.nextDouble(), diff.x, diff.y, diff.z);
|
||||
Vec3d center = vertices[max].add(vertices[min]).scale(.5);
|
|
@ -12,15 +12,13 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks.wire;
|
||||
package malte0811.industrialWires.blocks.wire;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEProperties;
|
||||
import malte0811.industrialwires.IWConfig;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.BlockIWBase;
|
||||
import malte0811.industrialwires.blocks.IMetaEnum;
|
||||
import malte0811.industrialwires.util.ConversionUtil;
|
||||
import malte0811.industrialwires.wires.MixedWireType;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.BlockIWBase;
|
||||
import malte0811.industrialWires.blocks.IMetaEnum;
|
||||
import malte0811.industrialWires.wires.IC2Wiretype;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
|
@ -64,7 +62,7 @@ public class BlockIC2Connector extends BlockIWBase implements IMetaEnum {
|
|||
TileEntity te = world.getTileEntity(pos);
|
||||
if (te instanceof TileEntityIC2ConnectorTin) {
|
||||
TileEntityIC2ConnectorTin connector = (TileEntityIC2ConnectorTin) te;
|
||||
if (world.isAirBlock(pos.offset(connector.getFacing()))) {
|
||||
if (world.isAirBlock(pos.offset(connector.facing))) {
|
||||
this.dropBlockAsItem(connector.getWorld(), pos, world.getBlockState(pos), 0);
|
||||
connector.getWorld().setBlockToAir(pos);
|
||||
}
|
||||
|
@ -124,11 +122,10 @@ public class BlockIC2Connector extends BlockIWBase implements IMetaEnum {
|
|||
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state) {
|
||||
TileEntityIC2ConnectorTin base = getBaseTE(state.getValue(TYPE));
|
||||
if (base!=null) {
|
||||
base.setFacing(state.getValue(IEProperties.FACING_ALL));
|
||||
base.facing = state.getValue(IEProperties.FACING_ALL);
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
private TileEntityIC2ConnectorTin getBaseTE(BlockTypes_IC2_Connector type) {
|
||||
switch (type) {
|
||||
case TIN_CONN:
|
||||
|
@ -162,10 +159,9 @@ public class BlockIC2Connector extends BlockIWBase implements IMetaEnum {
|
|||
if (!stack.isEmpty() && stack.getMetadata() % 2 == 0) {
|
||||
int type = stack.getMetadata() / 2;
|
||||
tooltip.add(I18n.format(IndustrialWires.MODID + ".tooltip.power_tier", (type%5) + 1));
|
||||
MixedWireType wire = MixedWireType.ALL[type];
|
||||
tooltip.add(I18n.format(IndustrialWires.MODID + ".tooltip.energy_per_tick",
|
||||
wire.getIORate()*ConversionUtil.euPerJoule(),
|
||||
wire.getIORate()*ConversionUtil.ifPerJoule()*IWConfig.wireRatio));
|
||||
IC2Wiretype wire = IC2Wiretype.ALL[type];
|
||||
tooltip.add(I18n.format(IndustrialWires.MODID + ".tooltip.eu_per_tick",
|
||||
wire.getTransferRate() / wire.getFactor()));
|
||||
}
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks.wire;
|
||||
package malte0811.industrialWires.blocks.wire;
|
||||
|
||||
import blusunrize.immersiveengineering.common.blocks.BlockIEBase.IBlockEnum;
|
||||
|
|
@ -12,17 +12,30 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks.wire;
|
||||
package malte0811.industrialWires.blocks.wire;
|
||||
|
||||
import static malte0811.industrialwires.wires.MixedWireType.COPPER_IC2;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.WireType;
|
||||
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.COPPER_IC2;
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.IC2_COPPER_CAT;
|
||||
|
||||
public class TileEntityIC2ConnectorCopper extends TileEntityIC2ConnectorTin {
|
||||
|
||||
public TileEntityIC2ConnectorCopper(boolean rel) {
|
||||
super(rel, COPPER_IC2, 2, .5, .5);
|
||||
super(rel);
|
||||
}
|
||||
|
||||
public TileEntityIC2ConnectorCopper() {
|
||||
this(false);
|
||||
}
|
||||
|
||||
{
|
||||
tier = 2;
|
||||
maxStored = COPPER_IC2.getTransferRate() / COPPER_IC2.getFactor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(WireType t) {
|
||||
return IC2_COPPER_CAT.equals(t.getCategory());
|
||||
}
|
||||
|
||||
}
|
|
@ -12,16 +12,28 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.blocks.wire;
|
||||
package malte0811.industrialWires.blocks.wire;
|
||||
|
||||
import static malte0811.industrialwires.wires.MixedWireType.GLASS;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.WireType;
|
||||
|
||||
public class TileEntityIC2ConnectorGlass extends TileEntityIC2ConnectorTin {
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.GLASS;
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.IC2_GLASS_CAT;
|
||||
|
||||
public class TileEntityIC2ConnectorGlass extends TileEntityIC2ConnectorHV {
|
||||
public TileEntityIC2ConnectorGlass(boolean rel) {
|
||||
super(rel, GLASS, 5, .875, .75);
|
||||
super(rel);
|
||||
}
|
||||
|
||||
public TileEntityIC2ConnectorGlass() {
|
||||
this(false);
|
||||
}
|
||||
|
||||
{
|
||||
tier = 5;
|
||||
maxStored = GLASS.getTransferRate() / GLASS.getFactor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(WireType t) {
|
||||
return IC2_GLASS_CAT.equals(t.getCategory());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* This file is part of Industrial Wires.
|
||||
* Copyright (C) 2016-2018 malte0811
|
||||
* Industrial Wires is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Industrial Wires is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialWires.blocks.wire;
|
||||
|
||||
import blusunrize.immersiveengineering.api.energy.wires.IImmersiveConnectable;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler.Connection;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.WireType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.GOLD;
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.IC2_GOLD_CAT;
|
||||
|
||||
public class TileEntityIC2ConnectorGold extends TileEntityIC2ConnectorTin {
|
||||
|
||||
public TileEntityIC2ConnectorGold(boolean rel) {
|
||||
super(rel);
|
||||
}
|
||||
|
||||
public TileEntityIC2ConnectorGold() {
|
||||
}
|
||||
|
||||
{
|
||||
tier = 3;
|
||||
maxStored = GOLD.getTransferRate() / GOLD.getFactor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(WireType t) {
|
||||
return IC2_GOLD_CAT.equals(t.getCategory());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getRaytraceOffset(IImmersiveConnectable link) {
|
||||
EnumFacing side = facing.getOpposite();
|
||||
return new Vec3d(.5 + side.getFrontOffsetX() * .125, .5 + side.getFrontOffsetY() * .125, .5 + side.getFrontOffsetZ() * .125);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getConnectionOffset(Connection con) {
|
||||
EnumFacing side = facing.getOpposite();
|
||||
double conRadius = con.cableType.getRenderDiameter() / 2;
|
||||
return new Vec3d(.5 + side.getFrontOffsetX() * (.0625 - conRadius), .5 + side.getFrontOffsetY() * (.0625 - conRadius), .5 + side.getFrontOffsetZ() * (.0625 - conRadius));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* This file is part of Industrial Wires.
|
||||
* Copyright (C) 2016-2018 malte0811
|
||||
* Industrial Wires is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Industrial Wires is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialWires.blocks.wire;
|
||||
|
||||
import blusunrize.immersiveengineering.api.energy.wires.IImmersiveConnectable;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler.Connection;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.WireType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.HV;
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.IC2_HV_CAT;
|
||||
|
||||
public class TileEntityIC2ConnectorHV extends TileEntityIC2ConnectorTin {
|
||||
|
||||
public TileEntityIC2ConnectorHV(boolean rel) {
|
||||
super(rel);
|
||||
}
|
||||
|
||||
public TileEntityIC2ConnectorHV() {
|
||||
}
|
||||
|
||||
{
|
||||
tier = 4;
|
||||
maxStored = HV.getTransferRate() / HV.getFactor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(WireType t) {
|
||||
return IC2_HV_CAT.equals(t.getCategory());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getRaytraceOffset(IImmersiveConnectable link) {
|
||||
EnumFacing side = facing.getOpposite();
|
||||
if (relay) {
|
||||
return new Vec3d(.5 + side.getFrontOffsetX() * .4375, .5 + side.getFrontOffsetY() * .4375, .5 + side.getFrontOffsetZ() * .4375);
|
||||
} else {
|
||||
return new Vec3d(.5 + side.getFrontOffsetX() * .3125, .5 + side.getFrontOffsetY() * .3125, .5 + side.getFrontOffsetZ() * .3125);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getConnectionOffset(Connection con) {
|
||||
EnumFacing side = facing.getOpposite();
|
||||
double conRadius = con.cableType.getRenderDiameter() / 2;
|
||||
if (relay) {
|
||||
return new Vec3d(.5 + side.getFrontOffsetX() * (.375 - conRadius), .5 + side.getFrontOffsetY() * (.375 - conRadius), .5 + side.getFrontOffsetZ() * (.375 - conRadius));
|
||||
} else {
|
||||
return new Vec3d(.5 + side.getFrontOffsetX() * (.25 - conRadius), .5 + side.getFrontOffsetY() * (.25 - conRadius), .5 + side.getFrontOffsetZ() * (.25 - conRadius));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,457 @@
|
|||
/*
|
||||
* This file is part of Industrial Wires.
|
||||
* Copyright (C) 2016-2018 malte0811
|
||||
* Industrial Wires is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Industrial Wires is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialWires.blocks.wire;
|
||||
|
||||
import blusunrize.immersiveengineering.api.ApiUtils;
|
||||
import blusunrize.immersiveengineering.api.TargetingInfo;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.*;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler.AbstractConnection;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler.Connection;
|
||||
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile;
|
||||
import ic2.api.energy.event.EnergyTileLoadEvent;
|
||||
import ic2.api.energy.event.EnergyTileUnloadEvent;
|
||||
import ic2.api.energy.tile.IEnergyAcceptor;
|
||||
import ic2.api.energy.tile.IEnergyEmitter;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import ic2.api.energy.tile.IEnergySource;
|
||||
import malte0811.industrialWires.IIC2Connector;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.IBlockBoundsIW;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.IC2_TIN_CAT;
|
||||
import static malte0811.industrialWires.wires.IC2Wiretype.TIN;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "ic2"),
|
||||
@Optional.Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "ic2")
|
||||
})
|
||||
public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable implements IEnergySource, IEnergySink, IDirectionalTile,
|
||||
ITickable, IIC2Connector, IBlockBoundsIW {
|
||||
private static final double EPS = .1;
|
||||
EnumFacing facing = EnumFacing.NORTH;
|
||||
boolean relay;
|
||||
private boolean first = true;
|
||||
//IC2 net to IE net buffer
|
||||
double bufferToNet = 0;
|
||||
private double ieInputInTick = 0;
|
||||
double maxToNet = 0;
|
||||
//IE net to IC2 net buffer
|
||||
double bufferToMachine = 0;
|
||||
private double ic2inputInTick = 0;
|
||||
double maxToMachine = 0;
|
||||
double maxStored = TIN.getTransferRate() / TIN.getFactor();
|
||||
int tier = 1;
|
||||
|
||||
TileEntityIC2ConnectorTin(boolean rel) {
|
||||
relay = rel;
|
||||
}
|
||||
|
||||
public TileEntityIC2ConnectorTin() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (first) {
|
||||
if (!world.isRemote&& IndustrialWires.hasIC2)
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
|
||||
ImmersiveNetHandler.INSTANCE.onTEValidated(this);
|
||||
first = false;
|
||||
}
|
||||
if (bufferToNet < maxToNet) {
|
||||
maxToNet = bufferToNet;
|
||||
}
|
||||
if (ic2inputInTick >maxToNet) {
|
||||
maxToNet = ic2inputInTick;
|
||||
}
|
||||
ic2inputInTick = 0;
|
||||
|
||||
if (bufferToMachine < maxToMachine) {
|
||||
maxToMachine = bufferToMachine;
|
||||
}
|
||||
if (ieInputInTick >maxToMachine) {
|
||||
maxToMachine = ieInputInTick;
|
||||
}
|
||||
ieInputInTick = 0;
|
||||
|
||||
if (!world.isRemote) {
|
||||
if (bufferToNet > EPS) {
|
||||
transferPower();
|
||||
}
|
||||
if (bufferToNet >EPS) {
|
||||
notifyAvailableEnergy(bufferToNet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void transferPower() {
|
||||
Set<AbstractConnection> conns = ImmersiveNetHandler.INSTANCE.getIndirectEnergyConnections(pos, world, true);
|
||||
Map<AbstractConnection, Pair<IIC2Connector, Double>> maxOutputs = new HashMap<>();
|
||||
double outputMax = Math.min(bufferToNet, maxToNet);
|
||||
double sum = 0;
|
||||
for (AbstractConnection c : conns) {
|
||||
if (c.isEnergyOutput) {
|
||||
IImmersiveConnectable iic = ApiUtils.toIIC(c.end, world);
|
||||
if (iic instanceof IIC2Connector) {
|
||||
double extract =
|
||||
outputMax - ((IIC2Connector) iic).insertEnergy(outputMax, true);
|
||||
if (extract > EPS) {
|
||||
maxOutputs.put(c, new ImmutablePair<>((IIC2Connector) iic, extract));
|
||||
sum += extract;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sum > EPS) {
|
||||
HashMap<Connection, Integer> transferedPerConn = ImmersiveNetHandler.INSTANCE.getTransferedRates(world.provider.getDimension());
|
||||
for (Map.Entry<AbstractConnection, Pair<IIC2Connector, Double>> entry : maxOutputs.entrySet()) {
|
||||
Pair<IIC2Connector, Double> p = entry.getValue();
|
||||
AbstractConnection c = entry.getKey();
|
||||
double out = outputMax * p.getRight() / sum;
|
||||
double loss = getAverageLossRate(c);
|
||||
out = Math.min(out, bufferToNet -loss);
|
||||
if (out<=0)
|
||||
continue;
|
||||
double inserted = out - p.getLeft().insertEnergy(out, false);
|
||||
double energyAtConn = inserted + loss;
|
||||
bufferToNet -= energyAtConn;
|
||||
float intermediaryLoss = 0;
|
||||
HashSet<IImmersiveConnectable> passedConnectors = new HashSet<>();
|
||||
for (Connection sub : c.subConnections) {
|
||||
int transferredPerCon = transferedPerConn.getOrDefault(sub, 0);
|
||||
energyAtConn -= sub.cableType.getLossRatio() * sub.length;
|
||||
ImmersiveNetHandler.INSTANCE.getTransferedRates(world.provider.getDimension()).put(sub, (int) (transferredPerCon + energyAtConn));
|
||||
IImmersiveConnectable subStart = ApiUtils.toIIC(sub.start, world);
|
||||
IImmersiveConnectable subEnd = ApiUtils.toIIC(sub.end, world);
|
||||
if (subStart != null && passedConnectors.add(subStart))
|
||||
subStart.onEnergyPassthrough((int) (inserted - inserted * intermediaryLoss));
|
||||
if (subEnd != null && passedConnectors.add(subEnd))
|
||||
subEnd.onEnergyPassthrough((int) (inserted - inserted * intermediaryLoss));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyAvailableEnergy(double storedNew)
|
||||
{
|
||||
Set<AbstractConnection> outputs = ImmersiveNetHandler.INSTANCE.getIndirectEnergyConnections(pos, world, true);
|
||||
for(AbstractConnection con : outputs)
|
||||
{
|
||||
IImmersiveConnectable end = ApiUtils.toIIC(con.end, world);
|
||||
if(con.cableType!=null && end!=null && end.allowEnergyToPass(null))
|
||||
{
|
||||
Pair<Float, Consumer<Float>> e = getEnergyForConnection(con, storedNew);
|
||||
end.addAvailableEnergy(e.getKey(), e.getValue());
|
||||
}
|
||||
}
|
||||
addAvailableEnergy(-1, null);
|
||||
}
|
||||
|
||||
private Pair<Float, Consumer<Float>> getEnergyForConnection(@Nullable AbstractConnection c, double storedNew)
|
||||
{
|
||||
float loss = c!=null?c.getAverageLossRate():0;
|
||||
float max = (float) (storedNew-loss);
|
||||
Consumer<Float> extract = (energy)->{
|
||||
bufferToNet -= energy+loss;
|
||||
};
|
||||
return new ImmutablePair<>(max, extract);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamageAmount(Entity e, Connection c) {
|
||||
return (float) Math.ceil(super.getDamageAmount(e, c));
|
||||
}
|
||||
|
||||
private double getAverageLossRate(AbstractConnection conn) {
|
||||
double f = 0;
|
||||
for (Connection c : conn.subConnections) {
|
||||
f += c.length * c.cableType.getLossRatio();
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
//Input through the net
|
||||
@Override
|
||||
public double insertEnergy(double eu, boolean simulate) {
|
||||
final double insert = Math.min(maxStored - bufferToMachine, eu);
|
||||
if (!simulate) {
|
||||
bufferToMachine += insert;
|
||||
} else {
|
||||
//Yes, this is weird. But it works, otherwise the system can get stuck at a lower output rate with a full buffer
|
||||
ieInputInTick += insert;
|
||||
}
|
||||
return eu - insert;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
if (!world.isRemote && !first)
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
|
||||
first = true;
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
if (!world.isRemote && !first)
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
|
||||
first = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getConnectionOffset(Connection con) {
|
||||
EnumFacing side = facing.getOpposite();
|
||||
double conRadius = con.cableType.getRenderDiameter() / 2;
|
||||
return new Vec3d(.5 - conRadius * side.getFrontOffsetX(), .5 - conRadius * side.getFrontOffsetY(), .5 - conRadius * side.getFrontOffsetZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnergyOutput() {
|
||||
return !relay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectCable(WireType cableType, TargetingInfo target, Vec3i offset) {
|
||||
return (limitType == null || (this.isRelay() && WireApi.canMix(cableType, limitType))) && canConnect(cableType);
|
||||
}
|
||||
|
||||
public boolean canConnect(WireType t) {
|
||||
return IC2_TIN_CAT.equals(t.getCategory());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isRelay() {
|
||||
return relay;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid="ic2")
|
||||
public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing side) {
|
||||
return !relay && side == facing;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid="ic2")
|
||||
public boolean acceptsEnergyFrom(IEnergyEmitter emitter, EnumFacing side) {
|
||||
return !relay && side == facing;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid="ic2")
|
||||
public double getDemandedEnergy() {
|
||||
double ret = maxStored + .5 - bufferToNet;
|
||||
if (ret < .1)
|
||||
ret = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid="ic2")
|
||||
public int getSinkTier() {
|
||||
return tier;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid="ic2")
|
||||
public double injectEnergy(EnumFacing directionFrom, double amount, double voltage) {
|
||||
if (bufferToNet < maxStored) {
|
||||
addToIn(amount);
|
||||
markDirty();
|
||||
return 0;
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid="ic2")
|
||||
public double getOfferedEnergy() {
|
||||
return Math.min(maxToMachine, bufferToMachine);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid="ic2")
|
||||
public void drawEnergy(double amount) {
|
||||
bufferToMachine -= amount;
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected Pair<Float,Consumer<Float>> getOwnEnergy()
|
||||
{
|
||||
if (isRelay())
|
||||
return null;
|
||||
return new ImmutablePair<>((float) bufferToNet, (d)-> bufferToNet -= d);
|
||||
}
|
||||
@Override
|
||||
protected float getBaseDamage(ImmersiveNetHandler.Connection c) {
|
||||
return 1/64F;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid="ic2")
|
||||
public int getSourceTier() {
|
||||
return tier;
|
||||
}
|
||||
|
||||
private void addToIn(double amount) {
|
||||
bufferToNet += amount;
|
||||
ic2inputInTick += amount;
|
||||
notifyAvailableEnergy(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(@Nonnull NBTTagCompound nbt, boolean descPacket) {
|
||||
super.readCustomNBT(nbt, descPacket);
|
||||
facing = EnumFacing.getFront(nbt.getInteger("facing"));
|
||||
relay = nbt.getBoolean("relay");
|
||||
bufferToNet = nbt.getDouble("inBuffer");
|
||||
bufferToMachine = nbt.getDouble("outBuffer");
|
||||
if (nbt.hasKey("maxToNet")) {
|
||||
maxToNet = nbt.getDouble("maxToNet");
|
||||
} else {
|
||||
maxToNet = bufferToNet;
|
||||
}
|
||||
if (nbt.hasKey("maxToMachine")) {
|
||||
maxToMachine = nbt.getDouble("maxToMachine");
|
||||
} else {
|
||||
maxToMachine = bufferToMachine;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeCustomNBT(@Nonnull NBTTagCompound nbt, boolean descPacket) {
|
||||
super.writeCustomNBT(nbt, descPacket);
|
||||
nbt.setInteger("facing", facing.getIndex());
|
||||
nbt.setBoolean("relay", relay);
|
||||
nbt.setDouble("inBuffer", bufferToNet);
|
||||
nbt.setDouble("outBuffer", bufferToMachine);
|
||||
nbt.setDouble("maxToNet", maxToNet);
|
||||
nbt.setDouble("maxToMachine", maxToMachine);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumFacing getFacing() {
|
||||
return facing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(@Nonnull EnumFacing facing) {
|
||||
this.facing = facing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFacingLimitation() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mirrorFacingOnPlacement(@Nonnull EntityLivingBase placer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHammerRotate(@Nonnull EnumFacing side, float hitX, float hitY, float hitZ, @Nonnull EntityLivingBase entity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox() {
|
||||
float length = this instanceof TileEntityIC2ConnectorHV ? (relay ? .875f : .75f) : this instanceof TileEntityIC2ConnectorGold ? .5625f : .5f;
|
||||
float wMin = .3125f;
|
||||
float wMax = .6875f;
|
||||
switch (facing.getOpposite()) {
|
||||
case UP:
|
||||
return new AxisAlignedBB(wMin, 0, wMin, wMax, length, wMax);
|
||||
case DOWN:
|
||||
return new AxisAlignedBB(wMin, 1 - length, wMin, wMax, 1, wMax);
|
||||
case SOUTH:
|
||||
return new AxisAlignedBB(wMin, wMin, 0, wMax, wMax, length);
|
||||
case NORTH:
|
||||
return new AxisAlignedBB(wMin, wMin, 1 - length, wMax, wMax, 1);
|
||||
case EAST:
|
||||
return new AxisAlignedBB(0, wMin, wMin, length, wMax, wMax);
|
||||
case WEST:
|
||||
return new AxisAlignedBB(1 - length, wMin, wMin, 1, wMax, wMax);
|
||||
}
|
||||
return new AxisAlignedBB(0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* regarding equals+hashCode
|
||||
* TE's are considered equal if they have the same pos+dimension id
|
||||
* This is necessary to work around a weird bug causing a lot of log spam (100GB and above are well possible).
|
||||
* For further information see #1 (https://github.com/malte0811/IndustrialWires/issues/1)
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
if (world==null)
|
||||
return 0;
|
||||
int ret = world.provider.getDimension();
|
||||
ret = 31 * ret + pos.hashCode();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof TileEntityIC2ConnectorTin)) {
|
||||
return false;
|
||||
}
|
||||
if (obj.getClass() != getClass()) {
|
||||
return false;
|
||||
}
|
||||
TileEntityIC2ConnectorTin te = (TileEntityIC2ConnectorTin) obj;
|
||||
if (!te.pos.equals(pos)) {
|
||||
return false;
|
||||
}
|
||||
if (te.world.provider.getDimension() != world.provider.getDimension()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRotate(@Nonnull EnumFacing axis) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -12,25 +12,25 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.client;
|
||||
package malte0811.industrialWires.client;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEProperties;
|
||||
import blusunrize.immersiveengineering.api.Lib;
|
||||
import blusunrize.immersiveengineering.client.ClientUtils;
|
||||
import blusunrize.immersiveengineering.common.util.ItemNBTHelper;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.BlockIWBase;
|
||||
import malte0811.industrialwires.blocks.IMetaEnum;
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityPanel;
|
||||
import malte0811.industrialwires.blocks.hv.BlockHVMultiblocks;
|
||||
import malte0811.industrialwires.client.panelmodel.PanelModel;
|
||||
import malte0811.industrialwires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialwires.items.ItemIC2Coil;
|
||||
import malte0811.industrialwires.items.ItemKey;
|
||||
import malte0811.industrialwires.items.ItemPanelComponent;
|
||||
import malte0811.industrialwires.mech_mb.MechMBPart;
|
||||
import malte0811.industrialwires.wires.MixedWireType;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.BlockIWBase;
|
||||
import malte0811.industrialWires.blocks.IMetaEnum;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanel;
|
||||
import malte0811.industrialWires.blocks.hv.BlockHVMultiblocks;
|
||||
import malte0811.industrialWires.client.panelmodel.PanelModel;
|
||||
import malte0811.industrialWires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialWires.items.ItemIC2Coil;
|
||||
import malte0811.industrialWires.items.ItemKey;
|
||||
import malte0811.industrialWires.items.ItemPanelComponent;
|
||||
import malte0811.industrialWires.mech_mb.MechMBPart;
|
||||
import malte0811.industrialWires.wires.IC2Wiretype;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -67,7 +67,7 @@ import javax.annotation.Nonnull;
|
|||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import static malte0811.industrialwires.client.render.TileRenderMechMB.BASE_MODELS;
|
||||
import static malte0811.industrialWires.client.render.TileRenderMechMB.BASE_MODELS;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = IndustrialWires.MODID, value = Side.CLIENT)
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -82,7 +82,7 @@ public class ClientEventHandler {
|
|||
if (!player.getHeldItem(hand).isEmpty()) {
|
||||
ItemStack equipped = player.getHeldItem(hand);
|
||||
if (OreDictionary.itemMatches(new ItemStack(IndustrialWires.coil, 1, OreDictionary.WILDCARD_VALUE), equipped, false)) {
|
||||
MixedWireType type = MixedWireType.ALL[equipped.getItemDamage()];
|
||||
IC2Wiretype type = IC2Wiretype.ALL[equipped.getItemDamage()];
|
||||
int color = type.getColour(null);
|
||||
final int threshold = 0x40-1;
|
||||
for (int i = 0;i<3;i++) {
|
||||
|
@ -193,7 +193,7 @@ public class ClientEventHandler {
|
|||
public static void renderWorldLastLow(RenderWorldLastEvent ev) {
|
||||
if (shouldScreenshot) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ITextComponent comp = ScreenShotHelper.saveScreenshot(mc.gameDir, mc.displayWidth, mc.displayHeight, mc.getFramebuffer());//TODO
|
||||
ITextComponent comp = ScreenShotHelper.saveScreenshot(mc.mcDataDir, mc.displayWidth, mc.displayHeight, mc.getFramebuffer());//TODO
|
||||
mc.player.sendMessage(comp);
|
||||
shouldScreenshot = false;
|
||||
}
|
|
@ -12,10 +12,11 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package malte0811.industrialwires.client;
|
||||
package malte0811.industrialWires.client;
|
||||
|
||||
import blusunrize.immersiveengineering.api.ManualHelper;
|
||||
import blusunrize.immersiveengineering.api.ManualPageMultiblock;
|
||||
import blusunrize.immersiveengineering.api.energy.wires.WireApi;
|
||||
import blusunrize.immersiveengineering.client.ClientUtils;
|
||||
import blusunrize.immersiveengineering.common.Config;
|
||||
import blusunrize.immersiveengineering.common.util.Utils;
|
||||
|
@ -24,44 +25,43 @@ import blusunrize.lib.manual.ManualInstance;
|
|||
import blusunrize.lib.manual.ManualPages;
|
||||
import blusunrize.lib.manual.ManualPages.PositionedItemStack;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntLinkedOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import malte0811.industrialwires.*;
|
||||
import malte0811.industrialwires.blocks.controlpanel.BlockTypes_Panel;
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityPanelCreator;
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityRSPanel;
|
||||
import malte0811.industrialwires.blocks.converter.TileEntityMechMB;
|
||||
import malte0811.industrialwires.blocks.hv.TileEntityJacobsLadder;
|
||||
import malte0811.industrialwires.blocks.hv.TileEntityMarx;
|
||||
import malte0811.industrialwires.client.gui.GuiPanelComponent;
|
||||
import malte0811.industrialwires.client.gui.GuiPanelCreator;
|
||||
import malte0811.industrialwires.client.gui.GuiRSPanelConn;
|
||||
import malte0811.industrialwires.client.gui.GuiRenameKey;
|
||||
import malte0811.industrialwires.client.manual.TextSplitter;
|
||||
import malte0811.industrialwires.client.multiblock_io_model.MBIOModelLoader;
|
||||
import malte0811.industrialwires.client.panelmodel.PanelModelLoader;
|
||||
import malte0811.industrialwires.client.render.*;
|
||||
import malte0811.industrialwires.compat.Compat;
|
||||
import malte0811.industrialwires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialwires.crafting.IC2TRHelper;
|
||||
import malte0811.industrialwires.entities.EntityBrokenPart;
|
||||
import malte0811.industrialwires.hv.MarxOreHandler;
|
||||
import malte0811.industrialwires.hv.MultiblockMarx;
|
||||
import malte0811.industrialwires.items.ItemIC2Coil;
|
||||
import malte0811.industrialwires.items.ItemPanelComponent;
|
||||
import malte0811.industrialwires.mech_mb.*;
|
||||
import malte0811.industrialwires.util.CommandIWClient;
|
||||
import malte0811.industrialwires.util.ConversionUtil;
|
||||
import malte0811.industrialwires.util.MiscUtils;
|
||||
import malte0811.industrialWires.CommonProxy;
|
||||
import malte0811.industrialWires.IWConfig;
|
||||
import malte0811.industrialWires.IWPotions;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.controlpanel.BlockTypes_Panel;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanelCreator;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityRSPanel;
|
||||
import malte0811.industrialWires.blocks.converter.TileEntityMechMB;
|
||||
import malte0811.industrialWires.blocks.hv.TileEntityJacobsLadder;
|
||||
import malte0811.industrialWires.blocks.hv.TileEntityMarx;
|
||||
import malte0811.industrialWires.client.gui.GuiPanelComponent;
|
||||
import malte0811.industrialWires.client.gui.GuiPanelCreator;
|
||||
import malte0811.industrialWires.client.gui.GuiRSPanelConn;
|
||||
import malte0811.industrialWires.client.gui.GuiRenameKey;
|
||||
import malte0811.industrialWires.client.manual.TextSplitter;
|
||||
import malte0811.industrialWires.client.multiblock_io_model.MBIOModelLoader;
|
||||
import malte0811.industrialWires.client.panelmodel.PanelModelLoader;
|
||||
import malte0811.industrialWires.client.render.*;
|
||||
import malte0811.industrialWires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialWires.crafting.IC2TRHelper;
|
||||
import malte0811.industrialWires.entities.EntityBrokenPart;
|
||||
import malte0811.industrialWires.hv.MarxOreHandler;
|
||||
import malte0811.industrialWires.hv.MultiblockMarx;
|
||||
import malte0811.industrialWires.items.ItemIC2Coil;
|
||||
import malte0811.industrialWires.items.ItemPanelComponent;
|
||||
import malte0811.industrialWires.mech_mb.*;
|
||||
import malte0811.industrialWires.util.CommandIWClient;
|
||||
import malte0811.industrialWires.util.ConversionUtil;
|
||||
import malte0811.industrialWires.util.MiscUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.audio.MovingSound;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.audio.SoundHandler;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.resources.IReloadableResourceManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -85,13 +85,52 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
|
||||
import java.util.*;
|
||||
|
||||
import static malte0811.industrialwires.IndustrialWires.*;
|
||||
import static malte0811.industrialWires.IndustrialWires.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ClientProxy extends CommonProxy {
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
if (IndustrialWires.hasIC2) {
|
||||
WireApi.registerConnectorForRender("ic2_conn_tin", new ResourceLocation("immersiveengineering:block/connector/connector_lv.obj"),
|
||||
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_lv",
|
||||
IndustrialWires.MODID + ":blocks/ic2_conn_tin"));
|
||||
WireApi.registerConnectorForRender("ic2_relay_tin", new ResourceLocation("immersiveengineering:block/connector/connector_lv.obj"),
|
||||
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_lv",
|
||||
IndustrialWires.MODID + ":blocks/ic2_relay_tin"));
|
||||
|
||||
WireApi.registerConnectorForRender("ic2_conn_copper", new ResourceLocation("immersiveengineering:block/connector/connector_lv.obj"),
|
||||
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_lv",
|
||||
IndustrialWires.MODID + ":blocks/ic2_conn_copper"));
|
||||
WireApi.registerConnectorForRender("ic2_relay_copper", new ResourceLocation("immersiveengineering:block/connector/connector_lv.obj"),
|
||||
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_lv",
|
||||
IndustrialWires.MODID + ":blocks/ic2_relay_copper"));
|
||||
|
||||
WireApi.registerConnectorForRender("ic2_conn_gold", new ResourceLocation("immersiveengineering:block/connector/connector_mv.obj"),
|
||||
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_mv",
|
||||
IndustrialWires.MODID + ":blocks/ic2_conn_gold"));
|
||||
WireApi.registerConnectorForRender("ic2_relay_gold", new ResourceLocation("immersiveengineering:block/connector/connector_mv.obj"),
|
||||
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_mv",
|
||||
IndustrialWires.MODID + ":blocks/ic2_relay_gold"));
|
||||
|
||||
WireApi.registerConnectorForRender("ic2_conn_hv", new ResourceLocation("immersiveengineering:block/connector/connector_hv.obj"),
|
||||
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_hv",
|
||||
IndustrialWires.MODID + ":blocks/ic2_conn_hv"));
|
||||
WireApi.registerConnectorForRender("ic2_relay_hv", new ResourceLocation("immersiveengineering:block/connector/relay_hv.obj"), null);
|
||||
|
||||
WireApi.registerConnectorForRender("ic2_conn_glass", new ResourceLocation("immersiveengineering:block/connector/connector_hv.obj"),
|
||||
ImmutableMap.of("#immersiveengineering:blocks/connector_connector_hv",
|
||||
IndustrialWires.MODID + ":blocks/ic2_conn_glass"));
|
||||
WireApi.registerConnectorForRender("ic2_relay_glass", new ResourceLocation("immersiveengineering:block/connector/relay_hv.obj"),
|
||||
ImmutableMap.of("#immersiveengineering:blocks/connector_relay_hv",
|
||||
IndustrialWires.MODID + ":blocks/ic2_relay_glass"));
|
||||
}
|
||||
WireApi.registerConnectorForRender("rs_panel_conn", new ResourceLocation("industrialwires:block/rs_panel_conn.obj"), null);
|
||||
|
||||
WireApi.registerConnectorForRender("empty", new ResourceLocation("builtin/generated"), null);
|
||||
|
||||
OBJLoader.INSTANCE.addDomain(IndustrialWires.MODID);
|
||||
ModelLoaderRegistry.registerLoader(new PanelModelLoader());
|
||||
ModelLoaderRegistry.registerLoader(new MBIOModelLoader());
|
||||
|
@ -109,67 +148,56 @@ public class ClientProxy extends CommonProxy {
|
|||
public void postInit() {
|
||||
super.postInit();
|
||||
ManualInstance m = ManualHelper.getManual();
|
||||
boolean uni = m.fontRenderer.getUnicodeFlag();
|
||||
m.fontRenderer.setUnicodeFlag(true);
|
||||
m.entryRenderPre();
|
||||
TextSplitter splitter;
|
||||
{
|
||||
if (IndustrialWires.hasIC2) {
|
||||
PositionedItemStack[][] wireRecipes = new PositionedItemStack[3][10];
|
||||
int xBase = 15;
|
||||
Ingredient copperCable = IC2TRHelper.getStack("cable", "type:copper,insulation:0");
|
||||
Object2IntMap<ItemStack> copperCables = new Object2IntLinkedOpenHashMap<>();
|
||||
for (ItemStack itemStack : copperCable.getMatchingStacks()) {
|
||||
copperCables.put(itemStack, 1);
|
||||
}
|
||||
copperCables.put(new ItemStack(IEObjects.itemWireCoil, 1, 0), 8);
|
||||
List<ItemStack> copperCableList = new ArrayList<>(copperCables.keySet());
|
||||
Ingredient tinCable = IC2TRHelper.getStack("cable", "type:tin,insulation:0");
|
||||
List<ItemStack> tinCableList = Arrays.asList(tinCable.getMatchingStacks());
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
wireRecipes[0][3 * i + j] = new PositionedItemStack(copperCableList, 18 * i + xBase, 18 * j);
|
||||
wireRecipes[0][3 * i + j] = new PositionedItemStack(tinCableList, 18 * i + xBase, 18 * j);
|
||||
}
|
||||
}
|
||||
ItemStack copperCoil = new ItemStack(IndustrialWires.coil, 1, 1);
|
||||
ItemIC2Coil.setLength(copperCoil, 9);
|
||||
wireRecipes[0][9] = new PositionedItemStack(copperCoil, 18 * 4 + xBase, 18);
|
||||
ItemStack tmp = new ItemStack(IndustrialWires.coil);
|
||||
ItemIC2Coil.setLength(tmp, 9);
|
||||
wireRecipes[0][9] = new PositionedItemStack(tmp, 18 * 4 + xBase, 18);
|
||||
Random r = new Random();
|
||||
for (int i = 1; i < 3; i++) {
|
||||
int lengthSum = 0;
|
||||
for (int j1 = 0; j1 < 3; j1++) {
|
||||
for (int j2 = 0; j2 < 3; j2++) {
|
||||
if (r.nextDouble() > 1 / (1. + copperCables.size())) {
|
||||
if (r.nextBoolean()) {
|
||||
// cable
|
||||
ItemStack chosen = copperCableList.get(r.nextInt(copperCables.size()));
|
||||
lengthSum += copperCables.getInt(chosen);
|
||||
wireRecipes[i][3 * j1 + j2] = new PositionedItemStack(chosen, 18 * j1 + xBase, 18 * j2);
|
||||
lengthSum++;
|
||||
wireRecipes[i][3 * j1 + j2] = new PositionedItemStack(tinCableList, 18 * j1 + xBase, 18 * j2);
|
||||
} else {
|
||||
// wire coil
|
||||
int length = r.nextInt(99) + 1;
|
||||
copperCoil = new ItemStack(IndustrialWires.coil, 1, 1);
|
||||
ItemIC2Coil.setLength(copperCoil, length);
|
||||
wireRecipes[i][3 * j1 + j2] = new PositionedItemStack(copperCoil, 18 * j1 + xBase, 18 * j2);
|
||||
tmp = new ItemStack(IndustrialWires.coil);
|
||||
ItemIC2Coil.setLength(tmp, length);
|
||||
wireRecipes[i][3 * j1 + j2] = new PositionedItemStack(tmp, 18 * j1 + xBase, 18 * j2);
|
||||
lengthSum += length;
|
||||
}
|
||||
}
|
||||
}
|
||||
copperCoil = new ItemStack(IndustrialWires.coil);
|
||||
ItemIC2Coil.setLength(copperCoil, lengthSum);
|
||||
wireRecipes[i][9] = new PositionedItemStack(copperCoil, 18 * 4 + xBase, 18);
|
||||
tmp = new ItemStack(IndustrialWires.coil);
|
||||
ItemIC2Coil.setLength(tmp, lengthSum);
|
||||
wireRecipes[i][9] = new PositionedItemStack(tmp, 18 * 4 + xBase, 18);
|
||||
}
|
||||
|
||||
splitter = new TextSplitter(m);
|
||||
splitter.addSpecialPage(0, 0, 10,
|
||||
s->new ManualPages.CraftingMulti(m, s, (Object[]) wireRecipes));
|
||||
String text = I18n.format("ie.manual.entry.industrialwires.wires");
|
||||
splitter.split(text);
|
||||
List<IManualPage> entry = splitter.toManualEntry();
|
||||
m.addEntry("industrialwires.wires", IndustrialWires.MODID, entry.toArray(new IManualPage[0]));
|
||||
}
|
||||
if (hasIC2 && IndustrialWires.mechConv != null) {
|
||||
m.addEntry("industrialwires.mechConv", "industrialwires",
|
||||
new ManualPages.Crafting(m, "industrialwires.mechConv0", new ItemStack(IndustrialWires.mechConv, 1, 1)),
|
||||
new ManualPages.Crafting(m, "industrialwires.mechConv1", new ItemStack(IndustrialWires.mechConv, 1, 2)),
|
||||
new ManualPages.Crafting(m, "industrialwires.mechConv2", new ItemStack(IndustrialWires.mechConv, 1, 0))
|
||||
m.addEntry("industrialwires.wires", "industrialwires",
|
||||
new ManualPages.CraftingMulti(m, "industrialwires.wires0", new ItemStack(IndustrialWires.ic2conn, 1, 0), new ItemStack(IndustrialWires.ic2conn, 1, 1), new ItemStack(IndustrialWires.ic2conn, 1, 2), new ItemStack(IndustrialWires.ic2conn, 1, 3),
|
||||
new ItemStack(IndustrialWires.ic2conn, 1, 4), new ItemStack(IndustrialWires.ic2conn, 1, 5), new ItemStack(IndustrialWires.ic2conn, 1, 6), new ItemStack(IndustrialWires.ic2conn, 1, 7)),
|
||||
new ManualPages.Text(m, "industrialwires.wires1"),
|
||||
new ManualPages.CraftingMulti(m, "industrialwires.wires2", (Object[]) wireRecipes)
|
||||
);
|
||||
if (IndustrialWires.mechConv != null) {
|
||||
m.addEntry("industrialwires.mechConv", "industrialwires",
|
||||
new ManualPages.Crafting(m, "industrialwires.mechConv0", new ItemStack(IndustrialWires.mechConv, 1, 1)),
|
||||
new ManualPages.Crafting(m, "industrialwires.mechConv1", new ItemStack(IndustrialWires.mechConv, 1, 2)),
|
||||
new ManualPages.Crafting(m, "industrialwires.mechConv2", new ItemStack(IndustrialWires.mechConv, 1, 0))
|
||||
);
|
||||
}
|
||||
}
|
||||
addUnblockableSounds(TINNITUS, TURN_FAST, TURN_SLOW);
|
||||
|
||||
|
@ -191,29 +219,22 @@ public class ClientProxy extends CommonProxy {
|
|||
new ManualPages.Text(m, "industrialwires.jacobs1"));
|
||||
|
||||
|
||||
String text = I18n.format("ie.manual.entry.industrialwires.intro");
|
||||
splitter = new TextSplitter(m);
|
||||
splitter.addSpecialPage(0, 0, 9, s -> new ManualPages.Crafting(m, s,
|
||||
new ItemStack(IndustrialWires.panel, 1, BlockTypes_Panel.DUMMY.ordinal())));
|
||||
splitter.addSpecialPage(1, 0, 9, s -> new ManualPages.Crafting(m, s,
|
||||
new ItemStack(IndustrialWires.panel, 1, BlockTypes_Panel.UNFINISHED.ordinal())));
|
||||
splitter.split(text);
|
||||
m.addEntry("industrialwires.intro", "control_panels",
|
||||
splitter.toManualEntry().toArray(new IManualPage[0])
|
||||
new ManualPages.Text(m, "industrialwires.intro0"),
|
||||
new ManualPages.Text(m, "industrialwires.intro1"),
|
||||
new ManualPages.Crafting(m, "industrialwires.intro2", new ItemStack(IndustrialWires.panel, 1, BlockTypes_Panel.DUMMY.ordinal())),
|
||||
new ManualPages.Text(m, "industrialwires.intro3"),
|
||||
new ManualPages.Crafting(m, "industrialwires.intro4", new ItemStack(IndustrialWires.panel, 1, BlockTypes_Panel.UNFINISHED.ordinal())),
|
||||
new ManualPages.Text(m, "industrialwires.intro5")
|
||||
);
|
||||
m.addEntry("industrialwires.panel_creator", "control_panels",
|
||||
new ManualPages.Crafting(m, "industrialwires.panel_creator0", new ItemStack(IndustrialWires.panel, 1, BlockTypes_Panel.CREATOR.ordinal())),
|
||||
new ManualPages.Text(m, "industrialwires.panel_creator1"),
|
||||
new ManualPages.Text(m, "industrialwires.panel_creator2")
|
||||
);
|
||||
text = I18n.format("ie.manual.entry.industrialwires.redstone");
|
||||
splitter = new TextSplitter(m);
|
||||
splitter.addSpecialPage(-1, 0, Compat.enableOtherRS ? 9 : 12, s -> new ManualPages.CraftingMulti(m, s,
|
||||
new ResourceLocation(IndustrialWires.MODID, "control_panel_rs_other"),
|
||||
new ResourceLocation(IndustrialWires.MODID, "control_panel_rs_wire")));
|
||||
splitter.split(text);
|
||||
m.addEntry("industrialwires.redstone", "control_panels",
|
||||
splitter.toManualEntry().toArray(new IManualPage[0])
|
||||
new ManualPages.Crafting(m, "industrialwires.redstone0", new ItemStack(IndustrialWires.panel, 1, BlockTypes_Panel.RS_WIRE.ordinal())),
|
||||
new ManualPages.Text(m, "industrialwires.redstone1")
|
||||
);
|
||||
m.addEntry("industrialwires.components", "control_panels",
|
||||
new ManualPages.Text(m, "industrialwires.components.general"),
|
||||
|
@ -227,11 +248,10 @@ public class ClientProxy extends CommonProxy {
|
|||
new ManualPages.CraftingMulti(m, "industrialwires.lock", new ItemStack(IndustrialWires.panelComponent, 1, 7), new ItemStack(IndustrialWires.key)),
|
||||
new ManualPages.Crafting(m, "industrialwires.lock1", new ItemStack(IndustrialWires.key, 1, 2)),
|
||||
new ManualPages.Crafting(m, "industrialwires.panel_meter", new ItemStack(IndustrialWires.panelComponent, 1, 8)),
|
||||
new ManualPages.Crafting(m, "industrialwires.7seg", new ItemStack(IndustrialWires.panelComponent, 1, 9)),
|
||||
new ManualPages.Crafting(m, "industrialwires.rgb_led", new ItemStack(IndustrialWires.panelComponent, 1, 10))
|
||||
new ManualPages.Crafting(m, "industrialwires.7seg", new ItemStack(IndustrialWires.panelComponent, 1, 9))
|
||||
);
|
||||
List<MarxOreHandler.OreInfo> ores = MarxOreHandler.getRecipes();
|
||||
text = I18n.format("ie.manual.entry.industrialwires.marx");
|
||||
String text = I18n.format("ie.manual.entry.industrialwires.marx");
|
||||
for (int i = 0; i < ores.size(); i++) {
|
||||
MarxOreHandler.OreInfo curr = ores.get(i);
|
||||
if (!curr.exampleInput.isEmpty()) {
|
||||
|
@ -243,7 +263,10 @@ public class ClientProxy extends CommonProxy {
|
|||
text += I18n.format(IndustrialWires.MODID + ".desc.ideal_e") + ": " + Utils.formatDouble(curr.avgEnergy * MarxOreHandler.defaultEnergy / 1000, "0.#") + " kJ<br><br>";
|
||||
}
|
||||
}
|
||||
splitter = new TextSplitter(m);
|
||||
boolean uni = m.fontRenderer.getUnicodeFlag();
|
||||
m.fontRenderer.setUnicodeFlag(true);
|
||||
m.entryRenderPre();
|
||||
TextSplitter splitter = new TextSplitter(m);
|
||||
splitter.addSpecialPage(0, 0, 6,
|
||||
(s) -> new ManualPageMultiblock(m, s,
|
||||
MultiblockMarx.INSTANCE));
|
||||
|
@ -261,9 +284,9 @@ public class ClientProxy extends CommonProxy {
|
|||
|
||||
String[][] flywheelTable;
|
||||
{
|
||||
List<String[]> flywheelTableList = new ArrayList<>(1 + Material.values().length);
|
||||
List<String[]> flywheelTableList = new ArrayList<>(1+Material.values().length);
|
||||
flywheelTableList.add(new String[]{"industrialwires.desc.material", "industrialwires.desc.inertia", "industrialwires.desc.max_speed"});
|
||||
for (Material mat : Material.values()) {
|
||||
for (Material mat:Material.values()) {
|
||||
MechPartFlywheel f = new MechPartFlywheel(mat);
|
||||
flywheelTableList.add(new String[]{mat.oreName(), Utils.formatDouble(f.getInertia(), "0.#"),
|
||||
Utils.formatDouble(f.getMaxSpeed(), "0.#")});
|
||||
|
@ -274,7 +297,7 @@ public class ClientProxy extends CommonProxy {
|
|||
splitter = new TextSplitter(m);
|
||||
splitter.addSpecialPage(0, 0, 10, (s) -> new ManualPageMultiblock(m, s,
|
||||
MechMBPart.getManualMBForPart(MechPartFlywheel.class)));
|
||||
splitter.addSpecialPage(1, 0, 1, s -> new ManualPages.Table(m, "", flywheelTable, true));
|
||||
splitter.addSpecialPage(1, 0, 1, s->new ManualPages.Table(m, "", flywheelTable, true));
|
||||
splitter.addSpecialPage(2, 0, 10, (s) -> new ManualPageMultiblock(m, s,
|
||||
MechMBPart.getManualMBForPart(MechPartSingleCoil.class)));
|
||||
splitter.addSpecialPage(3, 0, 10, (s) -> new ManualPageMultiblock(m, s,
|
||||
|
@ -463,29 +486,6 @@ public class ClientProxy extends CommonProxy {
|
|||
return Minecraft.getMinecraft().isSingleplayer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidTextureSource(ItemStack stack) {
|
||||
if (!super.isValidTextureSource(stack)) {
|
||||
return false;
|
||||
}
|
||||
IBakedModel texModel = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack,
|
||||
null, null);
|
||||
TextureAtlasSprite sprite = texModel.getParticleTexture();
|
||||
//noinspection ConstantConditions
|
||||
if (sprite == null || sprite.hasAnimationMetadata()) {
|
||||
return false;
|
||||
}
|
||||
int[][] data = sprite.getFrameTextureData(0);
|
||||
for (int x = 0; x < data.length; x++) {
|
||||
for (int y = 0; y < data[x].length; y++) {
|
||||
if ((data[x][y] >>> 24) != 255) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Gui getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
if (ID == 0) {
|
|
@ -13,11 +13,11 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client;
|
||||
package malte0811.industrialWires.client;
|
||||
|
||||
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;
|
||||
import malte0811.industrialwires.client.panelmodel.SmartLightingQuadIW;
|
||||
import malte0811.industrialwires.controlpanel.PanelUtils;
|
||||
import malte0811.industrialWires.client.panelmodel.SmartLightingQuadIW;
|
||||
import malte0811.industrialWires.controlpanel.PanelUtils;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|
@ -13,12 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client;
|
||||
package malte0811.industrialWires.client;
|
||||
|
||||
import blusunrize.immersiveengineering.api.Lib;
|
||||
import blusunrize.immersiveengineering.common.items.ItemEarmuffs;
|
||||
import blusunrize.immersiveengineering.common.util.ItemNBTHelper;
|
||||
import malte0811.industrialwires.IEObjects;
|
||||
import malte0811.industrialWires.IEObjects;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ITickableSound;
|
||||
import net.minecraft.client.audio.PositionedSound;
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client;
|
||||
package malte0811.industrialWires.client;
|
||||
|
||||
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
|
@ -13,20 +13,20 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.gui;
|
||||
package malte0811.industrialWires.client.gui;
|
||||
|
||||
import blusunrize.immersiveengineering.client.ClientUtils;
|
||||
import blusunrize.immersiveengineering.client.gui.elements.GuiButtonCheckbox;
|
||||
import blusunrize.immersiveengineering.client.gui.elements.GuiSliderIE;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.client.gui.elements.GuiChannelPicker;
|
||||
import malte0811.industrialwires.client.gui.elements.GuiChannelPickerSmall;
|
||||
import malte0811.industrialwires.client.gui.elements.GuiIntChooser;
|
||||
import malte0811.industrialwires.containers.ContainerPanelComponent;
|
||||
import malte0811.industrialwires.controlpanel.IConfigurableComponent;
|
||||
import malte0811.industrialwires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialwires.network.MessageItemSync;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.client.gui.elements.GuiChannelPicker;
|
||||
import malte0811.industrialWires.client.gui.elements.GuiChannelPickerSmall;
|
||||
import malte0811.industrialWires.client.gui.elements.GuiIntChooser;
|
||||
import malte0811.industrialWires.containers.ContainerPanelComponent;
|
||||
import malte0811.industrialWires.controlpanel.IConfigurableComponent;
|
||||
import malte0811.industrialWires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialWires.network.MessageItemSync;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
|
@ -43,7 +43,7 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static malte0811.industrialwires.util.NBTKeys.*;
|
||||
import static malte0811.industrialWires.util.NBTKeys.*;
|
||||
|
||||
public class GuiPanelComponent extends GuiContainer {
|
||||
private PanelComponent component;
|
|
@ -13,18 +13,18 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.gui;
|
||||
package malte0811.industrialWires.client.gui;
|
||||
|
||||
import blusunrize.immersiveengineering.client.ClientUtils;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityPanelCreator;
|
||||
import malte0811.industrialwires.containers.ContainerPanelCreator;
|
||||
import malte0811.industrialwires.controlpanel.MessageType;
|
||||
import malte0811.industrialwires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialwires.controlpanel.PanelUtils;
|
||||
import malte0811.industrialwires.items.ItemPanelComponent;
|
||||
import malte0811.industrialwires.network.MessageGUIInteract;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanelCreator;
|
||||
import malte0811.industrialWires.containers.ContainerPanelCreator;
|
||||
import malte0811.industrialWires.controlpanel.MessageType;
|
||||
import malte0811.industrialWires.controlpanel.PanelComponent;
|
||||
import malte0811.industrialWires.controlpanel.PanelUtils;
|
||||
import malte0811.industrialWires.items.ItemPanelComponent;
|
||||
import malte0811.industrialWires.network.MessageGUIInteract;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
@ -309,7 +309,7 @@ public class GuiPanelCreator extends GuiContainer {
|
|||
nbt.setInteger("type", MessageType.DISASSEMBLE.ordinal());
|
||||
break;
|
||||
}
|
||||
if (!nbt.isEmpty()) {
|
||||
if (!nbt.hasNoTags()) {
|
||||
IndustrialWires.packetHandler.sendToServer(new MessageGUIInteract(container.tile, nbt));
|
||||
}
|
||||
}
|
|
@ -13,13 +13,13 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.gui;
|
||||
package malte0811.industrialWires.client.gui;
|
||||
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityRSPanel;
|
||||
import malte0811.industrialwires.client.gui.elements.GuiIntChooser;
|
||||
import malte0811.industrialwires.containers.ContainerRSPanelConn;
|
||||
import malte0811.industrialwires.network.MessageGUIInteract;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityRSPanel;
|
||||
import malte0811.industrialWires.client.gui.elements.GuiIntChooser;
|
||||
import malte0811.industrialWires.containers.ContainerRSPanelConn;
|
||||
import malte0811.industrialWires.network.MessageGUIInteract;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
|
@ -13,11 +13,11 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.gui;
|
||||
package malte0811.industrialWires.client.gui;
|
||||
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.containers.ContainerRenameKey;
|
||||
import malte0811.industrialwires.network.MessageItemSync;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.containers.ContainerRenameKey;
|
||||
import malte0811.industrialWires.network.MessageItemSync;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.gui.elements;
|
||||
package malte0811.industrialWires.client.gui.elements;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.gui.elements;
|
||||
package malte0811.industrialWires.client.gui.elements;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.gui.elements;
|
||||
package malte0811.industrialWires.client.gui.elements;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.manual;
|
||||
package malte0811.industrialWires.client.manual;
|
||||
|
||||
import blusunrize.lib.manual.IManualPage;
|
||||
import blusunrize.lib.manual.ManualInstance;
|
|
@ -13,19 +13,19 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.multiblock_io_model;
|
||||
package malte0811.industrialWires.client.multiblock_io_model;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEEnums.SideConfig;
|
||||
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.IWProperties;
|
||||
import malte0811.industrialwires.client.ClientUtilsIW;
|
||||
import malte0811.industrialwires.client.RawQuad;
|
||||
import malte0811.industrialwires.util.MBSideConfig;
|
||||
import malte0811.industrialwires.util.MBSideConfig.BlockFace;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.IWProperties;
|
||||
import malte0811.industrialWires.client.ClientUtilsIW;
|
||||
import malte0811.industrialWires.client.RawQuad;
|
||||
import malte0811.industrialWires.util.MBSideConfig;
|
||||
import malte0811.industrialWires.util.MBSideConfig.BlockFace;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
|
@ -73,8 +73,6 @@ public class BakedMBIOModel implements IBakedModel {
|
|||
@Nonnull
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) {
|
||||
if (side != null)
|
||||
return ImmutableList.of();
|
||||
MBSideConfig config = NULL_CONFIG;
|
||||
if (state instanceof IExtendedBlockState) {
|
||||
MBSideConfig tmpConfig = ((IExtendedBlockState) state).getValue(IWProperties.MB_SIDES);
|
||||
|
@ -115,7 +113,7 @@ public class BakedMBIOModel implements IBakedModel {
|
|||
float[] vec = new float[3];
|
||||
for (int i = 0; i < EnumFacing.VALUES.length; i++) {
|
||||
EnumFacing f = EnumFacing.VALUES[i];
|
||||
NORMALS[i] = new Vector3f(f.getXOffset(), f.getYOffset(), f.getZOffset());
|
||||
NORMALS[i] = new Vector3f(f.getFrontOffsetX(), f.getFrontOffsetY(), f.getFrontOffsetZ());
|
||||
int axis = f.getAxis().ordinal();
|
||||
vec[axis] = f.getAxisDirection()==EnumFacing.AxisDirection.POSITIVE?1.001F:-.001F;
|
||||
float x1 = f.getAxisDirection()==EnumFacing.AxisDirection.POSITIVE?offsetInner:1-offsetInner;
|
|
@ -13,12 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.multiblock_io_model;
|
||||
package malte0811.industrialWires.client.multiblock_io_model;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEApi;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
|
@ -50,8 +50,8 @@ public class MBIOModelLoader implements ICustomModelLoader {
|
|||
}
|
||||
@Override
|
||||
public boolean accepts(@Nonnull ResourceLocation modelLocation) {
|
||||
return IndustrialWires.MODID.equals(modelLocation.getNamespace())
|
||||
&& "models/block/mbio".equals(modelLocation.getPath());
|
||||
return IndustrialWires.MODID.equals(modelLocation.getResourceDomain())
|
||||
&& "models/block/mbio".equals(modelLocation.getResourcePath());
|
||||
}
|
||||
|
||||
@Nonnull
|
|
@ -13,18 +13,18 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.panelmodel;
|
||||
package malte0811.industrialWires.client.panelmodel;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEApi;
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import malte0811.industrialwires.blocks.controlpanel.BlockTypes_Panel;
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityPanel;
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityUnfinishedPanel;
|
||||
import malte0811.industrialwires.controlpanel.PanelUtils;
|
||||
import malte0811.industrialwires.controlpanel.PropertyComponents;
|
||||
import malte0811.industrialwires.controlpanel.PropertyComponents.PanelRenderProperties;
|
||||
import malte0811.industrialWires.blocks.controlpanel.BlockTypes_Panel;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanel;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityUnfinishedPanel;
|
||||
import malte0811.industrialWires.controlpanel.PanelUtils;
|
||||
import malte0811.industrialWires.controlpanel.PropertyComponents;
|
||||
import malte0811.industrialWires.controlpanel.PropertyComponents.PanelRenderProperties;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.*;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
|
@ -13,11 +13,11 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.panelmodel;
|
||||
package malte0811.industrialWires.client.panelmodel;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.controlpanel.PanelUtils;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.controlpanel.PanelUtils;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
|
@ -47,13 +47,13 @@ public class PanelModelLoader implements ICustomModelLoader {
|
|||
|
||||
@Override
|
||||
public boolean accepts(@Nonnull ResourceLocation modelLocation) {
|
||||
return modelLocation.getPath().contains(RESOURCE_BASE + RESOURCE_LOCATION);
|
||||
return modelLocation.getResourcePath().contains(RESOURCE_BASE + RESOURCE_LOCATION);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IModel loadModel(@Nonnull ResourceLocation modelLocation) throws IOException {
|
||||
String resourcePath = modelLocation.getPath();
|
||||
String resourcePath = modelLocation.getResourcePath();
|
||||
int pos = resourcePath.indexOf(RESOURCE_LOCATION);
|
||||
if (pos >= 0) {
|
||||
return new PanelModelBase();
|
|
@ -13,11 +13,11 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.panelmodel;
|
||||
package malte0811.industrialWires.client.panelmodel;
|
||||
|
||||
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import malte0811.industrialwires.client.RawQuad;
|
||||
import malte0811.industrialWires.client.RawQuad;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
@ -91,10 +91,10 @@ public class RawModelFontRenderer extends FontRenderer {
|
|||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||
super.onResourceManagerReload(resourceManager);
|
||||
String p = locationFontTexture.getPath();
|
||||
String p = locationFontTexture.getResourcePath();
|
||||
if (p.startsWith("textures/")) p = p.substring("textures/".length(), p.length());
|
||||
if (p.endsWith(".png")) p = p.substring(0, p.length() - ".png".length());
|
||||
String f = locationFontTexture.getNamespace() + ":" + p;
|
||||
String f = locationFontTexture.getResourceDomain() + ":" + p;
|
||||
sprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(f);
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.panelmodel;
|
||||
package malte0811.industrialWires.client.panelmodel;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
|
@ -13,10 +13,10 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.render;
|
||||
package malte0811.industrialWires.client.render;
|
||||
|
||||
import blusunrize.immersiveengineering.client.ClientUtils;
|
||||
import malte0811.industrialwires.entities.EntityBrokenPart;
|
||||
import malte0811.industrialWires.entities.EntityBrokenPart;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
|
@ -13,11 +13,11 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.render;
|
||||
package malte0811.industrialWires.client.render;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEApi;
|
||||
import malte0811.industrialwires.IWConfig;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialWires.IWConfig;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import org.lwjgl.opengl.ARBFragmentShader;
|
|
@ -13,11 +13,11 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.render;
|
||||
package malte0811.industrialWires.client.render;
|
||||
|
||||
import malte0811.industrialwires.blocks.hv.TileEntityJacobsLadder;
|
||||
import malte0811.industrialwires.blocks.hv.TileEntityJacobsLadder.LadderSize;
|
||||
import malte0811.industrialwires.util.Beziers;
|
||||
import malte0811.industrialWires.blocks.hv.TileEntityJacobsLadder;
|
||||
import malte0811.industrialWires.blocks.hv.TileEntityJacobsLadder.LadderSize;
|
||||
import malte0811.industrialWires.util.Beziers;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
@ -26,7 +26,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|||
import net.minecraft.util.math.Vec3d;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import static malte0811.industrialwires.blocks.hv.TileEntityJacobsLadder.getColor;
|
||||
import static malte0811.industrialWires.blocks.hv.TileEntityJacobsLadder.getColor;
|
||||
|
||||
public class TileRenderJacobsLadder extends TileEntitySpecialRenderer<TileEntityJacobsLadder> {
|
||||
@Override
|
|
@ -13,14 +13,14 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.render;
|
||||
package malte0811.industrialWires.client.render;
|
||||
|
||||
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;
|
||||
import malte0811.industrialwires.blocks.IWProperties;
|
||||
import malte0811.industrialwires.blocks.hv.TileEntityMarx;
|
||||
import malte0811.industrialwires.blocks.hv.TileEntityMarx.Discharge;
|
||||
import malte0811.industrialwires.client.ClientEventHandler;
|
||||
import malte0811.industrialwires.util.MiscUtils;
|
||||
import malte0811.industrialWires.blocks.IWProperties;
|
||||
import malte0811.industrialWires.blocks.hv.TileEntityMarx;
|
||||
import malte0811.industrialWires.blocks.hv.TileEntityMarx.Discharge;
|
||||
import malte0811.industrialWires.client.ClientEventHandler;
|
||||
import malte0811.industrialWires.util.MiscUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -32,7 +32,7 @@ import net.minecraft.util.math.Vec3d;
|
|||
import net.minecraft.util.math.Vec3i;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import static malte0811.industrialwires.blocks.hv.TileEntityMarx.FiringState.FIRE;
|
||||
import static malte0811.industrialWires.blocks.hv.TileEntityMarx.FiringState.FIRE;
|
||||
|
||||
public class TileRenderMarx extends TileEntitySpecialRenderer<TileEntityMarx> {
|
||||
public static boolean screenShot = false;
|
||||
|
@ -52,14 +52,14 @@ public class TileRenderMarx extends TileEntitySpecialRenderer<TileEntityMarx> {
|
|||
//draw firing spark gaps
|
||||
Vec3i facing = te.facing.getDirectionVec();
|
||||
Vec3d offset = new Vec3d(MiscUtils.offset(BlockPos.ORIGIN, te.facing, te.mirrored, 1, 1, 0));
|
||||
offset = offset.add(-.5 * oneSgn(offset.x), 0, -.5 * oneSgn(offset.z));
|
||||
offset = offset.addVector(-.5*oneSgn(offset.x), 0, -.5*oneSgn(offset.z));
|
||||
final float pos = .3125F;
|
||||
Vec3d gapDir = new Vec3d(facing.getZ()*(te.mirrored?-1:1), 1, facing.getX()*(te.mirrored?1:-1));
|
||||
Vec3d up = new Vec3d(gapDir.x, -1, gapDir.z);
|
||||
Vec3d bottomGap = new Vec3d(offset.x+facing.getX()*pos+.5, offset.y+.75, offset.z+facing.getZ() * pos+.5);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(x + bottomGap.x, y + bottomGap.y, z + bottomGap.z);
|
||||
bottomGap = bottomGap.add(te.getPos().getX(), te.getPos().getY(), te.getPos().getZ());
|
||||
bottomGap = bottomGap.addVector(te.getPos().getX(), te.getPos().getY(), te.getPos().getZ());
|
||||
for (int i = 0; i < te.getStageCount() - 1; i++) {
|
||||
renderGap(i, facing, vb, tes, player, gapDir, up, bottomGap, te.mirrored);
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class TileRenderMarx extends TileEntitySpecialRenderer<TileEntityMarx> {
|
|||
player = player.subtract(bottomGap.x, bottomGap.y+i, bottomGap.z);
|
||||
double t = player.dotProduct(gapDir)/2;
|
||||
Vec3d lineToPlayer = gapDir.scale(t).subtract(player);
|
||||
double angleRad = Math.acos(up.dotProduct(lineToPlayer) / (up.length() * lineToPlayer.length()));
|
||||
double angleRad = Math.acos(up.dotProduct(lineToPlayer)/(up.lengthVector()*lineToPlayer.lengthVector()));
|
||||
angleRad *= Math.signum(lineToPlayer.dotProduct(new Vec3d(facing)));
|
||||
float angle = (float) (Math.toDegrees(angleRad));
|
||||
if (facing.getZ()<0) {
|
|
@ -13,15 +13,15 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.client.render;
|
||||
package malte0811.industrialWires.client.render;
|
||||
|
||||
import blusunrize.immersiveengineering.api.IEApi;
|
||||
import blusunrize.immersiveengineering.client.ClientUtils;
|
||||
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;
|
||||
import malte0811.industrialwires.blocks.converter.TileEntityMechMB;
|
||||
import malte0811.industrialwires.client.ClientUtilsIW;
|
||||
import malte0811.industrialwires.client.RawQuad;
|
||||
import malte0811.industrialwires.mech_mb.MechMBPart;
|
||||
import malte0811.industrialWires.blocks.converter.TileEntityMechMB;
|
||||
import malte0811.industrialWires.client.ClientUtilsIW;
|
||||
import malte0811.industrialWires.client.RawQuad;
|
||||
import malte0811.industrialWires.mech_mb.MechMBPart;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
@ -42,8 +42,8 @@ import org.lwjgl.util.vector.Vector3f;
|
|||
import javax.annotation.Nonnull;
|
||||
import java.util.*;
|
||||
|
||||
import static malte0811.industrialwires.blocks.converter.TileEntityMechMB.TICK_ANGLE_PER_SPEED;
|
||||
import static malte0811.industrialwires.mech_mb.MechMBPart.SHAFT_KEY;
|
||||
import static malte0811.industrialWires.blocks.converter.TileEntityMechMB.TICK_ANGLE_PER_SPEED;
|
||||
import static malte0811.industrialWires.mech_mb.MechMBPart.SHAFT_KEY;
|
||||
|
||||
public class TileRenderMechMB extends TileEntitySpecialRenderer<TileEntityMechMB> implements IResourceManagerReloadListener {
|
||||
public static final Map<ResourceLocation, IBakedModel> BASE_MODELS = new HashMap<>();
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.compat;
|
||||
package malte0811.industrialWires.compat;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
|
@ -23,8 +23,8 @@ import crafttweaker.api.item.IIngredient;
|
|||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.minecraft.CraftTweakerMC;
|
||||
import crafttweaker.api.oredict.IOreDictEntry;
|
||||
import malte0811.industrialwires.hv.MarxOreHandler;
|
||||
import malte0811.industrialwires.hv.MarxOreHandler.OreChecker;
|
||||
import malte0811.industrialWires.hv.MarxOreHandler;
|
||||
import malte0811.industrialWires.hv.MarxOreHandler.OreChecker;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
|
@ -13,11 +13,10 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.compat;
|
||||
package malte0811.industrialWires.compat;
|
||||
|
||||
import blusunrize.immersiveengineering.api.ApiUtils;
|
||||
import blusunrize.immersiveengineering.api.tool.ToolboxHandler;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import ic2.api.energy.event.EnergyTileLoadEvent;
|
||||
|
@ -26,36 +25,27 @@ import ic2.api.energy.tile.IEnergyTile;
|
|||
import ic2.api.item.IBoxable;
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.core.block.TileEntityBlock;
|
||||
import malte0811.industrialwires.compat.CompatCapabilities.Charset;
|
||||
import malte0811.industrialwires.hv.MarxOreHandler;
|
||||
import malte0811.industrialwires.mech_mb.MechPartCommutator;
|
||||
import malte0811.industrialWires.hv.MarxOreHandler;
|
||||
import malte0811.industrialWires.mech_mb.MechPartCommutator;
|
||||
import mrtjp.projectred.api.ProjectRedAPI;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.gen.structure.template.Template;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import pl.asie.charset.api.wires.IBundledEmitter;
|
||||
import pl.asie.charset.api.wires.IBundledReceiver;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class Compat {
|
||||
public static final String IC2_ID = "ic2";
|
||||
public static final String CRAFTTWEAKER_ID = "crafttweaker";
|
||||
public static final String CHARSET_ID = "charset";
|
||||
public static BiFunction<ItemStack, Template.BlockInfo, ItemStack> stackFromInfo = (s, i)->s;
|
||||
public static BiFunction<String, String, List<ItemStack>> getIC2Item = (s, s2)->ImmutableList.of();
|
||||
static Consumer<MarxOreHandler.OreInfo> addMarx = (o) -> {
|
||||
};
|
||||
static Consumer<MarxOreHandler.OreInfo> removeMarx = (o) -> {
|
||||
|
@ -64,12 +54,10 @@ public class Compat {
|
|||
};
|
||||
public static Consumer<TileEntity> unloadIC2Tile = te -> {
|
||||
};
|
||||
public static IBlockAction<EnumFacing, byte[]> getBundledRS = (w, p, f) -> new byte[16];
|
||||
public static IBlockAction<Void, Void> updateBundledRS = (w, p, f) -> null;
|
||||
public static IBundledRSGetter getBundledRS = (w, p, f) -> new byte[16];
|
||||
public static boolean enableOtherRS = false;
|
||||
private static Map<String, Class<? extends CompatModule>> modules = ImmutableMap.of(IC2_ID, CompatIC2.class,
|
||||
CRAFTTWEAKER_ID, CompatCT.class, ProjectRedAPI.modIDCore, CompatProjectRed.class,
|
||||
CHARSET_ID, CompatCharset.class);
|
||||
private static Map<String, Class<? extends CompatModule>> modules = ImmutableMap.of("ic2", CompatIC2.class,
|
||||
"crafttweaker", CompatCT.class, ProjectRedAPI.modIDCore, CompatProjectRed.class);
|
||||
private static Method preInit;
|
||||
private static Method init;
|
||||
|
||||
|
@ -122,21 +110,6 @@ public class Compat {
|
|||
}
|
||||
|
||||
public static class CompatIC2 extends CompatModule {
|
||||
@Override
|
||||
public void preInit() {
|
||||
loadIC2Tile = (te) -> {
|
||||
if (!te.getWorld().isRemote) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent((IEnergyTile) te));
|
||||
}
|
||||
};
|
||||
unloadIC2Tile = (te) -> {
|
||||
if (!te.getWorld().isRemote) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile) te));
|
||||
}
|
||||
};
|
||||
getIC2Item = (type, variant) -> ImmutableList.of(IC2Items.getItem(type, variant));
|
||||
}
|
||||
|
||||
public void init() {
|
||||
Item tinnedFood = IC2Items.getItem("filled_tin_can").getItem();
|
||||
ItemStack emptyMug = IC2Items.getItem("mug", "empty");
|
||||
|
@ -151,6 +124,16 @@ public class Compat {
|
|||
return a instanceof IBoxable && ((IBoxable) a).canBeStoredInToolbox(s);
|
||||
});
|
||||
MechPartCommutator.originalStack = IC2Items.getItem("te", "kinetic_generator");
|
||||
loadIC2Tile = (te) -> {
|
||||
if (!te.getWorld().isRemote) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent((IEnergyTile) te));
|
||||
}
|
||||
};
|
||||
unloadIC2Tile = (te) ->{
|
||||
if (!te.getWorld().isRemote) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile) te));
|
||||
}
|
||||
};
|
||||
try {
|
||||
Class<?> teb = Class.forName("ic2.core.block.TileEntityBlock");
|
||||
Method getPickBlock = teb.getDeclaredMethod("getPickBlock", EntityPlayer.class, RayTraceResult.class);
|
||||
|
@ -176,76 +159,21 @@ public class Compat {
|
|||
}
|
||||
|
||||
public static class CompatProjectRed extends CompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
enableOtherRS = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
IBlockAction<EnumFacing, byte[]> oldGet = getBundledRS;
|
||||
IBundledRSGetter old = getBundledRS;
|
||||
enableOtherRS = true;
|
||||
getBundledRS = (w, p, f) -> {
|
||||
byte[] oldIn = oldGet.run(w, p, f);
|
||||
byte[] oldIn = old.getBundledInput(w, p, f);
|
||||
byte[] prIn = ProjectRedAPI.transmissionAPI.getBundledInput(w, p, f);
|
||||
if (prIn!=null) {
|
||||
for (int i = 0; i < 16; i++) {
|
||||
oldIn[i] = (byte) Math.ceil((prIn[i] & 255) / 17.0);
|
||||
oldIn[i] = (byte)((prIn[i]&255)/17);
|
||||
}
|
||||
}
|
||||
return oldIn;
|
||||
};
|
||||
IBlockAction<Void, Void> oldUpdate = updateBundledRS;
|
||||
updateBundledRS = (w, p, f)-> {
|
||||
oldUpdate.run(w, p, f);
|
||||
w.notifyNeighborsOfStateChange(p, w.getBlockState(p).getBlock(), true);
|
||||
return null;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static class CompatCharset extends CompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
enableOtherRS = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
IBlockAction<EnumFacing, byte[]> old = getBundledRS;
|
||||
getBundledRS = (w, p, f) -> {
|
||||
byte[] oldIn = old.run(w, p, f);
|
||||
TileEntity te = w.getTileEntity(p.offset(f));
|
||||
if (te!=null && te.hasCapability(Charset.EMITTER_CAP, f.getOpposite())) {
|
||||
IBundledEmitter emitter = te.getCapability(Charset.EMITTER_CAP, f.getOpposite());
|
||||
assert emitter!=null;
|
||||
byte[] charIn = emitter.getBundledSignal();
|
||||
if (charIn!=null) {
|
||||
for (int i = 0;i<16;i++) {
|
||||
if (charIn[i]>oldIn[i]) {
|
||||
oldIn[i] = charIn[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return oldIn;
|
||||
};
|
||||
IBlockAction<Void, Void> oldUpdate = updateBundledRS;
|
||||
updateBundledRS = (w, p, __)-> {
|
||||
oldUpdate.run(w, p, __);
|
||||
for (EnumFacing face : EnumFacing.VALUES) {
|
||||
TileEntity te = w.getTileEntity(p.offset(face.getOpposite()));
|
||||
if (te != null && te.hasCapability(Charset.RECEIVER_CAP, face)) {
|
||||
IBundledReceiver receiver = te.getCapability(Charset.RECEIVER_CAP, face);
|
||||
assert receiver != null;
|
||||
receiver.onBundledInputChange();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,11 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.compat;
|
||||
package malte0811.industrialWires.compat;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IBlockAction<P, R> {
|
||||
R run(World w, BlockPos pos, P f);
|
||||
public interface IBundledRSGetter {
|
||||
byte[] getBundledInput(World w, BlockPos pos, EnumFacing f);
|
||||
}
|
|
@ -13,14 +13,14 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.compat;
|
||||
package malte0811.industrialWires.compat;
|
||||
|
||||
import blusunrize.immersiveengineering.common.util.Utils;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.blocks.hv.BlockTypes_HVMultiblocks;
|
||||
import malte0811.industrialwires.hv.MarxOreHandler;
|
||||
import malte0811.industrialwires.hv.MarxOreHandler.OreInfo;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.blocks.hv.BlockTypes_HVMultiblocks;
|
||||
import malte0811.industrialWires.hv.MarxOreHandler;
|
||||
import malte0811.industrialWires.hv.MarxOreHandler.OreInfo;
|
||||
import mezz.jei.api.*;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
|
@ -13,9 +13,9 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.containers;
|
||||
package malte0811.industrialWires.containers;
|
||||
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.util.EnumHand;
|
|
@ -13,12 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.containers;
|
||||
package malte0811.industrialWires.containers;
|
||||
|
||||
import blusunrize.immersiveengineering.api.ApiUtils;
|
||||
import malte0811.industrialwires.blocks.controlpanel.BlockTypes_Panel;
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityPanelCreator;
|
||||
import malte0811.industrialwires.controlpanel.PanelUtils;
|
||||
import malte0811.industrialWires.blocks.controlpanel.BlockTypes_Panel;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanelCreator;
|
||||
import malte0811.industrialWires.controlpanel.PanelUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
|
@ -13,9 +13,9 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.containers;
|
||||
package malte0811.industrialWires.containers;
|
||||
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityRSPanel;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityRSPanel;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
|
@ -13,9 +13,9 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.containers;
|
||||
package malte0811.industrialWires.containers;
|
||||
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.util.EnumHand;
|
|
@ -13,13 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.controlpanel;
|
||||
package malte0811.industrialWires.controlpanel;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import malte0811.industrialwires.blocks.controlpanel.TileEntityGeneralCP;
|
||||
import malte0811.industrialwires.util.MiscUtils;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import malte0811.industrialWires.blocks.controlpanel.TileEntityGeneralCP;
|
||||
import malte0811.industrialWires.util.MiscUtils;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagByte;
|
||||
import net.minecraft.nbt.NBTTagInt;
|
||||
|
@ -138,7 +137,7 @@ public class ControlPanelNetwork {
|
|||
private void replaceWith(ControlPanelNetwork newNet, World w, Collection<BlockPos> toReplace) {
|
||||
removeAllMembers(ImmutableList.copyOf(toReplace));
|
||||
for (BlockPos member:toReplace) {
|
||||
TileEntityGeneralCP te = MiscUtils.getLoadedTE(w, member, TileEntityGeneralCP.class);
|
||||
TileEntityGeneralCP te = MiscUtils.getExistingTE(w, member, TileEntityGeneralCP.class);
|
||||
if (te!=null) {
|
||||
newNet.addMember(te);
|
||||
}
|
||||
|
@ -337,11 +336,6 @@ public class ControlPanelNetwork {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Channel " + EnumDyeColor.byMetadata(color).getName() + " on controller ID " + controller;
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return controller>=0 && color >= 0;
|
||||
}
|
||||
|
@ -404,11 +398,7 @@ public class ControlPanelNetwork {
|
|||
int result = channel.hashCode();
|
||||
result = 31 * result + strength;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return channel + ": " + strength;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,12 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.controlpanel;
|
||||
package malte0811.industrialWires.controlpanel;
|
||||
|
||||
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.client.RawQuad;
|
||||
import malte0811.industrialwires.client.gui.GuiPanelCreator;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.client.RawQuad;
|
||||
import malte0811.industrialWires.client.gui.GuiPanelCreator;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
|
@ -31,7 +31,7 @@ import org.lwjgl.util.vector.Vector3f;
|
|||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
import static malte0811.industrialwires.util.NBTKeys.COLOR;
|
||||
import static malte0811.industrialWires.util.NBTKeys.COLOR;
|
||||
|
||||
public class CoveredToggleSwitch extends ToggleSwitch {
|
||||
private int color = 0xff0000;
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.controlpanel;
|
||||
package malte0811.industrialWires.controlpanel;
|
||||
|
||||
import blusunrize.immersiveengineering.api.tool.IConfigurableTool.ToolConfig;
|
||||
import net.minecraft.nbt.NBTBase;
|
|
@ -13,12 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.controlpanel;
|
||||
package malte0811.industrialWires.controlpanel;
|
||||
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.client.RawQuad;
|
||||
import malte0811.industrialwires.client.gui.GuiPanelCreator;
|
||||
import malte0811.industrialwires.controlpanel.ControlPanelNetwork.RSChannel;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.client.RawQuad;
|
||||
import malte0811.industrialWires.client.gui.GuiPanelCreator;
|
||||
import malte0811.industrialWires.controlpanel.ControlPanelNetwork.RSChannel;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
|
@ -36,7 +36,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static malte0811.industrialwires.util.NBTKeys.*;
|
||||
import static malte0811.industrialWires.util.NBTKeys.*;
|
||||
|
||||
public class IndicatorLight extends PanelComponent implements IConfigurableComponent {
|
||||
@Nonnull
|
|
@ -13,12 +13,12 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.controlpanel;
|
||||
package malte0811.industrialWires.controlpanel;
|
||||
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.client.RawQuad;
|
||||
import malte0811.industrialwires.client.gui.GuiPanelCreator;
|
||||
import malte0811.industrialwires.client.panelmodel.RawModelFontRenderer;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.client.RawQuad;
|
||||
import malte0811.industrialWires.client.gui.GuiPanelCreator;
|
||||
import malte0811.industrialWires.client.panelmodel.RawModelFontRenderer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
@ -35,8 +35,8 @@ import javax.annotation.Nonnull;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import static malte0811.industrialwires.util.NBTKeys.COLOR;
|
||||
import static malte0811.industrialwires.util.NBTKeys.TEXT;
|
||||
import static malte0811.industrialWires.util.NBTKeys.COLOR;
|
||||
import static malte0811.industrialWires.util.NBTKeys.TEXT;
|
||||
|
||||
public class Label extends PanelComponent implements IConfigurableComponent {
|
||||
private String text = "Test";
|
|
@ -13,13 +13,13 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.controlpanel;
|
||||
package malte0811.industrialWires.controlpanel;
|
||||
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.client.RawQuad;
|
||||
import malte0811.industrialwires.client.gui.GuiPanelCreator;
|
||||
import malte0811.industrialwires.controlpanel.ControlPanelNetwork.RSChannel;
|
||||
import malte0811.industrialwires.controlpanel.ControlPanelNetwork.RSChannelState;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.client.RawQuad;
|
||||
import malte0811.industrialWires.client.gui.GuiPanelCreator;
|
||||
import malte0811.industrialWires.controlpanel.ControlPanelNetwork.RSChannel;
|
||||
import malte0811.industrialWires.controlpanel.ControlPanelNetwork.RSChannelState;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
|
@ -34,7 +34,7 @@ import javax.annotation.Nonnull;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static malte0811.industrialwires.util.NBTKeys.*;
|
||||
import static malte0811.industrialWires.util.NBTKeys.*;
|
||||
import static net.minecraftforge.fml.relauncher.Side.CLIENT;
|
||||
|
||||
public class LightedButton extends PanelComponent implements IConfigurableComponent {
|
|
@ -13,15 +13,15 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.controlpanel;
|
||||
package malte0811.industrialWires.controlpanel;
|
||||
|
||||
import blusunrize.immersiveengineering.common.util.chickenbones.Matrix4;
|
||||
import malte0811.industrialwires.IndustrialWires;
|
||||
import malte0811.industrialwires.client.RawQuad;
|
||||
import malte0811.industrialwires.client.gui.GuiPanelCreator;
|
||||
import malte0811.industrialwires.controlpanel.ControlPanelNetwork.RSChannel;
|
||||
import malte0811.industrialwires.controlpanel.ControlPanelNetwork.RSChannelState;
|
||||
import malte0811.industrialwires.items.ItemKey;
|
||||
import malte0811.industrialWires.IndustrialWires;
|
||||
import malte0811.industrialWires.client.RawQuad;
|
||||
import malte0811.industrialWires.client.gui.GuiPanelCreator;
|
||||
import malte0811.industrialWires.controlpanel.ControlPanelNetwork.RSChannel;
|
||||
import malte0811.industrialWires.controlpanel.ControlPanelNetwork.RSChannelState;
|
||||
import malte0811.industrialWires.items.ItemKey;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
@ -45,7 +45,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import static malte0811.industrialwires.util.NBTKeys.*;
|
||||
import static malte0811.industrialWires.util.NBTKeys.*;
|
||||
|
||||
public class Lock extends PanelComponent implements IConfigurableComponent {
|
||||
private final static Random rand = new Random();
|
|
@ -13,7 +13,7 @@
|
|||
* along with Industrial Wires. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package malte0811.industrialwires.controlpanel;
|
||||
package malte0811.industrialWires.controlpanel;
|
||||
|
||||
public enum MessageType {
|
||||
ADD,
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue