Created
August 11, 2015 20:56
-
-
Save StillManic/d0b6657b2281f74f9d4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connected to the target VM, address: '127.0.0.1:49706', transport: 'socket' | |
[13:50:29] [main/INFO]: username: [email protected] | |
[13:50:29] [main/INFO]: Extra: [] | |
[13:50:29] [main/INFO]: Password found, attempting login | |
[13:50:29] [main/INFO]: Logging in with username & password | |
[13:50:31] [main/INFO]: Login Succesful! | |
[13:50:31] [main/INFO]: Running with arguments: [--userProperties, [{"name":"twitch_access_token","value":"fnpsih9tsgq7wgs04619cbzxwfu024d"}], --assetsDir, C:/Users/Gerald/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --userType, mojang, --accessToken, {REDACTED}, --version, 1.8, --uuid, 1487d900d7a847b494cf0cd5ddf9160e, --username, shadekiller666, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker] | |
[13:50:31] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker | |
[13:50:31] [main/INFO]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker | |
[13:50:31] [main/INFO]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker | |
[13:50:31] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker | |
[13:50:31] [main/INFO]: Forge Mod Loader version 8.99.205.1502 for Minecraft 1.8 loading | |
[13:50:31] [main/INFO]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_45, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jdk1.8.0_45\jre | |
[13:50:31] [main/INFO]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation | |
[13:50:31] [main/INFO]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker | |
[13:50:31] [main/INFO]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin | |
[13:50:31] [main/INFO]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin | |
[13:50:31] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker | |
[13:50:31] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker | |
[13:50:31] [main/INFO]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker | |
[13:50:31] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker | |
[13:50:31] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker | |
[13:50:31] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper | |
[13:50:32] [main/ERROR]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! | |
[13:50:35] [main/ERROR]: FML appears to be missing any signature data. This is not a good thing | |
[13:50:35] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper | |
[13:50:35] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker | |
[13:50:36] [main/INFO]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker | |
[13:50:36] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker | |
[13:50:36] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker | |
[13:50:36] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main} | |
[13:50:38] [Client thread/INFO]: Setting user: shadekiller666 | |
[13:50:42] [Client thread/INFO]: LWJGL Version: 2.9.1 | |
[13:50:42] [Client thread/INFO]: [net.minecraftforge.fml.client.SplashProgress:start:235]: ---- Minecraft Crash Report ---- | |
// Everything's going to plan. No, really, that was supposed to happen. | |
Time: 8/11/15 1:50 PM | |
Description: Loading screen debug info | |
This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR | |
A detailed walkthrough of the error, its code path and all known details is as follows: | |
--------------------------------------------------------------------------------------- | |
-- System Details -- | |
Details: | |
Minecraft Version: 1.8 | |
Operating System: Windows 8.1 (amd64) version 6.3 | |
Java Version: 1.8.0_45, Oracle Corporation | |
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation | |
Memory: 851371328 bytes (811 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) | |
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M | |
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 | |
FML: | |
Loaded coremods (and transformers): | |
GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13399 Compatibility Profile Context 15.200.1062.1002' Renderer: 'AMD Radeon HD 7800 Series' | |
[13:50:42] [Client thread/INFO]: Attempting early MinecraftForge initialization | |
[13:50:42] [Client thread/INFO]: MinecraftForge v11.14.3.1502 Initialized | |
[13:50:43] [Client thread/INFO]: Replaced 204 ore recipies | |
[13:50:43] [Client thread/INFO]: Completed early MinecraftForge initialization | |
[13:50:43] [Client thread/INFO]: Found 0 mods from the command line. Injecting into mod discoverer | |
[13:50:43] [Client thread/INFO]: Searching C:\Users\Gerald\Documents\GitHub\Rollercoaster2\run\mods for mods | |
[13:50:48] [Client thread/INFO]: Forge Mod Loader has identified 4 mods to load | |
[13:50:48] [Client thread/INFO]: Attempting connection with missing mods [mcp, FML, Forge, rc2] at CLIENT | |
[13:50:48] [Client thread/INFO]: Attempting connection with missing mods [mcp, FML, Forge, rc2] at SERVER | |
[13:50:49] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:§4§lRollercoaster 2 | |
[13:50:49] [Client thread/INFO]: Processing ObjectHolder annotations | |
[13:50:49] [Client thread/INFO]: Found 384 ObjectHolder annotations | |
[13:50:49] [Client thread/INFO]: Identifying ItemStackHolder annotations | |
[13:50:49] [Client thread/INFO]: Found 0 ItemStackHolder annotations | |
[13:50:49] [Client thread/INFO]: Configured a dormant chunk cache size of 0 | |
[13:51:11] [Client thread/ERROR]: Caught an exception during block registration | |
java.lang.ArrayIndexOutOfBoundsException: -1 | |
at java.util.ArrayList.elementData(ArrayList.java:418) ~[?:1.8.0_45] | |
at java.util.ArrayList.set(ArrayList.java:446) ~[?:1.8.0_45] | |
at net.minecraft.util.ObjectIntIdentityMap.put(ObjectIntIdentityMap.java:25) ~[ObjectIntIdentityMap.class:?] | |
at net.minecraftforge.fml.common.registry.GameData.registerBlock(GameData.java:840) ~[GameData.class:?] | |
at net.minecraftforge.fml.common.registry.GameData.registerBlock(GameData.java:802) ~[GameData.class:?] | |
at net.minecraftforge.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:220) [GameRegistry.class:?] | |
at rcteam.rc2.block.RC2Blocks.registerBlock(RC2Blocks.java:60) [RC2Blocks.class:?] | |
at rcteam.rc2.block.RC2Blocks.preInit(RC2Blocks.java:43) [RC2Blocks.class:?] | |
at rcteam.rc2.RC2.preInit(RC2.java:100) [RC2.class:?] | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45] | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45] | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45] | |
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45] | |
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:537) [FMLModContainer.class:?] | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45] | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45] | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45] | |
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45] | |
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [guava-17.0.jar:?] | |
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [guava-17.0.jar:?] | |
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [guava-17.0.jar:?] | |
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [guava-17.0.jar:?] | |
at com.google.common.eventbus.EventBus.post(EventBus.java:275) [guava-17.0.jar:?] | |
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) [LoadController.class:?] | |
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) [LoadController.class:?] | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45] | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45] | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45] | |
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45] | |
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [guava-17.0.jar:?] | |
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [guava-17.0.jar:?] | |
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [guava-17.0.jar:?] | |
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [guava-17.0.jar:?] | |
at com.google.common.eventbus.EventBus.post(EventBus.java:275) [guava-17.0.jar:?] | |
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?] | |
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) [Loader.class:?] | |
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) [FMLClientHandler.class:?] | |
at net.minecraft.client.Minecraft.startGame(Minecraft.java:447) [Minecraft.class:?] | |
at net.minecraft.client.Minecraft.run(Minecraft.java:356) [Minecraft.class:?] | |
at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45] | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45] | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45] | |
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45] | |
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] | |
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] | |
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] | |
at GradleStart.main(Unknown Source) [start/:?] | |
java.lang.ClassNotFoundException: GiveThemeParkCommand | |
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) | |
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) | |
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) | |
at java.lang.Class.forName0(Native Method) | |
at java.lang.Class.forName(Class.java:348) | |
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:542) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:497) | |
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) | |
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) | |
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) | |
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) | |
at com.google.common.eventbus.EventBus.post(EventBus.java:275) | |
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) | |
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:497) | |
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) | |
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) | |
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) | |
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) | |
at com.google.common.eventbus.EventBus.post(EventBus.java:275) | |
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) | |
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:550) | |
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:249) | |
at net.minecraft.client.Minecraft.startGame(Minecraft.java:447) | |
at net.minecraft.client.Minecraft.run(Minecraft.java:356) | |
at net.minecraft.client.main.Main.main(Main.java:117) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:497) | |
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) | |
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) | |
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) | |
at GradleStart.main(Unknown Source) | |
Disconnected from the target VM, address: '127.0.0.1:49706', transport: 'socket' | |
Process finished with exit code -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rcteam.rc2.block; | |
import net.minecraft.block.properties.IProperty; | |
import net.minecraft.block.properties.PropertyDirection; | |
import net.minecraft.block.state.BlockState; | |
import net.minecraft.block.state.IBlockState; | |
import net.minecraft.entity.EntityLivingBase; | |
import net.minecraft.util.BlockPos; | |
import net.minecraft.util.EnumFacing; | |
import net.minecraftforge.common.property.ExtendedBlockState; | |
import net.minecraftforge.common.property.IExtendedBlockState; | |
import net.minecraftforge.common.property.IUnlistedProperty; | |
import net.minecraftforge.fml.common.registry.LanguageRegistry; | |
import net.minecraft.block.Block; | |
import net.minecraft.block.ITileEntityProvider; | |
import net.minecraft.block.material.Material; | |
import net.minecraft.client.renderer.texture.IIconRegister; | |
import net.minecraft.tileentity.TileEntity; | |
import net.minecraft.util.IIcon; | |
import net.minecraft.world.IBlockAccess; | |
import net.minecraft.world.World; | |
import rcteam.rc2.RC2; | |
import rcteam.rc2.block.te.TileEntityTrack; | |
import rcteam.rc2.proxy.ClientProxy; | |
import rcteam.rc2.rollercoaster.*; | |
import rcteam.rc2.util.Utils; | |
public class BlockTrack extends Block implements ITileEntityProvider { | |
public static final PropertyDirection FACING = PropertyDirection.create("facing"); | |
public ExtendedBlockState state = new ExtendedBlockState(this, new IProperty[] {FACING}, new IUnlistedProperty[] {TrackProperty.instance}); | |
private TrackPieceInfo info; | |
public BlockTrack(TrackPieceInfo info) { | |
super(info.getCategory().getMaterial()); | |
this.info = info; | |
setCreativeTab(RC2.tab); | |
setBlockUnbreakable(); | |
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); | |
setBlockBounds(0f, 0f, 0f, 1f, 0.5f, 1f); | |
setUnlocalizedName(RC2.MODID + ".track_" + info.getCategory().getName()); | |
} | |
public TrackPieceInfo getInfo() { | |
return this.info; | |
} | |
@Override | |
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) { | |
return ((IExtendedBlockState) state).withProperty(TrackProperty.instance, this.info); | |
} | |
@Override | |
public BlockState createBlockState() { | |
// return state; | |
return new ExtendedBlockState(this, new IProperty[] {FACING}, new IUnlistedProperty[] {TrackProperty.instance}); | |
} | |
@Override | |
public IBlockState getStateFromMeta(int meta) { | |
return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); | |
} | |
@Override | |
public int getMetaFromState(IBlockState state) { | |
return ((EnumFacing) state.getValue(FACING)).getHorizontalIndex(); | |
} | |
@Override | |
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { | |
//TODO: things will be set from the track designer later | |
return ((IExtendedBlockState) this.getDefaultState()).withProperty(TrackProperty.instance, this.info).withProperty(FACING, Utils.getFacingFromEntity(worldIn, pos, placer)); | |
} | |
@Override | |
public int getRenderType() { | |
return 3; | |
} | |
@Override | |
public boolean hasTileEntity(IBlockState state) { | |
return true; | |
} | |
@Override | |
public TileEntity createNewTileEntity(World world, int meta) { | |
return new TileEntityTrack(this.info); | |
} | |
public enum TrackProperty implements IUnlistedProperty<TrackPieceInfo> { | |
instance; | |
@Override | |
public String getName() { | |
return "TrackProperty"; | |
} | |
@Override | |
public boolean isValid(TrackPieceInfo value) { | |
return value != null && value.getCategory() != null && value.getPieces() != null && !value.getPieces().isEmpty(); | |
} | |
@Override | |
public Class<TrackPieceInfo> getType() { | |
return TrackPieceInfo.class; | |
} | |
@Override | |
public String valueToString(TrackPieceInfo value) { | |
return value.toString(); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rcteam.rc2.proxy; | |
import net.minecraft.client.resources.IReloadableResourceManager; | |
import net.minecraft.client.resources.model.ModelResourceLocation; | |
import net.minecraftforge.client.MinecraftForgeClient; | |
import net.minecraftforge.client.model.ModelLoader; | |
import net.minecraftforge.client.model.ModelLoaderRegistry; | |
import net.minecraft.client.Minecraft; | |
import net.minecraft.item.Item; | |
import net.minecraftforge.common.MinecraftForge; | |
import net.minecraftforge.fml.client.FMLClientHandler; | |
import net.minecraftforge.fml.common.FMLCommonHandler; | |
import rcteam.rc2.RC2; | |
import rcteam.rc2.block.BlockTrack; | |
import rcteam.rc2.block.RC2Blocks; | |
import rcteam.rc2.client.gui.GuiThemeParkOverlay; | |
import rcteam.rc2.rollercoaster.CategoryEnum; | |
import rcteam.rc2.rollercoaster.ThemeParkLogo; | |
import rcteam.rc2.util.FileManager; | |
import rcteam.rc2.util.OBJLoader; | |
import java.io.File; | |
import java.util.Map; | |
public class ClientProxy extends CommonProxy { | |
public static int trackRenderId = -1; | |
@Override | |
public void initRenderers() { | |
ModelLoaderRegistry.registerLoader(OBJLoader.instance); | |
// ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTrack.class, new TileEntityTrackRenderer()); | |
// RC2Blocks.trackMap.forEach((categoryEnum, blockTrack) -> MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(blockTrack), new ItemTrackRenderer())); | |
ThemeParkLogo.init(); | |
MinecraftForge.EVENT_BUS.register(new GuiThemeParkOverlay(Minecraft.getMinecraft())); | |
// ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new FileManager()); | |
} | |
@Override | |
public void init() { | |
OBJLoader.instance.addDomain(RC2.MODID.toLowerCase()); | |
Item item = Item.getItemFromBlock(RC2Blocks.track_steel); | |
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(RC2.MODID.toLowerCase() + ":" + "track", "inventory")); | |
Item item1 = Item.getItemFromBlock(RC2Blocks.track_wood); | |
ModelLoader.setCustomModelResourceLocation(item1, 0, new ModelResourceLocation(RC2.MODID.toLowerCase() + ":" + "track", "inventory")); | |
Item item2 = Item.getItemFromBlock(RC2Blocks.track_inverted); | |
ModelLoader.setCustomModelResourceLocation(item2, 0, new ModelResourceLocation(RC2.MODID.toLowerCase() + ":" + "track", "inventory")); | |
Item item3 = Item.getItemFromBlock(RC2Blocks.track_water); | |
ModelLoader.setCustomModelResourceLocation(item3, 0, new ModelResourceLocation(RC2.MODID.toLowerCase() + ":" + "track", "inventory")); | |
// for (Map.Entry<CategoryEnum, BlockTrack> entry : RC2Blocks.trackMap.entrySet()) { | |
//// for (BlockTrack track : RC2Blocks.trackMap.values()) { | |
// Item trackItem = Item.getItemFromBlock(entry.getValue()); | |
// File temp = new File(entry.getValue().getStyle().getModelLocation().getResourcePath()); | |
//// ModelLoader.setCustomModelResourceLocation(trackItem, 0, new ModelResourceLocation(RC2.MODID + ":" + entry.getValue().getStyle().getModelLocation().getResourcePath())); | |
// ModelLoader.setCustomModelResourceLocation(trackItem, 0, new ModelResourceLocation(RC2.MODID + ":" + temp.getAbsolutePath())); | |
// } | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rcteam.rc2.item; | |
import net.minecraft.block.Block; | |
import net.minecraft.block.state.IBlockState; | |
import net.minecraft.entity.player.EntityPlayer; | |
import net.minecraft.item.ItemBlock; | |
import net.minecraft.item.ItemStack; | |
import net.minecraft.launchwrapper.Launch; | |
import net.minecraft.util.BlockPos; | |
import net.minecraft.util.EnumFacing; | |
import net.minecraft.world.World; | |
import net.minecraftforge.common.util.ForgeDirection; | |
import rcteam.rc2.block.BlockTrack; | |
public class ItemTrack extends ItemBlock { | |
private BlockTrack track; | |
public ItemTrack(Block track) { | |
super(track); | |
this.track = (BlockTrack) track; | |
} | |
public BlockTrack getTrack() { | |
return this.track; | |
} | |
@Override | |
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) { | |
if ((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) { //this makes tracks placeable by hand when run in a dev env | |
//TODO! | |
// world.setBlockState(); | |
return true; | |
} | |
return false; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rcteam.rc2; | |
import net.minecraft.client.Minecraft; | |
import net.minecraft.client.resources.IResource; | |
import net.minecraft.command.CommandHandler; | |
import net.minecraft.util.ResourceLocation; | |
import net.minecraftforge.fml.client.FMLClientHandler; | |
import net.minecraftforge.fml.common.FMLLog; | |
import net.minecraftforge.fml.common.Mod; | |
import net.minecraftforge.fml.common.Mod.EventHandler; | |
import net.minecraftforge.fml.common.Mod.Instance; | |
import net.minecraftforge.fml.common.SidedProxy; | |
import net.minecraftforge.fml.common.event.FMLInitializationEvent; | |
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; | |
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; | |
import net.minecraftforge.fml.common.event.FMLServerStartingEvent; | |
import net.minecraftforge.fml.common.network.NetworkRegistry; | |
import net.minecraftforge.fml.relauncher.Side; | |
import net.minecraftforge.fml.relauncher.SideOnly; | |
import net.minecraft.creativetab.CreativeTabs; | |
import net.minecraft.item.Item; | |
import net.minecraft.item.ItemStack; | |
import org.apache.logging.log4j.*; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
import rcteam.rc2.block.RC2Blocks; | |
import rcteam.rc2.client.gui.GuiHandler; | |
import rcteam.rc2.command.GiveThemeParkCommand; | |
import rcteam.rc2.item.RC2Items; | |
import rcteam.rc2.network.packets.PacketPipeline; | |
import rcteam.rc2.proxy.CommonProxy; | |
import rcteam.rc2.rollercoaster.CoasterStyle; | |
import rcteam.rc2.rollercoaster.StyleRegistry; | |
import rcteam.rc2.rollercoaster.TrackPieceRegistry; | |
import rcteam.rc2.util.CoasterPack; | |
import rcteam.rc2.util.FileManager; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.Collection; | |
import java.util.HashMap; | |
import rcteam.rc2.util.JsonParser; | |
import rcteam.rc2.util.Reference; | |
@Mod(modid = RC2.MODID, name = RC2.NAME, version = RC2.VERSION) | |
public class RC2 { | |
public static final String MODID = "rc2"; | |
public static final String NAME = "Roller Coaster 2"; | |
public static final String VERSION = "v0.1"; | |
public static HashMap<String, CoasterPack> packs = new HashMap<>(); | |
@Instance | |
public static RC2 instance; | |
@SidedProxy(clientSide="rcteam.rc2.proxy.ClientProxy", serverSide="rcteam.rc2.proxy.CommonProxy") | |
public static CommonProxy proxy; | |
public static String srcDir; | |
public static String packsDir; | |
public static Logger logger; | |
public static CreativeTabs tab; | |
public static final PacketPipeline packetPipeline = new PacketPipeline(); | |
@EventHandler | |
public void preInit(FMLPreInitializationEvent event) { | |
proxy.preInit(); | |
srcDir = event.getSourceFile().getAbsolutePath(); | |
packsDir = srcDir + "\\assets\\" + MODID + "\\packs\\"; | |
logger = LogManager.getLogger(NAME); | |
tab = new CreativeTabs(NAME) { | |
@Override | |
@SideOnly(Side.CLIENT) | |
public Item getTabIconItem() { | |
return null; | |
} | |
@Override | |
@SideOnly(Side.CLIENT) | |
public ItemStack getIconItemStack() { | |
return new ItemStack(RC2Items.hammer); | |
} | |
}; | |
TrackPieceRegistry.INSTANCE.registerDefaultPieces(); | |
// if (event.getSide() == Side.CLIENT) { | |
// readPackFolder(); | |
// } | |
// readPackFolder(); | |
// getListPacks().stream().forEach(CoasterPack::registerStyles); | |
// StyleRegistry.INSTANCE.registerBlocks(); | |
RC2Items.preInit(); | |
RC2Blocks.preInit(); | |
} | |
@EventHandler | |
public void init(FMLInitializationEvent event) { | |
packetPipeline.initalise(); | |
// readPackFolder(); | |
// getListPacks().stream().forEach(CoasterPack::registerStyles); | |
// StyleRegistry.INSTANCE.registerBlocks(); | |
proxy.init(); | |
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); | |
} | |
@EventHandler | |
public void postInit(FMLPostInitializationEvent event) { | |
packetPipeline.postInitialise(); | |
} | |
@EventHandler | |
public void serverStarting(FMLServerStartingEvent event) { | |
((CommandHandler) event.getServer().getCommandManager()).registerCommand(new GiveThemeParkCommand()); | |
// event.registerServerCommand(new GiveThemeParkCommand()); | |
} | |
public static void readPackFolder() { | |
// logger.info("reading pack folder"); | |
// logger.info(srcDir + "\\assets\\rc2\\packs\\"); | |
File packsFolder = new File(packsDir); | |
for (File pack : packsFolder.listFiles()) { | |
CoasterPack coasterPack = FileManager.readPack(pack); | |
if (coasterPack != null) register(coasterPack); | |
} | |
} | |
public static Collection<CoasterPack> getListPacks() { | |
return packs.values(); | |
} | |
public static void register(CoasterPack pack) { | |
logger.info("Registering pack: " + pack.getName()); | |
if (packs.get(pack.getName()) == null) RC2.packs.put(pack.getName(), pack); | |
else logger.error("A coaster pack has already been registered with name {}", pack.getName()); | |
} | |
public static CoasterPack getPack(String name) { | |
return packs.get(name); | |
} | |
public static CoasterPack getPackContainingStyle(CoasterStyle style) { | |
return packs.values().stream().filter(pack -> pack.getStyles().containsKey(style.getName())).findFirst().get(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rcteam.rc2.block; | |
import com.google.common.collect.ImmutableMap; | |
import com.google.common.collect.Maps; | |
import net.minecraft.item.Item; | |
import net.minecraft.item.ItemBlock; | |
import net.minecraft.util.WeightedRandom; | |
import net.minecraftforge.fml.common.registry.GameRegistry; | |
import net.minecraft.block.Block; | |
import net.minecraft.tileentity.TileEntity; | |
import rcteam.rc2.RC2; | |
import rcteam.rc2.block.te.TileEntityEntrance; | |
import rcteam.rc2.block.te.TileEntityTrack; | |
import rcteam.rc2.item.ItemTrack; | |
import rcteam.rc2.rollercoaster.CategoryEnum; | |
import rcteam.rc2.rollercoaster.TrackPieceInfo; | |
import rcteam.rc2.rollercoaster.TrackPieceRegistry; | |
import java.util.Map; | |
public class RC2Blocks { | |
public static final Map<CategoryEnum, BlockTrack> trackMap = Maps.newEnumMap(CategoryEnum.class); | |
public static Block entrance; | |
public static Block track_steel; | |
public static Block track_wood; | |
public static Block track_inverted; | |
public static Block track_water; | |
public static void preInit() { | |
entrance = new BlockEntrance(); | |
TrackPieceInfo steelInfo = new TrackPieceInfo(CategoryEnum.STEEL, TrackPieceRegistry.INSTANCE.getPieces()); //TODO: distinguish between different category pieces and different Style pieces! | |
TrackPieceInfo woodInfo = new TrackPieceInfo(CategoryEnum.WOODEN, TrackPieceRegistry.INSTANCE.getPieces()); | |
TrackPieceInfo invertedInfo = new TrackPieceInfo(CategoryEnum.INVERTED, TrackPieceRegistry.INSTANCE.getPieces()); | |
TrackPieceInfo waterInfo = new TrackPieceInfo(CategoryEnum.WATER, TrackPieceRegistry.INSTANCE.getPieces()); | |
track_steel = new BlockTrack(steelInfo); | |
track_wood = new BlockTrack(woodInfo); | |
track_inverted = new BlockTrack(invertedInfo); | |
track_water = new BlockTrack(waterInfo); | |
registerBlock(entrance); | |
registerBlock(track_steel, ItemTrack.class); | |
registerBlock(track_wood, ItemTrack.class); | |
registerBlock(track_inverted, ItemTrack.class); | |
registerBlock(track_water, ItemTrack.class); | |
registerTE(TileEntityEntrance.class, entrance); | |
registerTE(TileEntityTrack.class, track_steel); | |
registerTE(TileEntityTrack.class, track_wood); | |
registerTE(TileEntityTrack.class, track_inverted); | |
registerTE(TileEntityTrack.class, track_water); | |
} | |
private static void registerBlock(Block block) { | |
GameRegistry.registerBlock(block, block.getUnlocalizedName()); | |
} | |
private static void registerBlock(Block block, Class<? extends ItemBlock> itemClass, Object ... itemConstructorArgs) { | |
GameRegistry.registerBlock(block, itemClass, block.getUnlocalizedName(), itemConstructorArgs); | |
} | |
private static void registerTE(Class<? extends TileEntity> te, Block block) { | |
GameRegistry.registerTileEntity(te, block.getUnlocalizedName()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rcteam.rc2.block.te; | |
import net.minecraft.tileentity.TileEntity; | |
import rcteam.rc2.rollercoaster.*; | |
public class TileEntityTrack extends TileEntity { | |
// public CoasterStyle style; | |
// public CategoryEnum category; | |
// public TrackPiece piece; | |
public TrackPieceInfo info; | |
// public TileEntityTrack() { | |
//// this.info = new TrackPieceInfo(CategoryEnum.STEEL, TrackPieceRegistry.INSTANCE.getPiece("straight")); | |
// } | |
// public TileEntityTrack(CoasterStyle style) { | |
// this.style = style; | |
// } | |
// public TileEntityTrack(CategoryEnum category, TrackPiece piece) { | |
// this.category = category; | |
// this.piece = piece; | |
// } | |
public TileEntityTrack(TrackPieceInfo info) { | |
this.info = info; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rcteam.rc2.rollercoaster; | |
import org.apache.commons.lang3.StringUtils; | |
import javax.vecmath.Vector3f; | |
public class TrackPiece { | |
private String name = "Default Name"; | |
private String displayName = null; | |
private Vector3f size = new Vector3f(1, 1, 1); | |
public TrackPiece(String name, Vector3f size) { | |
this.name = name; | |
this.size = size; | |
} | |
public String getName() { | |
return this.name; | |
} | |
public String getDisplayName() { | |
if (this.displayName != null) return this.displayName; | |
String ret = this.name.replaceAll("_", " "); | |
StringUtils.capitalize(ret); | |
this.displayName = ret; | |
return ret; | |
} | |
public Vector3f getSize() { | |
return this.size; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rcteam.rc2.rollercoaster; | |
import com.google.common.collect.Lists; | |
import java.util.List; | |
public class TrackPieceInfo { | |
private CategoryEnum category; | |
// private TrackPiece piece; | |
private List<TrackPiece> pieces = Lists.newArrayList(); | |
public TrackPieceInfo(CategoryEnum category) { | |
this.category = category; | |
} | |
public TrackPieceInfo(CategoryEnum category, List<TrackPiece> pieces) { | |
this.category = category; | |
this.pieces = pieces; | |
} | |
public void setCategory(CategoryEnum category) { | |
this.category = category; | |
} | |
public CategoryEnum getCategory() { | |
return this.category; | |
} | |
public void addPiece(TrackPiece piece) { | |
this.pieces.add(piece); | |
} | |
public void addPieces(List<TrackPiece> pieces) { | |
this.pieces.addAll(pieces); | |
} | |
public List<TrackPiece> getPieces() { | |
return this.pieces; | |
} | |
@Override | |
public String toString() { | |
StringBuilder builder = new StringBuilder(String.format("TrackPieceInfo: Category: %s, Pieces: [", this.category.getName())); | |
for (TrackPiece piece : this.pieces) { | |
builder.append(String.format("%s, ", piece.getName())); | |
} | |
builder.delete(builder.length() - 3, builder.length()); | |
builder.append("]"); | |
return builder.toString(); | |
// return String.format("TrackPieceInfo: Category: %s, ", this.category.getName(), this.piece.getName()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rcteam.rc2.rollercoaster; | |
import com.google.common.collect.BiMap; | |
import com.google.common.collect.Lists; | |
import com.google.common.collect.Maps; | |
import rcteam.rc2.RC2; | |
import javax.vecmath.Vector3f; | |
import java.util.List; | |
import java.util.Map; | |
public class TrackPieceRegistry { | |
public static final TrackPieceRegistry INSTANCE = new TrackPieceRegistry(); | |
private Map<String, TrackPiece> pieceMap = Maps.newHashMap(); | |
private TrackPieceRegistry() {} | |
public void registerPiece(TrackPiece piece) { | |
if (!this.pieceMap.containsKey(piece.getName()) && !this.pieceMap.containsValue(piece)) { | |
this.pieceMap.put(piece.getName(), piece); | |
} else { | |
RC2.logger.warn("TrackPieceRegistry: Tried to register a duplicate TrackPiece: %s, skipping!", piece.getName()); | |
} | |
} | |
public void replacePiece(TrackPiece piece) { | |
if (!this.pieceMap.containsKey(piece.getName()) && !this.pieceMap.containsValue(piece)) { | |
this.pieceMap.put(piece.getName(), piece); | |
RC2.logger.warn("TrackPieceRegistry: Tried to replace a piece that hasn't been registered, added piece %s to map instead.", piece.getName()); | |
} else { | |
this.pieceMap.replace(piece.getName(), piece); | |
} | |
} | |
public void removePiece(String name) { | |
if (!this.pieceMap.containsKey(name)) { | |
RC2.logger.warn("TrackPieceMap: Tried to remove a piece with name %s, but no piece of that name exists in the map.", name); | |
} else { | |
this.pieceMap.remove(name); | |
} | |
} | |
public Map<String, TrackPiece> getPieceMap() { | |
return this.pieceMap; | |
} | |
public List<TrackPiece> getPieces() { | |
return Lists.newArrayList(this.pieceMap.values()); | |
} | |
public List<String> getPieceNames() { | |
return Lists.newArrayList(this.pieceMap.keySet()); | |
} | |
public TrackPiece getPiece(String name) { | |
return this.pieceMap.get(name); | |
} | |
public void registerDefaultPieces() { | |
this.registerPiece(new TrackPiece("straight", new Vector3f(1, 1, 1))); | |
this.registerPiece(new TrackPiece("small_corner", new Vector3f(2, 1, 2))); | |
this.registerPiece(new TrackPiece("medium_corner", new Vector3f(3, 1, 3))); | |
this.registerPiece(new TrackPiece("large_corner_right", new Vector3f(2, 1, 2))); | |
this.registerPiece(new TrackPiece("large_corner_left", new Vector3f(2, 1, 2))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment