├── Resources ├── Shader │ ├── liblist.txt │ ├── base.txt │ ├── lib_math.txt │ ├── lib_chunk.txt │ └── lib_color.txt ├── New.png ├── gui.png ├── dummy.png ├── slime.png ├── brushes.png ├── buttons.png ├── guidebcg.png ├── mutewarn.png ├── warning.png ├── frey_glow.png ├── reika_glow.png ├── reika_tex.png ├── samaki_glow.png ├── samaki_tex.png ├── reika_effect.vert ├── reika_stencil.vert ├── reika_stencil.frag └── reika_effect.frag ├── Extras ├── GeneratedCalls.java ├── NeedsImplementation.java ├── TemporaryCodeCalls.java └── SanityCheckNotification.java ├── Instantiable ├── IO │ ├── PacketPipeline.rar │ ├── ForcedResource.java │ ├── DynamicDirectResource.java │ └── DynamicSoundLoader.java ├── GUI │ ├── DummyContainer.java │ ├── Slot │ │ ├── SlotFullStack.java │ │ └── SlotXItems.java │ ├── InvisibleButton.java │ └── Slider.java ├── Math │ ├── Noise │ │ └── Octave.java │ ├── Matrix2D.java │ ├── Matrix3D.java │ ├── Vec4.java │ └── CachedRayComponents.java ├── Event │ ├── MTReloadEvent.java │ ├── EntityRemovedEvent.java │ ├── WorldCreationEvent.java │ ├── Client │ │ ├── RenderCursorStackEvent.java │ │ ├── SinglePlayerLogoutEvent.java │ │ ├── GameFinishedLoadingEvent.java │ │ ├── LightmapEvent.java │ │ ├── TextureReloadEvent.java │ │ ├── RenderFirstPersonItemEvent.java │ │ ├── EntitySemitransparencyEvent.java │ │ ├── ClientLogoutEvent.java │ │ ├── FarClippingPlaneEvent.java │ │ ├── ClientLoginEvent.java │ │ ├── SkyColorEvent.java │ │ └── FogDistanceEvent.java │ ├── Base │ │ └── PositionEventClient.java │ ├── GetYToSpawnMobEvent.java │ ├── ItemUpdateEvent.java │ ├── CreeperExplodeEvent.java │ ├── EntityAIEvent.java │ ├── BlockUpdateEvent.java │ ├── LavaFreezeEvent.java │ ├── SpawnerGenerateEntityEvent.java │ ├── RawKeyPressEvent.java │ ├── ConfigReloadEvent.java │ ├── PlayerSprintEvent.java │ ├── XPUpdateEvent.java │ ├── AddRecipeEvent.java │ ├── PlayerHasItemEvent.java │ ├── LivingFarDespawnEvent.java │ └── RemovePlayerItemEvent.java ├── Data │ ├── Maps │ │ ├── PathMap.java │ │ └── PairMap.java │ ├── Immutable │ │ ├── ImmutableArray.java │ │ ├── Column.java │ │ ├── ScaledCubeDirection.java │ │ └── ScaledDirection.java │ ├── CachedValue.java │ ├── DynamicAverage.java │ └── Collections │ │ ├── LinearSequence.java │ │ ├── TimedSet.java │ │ └── ClassNameCache.java ├── ReadOnlyIterator.java ├── RedstoneTracker.java ├── BasicTeleporter.java ├── Rendering │ └── NullEntityRender.java ├── ItemOnSpawnTracker.java ├── ResettableRandom.java ├── AlphabeticItemComparator.java ├── TemporaryInventory.java ├── ObfuscationMapping.java ├── CubeRotation.java ├── ModInteract │ ├── MEWorkTracker.java │ └── PositionedStackWithTooltip.java ├── Formula │ └── MathExpression.java ├── ModifiableAttributeMap.java └── AI │ └── AITaskSeekMachine.java ├── Interfaces ├── LegacyPatcher.java ├── Block │ ├── Reedlike.java │ ├── CraftableStone.java │ ├── CustomSnowAccumulation.java │ ├── CollisionDelegate.java │ ├── SemiTransparent.java │ ├── SidedTextureIndex.java │ ├── SemiUnbreakable.java │ ├── SelectiveMovable.java │ └── ShearablePlant.java ├── Registry │ ├── StreamableSound.java │ ├── DynamicSound.java │ ├── CustomDistanceSound.java │ ├── VariableSound.java │ ├── StructureEnum.java │ ├── ISBRHEnum.java │ ├── RegistryType.java │ ├── ModCrop.java │ ├── Dependency.java │ ├── IDRegistry.java │ ├── EnchantmentEnum.java │ ├── ItemEnum.java │ ├── ModEntry.java │ ├── EntityEnum.java │ ├── RegistryEntry.java │ ├── BlockEnum.java │ ├── TileEnum.java │ └── RegistrationList.java ├── TileEntity │ ├── CopyableSettings.java │ ├── ConditionBreakDropsInventory.java │ ├── SimpleConnection.java │ ├── ConditionalUnbreakability.java │ ├── NonIFluidTank.java │ ├── GuiController.java │ ├── BreakAction.java │ ├── PartialTank.java │ ├── PartialInventory.java │ ├── TriggerableAction.java │ ├── PlaceNotification.java │ ├── InertIInv.java │ ├── XPProducer.java │ ├── ThermalTile.java │ ├── ToggleTile.java │ ├── MobRepellent.java │ ├── CraftingTile.java │ ├── MobAttractor.java │ ├── OpenTopTank.java │ ├── LocationCached.java │ ├── SidePlacedTile.java │ ├── HitAction.java │ ├── MultiPageInventory.java │ ├── NBTCopyable.java │ ├── AdjacentUpdateWatcher.java │ ├── PlayerBreakHook.java │ ├── RenderFetcher.java │ ├── RedstoneTile.java │ ├── Connectable.java │ └── ChunkLoadingTile.java ├── IconEnum.java ├── Item │ ├── CustomEnchantingCategory.java │ ├── VariableSizeSpritesheet.java │ ├── CustomMatchingItem.java │ ├── ToolSprite.java │ ├── UnbreakableArmor.java │ ├── BlendedColor.java │ ├── MetadataSpecificTrade.java │ ├── MultiLayerItemSprite.java │ ├── MultisheetItem.java │ ├── EntityCapturingItem.java │ ├── EnumItem.java │ ├── IndexedItemSprites.java │ ├── MusicDataItem.java │ ├── GradientBlend.java │ ├── ActivatedInventoryItem.java │ ├── SpriteRenderCallback.java │ └── AnimatedSpritesheet.java ├── ObjectToNBTSerializer.java ├── DataProvider.java ├── Entity │ ├── ClampedDamage.java │ ├── ChunkLoadingEntity.java │ ├── TameHostile.java │ ├── EtherealEntity.java │ ├── CustomProjectile.java │ ├── DestroyOnUnload.java │ └── CustomRenderFX.java ├── WinterBiomeStrengthControl.java ├── EntityPathfinder.java ├── PlayerTracker.java ├── Callbacks │ ├── BlockPlaceCallback.java │ ├── EventWatchers.java │ └── PositionCallable.java ├── NumberedSlots.java ├── Matcher.java ├── ComparableAI.java ├── CustomTemperatureBiome.java ├── FractionalButtonGui.java ├── WrappedRecipe.java ├── Configuration │ ├── MatchingConfig.java │ ├── CustomCategoryConfig.java │ ├── UserSpecificConfig.java │ ├── SegmentedConfigList.java │ ├── SelectiveConfig.java │ ├── StringConfig.java │ ├── IntArrayConfig.java │ ├── StringArrayConfig.java │ ├── BoundedConfig.java │ ├── IntegerConfig.java │ ├── DecimalConfig.java │ ├── BooleanConfig.java │ └── ConfigList.java ├── ASMEnum.java ├── ColorController.java ├── TextureFetcher.java ├── CustomBiomeDistributionWorld.java ├── TileModel.java ├── PermaPotion.java ├── MotionController.java ├── PositionController.java ├── CustomMapColorBiome.java ├── OreGenerator.java ├── PacketHandler.java ├── CustomToStringRecipe.java ├── Subgenerator.java ├── Location.java ├── RetroactiveGenerator.java ├── DataSync.java └── PlayerRenderObj.java ├── README.md ├── ModInteract ├── DummyBiomeSettings.java ├── Lua │ └── LibraryLuaMethod.java ├── DeepInteract │ └── MoleculeHelper.java ├── Bees │ ├── GeneBase.java │ ├── BeeEvent.java │ ├── BasicGene.java │ └── DummyEffectData.java ├── ItemHandlers │ └── HexcraftHandler.java ├── ReikaTwilightHelper.java └── Computers │ ├── PeripheralHandlerCC.java │ └── PeripheralHandlerRelay.java ├── Libraries ├── MathSci │ ├── ChemicalElement.java │ └── ReikaStatisticsHelper.java ├── ReikaContainerAPI.java ├── IO │ ├── ReikaMediaHelper.java │ └── ReikaCommandHelper.java └── Java │ └── ClassModifiers.java ├── IO ├── Shaders │ └── ShaderHook.java └── ReikaCSVReader.java ├── ASM └── Patchers │ ├── Hooks │ ├── Event │ │ ├── Render │ │ │ ├── PackedIceIcon.java │ │ │ ├── LiquidIcon.java │ │ │ └── ChunkCacheRenderBrightness.java │ │ ├── Block │ │ │ ├── VanillaLeafDecayEvent.java │ │ │ ├── GrassSpreadEvent.java │ │ │ └── MyceliumSpreadEvent.java │ │ ├── Entity │ │ │ ├── BasicEntityInvisibilityEvent.java │ │ │ └── Player │ │ │ │ └── PlayerEntityInvisibilityEvent.java │ │ ├── RaytraceEvent1.java │ │ ├── RaytraceEvent2.java │ │ ├── RaytraceEvent3.java │ │ └── World │ │ │ └── Gen │ │ │ ├── DungeonSpawnerGen.java │ │ │ ├── NetherSpawnerGen.java │ │ │ ├── MineshaftSpawnerGen.java │ │ │ ├── StrongholdSpawnerGen.java │ │ │ └── DungeonLootGen.java │ └── WorldGLLists.java │ ├── MobSpawnerPatch.java │ └── Fixes │ ├── RecipeStackParsingOre.java │ └── RecipeStackParsingShaped.java ├── Exception ├── WorldSanityException.java ├── UnreachableCodeException.java ├── ModHandlerException.java ├── UserErrorException.java ├── MissingDependencyException.java ├── ModIntegrityException.java ├── MissingASMException.java ├── DragonAPIException.java └── JarZipException.java ├── Base ├── OneSlotMachine.java ├── CropHandlerBase.java ├── ProgressContainer.java └── BlockTileEnum.java ├── Objects └── LineType.java ├── .gitattributes ├── Command ├── ClearBreakersCommand.java ├── DragonClientCommand.java ├── ChestRepopulationCommand.java ├── FlushChunkDataCommand.java └── ToggleBlockChangePacketCommand.java ├── APIProxy.java ├── APIGuiHandler.java └── Auxiliary └── PacketTypes.java /Resources/Shader/liblist.txt: -------------------------------------------------------------------------------- 1 | math 2 | color 3 | geometry 4 | noise 5 | chunk 6 | effects -------------------------------------------------------------------------------- /Resources/New.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/New.png -------------------------------------------------------------------------------- /Resources/gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/gui.png -------------------------------------------------------------------------------- /Resources/dummy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/dummy.png -------------------------------------------------------------------------------- /Resources/slime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/slime.png -------------------------------------------------------------------------------- /Resources/brushes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/brushes.png -------------------------------------------------------------------------------- /Resources/buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/buttons.png -------------------------------------------------------------------------------- /Resources/guidebcg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/guidebcg.png -------------------------------------------------------------------------------- /Resources/mutewarn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/mutewarn.png -------------------------------------------------------------------------------- /Resources/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/warning.png -------------------------------------------------------------------------------- /Resources/frey_glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/frey_glow.png -------------------------------------------------------------------------------- /Resources/reika_glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/reika_glow.png -------------------------------------------------------------------------------- /Resources/reika_tex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/reika_tex.png -------------------------------------------------------------------------------- /Resources/samaki_glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/samaki_glow.png -------------------------------------------------------------------------------- /Resources/samaki_tex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Resources/samaki_tex.png -------------------------------------------------------------------------------- /Extras/GeneratedCalls.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Extras; 2 | 3 | 4 | public class GeneratedCalls { 5 | 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Instantiable/IO/PacketPipeline.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReikaKalseki/DragonAPI/HEAD/Instantiable/IO/PacketPipeline.rar -------------------------------------------------------------------------------- /Interfaces/LegacyPatcher.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces; 2 | 3 | 4 | public interface LegacyPatcher { 5 | 6 | public ASMEnum getHandler(); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Interfaces/Block/Reedlike.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Block; 2 | 3 | /** For blocks that behave like sugarcane. */ 4 | public interface Reedlike { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /Resources/reika_effect.vert: -------------------------------------------------------------------------------- 1 | void main() { 2 | vec4 vert = gl_Vertex; 3 | gl_Position = gl_ModelViewProjectionMatrix * vert; 4 | texcoord = vec2(gl_MultiTexCoord0); 5 | } -------------------------------------------------------------------------------- /Resources/reika_stencil.vert: -------------------------------------------------------------------------------- 1 | void main() { 2 | vec4 vert = gl_Vertex; 3 | gl_Position = gl_ModelViewProjectionMatrix * vert; 4 | texcoord = vec2(gl_MultiTexCoord0); 5 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DragonAPI 2 | ========= 3 | 4 | The library that RotaryCraft and my other Minecraft mods use, to centralize and simplify functions. 5 | This library relies on MinecraftForge! 6 | -------------------------------------------------------------------------------- /Interfaces/Registry/StreamableSound.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Registry; 2 | 3 | 4 | public interface StreamableSound extends SoundEnum { 5 | 6 | boolean isStreamed(); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/CopyableSettings.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.TileEntity; 2 | 3 | public interface CopyableSettings { 4 | 5 | public boolean copySettingsFrom(T te); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Interfaces/Registry/DynamicSound.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Registry; 2 | 3 | 4 | public interface DynamicSound extends SoundEnum { 5 | 6 | public String getRelativePath(); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /ModInteract/DummyBiomeSettings.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ModInteract; 2 | 3 | 4 | public class DummyBiomeSettings { 5 | 6 | protected DummyBiomeSettings(String id) { 7 | 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Libraries/MathSci/ChemicalElement.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Libraries.MathSci; 2 | 3 | public interface ChemicalElement { 4 | 5 | public String getChemicalSymbol(); 6 | public int getAtomicWeight(); 7 | 8 | } -------------------------------------------------------------------------------- /Interfaces/Block/CraftableStone.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Block; 2 | 3 | /** Used for blocks that are craftable into variants and smeltable back to the base type. */ 4 | public interface CraftableStone { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/ConditionBreakDropsInventory.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.TileEntity; 2 | 3 | 4 | public interface ConditionBreakDropsInventory { 5 | 6 | public boolean dropsInventoryOnBroken(); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Interfaces/IconEnum.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces; 2 | 3 | import Reika.DragonAPI.Instantiable.GUI.GuiItemDisplay.IconProvider; 4 | 5 | public interface IconEnum extends IconProvider { 6 | 7 | public String name(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Interfaces/Registry/CustomDistanceSound.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Registry; 2 | 3 | 4 | public interface CustomDistanceSound extends SoundEnum { 5 | 6 | /** Return -1 for default */ 7 | public float getAudibleDistance(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/SimpleConnection.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.TileEntity; 2 | 3 | import net.minecraft.world.World; 4 | 5 | public interface SimpleConnection { 6 | 7 | public boolean tryConnect(World world, int x, int y, int z); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /IO/Shaders/ShaderHook.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.IO.Shaders; 2 | 3 | 4 | public interface ShaderHook { 5 | 6 | public void onPreRender(ShaderProgram s); 7 | public void onPostRender(ShaderProgram s); 8 | public void updateEnabled(ShaderProgram s); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Interfaces/Item/CustomEnchantingCategory.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Item; 2 | 3 | import net.minecraft.enchantment.EnumEnchantmentType; 4 | 5 | public interface CustomEnchantingCategory { 6 | 7 | EnumEnchantmentType getEnchantingCategory(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/Render/PackedIceIcon.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.Render; 2 | 3 | public class PackedIceIcon extends BlockIconPatch { 4 | 5 | public PackedIceIcon() { 6 | super("net.minecraft.block.BlockPackedIce", "amo"); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Interfaces/Block/CustomSnowAccumulation.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Block; 2 | 3 | import net.minecraft.world.World; 4 | 5 | 6 | public interface CustomSnowAccumulation { 7 | 8 | public boolean canSnowAccumulate(World world, int x, int y, int z); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Interfaces/ObjectToNBTSerializer.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces; 2 | 3 | import net.minecraft.nbt.NBTTagCompound; 4 | 5 | public interface ObjectToNBTSerializer { 6 | 7 | public NBTTagCompound save(V obj); 8 | public V construct(NBTTagCompound tag); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/ConditionalUnbreakability.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.TileEntity; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | 5 | public interface ConditionalUnbreakability { 6 | 7 | public boolean isUnbreakable(EntityPlayer ep); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/NonIFluidTank.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.TileEntity; 2 | 3 | import net.minecraftforge.fluids.Fluid; 4 | 5 | public interface NonIFluidTank { 6 | 7 | boolean allowAutomation(); 8 | 9 | int addFluid(Fluid fluid, int amount, boolean doFill); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Interfaces/DataProvider.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | public interface DataProvider { 7 | 8 | public InputStream getDataStream() throws IOException; 9 | 10 | public boolean canBeReloaded(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Interfaces/Item/VariableSizeSpritesheet.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Item; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | public interface VariableSizeSpritesheet extends IndexedItemSprites { 6 | 7 | /** In 16x16 cells */ 8 | public int getSpriteSize(ItemStack is); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/Block/VanillaLeafDecayEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.Block; 2 | 3 | 4 | public class VanillaLeafDecayEvent extends LeafDecayEvent { 5 | 6 | public VanillaLeafDecayEvent() { 7 | super("net.minecraft.block.BlockLeaves", "alt"); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Interfaces/Entity/ClampedDamage.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Entity; 2 | 3 | import net.minecraft.util.DamageSource; 4 | 5 | /** For entities that have damage caps per hit. */ 6 | public interface ClampedDamage { 7 | 8 | public float getDamageCap(DamageSource src, float dmg); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Interfaces/WinterBiomeStrengthControl.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.world.World; 5 | 6 | public interface WinterBiomeStrengthControl { 7 | 8 | float getWinterSkyStrength(World world, EntityPlayer ep); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/Entity/BasicEntityInvisibilityEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.Entity; 2 | 3 | 4 | public class BasicEntityInvisibilityEvent extends EntityInvisibilityEvent { 5 | 6 | public BasicEntityInvisibilityEvent() { 7 | super("net.minecraft.entity.Entity", "sa"); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Interfaces/Block/CollisionDelegate.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Block; 2 | 3 | import net.minecraft.world.World; 4 | 5 | import Reika.DragonAPI.Instantiable.Data.Immutable.Coordinate; 6 | 7 | 8 | public interface CollisionDelegate { 9 | 10 | Coordinate getDelegatedCollision(World world, int x, int y, int z); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Interfaces/Item/CustomMatchingItem.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Item; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | import Reika.DragonAPI.Instantiable.ItemFilter; 6 | 7 | public interface CustomMatchingItem { 8 | 9 | public boolean match(ItemStack is); 10 | 11 | public ItemFilter getFilter(ItemStack is); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Instantiable/GUI/DummyContainer.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.GUI; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.inventory.Container; 5 | 6 | 7 | public class DummyContainer extends Container { 8 | 9 | @Override 10 | public boolean canInteractWith(EntityPlayer ep) { 11 | return false; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Instantiable/Math/Noise/Octave.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Math.Noise; 2 | 3 | class Octave { 4 | 5 | protected final double frequency; 6 | protected final double amplitude; 7 | protected final double phaseShift; 8 | 9 | Octave(double f, double a, double p) { 10 | amplitude = a; 11 | frequency = f; 12 | phaseShift = p; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Instantiable/Event/MTReloadEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Event; 2 | 3 | import cpw.mods.fml.common.eventhandler.Event; 4 | import cpw.mods.fml.common.gameevent.TickEvent.Phase; 5 | 6 | 7 | public class MTReloadEvent extends Event { 8 | 9 | public final Phase phase; 10 | 11 | public MTReloadEvent(Phase p) { 12 | phase = p; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Interfaces/Registry/VariableSound.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Registry; 2 | 3 | import java.util.Collection; 4 | 5 | import Reika.DragonAPI.Instantiable.IO.SoundVariant; 6 | 7 | public interface VariableSound extends SoundEnum { 8 | 9 | public Collection getVariants(); 10 | 11 | public SoundVariant getVariant(String name); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Interfaces/Registry/StructureEnum.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Registry; 2 | 3 | import Reika.DragonAPI.Base.StructureBase; 4 | 5 | public interface StructureEnum { 6 | 7 | public V getStructure(); 8 | 9 | /** ie spawns naturally, with worldgen, as opposed to being built by the player */ 10 | public boolean isNatural(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Exception/WorldSanityException.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Exception; 2 | 3 | 4 | public class WorldSanityException extends DragonAPIException { 5 | 6 | public WorldSanityException(String msg) { 7 | super(); 8 | message.append("The world state has become seriously invalid, such that continuing the game is not feasible.\n"); 9 | message.append(msg); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Interfaces/Entity/ChunkLoadingEntity.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Entity; 2 | 3 | import java.util.Collection; 4 | 5 | import net.minecraft.world.ChunkCoordIntPair; 6 | 7 | public interface ChunkLoadingEntity { 8 | 9 | Collection getChunksToLoad(); 10 | 11 | /** Override setDead and call this in it, to unload your chunks. */ 12 | void onDestroy(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/Render/LiquidIcon.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.Render; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | 5 | public class LiquidIcon extends BlockIconPatch { 6 | 7 | public LiquidIcon() { 8 | super("net.minecraft.block.BlockLiquid", "alw"); 9 | } 10 | 11 | @Override 12 | protected void addSimpleCall(ClassNode cn) { 13 | //NO-OP 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/EntityPathfinder.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces; 2 | 3 | import net.minecraft.entity.Entity; 4 | 5 | import Reika.DragonAPI.Instantiable.Data.Immutable.DecimalPosition; 6 | 7 | public interface EntityPathfinder { 8 | 9 | /** Return null to indicate completion or no valid path. */ 10 | public DecimalPosition getNextWaypoint(Entity e); 11 | 12 | public boolean isInRange(Entity e); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Instantiable/Event/EntityRemovedEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Event; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraftforge.event.entity.EntityEvent; 5 | 6 | /** Fired when an entity is removed from the world, almost always because it was setDead()-ed. */ 7 | public class EntityRemovedEvent extends EntityEvent { 8 | 9 | public EntityRemovedEvent(Entity e) { 10 | super(e); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/Entity/Player/PlayerEntityInvisibilityEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.Entity.Player; 2 | 3 | import Reika.DragonAPI.ASM.Patchers.Hooks.Event.Entity.EntityInvisibilityEvent; 4 | 5 | public class PlayerEntityInvisibilityEvent extends EntityInvisibilityEvent { 6 | 7 | public PlayerEntityInvisibilityEvent() { 8 | super("net.minecraft.entity.player.EntityPlayer", "yz"); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Interfaces/Registry/ISBRHEnum.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Registry; 2 | 3 | import Reika.DragonAPI.Base.ISBRH; 4 | 5 | public interface ISBRHEnum { 6 | 7 | public int getRenderID(); 8 | 9 | public ISBRH getRenderer(); 10 | 11 | public void setRenderPass(int pass); 12 | 13 | public Class getRenderClass(); 14 | 15 | public void setRenderID(int id); 16 | 17 | public void setRenderer(ISBRH r); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Instantiable/Event/WorldCreationEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Event; 2 | 3 | import net.minecraft.world.World; 4 | import net.minecraftforge.event.world.WorldEvent; 5 | 6 | /** Fired when a world is created for the very first time, NOT simply reloaded from disk. */ 7 | @Deprecated 8 | public class WorldCreationEvent extends WorldEvent { 9 | 10 | public WorldCreationEvent(World world) { 11 | super(world); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Interfaces/PlayerTracker.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Interfaces/Callbacks/BlockPlaceCallback.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Callbacks; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.world.World; 5 | 6 | public interface BlockPlaceCallback { 7 | 8 | /** The boolean return value is "cancel the placement", but be aware various implementations may not respect it, and that this is intentional. */ 9 | public boolean onPlacement(World world, int x, int y, int z, Block b, int meta, int flags); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Base/OneSlotMachine.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Base; 11 | 12 | public interface OneSlotMachine { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Instantiable/Data/Maps/PathMap.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Data.Maps; 2 | 3 | import Reika.DragonAPI.Instantiable.Data.Immutable.Coordinate; 4 | 5 | public class PathMap { 6 | 7 | private final NestedMap data = new NestedMap(); 8 | 9 | public V get(Coordinate from, Coordinate to) { 10 | return data.get(from, to); 11 | } 12 | 13 | public void put(V path, Coordinate from, Coordinate to) { 14 | data.put(from, to, path); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Objects/LineType.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Objects; 2 | 3 | import org.lwjgl.opengl.GL11; 4 | 5 | public enum LineType { 6 | 7 | SOLID((short)0xFFFF), 8 | DASHED((short)0xF0F0), 9 | DOTTED((short)0xAAAA), 10 | THIN((short)0xFFFF); 11 | 12 | private final short value; 13 | 14 | private LineType(short s) { 15 | value = s; 16 | } 17 | 18 | public void setMode(int factor) { 19 | GL11.glEnable(GL11.GL_LINE_STIPPLE); 20 | GL11.glLineStipple(factor, value); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/RenderCursorStackEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Event.Client; 2 | 3 | import net.minecraft.client.gui.inventory.GuiContainer; 4 | import net.minecraft.item.ItemStack; 5 | 6 | public class RenderCursorStackEvent extends RenderItemInSlotEvent { 7 | 8 | public ItemStack itemToRender; 9 | 10 | public RenderCursorStackEvent(GuiContainer c, ItemStack is, int x, int y) { 11 | super(c, is, x, y); 12 | 13 | itemToRender = this.getItem(); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/NumberedSlots.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | public interface NumberedSlots { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Instantiable/Math/Matrix2D.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Math; 11 | 12 | 13 | public class Matrix2D { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Instantiable/Math/Matrix3D.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Math; 11 | 12 | 13 | public class Matrix3D { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Interfaces/Item/ToolSprite.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | public interface ToolSprite { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Extras/NeedsImplementation.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Extras; 11 | 12 | 13 | public @interface NeedsImplementation { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Interfaces/Entity/TameHostile.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Entity; 11 | 12 | public interface TameHostile { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Instantiable/ReadOnlyIterator.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable; 2 | 3 | import java.util.Iterator; 4 | import java.util.List; 5 | 6 | 7 | public class ReadOnlyIterator implements Iterator { 8 | 9 | private final Iterator data; 10 | 11 | public ReadOnlyIterator(List li) { 12 | data = li.iterator(); 13 | } 14 | 15 | @Override 16 | public boolean hasNext() { 17 | return data.hasNext(); 18 | } 19 | 20 | @Override 21 | public E next() { 22 | return data.next(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Interfaces/Entity/EtherealEntity.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2018 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Entity; 11 | 12 | 13 | public interface EtherealEntity { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/GuiController.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | public interface GuiController { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Resources/Shader/base.txt: -------------------------------------------------------------------------------- 1 | //This is a "base class" for all DragonAPI shader programs (represented Javaside with the ShaderProgram class); it has library functions and commonly used uniform values for which ShaderProgram has built-in functions. 2 | 3 | varying vec2 texcoord; 4 | 5 | //uniform sampler2D bgl_RenderedTexture; 6 | 7 | uniform int time; 8 | uniform int screenWidth; 9 | uniform int screenHeight; 10 | 11 | uniform mat4 modelview; 12 | uniform mat4 projection; 13 | uniform vec3 focus; 14 | 15 | uniform float intensity; -------------------------------------------------------------------------------- /Interfaces/Matcher.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | public interface Matcher { 13 | 14 | public boolean match(V v1, V v2); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/Render/ChunkCacheRenderBrightness.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.Render; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | 5 | import Reika.DragonAPI.ASM.Patchers.BlockRenderBrightness; 6 | 7 | public class ChunkCacheRenderBrightness extends BlockRenderBrightness { 8 | 9 | public ChunkCacheRenderBrightness() { 10 | super("net.minecraft.world.ChunkCache", "ahr"); 11 | } 12 | 13 | @Override 14 | protected void apply(ClassNode cn) { 15 | this.patchBlockLight(cn); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Libraries/MathSci/ReikaStatisticsHelper.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Libraries.MathSci; 11 | 12 | public class ReikaStatisticsHelper { 13 | 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/ComparableAI.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | public interface ComparableAI { 13 | 14 | public boolean match(ComparableAI ai); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/CustomTemperatureBiome.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces; 2 | 3 | import net.minecraft.world.World; 4 | 5 | public interface CustomTemperatureBiome { 6 | 7 | int getBaseAmbientTemperature(); 8 | 9 | float getSeasonStrength(); 10 | 11 | int getSurfaceTemperatureModifier(World world, int x, int y, int z, float temp, float sun); 12 | 13 | int getAltitudeTemperatureModifier(World world, int x, int y, int z, float temp, int dy); 14 | 15 | float getNoiseVariationStrength(World world, int x, int y, int z, float orig); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/BreakAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | public interface BreakAction { 13 | 14 | public void breakBlock(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/PartialTank.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | public interface PartialTank { 13 | 14 | public boolean hasTank(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/Callbacks/EventWatchers.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.Callbacks; 2 | 3 | import java.util.Comparator; 4 | 5 | public class EventWatchers { 6 | 7 | public static final Comparator comparator = new Comparator() { 8 | 9 | @Override 10 | public int compare(EventWatcher o1, EventWatcher o2) { 11 | return Integer.compare(o1.watcherSortIndex(), o2.watcherSortIndex()); 12 | } 13 | 14 | }; 15 | 16 | public static interface EventWatcher { 17 | 18 | public int watcherSortIndex(); 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Interfaces/Registry/RegistryType.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | public interface RegistryType { 13 | 14 | public boolean existsInGame(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/Block/SemiTransparent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Block; 11 | 12 | public interface SemiTransparent { 13 | 14 | public boolean isOpaque(int meta); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/Item/UnbreakableArmor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | 13 | public interface UnbreakableArmor { 14 | 15 | public boolean canBeDamaged(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/PartialInventory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | public interface PartialInventory { 13 | 14 | public boolean hasInventory(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/TriggerableAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | 13 | public interface TriggerableAction { 14 | 15 | public boolean trigger(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/PlaceNotification.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | 13 | 14 | public interface PlaceNotification { 15 | 16 | public void onPlaced(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Libraries/ReikaContainerAPI.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Libraries; 11 | 12 | import Reika.DragonAPI.DragonAPICore; 13 | 14 | public final class ReikaContainerAPI extends DragonAPICore { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /Interfaces/FractionalButtonGui.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | public interface FractionalButtonGui { 13 | 14 | public void onFractionalClick(int button, int fx, int fy); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/Registry/ModCrop.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | 13 | public interface ModCrop extends CropType { 14 | 15 | public boolean isTileEntityUsedForGrowth(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/InertIInv.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import net.minecraft.inventory.IInventory; 13 | 14 | public interface InertIInv extends IInventory { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/XPProducer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | public interface XPProducer { 13 | 14 | public void clearXP(); 15 | 16 | public float getXP(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Instantiable/Math/Vec4.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Math; 2 | 3 | /** This is meant for shader code, but is usable elsewhere. */ 4 | public class Vec4 { 5 | 6 | public float a; 7 | public float b; 8 | public float c; 9 | public float d; 10 | 11 | public Vec4() { 12 | this(0, 0, 0, 0); 13 | } 14 | 15 | public Vec4(double d1, double d2, double d3, double d4) { 16 | this((float)d1, (float)d2, (float)d3, (float)d4); 17 | } 18 | 19 | public Vec4(float d1, float d2, float d3, float d4) { 20 | a = d1; 21 | b = d2; 22 | c = d3; 23 | d = d4; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Interfaces/WrappedRecipe.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import net.minecraft.item.crafting.IRecipe; 13 | 14 | public interface WrappedRecipe { 15 | 16 | public IRecipe getRecipe(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Resources/Shader/lib_math.txt: -------------------------------------------------------------------------------- 1 | //On screen distance, proportional to screen size 2 | float distsq(vec2 a, vec2 b) { 3 | float f = float(screenHeight)/float(screenWidth); 4 | float dx = (a.x-b.x); 5 | float dy = (a.y-b.y)*f; 6 | return dx*dx+dy*dy; 7 | } 8 | 9 | float roundToNearest(float val, float base) { 10 | return ceil(val/base)*base; 11 | } 12 | 13 | float getDistance(vec3 diff) { 14 | diff = abs(diff); 15 | return sqrt(diff.x*diff.x+diff.y*diff.y+diff.z*diff.z); 16 | } 17 | 18 | float getDistanceXZ(vec3 diff) { 19 | diff = abs(diff); 20 | return sqrt(diff.x*diff.x+diff.z*diff.z); 21 | } -------------------------------------------------------------------------------- /Interfaces/Configuration/MatchingConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | 13 | public interface MatchingConfig extends ConfigList { 14 | 15 | public boolean enforceMatch(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Interfaces/Registry/Dependency.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | 13 | public interface Dependency { 14 | 15 | public boolean isLoaded(); 16 | 17 | public String getDisplayName(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Interfaces/Item/BlendedColor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | public interface BlendedColor { 15 | 16 | public int getColor(ItemStack is); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Interfaces/Configuration/CustomCategoryConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | 13 | public interface CustomCategoryConfig extends ConfigList { 14 | 15 | public String getCategory(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Interfaces/Configuration/UserSpecificConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | 13 | public interface UserSpecificConfig extends ConfigList { 14 | 15 | public boolean isUserSpecific(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Interfaces/Entity/CustomProjectile.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Entity; 11 | 12 | import net.minecraft.entity.Entity; 13 | 14 | 15 | public interface CustomProjectile { 16 | 17 | Entity getFiringEntity(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/ThermalTile.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | public interface ThermalTile { 13 | 14 | public int getTemperature(); 15 | 16 | public void setTemperature(int temp); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/ToggleTile.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | 13 | public interface ToggleTile { 14 | 15 | public boolean isEnabled(); 16 | public void setEnabled(boolean enable); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Interfaces/ASMEnum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import org.objectweb.asm.tree.ClassNode; 13 | 14 | public interface ASMEnum { 15 | 16 | public String name(); 17 | 18 | public void apply(ClassNode data); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Interfaces/Configuration/SegmentedConfigList.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | 13 | public interface SegmentedConfigList extends SelectiveConfig { 14 | 15 | public String getCustomConfigFile(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Interfaces/Item/MetadataSpecificTrade.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | /** Put this on a Merchant recipe subclass in order to make the trade metadata-specific */ 13 | public interface MetadataSpecificTrade { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Interfaces/Item/MultiLayerItemSprite.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | public interface MultiLayerItemSprite { 15 | 16 | public int[] getIndices(ItemStack is); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Command/ClearBreakersCommand.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Command; 2 | 3 | import net.minecraft.command.ICommandSender; 4 | 5 | import Reika.DragonAPI.Auxiliary.ProgressiveRecursiveBreaker; 6 | 7 | 8 | public class ClearBreakersCommand extends DragonCommandBase { 9 | 10 | @Override 11 | public void processCommand(ICommandSender ics, String[] args) { 12 | ProgressiveRecursiveBreaker.instance.clearBreakers(); 13 | } 14 | 15 | @Override 16 | public String getCommandString() { 17 | return "clearbreakers"; 18 | } 19 | 20 | @Override 21 | protected boolean isAdminOnly() { 22 | return true; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/SinglePlayerLogoutEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event.Client; 11 | 12 | import cpw.mods.fml.common.eventhandler.Event; 13 | 14 | 15 | public class SinglePlayerLogoutEvent extends Event { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/MobRepellent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import net.minecraft.entity.EntityLiving; 13 | 14 | public interface MobRepellent { 15 | 16 | public boolean canRepel(EntityLiving e); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Interfaces/Block/SidedTextureIndex.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Block; 11 | 12 | public interface SidedTextureIndex { 13 | 14 | public int getBlockTextureFromSideAndMetadata(int side, int metadata); 15 | public int getRenderType(); 16 | } 17 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/CraftingTile.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces.TileEntity; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.inventory.IInventory; 5 | 6 | import Reika.DragonAPI.Interfaces.CraftingContainer; 7 | 8 | public interface CraftingTile extends IInventory { 9 | 10 | public CraftingContainer constructContainer(); 11 | 12 | public boolean handleCrafting(V wr, EntityPlayer ep, boolean keyDown); 13 | 14 | public boolean isReadyToCraft(); 15 | 16 | public int getOutputSlot(); 17 | 18 | public void setToCraft(V recipe); 19 | 20 | public V getToCraft(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/MobAttractor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import net.minecraft.entity.EntityLiving; 13 | 14 | public interface MobAttractor { 15 | 16 | public boolean canAttract(EntityLiving e); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Interfaces/ColorController.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import net.minecraft.entity.Entity; 13 | 14 | 15 | public interface ColorController { 16 | 17 | public void update(Entity e); 18 | 19 | public int getColor(Entity e); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/TextureFetcher.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import Reika.DragonAPI.Interfaces.TileEntity.RenderFetcher; 13 | 14 | 15 | public interface TextureFetcher { 16 | 17 | public String getImageFileName(RenderFetcher te); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/OpenTopTank.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import net.minecraftforge.fluids.Fluid; 13 | 14 | 15 | public interface OpenTopTank { 16 | 17 | public int addLiquid(Fluid f, int amt, boolean doAdd); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Interfaces/Block/SemiUnbreakable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Block; 11 | 12 | import net.minecraft.world.World; 13 | 14 | public interface SemiUnbreakable { 15 | 16 | public boolean isUnbreakable(World world, int x, int y, int z, int meta); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Interfaces/Configuration/SelectiveConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | 13 | public interface SelectiveConfig extends ConfigList { 14 | 15 | public boolean saveIfUnspecified(); 16 | 17 | public boolean isAccessible(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Interfaces/CustomBiomeDistributionWorld.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import net.minecraft.world.World; 13 | 14 | 15 | public interface CustomBiomeDistributionWorld { 16 | 17 | public int getBiomeID(World world, int x, int z); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Interfaces/Entity/DestroyOnUnload.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2018 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Entity; 11 | 12 | 13 | /** Ensure your entity writes isDead to NBT! */ 14 | public interface DestroyOnUnload { 15 | 16 | /** Usually calls setDead */ 17 | public void destroy(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Interfaces/Item/MultisheetItem.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | public interface MultisheetItem extends IndexedItemSprites { 15 | 16 | public String getSpritesheet(ItemStack is); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/LocationCached.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | 13 | /** Implement this on TileEntities that are added to a cache. Do not forget to clean up */ 14 | public interface LocationCached extends BreakAction { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/GameFinishedLoadingEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event.Client; 11 | 12 | import cpw.mods.fml.common.eventhandler.Event; 13 | 14 | //@SideOnly(Side.CLIENT) 15 | public class GameFinishedLoadingEvent extends Event { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/SidePlacedTile.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | public interface SidePlacedTile { 13 | 14 | public void placeOnSide(int s); 15 | 16 | public boolean checkLocationValidity(); 17 | 18 | public void drop(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Interfaces/TileModel.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import java.util.ArrayList; 13 | 14 | import net.minecraft.tileentity.TileEntity; 15 | 16 | public interface TileModel { 17 | 18 | public void renderAll(TileEntity tile, ArrayList li); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Interfaces/Callbacks/PositionCallable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2018 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Callbacks; 11 | 12 | import net.minecraft.world.IBlockAccess; 13 | 14 | 15 | public interface PositionCallable { 16 | 17 | public V call(IBlockAccess world, int x, int y, int z); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Command/DragonClientCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Command; 11 | 12 | //@SideOnly(Side.CLIENT) 13 | public abstract class DragonClientCommand extends DragonCommandBase { 14 | 15 | @Override 16 | protected final boolean isAdminOnly() { 17 | return false; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Instantiable/RedstoneTracker.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable; 2 | 3 | import Reika.DragonAPI.Base.TileEntityBase; 4 | import Reika.DragonAPI.Libraries.World.ReikaWorldHelper; 5 | 6 | public class RedstoneTracker { 7 | 8 | private int value; 9 | 10 | public void update(TileEntityBase te) { 11 | int last = value; 12 | value = te.getRedstoneOverride(); 13 | if (last != value) { 14 | //ReikaJavaLibrary.pConsole(last+" > "+value); 15 | te.triggerBlockUpdate(); 16 | ReikaWorldHelper.causeAdjacentUpdates(te.worldObj, te.xCoord, te.yCoord, te.zCoord); 17 | } 18 | } 19 | 20 | public int getValue() { 21 | return value; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Interfaces/Configuration/StringConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | public interface StringConfig extends ConfigList { 13 | 14 | public boolean isString(); 15 | 16 | public String getString(); 17 | 18 | public String getDefaultString(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Instantiable/Event/Base/PositionEventClient.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Event.Base; 2 | 3 | import net.minecraft.world.IBlockAccess; 4 | import net.minecraft.world.biome.BiomeGenBase; 5 | 6 | import cpw.mods.fml.relauncher.Side; 7 | import cpw.mods.fml.relauncher.SideOnly; 8 | 9 | @SideOnly(Side.CLIENT) 10 | public abstract class PositionEventClient extends PositionEventBase { 11 | 12 | public PositionEventClient(IBlockAccess world, int x, int y, int z) { 13 | super(world, x, y, z); 14 | } 15 | 16 | public final BiomeGenBase getBiome() { 17 | return isFakeWorld ? BiomeGenBase.ocean : access.getBiomeGenForCoords(xCoord, zCoord); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Interfaces/Configuration/IntArrayConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | public interface IntArrayConfig extends ConfigList { 13 | 14 | public boolean isIntArray(); 15 | 16 | public int[] getIntArray(); 17 | 18 | public int[] getDefaultIntArray(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Interfaces/PermaPotion.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import net.minecraft.entity.EntityLivingBase; 13 | import net.minecraft.potion.PotionEffect; 14 | 15 | public interface PermaPotion { 16 | 17 | public boolean canBeCleared(EntityLivingBase e, PotionEffect pot); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/Block/GrassSpreadEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.Block; 11 | 12 | 13 | 14 | public class GrassSpreadEvent extends BlockSpreadingEvent { 15 | 16 | public GrassSpreadEvent() { 17 | super("net.minecraft.block.BlockGrass", "alh"); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Interfaces/Item/EntityCapturingItem.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | 15 | public interface EntityCapturingItem { 16 | 17 | public boolean hasEntity(ItemStack is); 18 | 19 | public String currentEntityName(ItemStack is); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/Item/EnumItem.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | import Reika.DragonAPI.Interfaces.Registry.RegistrationList; 15 | 16 | public interface EnumItem { 17 | 18 | public RegistrationList getRegistry(ItemStack is); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/Block/MyceliumSpreadEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.Block; 11 | 12 | 13 | 14 | public class MyceliumSpreadEvent extends BlockSpreadingEvent { 15 | 16 | public MyceliumSpreadEvent() { 17 | super("net.minecraft.block.BlockMycelium", "amd"); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Instantiable/BasicTeleporter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable; 11 | 12 | import net.minecraft.world.Teleporter; 13 | import net.minecraft.world.WorldServer; 14 | 15 | public class BasicTeleporter extends Teleporter { 16 | 17 | public BasicTeleporter(WorldServer ws) { 18 | super(ws); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Instantiable/Rendering/NullEntityRender.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Rendering; 2 | 3 | import net.minecraft.client.renderer.entity.Render; 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.util.ResourceLocation; 6 | 7 | 8 | public class NullEntityRender extends Render { 9 | 10 | public static final NullEntityRender instance = new NullEntityRender(); 11 | 12 | private NullEntityRender() { 13 | 14 | } 15 | 16 | @Override 17 | public void doRender(Entity e, double par2, double par4, double par6, float f, float ptick) { 18 | 19 | } 20 | 21 | @Override 22 | protected ResourceLocation getEntityTexture(Entity e) { 23 | return null; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Interfaces/Registry/IDRegistry.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | import Reika.DragonAPI.Interfaces.Configuration.MatchingConfig; 13 | 14 | 15 | public interface IDRegistry extends MatchingConfig { 16 | 17 | public int getDefaultID(); 18 | 19 | public String getCategory(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/HitAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.world.World; 14 | 15 | public interface HitAction { 16 | 17 | public void onHit(World world, int x, int y, int z, EntityPlayer ep); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Interfaces/Configuration/StringArrayConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | public interface StringArrayConfig extends ConfigList { 13 | 14 | public boolean isStringArray(); 15 | 16 | public String[] getStringArray(); 17 | 18 | public String[] getDefaultStringArray(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Interfaces/Registry/EnchantmentEnum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | import net.minecraft.enchantment.Enchantment; 13 | 14 | 15 | public interface EnchantmentEnum extends RegistryEntry { 16 | 17 | public Enchantment getEnchantment(); 18 | 19 | public int getEnchantmentID(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/MultiPageInventory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | public interface MultiPageInventory extends ConditionBreakDropsInventory { 13 | 14 | public int getNumberPages(); 15 | 16 | public int getSlotsOnPage(int page); 17 | 18 | public int getCurrentPage(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/NBTCopyable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import net.minecraft.nbt.NBTTagCompound; 13 | 14 | 15 | public interface NBTCopyable { 16 | 17 | public void writeCopyableData(NBTTagCompound NBT); 18 | 19 | public void readCopyableData(NBTTagCompound NBT); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/Registry/ItemEnum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | import net.minecraft.item.Item; 13 | 14 | /** This is an interface for ENUMS! */ 15 | public interface ItemEnum extends RegistrationList { 16 | 17 | public Item getItemInstance(); 18 | 19 | public boolean overwritingItem(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/Configuration/BoundedConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | import net.minecraftforge.common.config.Property; 13 | 14 | 15 | public interface BoundedConfig extends ConfigList { 16 | 17 | public boolean isValueValid(Property p); 18 | 19 | public String getBoundsAsString(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/AdjacentUpdateWatcher.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import net.minecraft.block.Block; 13 | import net.minecraft.world.World; 14 | 15 | 16 | public interface AdjacentUpdateWatcher { 17 | 18 | public void onAdjacentUpdate(World world, int x, int y, int z, Block b); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Interfaces/Configuration/IntegerConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | public interface IntegerConfig extends ConfigList { 13 | 14 | public boolean isNumeric(); 15 | 16 | //public int setValue(Configuration config); 17 | 18 | public int getValue(); 19 | 20 | public int getDefaultValue(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/RaytraceEvent1.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event; 11 | 12 | import Reika.DragonAPI.ASM.Patchers.RaytracePatcher; 13 | 14 | 15 | public class RaytraceEvent1 extends RaytracePatcher { 16 | 17 | public RaytraceEvent1() { 18 | super("net.minecraft.entity.projectile.EntityArrow", "zc"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Instantiable/Event/GetYToSpawnMobEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Event; 2 | 3 | import net.minecraft.world.World; 4 | import net.minecraftforge.common.MinecraftForge; 5 | 6 | import Reika.DragonAPI.Instantiable.Event.Base.WorldPositionEvent; 7 | 8 | public class GetYToSpawnMobEvent extends WorldPositionEvent { 9 | 10 | public int yToTry; 11 | 12 | public GetYToSpawnMobEvent(World world, int x, int y, int z) { 13 | super(world, x, y, z); 14 | 15 | yToTry = yCoord; 16 | } 17 | 18 | public static int fire(World world, int x, int y, int z) { 19 | GetYToSpawnMobEvent e = new GetYToSpawnMobEvent(world, x, y, z); 20 | MinecraftForge.EVENT_BUS.post(e); 21 | return e.yToTry; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Interfaces/Block/SelectiveMovable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Block; 11 | 12 | import net.minecraft.world.World; 13 | 14 | /** Use this to declare a TileEntity-holding block as "not always safely movable". */ 15 | public interface SelectiveMovable { 16 | 17 | public boolean canMove(World world, int x, int y, int z); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Interfaces/MotionController.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import net.minecraft.entity.Entity; 13 | 14 | 15 | public interface MotionController { 16 | 17 | public void update(Entity e); 18 | public double getMotionX(Entity e); 19 | public double getMotionY(Entity e); 20 | public double getMotionZ(Entity e); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/RaytraceEvent2.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event; 11 | 12 | import Reika.DragonAPI.ASM.Patchers.RaytracePatcher; 13 | 14 | 15 | public class RaytraceEvent2 extends RaytracePatcher { 16 | 17 | public RaytraceEvent2() { 18 | super("net.minecraft.entity.projectile.EntityThrowable", "zk"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/RaytraceEvent3.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event; 11 | 12 | import Reika.DragonAPI.ASM.Patchers.RaytracePatcher; 13 | 14 | 15 | public class RaytraceEvent3 extends RaytracePatcher { 16 | 17 | public RaytraceEvent3() { 18 | super("net.minecraft.entity.projectile.EntityFireball", "ze"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Instantiable/Event/ItemUpdateEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import net.minecraft.entity.item.EntityItem; 13 | import net.minecraftforge.event.entity.item.ItemEvent; 14 | 15 | public class ItemUpdateEvent extends ItemEvent { 16 | 17 | public ItemUpdateEvent(EntityItem ei) { 18 | super(ei); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/Configuration/DecimalConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | public interface DecimalConfig extends ConfigList { 13 | 14 | public boolean isDecimal(); 15 | 16 | //public float setDecimal(Configuration config); 17 | 18 | public float getFloat(); 19 | 20 | public float getDefaultFloat(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Interfaces/Item/IndexedItemSprites.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | public interface IndexedItemSprites { 15 | 16 | public int getItemSpriteIndex(ItemStack is); 17 | 18 | public String getTexture(ItemStack is); 19 | 20 | public Class getTextureReferenceClass(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Resources/Shader/lib_chunk.txt: -------------------------------------------------------------------------------- 1 | uniform int chunkX; 2 | uniform int chunkY; 3 | uniform int chunkZ; 4 | 5 | float getX(vec4 vert) { 6 | return vert.x+float(chunkX); 7 | } 8 | 9 | float getY(vec4 vert) { 10 | return vert.y+float(chunkY); 11 | } 12 | 13 | float getZ(vec4 vert) { 14 | return vert.z+float(chunkZ); 15 | } 16 | 17 | vec3 getReal(vec4 vert) { 18 | return vec3(getX(vert), getY(vert), getZ(vert)); 19 | } 20 | 21 | vec3 getRelativeCoord(vec3 real) { 22 | return real-vec3(float(chunkX), float(chunkY), float(chunkZ)); 23 | } 24 | 25 | vec3 getDistanceToBlockEdge(vec3 real) { 26 | float dx = abs(real.x-real.x); 27 | float dy = abs(real.y-real.y); 28 | float dz = abs(real.z-real.z); 29 | return vec3(dx, dy, dz); 30 | } -------------------------------------------------------------------------------- /Instantiable/GUI/Slot/SlotFullStack.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.GUI.Slot; 11 | 12 | import net.minecraft.inventory.IInventory; 13 | import net.minecraft.inventory.Slot; 14 | 15 | public class SlotFullStack extends Slot { 16 | 17 | public SlotFullStack(IInventory ii, int id, int x, int y) { 18 | super(ii, id, x, y); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/Configuration/BooleanConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | public interface BooleanConfig extends ConfigList { 13 | 14 | public boolean isBoolean(); 15 | 16 | //public boolean setState(Configuration config); 17 | 18 | public boolean getState(); 19 | 20 | public boolean getDefaultState(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Interfaces/Item/MusicDataItem.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | import Reika.DragonAPI.Instantiable.MusicScore; 15 | 16 | 17 | public interface MusicDataItem { 18 | 19 | public MusicScore getMusic(ItemStack is); 20 | //public int[][][] getNoteblockMusic(ItemStack is); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Interfaces/PositionController.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import net.minecraft.entity.Entity; 13 | 14 | 15 | public interface PositionController { 16 | 17 | public void update(Entity e); 18 | public double getPositionX(Entity e); 19 | public double getPositionY(Entity e); 20 | public double getPositionZ(Entity e); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Base/CropHandlerBase.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Base; 11 | 12 | import net.minecraft.world.World; 13 | 14 | import Reika.DragonAPI.Interfaces.Registry.CropHandler; 15 | 16 | public abstract class CropHandlerBase extends ModHandlerBase implements CropHandler { 17 | 18 | public void editTileDataForHarvest(World world, int x, int y, int z) {} 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/CustomMapColorBiome.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import net.minecraft.world.World; 13 | 14 | import cpw.mods.fml.relauncher.Side; 15 | import cpw.mods.fml.relauncher.SideOnly; 16 | 17 | 18 | public interface CustomMapColorBiome { 19 | 20 | @SideOnly(Side.CLIENT) 21 | public int getMapColor(World world, int x, int z); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Interfaces/Item/GradientBlend.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | public interface GradientBlend { 15 | 16 | public int getColorOne(ItemStack is); 17 | public int getColorTwo(ItemStack is); 18 | public int getColorThree(ItemStack is); 19 | public int getColorFour(ItemStack is); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/Registry/ModEntry.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | public interface ModEntry { 13 | 14 | public boolean isLoaded(); 15 | 16 | public String getVersion(); 17 | 18 | public String getModLabel(); 19 | 20 | public String getDisplayName(); 21 | 22 | public Class getBlockClass(); 23 | public Class getItemClass(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Interfaces/OreGenerator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import java.util.Random; 13 | 14 | import net.minecraft.world.World; 15 | 16 | import Reika.DragonAPI.Interfaces.Registry.OreEnum; 17 | 18 | 19 | public interface OreGenerator { 20 | 21 | public void generateOre(OreEnum ore, Random random, World world, int chunkX, int chunkZ); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/PlayerBreakHook.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | 14 | public interface PlayerBreakHook { 15 | 16 | /** Return false to cancel the block break. */ 17 | public boolean breakByPlayer(EntityPlayer ep); 18 | 19 | public boolean isBreakable(EntityPlayer ep); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/PacketHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.world.World; 14 | 15 | import Reika.DragonAPI.Libraries.IO.ReikaPacketHelper.PacketObj; 16 | 17 | public interface PacketHandler { 18 | 19 | public void handleData(PacketObj packet, World world, EntityPlayer ep); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/LightmapEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event.Client; 11 | 12 | import net.minecraftforge.common.MinecraftForge; 13 | 14 | import cpw.mods.fml.common.eventhandler.Event; 15 | 16 | 17 | public class LightmapEvent extends Event { 18 | 19 | public static void fire() { 20 | MinecraftForge.EVENT_BUS.post(new LightmapEvent()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/RenderFetcher.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import Reika.DragonAPI.Interfaces.TextureFetcher; 13 | 14 | import cpw.mods.fml.relauncher.Side; 15 | import cpw.mods.fml.relauncher.SideOnly; 16 | 17 | 18 | 19 | public interface RenderFetcher { 20 | 21 | @SideOnly(Side.CLIENT) 22 | public abstract TextureFetcher getRenderer(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /ModInteract/Lua/LibraryLuaMethod.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.ModInteract.Lua; 11 | 12 | import net.minecraft.tileentity.TileEntity; 13 | 14 | 15 | public abstract class LibraryLuaMethod extends LuaMethod { 16 | 17 | public LibraryLuaMethod(String name) { 18 | super(name, TileEntity.class); 19 | } 20 | 21 | public final boolean isDocumented() { 22 | return false; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Instantiable/Data/Immutable/ImmutableArray.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Data.Immutable; 11 | 12 | public final class ImmutableArray { 13 | 14 | private final V[] data; 15 | public final int length; 16 | 17 | public ImmutableArray(V[] arr) { 18 | data = arr; 19 | this.length = arr.length; 20 | } 21 | 22 | public V get(int i) { 23 | return data[i]; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/TextureReloadEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event.Client; 11 | 12 | import cpw.mods.fml.common.eventhandler.Event; 13 | import cpw.mods.fml.relauncher.Side; 14 | import cpw.mods.fml.relauncher.SideOnly; 15 | 16 | @SideOnly(Side.CLIENT) 17 | public class TextureReloadEvent extends Event { 18 | 19 | public TextureReloadEvent() { 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Instantiable/ItemOnSpawnTracker.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.item.ItemStack; 5 | 6 | import Reika.DragonAPI.Auxiliary.Trackers.PlayerFirstTimeTracker.PlayerTracker; 7 | import Reika.DragonAPI.Libraries.ReikaInventoryHelper; 8 | 9 | 10 | public abstract class ItemOnSpawnTracker implements PlayerTracker { 11 | 12 | @Override 13 | public final void onNewPlayer(EntityPlayer ep) { 14 | if (ReikaInventoryHelper.checkForItemStack(this.getItem(), ep.inventory, false)) 15 | return; 16 | if (!ep.inventory.addItemStackToInventory(this.getItem())) 17 | ep.dropPlayerItemWithRandomChoice(this.getItem(), true); 18 | } 19 | 20 | public abstract ItemStack getItem(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Resources/reika_stencil.frag: -------------------------------------------------------------------------------- 1 | #import math 2 | #import geometry 3 | 4 | uniform float distance; 5 | uniform float age; 6 | 7 | uniform float dx; 8 | uniform float dy; 9 | uniform float dz; 10 | 11 | void main() { 12 | vec2 focusXY = getScreenPos(dx, dy, dz); 13 | 14 | float distv = distsq(focusXY, texcoord); 15 | float distfac_vertex = max(0.0, min(1.0, 1.5-5.0*distv*distance/intensity)); 16 | float vf = distfac_vertex; 17 | 18 | vec4 color = texture2D(bgl_RenderedTexture, texcoord); 19 | 20 | float gs = max(color.r, vf); 21 | float new = gs == vf ? 1.0 : 0.0; 22 | vec2 xy = mix(vec2(color.g, color.b), focusXY, new); 23 | //float r = mix(color.r, age, new); 24 | 25 | gl_FragColor = vec4(gs, xy.x, xy.y, 1); 26 | //gl_FragColor = vec4(gs, gs, gs, 1); 27 | } -------------------------------------------------------------------------------- /Exception/UnreachableCodeException.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Exception; 2 | 3 | 4 | public class UnreachableCodeException extends DragonAPIException { 5 | 6 | public UnreachableCodeException() { 7 | this((String)null); 8 | } 9 | 10 | public UnreachableCodeException(String msg) { 11 | message.append("A block of code that was supposed to be unreachable has been executed!\n"); 12 | message.append("This is indicative of some sort of error, with possible causes ranging from version mismatches to programming oversights.\n"); 13 | if (msg != null) 14 | message.append(msg); 15 | this.crash(); 16 | } 17 | 18 | public UnreachableCodeException(Enum e) { 19 | this("A switch on an enum ("+e.getClass().getName()+") entered an unhandled case "+e); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Exception/ModHandlerException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Exception; 11 | 12 | import Reika.DragonAPI.ModList; 13 | 14 | public class ModHandlerException extends DragonAPIException { 15 | 16 | public ModHandlerException(ModList mod) { 17 | message.append("You cannot call a mod handler before its parent mod initializes!\n"); 18 | message.append("Target mod: "+mod); 19 | this.crash(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/RenderFirstPersonItemEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event.Client; 11 | 12 | import cpw.mods.fml.common.eventhandler.Event; 13 | import cpw.mods.fml.relauncher.Side; 14 | import cpw.mods.fml.relauncher.SideOnly; 15 | 16 | @SideOnly(Side.CLIENT) 17 | public class RenderFirstPersonItemEvent extends Event { 18 | 19 | public RenderFirstPersonItemEvent() { 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Instantiable/ResettableRandom.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable; 11 | 12 | import java.util.Random; 13 | 14 | 15 | public class ResettableRandom extends Random { 16 | 17 | private long lastSeed; 18 | 19 | @Override 20 | synchronized public void setSeed(long seed) { 21 | super.setSeed(seed); 22 | 23 | lastSeed = seed; 24 | } 25 | 26 | public void resetSeed() { 27 | this.setSeed(lastSeed); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/RedstoneTile.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import net.minecraft.world.IBlockAccess; 13 | import net.minecraftforge.common.util.ForgeDirection; 14 | 15 | 16 | public interface RedstoneTile { 17 | 18 | int getStrongPower(IBlockAccess world, int x, int y, int z, ForgeDirection side); 19 | int getWeakPower(IBlockAccess world, int x, int y, int z, ForgeDirection side); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Instantiable/Event/CreeperExplodeEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import net.minecraft.entity.monster.EntityCreeper; 13 | import net.minecraftforge.event.entity.living.LivingEvent; 14 | 15 | public class CreeperExplodeEvent extends LivingEvent { 16 | 17 | public final EntityCreeper creeper; 18 | 19 | public CreeperExplodeEvent(EntityCreeper e) { 20 | super(e); 21 | creeper = e; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Instantiable/AlphabeticItemComparator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable; 11 | 12 | import java.util.Comparator; 13 | 14 | import net.minecraft.item.ItemStack; 15 | 16 | public class AlphabeticItemComparator implements Comparator { 17 | 18 | @Override 19 | public int compare(ItemStack o1, ItemStack o2) { 20 | return String.CASE_INSENSITIVE_ORDER.compare(o1.getDisplayName(), o2.getDisplayName()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Libraries/IO/ReikaMediaHelper.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Libraries.IO; 11 | 12 | import net.minecraft.world.World; 13 | 14 | import Reika.DragonAPI.DragonAPICore; 15 | 16 | public final class ReikaMediaHelper extends DragonAPICore { 17 | 18 | public static void playSoundVarying(World world, int x, int y, int z, String name) { 19 | world.playSoundEffect(x+0.5, y+0.5, z+0.5, name, rand.nextFloat(), rand.nextFloat()); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/Connectable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import Reika.DragonAPI.Interfaces.Location; 13 | 14 | public interface Connectable extends BreakAction, SimpleConnection { 15 | 16 | public boolean isEmitting(); 17 | 18 | public void reset(); 19 | 20 | public void resetOther(); 21 | 22 | public L getConnection(); 23 | 24 | public boolean hasValidConnection(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Instantiable/Data/CachedValue.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Data; 2 | 3 | 4 | public class CachedValue { 5 | 6 | private final ValueCalculator calculator; 7 | 8 | private boolean needsRecalc = true; 9 | private V value; 10 | 11 | public CachedValue(ValueCalculator c) { 12 | this.calculator = c; 13 | this.value = c.calculate(); 14 | } 15 | 16 | public void markDirty() { 17 | needsRecalc = true; 18 | } 19 | 20 | public V getValue() { 21 | if (this.needsRecalc) { 22 | value = calculator.calculate(); 23 | this.needsRecalc = false; 24 | } 25 | return value; 26 | } 27 | 28 | public void setValue(V val) { 29 | this.value = val; 30 | this.needsRecalc = false; 31 | } 32 | 33 | public static interface ValueCalculator { 34 | 35 | V calculate(); 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /Instantiable/Event/EntityAIEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import net.minecraft.entity.EntityLivingBase; 13 | import net.minecraftforge.event.entity.EntityEvent; 14 | 15 | //Unimplemented 16 | public class EntityAIEvent extends EntityEvent { 17 | 18 | public EntityAIEvent(EntityLivingBase e) { 19 | super(e); 20 | } 21 | 22 | public static boolean fire(EntityLivingBase e) { 23 | return false; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Interfaces/CustomToStringRecipe.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | 13 | public interface CustomToStringRecipe { 14 | 15 | /** Only suitable for display, as it may vary unpredictably (eg item list ordering). Do NOT use this for map keys. */ 16 | public String toDisplayString(); 17 | 18 | /** This needs to be constant across platforms and game instances! This needs to be keysafe! */ 19 | public String toDeterministicString(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Interfaces/Subgenerator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2018 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | 13 | /** Implement this on WorldGenerator objects that are called as part of a parent generator (usually an IWG). 14 | * 15 | * This prevents it from being treated as its own generator in various trackers (eg profilers). */ 16 | public interface Subgenerator { 17 | 18 | /** The parent generator this is a submodule of. */ 19 | public Object getParentGenerator(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Libraries/Java/ClassModifiers.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Libraries.Java; 2 | 3 | import java.lang.reflect.Modifier; 4 | 5 | 6 | public enum ClassModifiers { 7 | 8 | PUBLIC(), 9 | PRIVATE(), 10 | PROTECTED(), 11 | STATIC(), 12 | FINAL(), 13 | SYNCHRONIZED(), 14 | VOLATILE(), 15 | TRANSIENT(), 16 | NATIVE(), 17 | INTERFACE(), 18 | ABSTRACT(), 19 | STRICT(); 20 | 21 | private final int bits; 22 | 23 | private ClassModifiers() { 24 | try { 25 | int val = Modifier.class.getDeclaredField(this.name()).getInt(null); 26 | bits = val; 27 | } 28 | catch (Exception e) { 29 | throw new RuntimeException(e); 30 | } 31 | } 32 | 33 | public boolean match(int modifiers) { 34 | return (modifiers & bits) != 0; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return this.name(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Interfaces/Configuration/ConfigList.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Configuration; 11 | 12 | 13 | /** This is an interface for ENUMS! */ 14 | public interface ConfigList { 15 | 16 | public Class getPropertyType(); 17 | 18 | public String getLabel(); 19 | 20 | //public boolean isDummiedOut(); 21 | 22 | public boolean isEnforcingDefaults(); 23 | 24 | public boolean shouldLoad(); 25 | 26 | /** To avoid casting */ 27 | public int ordinal(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Interfaces/Entity/CustomRenderFX.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Entity; 11 | 12 | import Reika.DragonAPI.Instantiable.Rendering.ParticleEngine.RenderMode; 13 | import Reika.DragonAPI.Instantiable.Rendering.ParticleEngine.TextureMode; 14 | 15 | 16 | public interface CustomRenderFX { 17 | 18 | RenderMode getRenderMode(); 19 | 20 | TextureMode getTexture(); 21 | 22 | public boolean rendersOverLimit(); 23 | 24 | //public double getRenderRange(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Interfaces/Location.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Interfaces; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | import net.minecraft.tileentity.TileEntity; 6 | import net.minecraft.util.MovingObjectPosition; 7 | import net.minecraft.util.Vec3; 8 | import net.minecraft.world.IBlockAccess; 9 | 10 | public interface Location { 11 | 12 | public void writeToTag(NBTTagCompound data); 13 | 14 | public NBTTagCompound writeToTag(); 15 | 16 | public void writeToNBT(String tag, NBTTagCompound NBT); 17 | 18 | public double getDistanceTo(double x, double y, double z); 19 | 20 | public Block getBlock(IBlockAccess world); 21 | 22 | public int getBlockMetadata(IBlockAccess world); 23 | 24 | public TileEntity getTileEntity(IBlockAccess world); 25 | 26 | public MovingObjectPosition asMovingPosition(int s, Vec3 vec); 27 | } 28 | -------------------------------------------------------------------------------- /Interfaces/Registry/EntityEnum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | 13 | public interface EntityEnum extends RegistryEntry { 14 | 15 | public int getTrackingDistance(); 16 | 17 | public boolean sendsVelocityUpdates(); 18 | 19 | /** This only works if you have a global ID; spawn eggs require that */ 20 | public boolean hasSpawnEgg(); 21 | 22 | public int eggColor1(); 23 | public int eggColor2(); 24 | 25 | public boolean hasGlobalID(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Instantiable/Data/Maps/PairMap.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Data.Maps; 11 | 12 | 13 | public final class PairMap { 14 | 15 | private final MixMap data = new MixMap(); 16 | 17 | public PairMap() { 18 | 19 | } 20 | 21 | public void add(V obj, V obj2) { 22 | data.addMix(obj, obj2, true); 23 | } 24 | 25 | public boolean contains(V obj, V obj2) { 26 | return data.containsKey(obj) && Boolean.TRUE.equals(data.getMix(obj, obj2)); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Instantiable/Event/BlockUpdateEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import net.minecraft.world.World; 13 | 14 | import Reika.DragonAPI.Instantiable.Event.Base.WorldPositionEvent; 15 | 16 | 17 | public class BlockUpdateEvent extends WorldPositionEvent { 18 | 19 | public final boolean renderOnly; 20 | 21 | public BlockUpdateEvent(World world, int x, int y, int z, boolean render) { 22 | super(world, x, y, z); 23 | renderOnly = render; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Interfaces/Block/ShearablePlant.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Block; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.world.World; 14 | import net.minecraftforge.common.util.ForgeDirection; 15 | 16 | 17 | public interface ShearablePlant { 18 | 19 | public void shearAll(World world, int x, int y, int z, EntityPlayer ep); 20 | 21 | public void shearSide(World world, int x, int y, int z, ForgeDirection side, EntityPlayer ep); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Interfaces/RetroactiveGenerator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | 13 | import net.minecraft.world.World; 14 | 15 | import cpw.mods.fml.common.IWorldGenerator; 16 | 17 | public interface RetroactiveGenerator extends IWorldGenerator { 18 | 19 | public boolean canGenerateAt(World world, int chunkX, int chunkZ); 20 | 21 | /** It would be a good idea to prefix this with your mod's name; eg ReactorCraft_PitchblendeGen */ 22 | public String getIDString(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /ModInteract/DeepInteract/MoleculeHelper.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.ModInteract.DeepInteract; 11 | 12 | 13 | 14 | public class MoleculeHelper { 15 | 16 | private static int maxID = 3600; 17 | 18 | public static void addMoleculeWithDecomposition(String molec, String roomstatus, String... parts) { 19 | //ChemicalAPI.registerMolecule(maxID, molec, r, g, b, r2, g2, b2, roomstatus, parts); 20 | maxID++; 21 | //RecipeAPI.addDecompositionRecipe(input, outputs); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Instantiable/Event/LavaFreezeEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Event; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.world.World; 5 | import net.minecraftforge.common.MinecraftForge; 6 | 7 | import Reika.DragonAPI.Instantiable.Event.Base.WorldPositionEvent; 8 | 9 | import cpw.mods.fml.common.eventhandler.Cancelable; 10 | 11 | @Cancelable 12 | public class LavaFreezeEvent extends WorldPositionEvent { 13 | 14 | public final Block originalPlacement; 15 | 16 | public LavaFreezeEvent(World world, int x, int y, int z, Block b) { 17 | super(world, x, y, z); 18 | originalPlacement = b; 19 | } 20 | 21 | public static boolean fire(World world, int x, int y, int z, Block b) { 22 | if (MinecraftForge.EVENT_BUS.post(new LavaFreezeEvent(world, x, y, z, b))) 23 | return false; 24 | return world.setBlock(x, y, z, b); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Instantiable/Event/SpawnerGenerateEntityEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Event; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraft.tileentity.MobSpawnerBaseLogic; 5 | import net.minecraft.tileentity.TileEntity; 6 | import net.minecraftforge.common.MinecraftForge; 7 | import net.minecraftforge.event.entity.EntityEvent; 8 | 9 | 10 | public class SpawnerGenerateEntityEvent extends EntityEvent { 11 | 12 | public final TileEntity spawner; 13 | 14 | public SpawnerGenerateEntityEvent(TileEntity tile, Entity e) { 15 | super(e); 16 | spawner = tile; 17 | } 18 | 19 | public static void fire(MobSpawnerBaseLogic lgc, Entity e) { 20 | TileEntity te = lgc.getSpawnerWorld().getTileEntity(lgc.getSpawnerX(), lgc.getSpawnerY(), lgc.getSpawnerZ()); 21 | MinecraftForge.EVENT_BUS.post(new SpawnerGenerateEntityEvent(te, e)); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Interfaces/Registry/RegistryEntry.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | public interface RegistryEntry { 13 | 14 | public String getBasicName(); 15 | 16 | /** Whether to create it or not */ 17 | public boolean isDummiedOut(); 18 | 19 | /** To avoid casting to Enum */ 20 | public int ordinal(); 21 | 22 | /** To avoid casting to Enum */ 23 | public String name(); 24 | 25 | public Class getObjectClass(); 26 | 27 | public String getUnlocalizedName(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Exception/UserErrorException.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Exception; 2 | 3 | import Reika.DragonAPI.Base.DragonAPIMod; 4 | 5 | public class UserErrorException extends DragonAPIException { 6 | 7 | public UserErrorException() { 8 | super(); 9 | } 10 | 11 | public UserErrorException(Exception e) { 12 | super(e); 13 | } 14 | 15 | protected final void applyDNP(DragonAPIMod mod) { 16 | String doc = mod.getDocumentationSite().toString(); 17 | String bug = mod.getBugSite() == null ? "" : mod.getBugSite().toString(); 18 | if (bug.isEmpty() || doc.equals(bug)) { 19 | message.append("This is not a "+mod.getDisplayName()+" bug. Do not post it to "+doc+" unless you are really stuck."); 20 | } 21 | else { 22 | message.append("This is not a "+mod.getDisplayName()+" bug. Do not post it to "+doc+" or "+bug+" unless you are really stuck."); 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Instantiable/TemporaryInventory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | public class TemporaryInventory extends BasicInventory { 15 | 16 | public TemporaryInventory(int size) { 17 | super("temp", size); 18 | } 19 | 20 | public TemporaryInventory(int size, int stack) { 21 | super("temp", size, stack); 22 | } 23 | 24 | @Override 25 | public boolean isItemValidForSlot(int i, ItemStack is) { 26 | return true; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Interfaces/Item/ActivatedInventoryItem.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | public interface ActivatedInventoryItem { 15 | 16 | public ItemStack[] getInventory(ItemStack is); 17 | 18 | public void decrementSlot(ItemStack is, int slot, int amt); 19 | 20 | public boolean isSlotActive(ItemStack is, int slot); 21 | 22 | public int getInventorySize(ItemStack is); 23 | 24 | public ItemStack getItem(ItemStack is, int slot); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Command/ChestRepopulationCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Command; 11 | 12 | import net.minecraft.command.ICommandSender; 13 | 14 | public class ChestRepopulationCommand extends DragonCommandBase { 15 | 16 | @Override 17 | public void processCommand(ICommandSender ics, String[] args) { 18 | 19 | } 20 | 21 | @Override 22 | public String getCommandString() { 23 | return "regenchests"; 24 | } 25 | 26 | @Override 27 | protected boolean isAdminOnly() { 28 | return true; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Interfaces/Registry/BlockEnum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | import net.minecraft.block.Block; 13 | import net.minecraft.item.Item; 14 | import net.minecraft.item.ItemBlock; 15 | 16 | /** This is an interface for ENUMS! */ 17 | public interface BlockEnum extends RegistrationList { 18 | 19 | public Block getBlockInstance(); 20 | 21 | public Class getItemBlock(); 22 | 23 | public boolean hasItemBlock(); 24 | 25 | public Item getItem(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/EntitySemitransparencyEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Event.Client; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraftforge.common.MinecraftForge; 5 | import net.minecraftforge.event.entity.EntityEvent; 6 | 7 | import cpw.mods.fml.relauncher.Side; 8 | import cpw.mods.fml.relauncher.SideOnly; 9 | 10 | 11 | @SideOnly(Side.CLIENT) 12 | public class EntitySemitransparencyEvent extends EntityEvent { 13 | 14 | public final float defaultOpacity; 15 | public float opacity; 16 | 17 | public EntitySemitransparencyEvent(Entity e) { 18 | super(e); 19 | defaultOpacity = 0.15F; 20 | opacity = defaultOpacity; 21 | } 22 | 23 | public static float fire(Entity e) { 24 | EntitySemitransparencyEvent evt = new EntitySemitransparencyEvent(e); 25 | MinecraftForge.EVENT_BUS.post(evt); 26 | return evt.opacity; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Command/FlushChunkDataCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2018 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Command; 11 | 12 | import net.minecraft.command.ICommandSender; 13 | 14 | @Deprecated 15 | public class FlushChunkDataCommand extends DragonCommandBase { 16 | 17 | @Override 18 | public void processCommand(ICommandSender ics, String[] args) { 19 | 20 | } 21 | 22 | @Override 23 | public String getCommandString() { 24 | return "flushchunks"; 25 | } 26 | 27 | @Override 28 | protected boolean isAdminOnly() { 29 | return false; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Instantiable/Event/RawKeyPressEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | 14 | import Reika.DragonAPI.Auxiliary.Trackers.KeyWatcher.Key; 15 | 16 | import cpw.mods.fml.common.eventhandler.Event; 17 | 18 | public class RawKeyPressEvent extends Event { 19 | 20 | public final Key key; 21 | public final EntityPlayer player; 22 | 23 | public RawKeyPressEvent(Key k, EntityPlayer ep) { 24 | key = k; 25 | player = ep; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Base/ProgressContainer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Base; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.tileentity.TileEntity; 14 | 15 | public abstract class ProgressContainer extends CoreContainer { 16 | 17 | public ProgressContainer(EntityPlayer player, TileEntity te) { 18 | super(player, te); 19 | } 20 | 21 | @Override 22 | public abstract void detectAndSendChanges(); 23 | 24 | @Override 25 | public abstract void updateProgressBar(int index, int value); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Exception/MissingDependencyException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Exception; 11 | 12 | import Reika.DragonAPI.Base.DragonAPIMod; 13 | 14 | public class MissingDependencyException extends UserErrorException { 15 | 16 | public MissingDependencyException(DragonAPIMod mod, String mod2) { 17 | message.append(mod.getDisplayName()+" was not installed correctly:\n"); 18 | message.append(mod.getDisplayName()+" was installed without its dependency "+mod2+"!\n"); 19 | this.applyDNP(mod); 20 | this.crash(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/ClientLogoutEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event.Client; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | 14 | import cpw.mods.fml.common.eventhandler.Event; 15 | import cpw.mods.fml.relauncher.Side; 16 | import cpw.mods.fml.relauncher.SideOnly; 17 | 18 | @SideOnly(Side.CLIENT) 19 | public class ClientLogoutEvent extends Event { 20 | 21 | public final EntityPlayer player; 22 | 23 | public ClientLogoutEvent(EntityPlayer ep) { 24 | player = ep; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Interfaces/DataSync.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import net.minecraft.nbt.NBTTagCompound; 13 | import net.minecraft.tileentity.TileEntity; 14 | 15 | import cpw.mods.fml.relauncher.Side; 16 | import cpw.mods.fml.relauncher.SideOnly; 17 | 18 | public interface DataSync { 19 | 20 | public void setData(TileEntity te, boolean force, NBTTagCompound NBT); 21 | 22 | @SideOnly(Side.CLIENT) 23 | public void readForSync(TileEntity te, NBTTagCompound NBT); 24 | 25 | public boolean hasNoData(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Interfaces/TileEntity/ChunkLoadingTile.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.TileEntity; 11 | 12 | import java.util.Collection; 13 | 14 | import net.minecraft.world.ChunkCoordIntPair; 15 | 16 | /** For TileEntities that load chunks. Only implement this on a TileEntity! */ 17 | public interface ChunkLoadingTile extends BreakAction { 18 | 19 | //public void setTicket(Ticket t); 20 | 21 | public Collection getChunksToLoad(); 22 | 23 | //public boolean loadChunk(ChunkCoordIntPair chip); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Instantiable/ObfuscationMapping.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable; 11 | 12 | import Reika.DragonAPI.Libraries.Java.ReikaObfuscationHelper; 13 | 14 | public class ObfuscationMapping { 15 | 16 | private final String deobfName; 17 | private final String obfName; 18 | 19 | public ObfuscationMapping(String deobf, String obf) { 20 | deobfName = deobf; 21 | obfName = obf; 22 | } 23 | 24 | public String getEffectiveName() { 25 | return ReikaObfuscationHelper.isDeObfEnvironment() ? deobfName : obfName; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Instantiable/GUI/Slot/SlotXItems.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.GUI.Slot; 11 | 12 | import net.minecraft.inventory.IInventory; 13 | import net.minecraft.inventory.Slot; 14 | 15 | public class SlotXItems extends Slot { 16 | 17 | public final int slotCapacity; 18 | 19 | public SlotXItems(IInventory ii, int par2, int par3, int par4, int size) { 20 | super(ii, par2, par3, par4); 21 | slotCapacity = size; 22 | } 23 | 24 | @Override 25 | public int getSlotStackLimit() 26 | { 27 | return slotCapacity; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Interfaces/Item/SpriteRenderCallback.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | import net.minecraft.client.renderer.entity.RenderItem; 13 | import net.minecraft.item.ItemStack; 14 | import net.minecraftforge.client.IItemRenderer.ItemRenderType; 15 | 16 | public interface SpriteRenderCallback { 17 | 18 | /** Return true to prevent further rendering. */ 19 | public boolean onRender(RenderItem ri, ItemStack is, ItemRenderType type); 20 | 21 | public boolean doPreGLTransforms(ItemStack is, ItemRenderType type); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Interfaces/Registry/TileEnum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | import net.minecraft.block.Block; 13 | import net.minecraft.item.ItemStack; 14 | import net.minecraft.tileentity.TileEntity; 15 | 16 | public interface TileEnum { 17 | 18 | public Class getTEClass(); 19 | public String getName(); 20 | public Block getBlock(); 21 | public int getBlockMetadata(); 22 | public ItemStack getCraftedProduct(); 23 | public ItemStack getCraftedProduct(TileEntity te); 24 | public int ordinal(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Instantiable/Event/ConfigReloadEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import Reika.DragonAPI.Base.DragonAPIMod; 13 | 14 | import cpw.mods.fml.common.eventhandler.Event; 15 | 16 | 17 | public class ConfigReloadEvent extends Event { 18 | 19 | public final DragonAPIMod mod; 20 | 21 | public ConfigReloadEvent() { 22 | this(null); 23 | } 24 | 25 | public ConfigReloadEvent(String s) { 26 | if (s != null) { 27 | mod = DragonAPIMod.getByName(s); 28 | } 29 | else { 30 | mod = null; 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Instantiable/Event/PlayerSprintEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraftforge.common.MinecraftForge; 14 | import net.minecraftforge.event.entity.player.PlayerEvent; 15 | 16 | 17 | public class PlayerSprintEvent extends PlayerEvent { 18 | 19 | public PlayerSprintEvent(EntityPlayer ep) { 20 | super(ep); 21 | } 22 | 23 | public static void fire(EntityPlayer ep) { 24 | MinecraftForge.EVENT_BUS.post(new PlayerSprintEvent(ep)); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Instantiable/Event/XPUpdateEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import net.minecraft.entity.item.EntityXPOrb; 13 | import net.minecraftforge.common.MinecraftForge; 14 | 15 | import cpw.mods.fml.common.eventhandler.Event; 16 | 17 | 18 | public class XPUpdateEvent extends Event { 19 | 20 | public final EntityXPOrb xp; 21 | 22 | public XPUpdateEvent(EntityXPOrb e) { 23 | xp = e; 24 | } 25 | 26 | public static void fire(EntityXPOrb e) { 27 | MinecraftForge.EVENT_BUS.post(new XPUpdateEvent(e)); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /ModInteract/Bees/GeneBase.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ModInteract.Bees; 2 | 3 | import forestry.api.genetics.IAllele; 4 | import forestry.api.genetics.IChromosomeType; 5 | 6 | 7 | public abstract class GeneBase implements IAllele { 8 | 9 | protected final String uid; 10 | public final String name; 11 | public final IChromosomeType geneType; 12 | 13 | public GeneBase(String uid, String name, IChromosomeType type) { 14 | this.uid = uid; 15 | this.name = name; 16 | geneType = type; 17 | } 18 | 19 | @Override 20 | public final String getUID() { 21 | return uid; 22 | } 23 | 24 | @Override 25 | public final String getName() { 26 | return name; 27 | } 28 | 29 | @Override 30 | public final String getUnlocalizedName() { 31 | return uid; 32 | } 33 | 34 | public final boolean equals(IAllele ia) { 35 | return ia != null && ia.getClass() == this.getClass() && ia.getUID().equals(uid); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/World/Gen/DungeonSpawnerGen.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.World.Gen; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | import org.objectweb.asm.tree.MethodNode; 5 | 6 | import Reika.DragonAPI.ASM.Patchers.SpawnerGen; 7 | import Reika.DragonAPI.Instantiable.Event.SpawnerGenerationEvent.SpawnerSource; 8 | import Reika.DragonAPI.Libraries.Java.ReikaASMHelper; 9 | 10 | 11 | public class DungeonSpawnerGen extends SpawnerGen { 12 | 13 | public DungeonSpawnerGen() { 14 | super("net.minecraft.world.gen.feature.WorldGenDungeons", "asd"); 15 | } 16 | 17 | @Override 18 | protected MethodNode getMethod(ClassNode cn) { 19 | return ReikaASMHelper.getMethodByName(cn, "func_76484_a", "generate", "(Lnet/minecraft/world/World;Ljava/util/Random;III)Z"); 20 | } 21 | 22 | @Override 23 | protected SpawnerSource getEnumEntry() { 24 | return SpawnerSource.DUNGEON; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Instantiable/CubeRotation.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable; 11 | 12 | import java.util.Random; 13 | 14 | 15 | public class CubeRotation { 16 | 17 | public double angX; 18 | public double angY; 19 | public double angZ; 20 | 21 | public double rvX; 22 | public double rvY; 23 | public double rvZ; 24 | 25 | public CubeRotation() { 26 | 27 | } 28 | 29 | public CubeRotation randomize(Random rand) { 30 | angX = rand.nextInt(360); 31 | angY = rand.nextInt(360); 32 | angZ = rand.nextInt(360); 33 | return this; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Exception/ModIntegrityException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Exception; 11 | 12 | import Reika.DragonAPI.Base.DragonAPIMod; 13 | 14 | public class ModIntegrityException extends DragonAPIException { 15 | 16 | public ModIntegrityException(DragonAPIMod mod, String tampering) { 17 | message.append("Something has tampered with and broken "+mod.getDisplayName()+"!\n"); 18 | message.append(tampering+" has occurred!\n"); 19 | message.append("Contact "+mod.getModAuthorName()+" immediately, with your full mod list!\n"); 20 | this.crash(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Instantiable/Data/DynamicAverage.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Data; 11 | 12 | import java.util.ArrayList; 13 | import java.util.Collection; 14 | 15 | 16 | public class DynamicAverage { 17 | 18 | private final Collection values = new ArrayList(); 19 | private double sum; 20 | 21 | public double getAverage() { 22 | return sum/values.size(); 23 | } 24 | 25 | public void add(double val) { 26 | sum += val; 27 | values.add(val); 28 | } 29 | 30 | public void clear() { 31 | values.clear(); 32 | sum = 0; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/FarClippingPlaneEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event.Client; 11 | 12 | import cpw.mods.fml.common.eventhandler.Event; 13 | 14 | public class FarClippingPlaneEvent extends Event { 15 | 16 | public float farClippingPlaneDistance; 17 | 18 | public final float partialTickTime; 19 | public final int unknownParamInt; 20 | 21 | public FarClippingPlaneEvent(float ptick, int par2, float plane) { 22 | partialTickTime = ptick; 23 | unknownParamInt = par2; 24 | farClippingPlaneDistance = plane; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Instantiable/GUI/InvisibleButton.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.GUI; 11 | 12 | import net.minecraft.client.Minecraft; 13 | import net.minecraft.client.gui.GuiButton; 14 | 15 | public class InvisibleButton extends GuiButton { 16 | 17 | public InvisibleButton(int par1, int par2, int par3, int par4, int par5) 18 | { 19 | super(par1, par2, par3, par4, par5, ""); 20 | } 21 | 22 | @Override 23 | public void drawButton(Minecraft par1Minecraft, int par2, int par3) 24 | { 25 | //super.drawButton(par1Minecraft, par2, par3); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Instantiable/IO/ForcedResource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.IO; 11 | 12 | import net.minecraft.util.ResourceLocation; 13 | 14 | /** Damn that assets folder... */ 15 | public final class ForcedResource extends ResourceLocation { 16 | 17 | private String texture; 18 | 19 | public ForcedResource(String tex) { 20 | super(tex); 21 | } 22 | 23 | @Override 24 | public String getResourcePath() 25 | { 26 | return texture; 27 | } 28 | 29 | @Override 30 | public String getResourceDomain() 31 | { 32 | return texture; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/WorldGLLists.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks; 2 | 3 | import org.objectweb.asm.Opcodes; 4 | import org.objectweb.asm.tree.ClassNode; 5 | import org.objectweb.asm.tree.MethodInsnNode; 6 | import org.objectweb.asm.tree.MethodNode; 7 | 8 | import Reika.DragonAPI.ASM.Patchers.Patcher; 9 | import Reika.DragonAPI.Libraries.Java.ReikaASMHelper; 10 | 11 | 12 | public class WorldGLLists extends Patcher { 13 | 14 | public WorldGLLists() { 15 | super("net.minecraft.client.renderer.RenderList", "bmd"); 16 | } 17 | 18 | @Override 19 | protected void apply(ClassNode cn) { 20 | MethodNode m = ReikaASMHelper.getMethodByName(cn, "func_78419_a", "callLists", "()V"); 21 | MethodInsnNode min = ReikaASMHelper.getFirstMethodCallByName(cn, m, "glCallLists"); 22 | min.owner = "Reika/DragonAPI/ASM/ASMCallsClient"; 23 | min.name = "callWorldGlLists"; 24 | min.setOpcode(Opcodes.INVOKESTATIC); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Instantiable/Data/Immutable/Column.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Data.Immutable; 2 | 3 | public class Column { 4 | 5 | public final int minY; 6 | public final int maxY; 7 | 8 | public Column(int y1, int y2) { 9 | minY = y1; 10 | maxY = y2; 11 | } 12 | 13 | public Column topSlice(int y) { 14 | if (y > maxY) 15 | return null; 16 | return new Column(y, maxY); 17 | } 18 | 19 | public Column bottomSlice(int y) { 20 | if (y < minY) 21 | return null; 22 | return new Column(minY, y); 23 | } 24 | 25 | public Column extendTo(int y) { 26 | int y1 = Math.min(y, minY); 27 | int y2 = Math.max(y, maxY); 28 | return new Column(y1, y2); 29 | } 30 | 31 | public Column merge(Column c) { 32 | int y1 = Math.min(c.minY, minY); 33 | int y2 = Math.max(c.maxY, maxY); 34 | return new Column(y1, y2); 35 | } 36 | 37 | public boolean contains(int y) { 38 | return y >= minY && y <= maxY; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Instantiable/ModInteract/MEWorkTracker.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.ModInteract; 2 | 3 | import Reika.DragonAPI.ModInteract.DeepInteract.MESystemReader.ChangeCallback; 4 | 5 | import appeng.api.storage.data.IAEItemStack; 6 | 7 | public class MEWorkTracker implements ChangeCallback { 8 | 9 | public final int tickRate; 10 | 11 | private long age = 0; 12 | private boolean hasWork = true; 13 | 14 | public MEWorkTracker() { 15 | this(200); 16 | } 17 | 18 | public MEWorkTracker(int r) { 19 | tickRate = r; 20 | } 21 | 22 | public void tick() { 23 | age++; 24 | hasWork |= age%tickRate == 0; 25 | } 26 | 27 | public void markDirty() { 28 | hasWork = true; 29 | } 30 | 31 | public void reset() { 32 | hasWork = false; 33 | } 34 | 35 | public boolean hasWork() { 36 | return hasWork; 37 | } 38 | 39 | @Override 40 | public void onItemChange(IAEItemStack iae) { 41 | hasWork = true; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Extras/TemporaryCodeCalls.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Extras; 11 | 12 | import cpw.mods.fml.common.event.FMLInitializationEvent; 13 | import cpw.mods.fml.common.event.FMLPostInitializationEvent; 14 | import cpw.mods.fml.common.event.FMLPreInitializationEvent; 15 | 16 | 17 | public class TemporaryCodeCalls { 18 | 19 | public static void preload(FMLPreInitializationEvent evt) { 20 | 21 | } 22 | 23 | public static void load(FMLInitializationEvent evt) { 24 | 25 | } 26 | 27 | public static void postload(FMLPostInitializationEvent evt) { 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Interfaces/Item/AnimatedSpritesheet.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Item; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | public interface AnimatedSpritesheet extends IndexedItemSprites { 15 | 16 | public boolean useAnimatedRender(ItemStack is); 17 | 18 | public int getFrameSpeed(ItemStack is); 19 | 20 | public int getColumn(ItemStack is); 21 | 22 | public int getFrameCount(ItemStack is); 23 | 24 | public int getFrameOffset(ItemStack is); 25 | 26 | public int getBaseRow(ItemStack is); 27 | 28 | public boolean verticalFrames(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Resources/Shader/lib_color.txt: -------------------------------------------------------------------------------- 1 | vec3 rgb2hsb(vec3 c) { 2 | vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); 3 | vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); 4 | vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); 5 | float d = q.x - min(q.w, q.y); 6 | float e = 1.0e-10; 7 | return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); 8 | } 9 | 10 | // Function from Iñigo Quiles 11 | // https://www.shadertoy.com/view/MsS3Wc 12 | vec3 hsb2rgb(vec3 c){ 13 | vec3 rgb = clamp(abs(mod(c.x * 6.0 + vec3(0.0, 4.0, 2.0), 6.0) - 3.0) - 1.0, 0.0, 1.0); 14 | rgb = rgb * rgb * (3.0 - 2.0 * rgb); 15 | return c.z * mix(vec3(1.0), rgb, c.y); 16 | } 17 | 18 | float getVisualBrightness(vec3 color) { 19 | return color.r*0.2989+color.g*0.5870+color.b*0.1140; 20 | } 21 | 22 | vec3 getGrayscaledColor(vec3 color) { 23 | float br = getVisualBrightness(color); 24 | return vec3(br, br, br); 25 | } -------------------------------------------------------------------------------- /ModInteract/Bees/BeeEvent.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ModInteract.Bees; 2 | 3 | import cpw.mods.fml.common.eventhandler.Event; 4 | import forestry.api.apiculture.IBee; 5 | import forestry.api.apiculture.IBeeHousing; 6 | import forestry.api.apiculture.IBeekeepingLogic; 7 | 8 | 9 | public class BeeEvent extends Event { 10 | 11 | public final IBee bee; 12 | 13 | public BeeEvent(IBee b) { 14 | bee = b; 15 | } 16 | 17 | public static class BeeHouseEvent extends BeeEvent { 18 | 19 | public final IBeeHousing housing; 20 | public final IBeekeepingLogic logic; 21 | 22 | public BeeHouseEvent(IBeeHousing ibh, IBeekeepingLogic lgc, IBee bee) { 23 | super(bee); 24 | housing = ibh; 25 | logic = lgc; 26 | } 27 | 28 | } 29 | 30 | public static class BeeSetHealthEvent extends BeeHouseEvent { 31 | 32 | public BeeSetHealthEvent(IBeeHousing te, IBeekeepingLogic lgc, IBee bee) { 33 | super(te, lgc, bee); 34 | } 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Instantiable/GUI/Slider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.GUI; 11 | 12 | public class Slider { 13 | 14 | public final int posX; 15 | public final int posY; 16 | public final int width; 17 | public final int height; 18 | 19 | private int position; 20 | 21 | public Slider(int x, int y, int w, int h) { 22 | posX = x; 23 | posY = y; 24 | width = w; 25 | height = h; 26 | } 27 | 28 | public float getFraction() { 29 | return position/(float)height; 30 | } 31 | 32 | public Slider setPosition(int pos) { 33 | position = pos; 34 | return this; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /ModInteract/Bees/BasicGene.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.ModInteract.Bees; 11 | 12 | import forestry.api.genetics.AlleleManager; 13 | import forestry.api.genetics.IChromosomeType; 14 | 15 | public abstract class BasicGene extends GeneBase { 16 | 17 | public BasicGene(String uid, String name, IChromosomeType type) { 18 | super(uid, name, type); 19 | this.preInit(); 20 | AlleleManager.alleleRegistry.registerAllele(this, type); 21 | } 22 | 23 | protected void preInit() { 24 | 25 | } 26 | 27 | @Override 28 | public boolean isDominant() { 29 | return true; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /ASM/Patchers/MobSpawnerPatch.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | import org.objectweb.asm.tree.MethodInsnNode; 5 | import org.objectweb.asm.tree.MethodNode; 6 | 7 | import net.minecraftforge.classloading.FMLForgePlugin; 8 | 9 | import Reika.DragonAPI.Libraries.Java.ReikaASMHelper; 10 | 11 | 12 | public class MobSpawnerPatch extends Patcher { 13 | 14 | public MobSpawnerPatch() { 15 | super("net.minecraft.world.SpawnerAnimals", "aho"); 16 | } 17 | 18 | @Override 19 | protected void apply(ClassNode cn) { 20 | MethodNode m = ReikaASMHelper.getMethodByName(cn, "func_77192_a", "findChunksForSpawning", "(Lnet/minecraft/world/WorldServer;ZZZ)I"); 21 | MethodInsnNode min = ReikaASMHelper.getFirstMethodCallByName(cn, m, FMLForgePlugin.RUNTIME_DEOBF ? "func_77190_a" : "canCreatureTypeSpawnAtLocation"); 22 | min.owner = "Reika/DragonAPI/ASM/ASMCalls"; 23 | min.name = "canSpawnCreature"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /ModInteract/Bees/DummyEffectData.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ModInteract.Bees; 2 | 3 | import net.minecraft.nbt.NBTTagCompound; 4 | 5 | import forestry.api.genetics.IEffectData; 6 | 7 | 8 | public class DummyEffectData implements IEffectData { 9 | 10 | @Override 11 | public void readFromNBT(NBTTagCompound nbttagcompound) { 12 | 13 | } 14 | 15 | @Override 16 | public void writeToNBT(NBTTagCompound nbttagcompound) { 17 | 18 | } 19 | 20 | @Override 21 | public void setInteger(int index, int val) { 22 | 23 | } 24 | 25 | @Override 26 | public void setFloat(int index, float val) { 27 | 28 | } 29 | 30 | @Override 31 | public void setBoolean(int index, boolean val) { 32 | 33 | } 34 | 35 | @Override 36 | public int getInteger(int index) { 37 | return 0; 38 | } 39 | 40 | @Override 41 | public float getFloat(int index) { 42 | return 0; 43 | } 44 | 45 | @Override 46 | public boolean getBoolean(int index) { 47 | return false; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/ClientLoginEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event.Client; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | 14 | import cpw.mods.fml.common.eventhandler.Event; 15 | import cpw.mods.fml.relauncher.Side; 16 | import cpw.mods.fml.relauncher.SideOnly; 17 | 18 | @SideOnly(Side.CLIENT) 19 | public class ClientLoginEvent extends Event { 20 | 21 | public final EntityPlayer player; 22 | 23 | public final boolean newLogin; 24 | 25 | public ClientLoginEvent(EntityPlayer ep, boolean log) { 26 | player = ep; 27 | newLogin = log; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Instantiable/Event/AddRecipeEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import net.minecraft.item.crafting.IRecipe; 13 | 14 | import cpw.mods.fml.common.eventhandler.Cancelable; 15 | import cpw.mods.fml.common.eventhandler.Event; 16 | 17 | @Cancelable 18 | public class AddRecipeEvent extends Event { 19 | 20 | public final IRecipe recipe; 21 | public static boolean isVanillaPass; 22 | 23 | public AddRecipeEvent(IRecipe r) { 24 | this(r, isVanillaPass); 25 | } 26 | 27 | public AddRecipeEvent(IRecipe r, boolean v) { 28 | recipe = r; 29 | isVanillaPass = v; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /APIProxy.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI; 11 | 12 | import net.minecraft.world.World; 13 | 14 | public class APIProxy { 15 | 16 | public void registerSidedHandlers() { 17 | 18 | } 19 | 20 | public void registerSidedHandlersMain() { 21 | 22 | } 23 | 24 | public void addArmorRenders() {} 25 | 26 | public World getClientWorld() { 27 | return null; 28 | } 29 | 30 | public void registerRenderInformation() { 31 | 32 | } 33 | 34 | public void registerSounds() { 35 | 36 | } 37 | 38 | public void registerSidedHandlersGameLoaded() { 39 | 40 | } 41 | 42 | public void postLoad() { 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ASM/Patchers/Fixes/RecipeStackParsingOre.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Fixes; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | import org.objectweb.asm.tree.MethodNode; 5 | 6 | import Reika.DragonAPI.Libraries.Java.ReikaASMHelper; 7 | 8 | public class RecipeStackParsingOre extends RecipeStackParser { 9 | 10 | public RecipeStackParsingOre() { 11 | super("net.minecraftforge.oredict.ShapedOreRecipe"); 12 | } 13 | 14 | @Override 15 | public int getIndexVar() { 16 | return 4; 17 | } 18 | 19 | @Override 20 | public int getMapVar() { 21 | return 5; 22 | } 23 | 24 | @Override 25 | protected boolean supportsOre() { 26 | return true; 27 | } 28 | 29 | @Override 30 | public String getArrayType() { 31 | return "java/lang/Object"; 32 | } 33 | 34 | @Override 35 | protected MethodNode getMethod(ClassNode cn) { 36 | return ReikaASMHelper.getMethodByName(cn, "", "(Lnet/minecraft/item/ItemStack;[Ljava/lang/Object;)V"); 37 | } 38 | 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Command/ToggleBlockChangePacketCommand.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Command; 11 | 12 | import net.minecraft.command.ICommandSender; 13 | 14 | import Reika.DragonAPI.Extras.ChangePacketRenderer; 15 | 16 | public class ToggleBlockChangePacketCommand extends DragonClientCommand { 17 | 18 | @Override 19 | public void processCommand(ICommandSender ics, String[] args) { 20 | ChangePacketRenderer.isActive = args.length > 0 && Boolean.parseBoolean(args[0]); 21 | ChangePacketRenderer.instance.clear(); 22 | } 23 | 24 | @Override 25 | public String getCommandString() { 26 | return "chgpkt"; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Instantiable/Data/Immutable/ScaledCubeDirection.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Data.Immutable; 11 | 12 | import Reika.DragonAPI.Libraries.ReikaDirectionHelper.CubeDirections; 13 | 14 | 15 | public final class ScaledCubeDirection { 16 | 17 | public final int offsetX; 18 | public final int offsetZ; 19 | 20 | public final int distance; 21 | public final CubeDirections direction; 22 | 23 | public ScaledCubeDirection(CubeDirections dir, int dist) { 24 | direction = dir; 25 | distance = dist; 26 | 27 | offsetX = dir.directionX*dist; 28 | offsetZ = dir.directionZ*dist; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Interfaces/Registry/RegistrationList.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces.Registry; 11 | 12 | import net.minecraft.item.ItemStack; 13 | 14 | /** This is an interface for ENUMS! */ 15 | public interface RegistrationList extends RegistryEntry { 16 | 17 | public Class[] getConstructorParamTypes(); 18 | 19 | public Object[] getConstructorParams(); 20 | 21 | public String getMultiValuedName(int meta); 22 | 23 | public boolean hasMultiValuedName(); 24 | 25 | public int getNumberMetadatas(); 26 | 27 | //public ItemStack getStackOf(); 28 | 29 | public ItemStack getStackOfMetadata(int meta); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /ModInteract/ItemHandlers/HexcraftHandler.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ModInteract.ItemHandlers; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.item.Item; 5 | 6 | import Reika.DragonAPI.Exception.MisuseException; 7 | 8 | public class HexcraftHandler { 9 | 10 | private static HexHandler handler; 11 | 12 | public static void setHandler(HexHandler h) { 13 | if (handler != null) 14 | throw new MisuseException("Handler already set!"); 15 | handler = h; 16 | } 17 | 18 | public static HexHandler getActiveHandler() { 19 | return handler; 20 | } 21 | 22 | public static interface HexHandler { 23 | 24 | boolean isMonolith(Block id); 25 | 26 | boolean isWorldGenMonolith(Block id); 27 | 28 | public BasicHexColor[] getColors(); 29 | 30 | } 31 | 32 | public static interface BasicHexColor { 33 | 34 | public Item getCrystal(); 35 | 36 | public Block getMonolith(boolean nether); 37 | 38 | public boolean isPrimary(boolean nether); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Exception/MissingASMException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Exception; 11 | 12 | import Reika.DragonAPI.Base.DragonAPIMod; 13 | 14 | public class MissingASMException extends DragonAPIException { 15 | 16 | public MissingASMException(DragonAPIMod mod) { 17 | message.append(mod.getDisplayName()+" is missing its ASM transformers.\n"); 18 | message.append("This should never happen, and is likely caused by a jar manifest failure.\n"); 19 | message.append("If you got this by editing the mod jar, you may have to redownload the mod. Consult the developer for further questions."); 20 | this.crash(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/SkyColorEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event.Client; 11 | 12 | import net.minecraftforge.common.MinecraftForge; 13 | 14 | import cpw.mods.fml.common.eventhandler.Event; 15 | 16 | 17 | public class SkyColorEvent extends Event { 18 | 19 | public final int originalColor; 20 | public int color; 21 | 22 | public SkyColorEvent(int c) { 23 | originalColor = c; 24 | color = originalColor; 25 | } 26 | 27 | public static int fire(int c) { 28 | SkyColorEvent evt = new SkyColorEvent(c); 29 | MinecraftForge.EVENT_BUS.post(evt); 30 | return evt.color; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Instantiable/IO/DynamicDirectResource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.IO; 11 | 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | 15 | public class DynamicDirectResource extends DirectResource { 16 | 17 | private final RemoteSourcedAsset asset; 18 | 19 | public DynamicDirectResource(RemoteSourcedAsset a) { 20 | super(a.path); 21 | 22 | asset = a; 23 | } 24 | 25 | @Override 26 | protected InputStream calcStream() { 27 | try { 28 | return asset.getData(); 29 | } 30 | catch (IOException e) { 31 | e.printStackTrace(); 32 | return null; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Instantiable/IO/DynamicSoundLoader.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.IO; 2 | 3 | import Reika.DragonAPI.IO.DirectResourceManager; 4 | import Reika.DragonAPI.Instantiable.IO.RemoteSourcedAsset.RemoteSourcedAssetRepository; 5 | import Reika.DragonAPI.Interfaces.Registry.DynamicSound; 6 | import Reika.DragonAPI.Interfaces.Registry.SoundEnum; 7 | 8 | public class DynamicSoundLoader extends SoundLoader { 9 | 10 | private final RemoteSourcedAssetRepository dataSource; 11 | 12 | public DynamicSoundLoader(Class c, RemoteSourcedAssetRepository repo) { 13 | super(c); 14 | dataSource = repo; 15 | } 16 | 17 | public DynamicSoundLoader(DynamicSound[] sounds, RemoteSourcedAssetRepository repo) { 18 | super(sounds); 19 | dataSource = repo; 20 | } 21 | 22 | @Override 23 | protected void onRegister(SoundEnum e, String p) { 24 | DirectResourceManager.getInstance().registerDynamicAsset(p, dataSource.createAsset(((DynamicSound)e).getRelativePath())); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/World/Gen/NetherSpawnerGen.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.World.Gen; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | import org.objectweb.asm.tree.MethodNode; 5 | 6 | import Reika.DragonAPI.ASM.Patchers.SpawnerGen; 7 | import Reika.DragonAPI.Instantiable.Event.SpawnerGenerationEvent.SpawnerSource; 8 | import Reika.DragonAPI.Libraries.Java.ReikaASMHelper; 9 | 10 | 11 | public class NetherSpawnerGen extends SpawnerGen { 12 | 13 | public NetherSpawnerGen() { 14 | super("net.minecraft.world.gen.structure.StructureStrongholdPieces$PortalRoom", "aus"); 15 | } 16 | 17 | @Override 18 | protected MethodNode getMethod(ClassNode cn) { 19 | return ReikaASMHelper.getMethodByName(cn, "func_74875_a", "addComponentParts", "(Lnet/minecraft/world/World;Ljava/util/Random;Lnet/minecraft/world/gen/structure/StructureBoundingBox;)Z"); 20 | } 21 | 22 | @Override 23 | protected SpawnerSource getEnumEntry() { 24 | return SpawnerSource.STRONGHOLD; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /APIGuiHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.world.World; 14 | 15 | import Reika.DragonAPI.Extras.GuiGuide; 16 | 17 | import cpw.mods.fml.common.network.IGuiHandler; 18 | 19 | public class APIGuiHandler implements IGuiHandler { 20 | 21 | @Override 22 | public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { 23 | return null; 24 | } 25 | 26 | @Override 27 | public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { 28 | return new GuiGuide(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/World/Gen/MineshaftSpawnerGen.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.World.Gen; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | import org.objectweb.asm.tree.MethodNode; 5 | 6 | import Reika.DragonAPI.ASM.Patchers.SpawnerGen; 7 | import Reika.DragonAPI.Instantiable.Event.SpawnerGenerationEvent.SpawnerSource; 8 | import Reika.DragonAPI.Libraries.Java.ReikaASMHelper; 9 | 10 | 11 | public class MineshaftSpawnerGen extends SpawnerGen { 12 | 13 | public MineshaftSpawnerGen() { 14 | super("net.minecraft.world.gen.structure.StructureMineshaftPieces$Corridor", "asy"); 15 | } 16 | 17 | @Override 18 | protected MethodNode getMethod(ClassNode cn) { 19 | return ReikaASMHelper.getMethodByName(cn, "func_74875_a", "addComponentParts", "(Lnet/minecraft/world/World;Ljava/util/Random;Lnet/minecraft/world/gen/structure/StructureBoundingBox;)Z"); 20 | } 21 | 22 | @Override 23 | protected SpawnerSource getEnumEntry() { 24 | return SpawnerSource.MINESHAFT; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Instantiable/Data/Immutable/ScaledDirection.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Data.Immutable; 11 | 12 | import net.minecraftforge.common.util.ForgeDirection; 13 | 14 | public final class ScaledDirection { 15 | 16 | public final int offsetX; 17 | public final int offsetY; 18 | public final int offsetZ; 19 | 20 | public final int distance; 21 | public final ForgeDirection direction; 22 | 23 | public ScaledDirection(ForgeDirection dir, int dist) { 24 | direction = dir; 25 | distance = dist; 26 | 27 | offsetX = dir.offsetX*dist; 28 | offsetY = dir.offsetY*dist; 29 | offsetZ = dir.offsetZ*dist; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Instantiable/Event/PlayerHasItemEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.item.ItemStack; 14 | import net.minecraftforge.event.entity.player.PlayerEvent; 15 | 16 | import cpw.mods.fml.common.eventhandler.Event.HasResult; 17 | 18 | @HasResult 19 | public class PlayerHasItemEvent extends PlayerEvent { 20 | 21 | private final ItemStack item; 22 | 23 | public PlayerHasItemEvent(EntityPlayer ep, ItemStack is) { 24 | super(ep); 25 | 26 | item = is; 27 | } 28 | 29 | public ItemStack getItem() { 30 | return item.copy(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/World/Gen/StrongholdSpawnerGen.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.World.Gen; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | import org.objectweb.asm.tree.MethodNode; 5 | 6 | import Reika.DragonAPI.ASM.Patchers.SpawnerGen; 7 | import Reika.DragonAPI.Instantiable.Event.SpawnerGenerationEvent.SpawnerSource; 8 | import Reika.DragonAPI.Libraries.Java.ReikaASMHelper; 9 | 10 | 11 | public class StrongholdSpawnerGen extends SpawnerGen { 12 | 13 | public StrongholdSpawnerGen() { 14 | super("net.minecraft.world.gen.structure.StructureNetherBridgePieces$Throne", "atr"); 15 | } 16 | 17 | @Override 18 | protected MethodNode getMethod(ClassNode cn) { 19 | return ReikaASMHelper.getMethodByName(cn, "func_74875_a", "addComponentParts", "(Lnet/minecraft/world/World;Ljava/util/Random;Lnet/minecraft/world/gen/structure/StructureBoundingBox;)Z"); 20 | } 21 | 22 | @Override 23 | protected SpawnerSource getEnumEntry() { 24 | return SpawnerSource.NETHERFORTRESS; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Instantiable/Event/Client/FogDistanceEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event.Client; 11 | 12 | import net.minecraftforge.common.MinecraftForge; 13 | 14 | import cpw.mods.fml.common.eventhandler.Event; 15 | 16 | 17 | public class FogDistanceEvent extends Event { 18 | 19 | public float fogDistance; 20 | public final float originalDistance; 21 | 22 | public FogDistanceEvent(float f) { 23 | fogDistance = originalDistance = f; 24 | } 25 | 26 | public static float fire(float f1) { 27 | FogDistanceEvent evt = new FogDistanceEvent(f1); 28 | MinecraftForge.EVENT_BUS.post(evt); 29 | return evt.fogDistance; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Instantiable/Event/LivingFarDespawnEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import net.minecraft.entity.EntityLiving; 13 | import net.minecraftforge.common.MinecraftForge; 14 | import net.minecraftforge.event.entity.living.LivingEvent; 15 | 16 | import cpw.mods.fml.common.eventhandler.Cancelable; 17 | 18 | @Cancelable 19 | public class LivingFarDespawnEvent extends LivingEvent { 20 | 21 | public LivingFarDespawnEvent(EntityLiving entity) { 22 | super(entity); 23 | } 24 | 25 | public static boolean fire(EntityLiving e) { 26 | return !MinecraftForge.EVENT_BUS.post(new LivingFarDespawnEvent(e)); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Instantiable/Event/RemovePlayerItemEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Event; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.item.ItemStack; 14 | import net.minecraftforge.event.entity.player.PlayerEvent; 15 | 16 | import cpw.mods.fml.common.eventhandler.Cancelable; 17 | 18 | @Cancelable 19 | public class RemovePlayerItemEvent extends PlayerEvent { 20 | 21 | private final ItemStack item; 22 | 23 | public RemovePlayerItemEvent(EntityPlayer ep, ItemStack is) { 24 | super(ep); 25 | 26 | item = is; 27 | } 28 | 29 | public ItemStack getItem() { 30 | return item.copy(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Extras/SanityCheckNotification.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Extras; 11 | 12 | import Reika.DragonAPI.Auxiliary.Trackers.CrashNotifications.CrashNotification; 13 | 14 | 15 | public class SanityCheckNotification implements CrashNotification { 16 | 17 | @Override 18 | public String getLabel() { 19 | return "Sanity Checker Notification"; 20 | } 21 | 22 | @Override 23 | public String addMessage(Throwable crash) { 24 | return "The DragonAPI environment sanity checker is disabled. Note that the mod showing up in the stacktrace may not be the cause, especially if the crash involves general-use registries like recipes or biomes."; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Interfaces/PlayerRenderObj.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Interfaces; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | 14 | import Reika.DragonAPI.Auxiliary.Trackers.PlayerSpecificRenderer.PlayerRotationData; 15 | 16 | import cpw.mods.fml.relauncher.Side; 17 | import cpw.mods.fml.relauncher.SideOnly; 18 | 19 | @SideOnly(Side.CLIENT) 20 | public interface PlayerRenderObj { 21 | 22 | /** Render starts centered on eye position */ 23 | public void render(EntityPlayer ep, float ptick, PlayerRotationData dat); 24 | 25 | /** Lower numbers render first. Use high numbers (>> 0) for transparency */ 26 | public int getRenderPriority(); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Libraries/IO/ReikaCommandHelper.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Libraries.IO; 11 | 12 | import java.util.Collection; 13 | 14 | import net.minecraft.command.ICommand; 15 | import net.minecraft.server.MinecraftServer; 16 | 17 | 18 | public class ReikaCommandHelper { 19 | 20 | public static ICommand getCommandByName(String n) { 21 | for (ICommand c : getCommandList()) { 22 | String n2 = c.getCommandName(); 23 | if (n2.equalsIgnoreCase(n)) 24 | return c; 25 | } 26 | return null; 27 | } 28 | 29 | public static Collection getCommandList() { 30 | return MinecraftServer.getServer().getCommandManager().getCommands().values(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Base/BlockTileEnum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Base; 11 | 12 | import net.minecraft.block.material.Material; 13 | import net.minecraft.world.IBlockAccess; 14 | import net.minecraft.world.World; 15 | 16 | import Reika.DragonAPI.Interfaces.Registry.TileEnum; 17 | 18 | public abstract class BlockTileEnum extends BlockTEBase { 19 | 20 | public BlockTileEnum(Material mat) { 21 | super(mat); 22 | } 23 | 24 | public abstract E getMapping(int meta); 25 | 26 | public abstract E getMapping(IBlockAccess world, int x, int y, int z); 27 | 28 | @Override 29 | public abstract T createTileEntity(World world, int meta); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Exception/DragonAPIException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Exception; 11 | 12 | 13 | public abstract class DragonAPIException extends RuntimeException { 14 | 15 | protected StringBuilder message = new StringBuilder(); 16 | 17 | protected DragonAPIException() { 18 | super(); 19 | } 20 | 21 | protected DragonAPIException(Throwable t) { 22 | super(t); 23 | } 24 | 25 | @Override 26 | public final String getMessage() { 27 | return message.toString(); 28 | } 29 | 30 | protected void crash() { 31 | //Minecraft.getMinecraft().crashed(CrashReport.makeCrashReport(this, this.getMessage())); 32 | //this.printStackTrace(); 33 | throw this; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Instantiable/Math/CachedRayComponents.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.Instantiable.Math; 2 | 3 | 4 | public class CachedRayComponents { 5 | 6 | private double angle; 7 | 8 | private double dx; 9 | private double dy; 10 | private double dxL; 11 | private double dyL; 12 | 13 | public CachedRayComponents(double angle) { 14 | this.angle = angle-1; 15 | this.setAngle(angle); 16 | } 17 | 18 | public void setAngle(double angle) { 19 | if (angle == this.angle) 20 | return; 21 | this.angle = angle; 22 | dx = Math.cos(Math.toRadians(angle)); 23 | dy = Math.sin(Math.toRadians(angle)); 24 | dxL = Math.cos(Math.toRadians(angle+90)); 25 | dyL = Math.sin(Math.toRadians(angle+90)); 26 | } 27 | 28 | public double getAngle() { 29 | return angle; 30 | } 31 | 32 | public double getDX() { 33 | return dx; 34 | } 35 | 36 | public double getDZ() { 37 | return dy; 38 | } 39 | 40 | public double getPerpendicularDX() { 41 | return dxL; 42 | } 43 | 44 | public double getPerpendicularDZ() { 45 | return dyL; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /Auxiliary/PacketTypes.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Auxiliary; 11 | 12 | public enum PacketTypes { 13 | 14 | DATA(), 15 | SOUND(), 16 | STRING(), 17 | UPDATE(), 18 | FLOAT(), 19 | SYNC(), 20 | TANK(), 21 | RAW(), 22 | NBT(), 23 | STRINGINT(), 24 | STRINGINTLOC(), 25 | UUID(), 26 | PREFIXED(), 27 | POS(), 28 | FULLSOUND(); 29 | 30 | private PacketTypes() { 31 | 32 | } 33 | 34 | public static PacketTypes getPacketType(int type) { 35 | return PacketTypes.values()[type]; 36 | } 37 | 38 | public boolean hasCoordinates() { 39 | return this != RAW && this != NBT && this != STRINGINT && this != PREFIXED && this != POS && this != FULLSOUND; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /ASM/Patchers/Hooks/Event/World/Gen/DungeonLootGen.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Hooks.Event.World.Gen; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | import org.objectweb.asm.tree.MethodInsnNode; 5 | import org.objectweb.asm.tree.MethodNode; 6 | 7 | import net.minecraftforge.classloading.FMLForgePlugin; 8 | 9 | import Reika.DragonAPI.ASM.StructureLootHooks; 10 | import Reika.DragonAPI.ASM.Patchers.Patcher; 11 | import Reika.DragonAPI.Libraries.Java.ReikaASMHelper; 12 | 13 | public class DungeonLootGen extends Patcher { 14 | 15 | public DungeonLootGen() { 16 | super("net.minecraft.world.gen.feature.WorldGenDungeons", "asd"); 17 | } 18 | 19 | @Override 20 | protected void apply(ClassNode cn) { 21 | MethodNode m = ReikaASMHelper.getMethodByName(cn, "func_76484_a", "generate", "(Lnet/minecraft/world/World;Ljava/util/Random;III)Z"); 22 | MethodInsnNode look = ReikaASMHelper.getFirstMethodCallByName(cn, m, FMLForgePlugin.RUNTIME_DEOBF ? "func_76293_a" : "generateChestContents"); 23 | StructureLootHooks.inject(cn, m, look); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /Instantiable/Data/Collections/LinearSequence.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Data.Collections; 11 | 12 | import java.util.LinkedList; 13 | 14 | public class LinearSequence { 15 | 16 | private LinkedList sequence = new LinkedList(); 17 | 18 | private int currentIndex; 19 | 20 | public LinearSequence addObject(Object o) { 21 | sequence.addLast(o); 22 | return this; 23 | } 24 | 25 | public Object getEntry() { 26 | return sequence.get(currentIndex); 27 | } 28 | 29 | public void step() { 30 | currentIndex++; 31 | } 32 | 33 | public Object getNext() { 34 | int index = currentIndex; 35 | this.step(); 36 | return sequence.get(index); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /ModInteract/ReikaTwilightHelper.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.ModInteract; 11 | 12 | import Reika.DragonAPI.ModInteract.ItemHandlers.TwilightForestHandler; 13 | 14 | public class ReikaTwilightHelper { 15 | 16 | //public static final int TWILIGHT_ID = 7; 17 | 18 | public static boolean isTwilightForestBoss(String name) { 19 | if (name == null) 20 | return false; 21 | if (name.equals("Ur-Ghast")) 22 | return true; 23 | if (name.equals("Hydra")) 24 | return true; 25 | if (name.equals("Naga")) 26 | return true; 27 | return false; 28 | } 29 | 30 | public static int getDimensionID() { 31 | return TwilightForestHandler.getInstance().dimensionID; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Instantiable/Data/Collections/TimedSet.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Data.Collections; 11 | 12 | import java.util.HashSet; 13 | 14 | 15 | public class TimedSet { 16 | 17 | private long lastTime; 18 | private final HashSet data = new HashSet(); 19 | 20 | public boolean add(long time, V val) { 21 | if (time != this.lastTime) { 22 | this.clear(); 23 | } 24 | this.lastTime = time; 25 | return this.data.add(val); 26 | } 27 | 28 | public boolean contains(V val) { 29 | return this.data.contains(val); 30 | } 31 | 32 | public int size() { 33 | return this.data.size(); 34 | } 35 | 36 | public void clear() { 37 | this.data.clear(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /IO/ReikaCSVReader.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.IO; 11 | 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | import java.nio.charset.Charset; 15 | import java.util.ArrayList; 16 | 17 | public final class ReikaCSVReader { 18 | 19 | private ReikaCSVReader() {throw new RuntimeException("The class "+this.getClass()+" cannot be instantiated!");} 20 | 21 | private final ArrayList lineData = new ArrayList(); 22 | 23 | public ReikaCSVReader(Class root, String path) throws IOException { 24 | try (InputStream input = root.getResourceAsStream(path)) { 25 | lineData.addAll(ReikaFileReader.getFileAsLines(input, true, Charset.defaultCharset())); 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Instantiable/Data/Collections/ClassNameCache.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Data.Collections; 11 | 12 | import java.util.HashSet; 13 | 14 | 15 | public class ClassNameCache { 16 | 17 | private final HashSet cache = new HashSet(); 18 | 19 | public void add(String s) { 20 | while (s.charAt(s.length()-1) == '*') 21 | s = s.substring(0, s.length()-2); 22 | cache.add(s); 23 | } 24 | 25 | public boolean contains(Class c) { 26 | String s = c.getName(); 27 | while (!s.isEmpty()) { 28 | if (cache.contains(s)) 29 | return true; 30 | int idx = s.lastIndexOf('.'); 31 | s = idx >= 0 ? s.substring(0, idx) : ""; 32 | } 33 | return false; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /ModInteract/Computers/PeripheralHandlerCC.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.ModInteract.Computers; 11 | 12 | import net.minecraft.tileentity.TileEntity; 13 | import net.minecraft.world.World; 14 | 15 | import Reika.DragonAPI.Base.TileEntityBase; 16 | 17 | import dan200.computercraft.api.peripheral.IPeripheral; 18 | import dan200.computercraft.api.peripheral.IPeripheralProvider; 19 | 20 | public class PeripheralHandlerCC implements IPeripheralProvider { 21 | 22 | @Override 23 | public IPeripheral getPeripheral(World world, int x, int y, int z, int side) { 24 | TileEntity te = world.getTileEntity(x, y, z); 25 | return te instanceof TileEntityBase ? (IPeripheral)te : null; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /ModInteract/Computers/PeripheralHandlerRelay.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2018 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.ModInteract.Computers; 11 | 12 | import Reika.DragonAPI.ModList; 13 | import Reika.DragonAPI.ASM.DependentMethodStripper.ModDependent; 14 | 15 | import dan200.computercraft.api.ComputerCraftAPI; 16 | import li.cil.oc.api.Driver; 17 | 18 | 19 | public class PeripheralHandlerRelay { 20 | 21 | @ModDependent(ModList.COMPUTERCRAFT) 22 | public static void registerCCHandler() { 23 | ComputerCraftAPI.registerPeripheralProvider(new PeripheralHandlerCC()); 24 | } 25 | 26 | @ModDependent(ModList.OPENCOMPUTERS) 27 | public static void registerOCHandler() { 28 | Driver.add(new PeripheralHandlerOC()); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Resources/reika_effect.frag: -------------------------------------------------------------------------------- 1 | #import color 2 | 3 | uniform sampler2D stencilTex; 4 | 5 | void main() { 6 | 7 | vec4 stencil = texture2D(stencilTex, texcoord); 8 | float factor = stencil.r;//a; 9 | //float age = stencil.r; 10 | vec2 focusXY = stencil.gb; 11 | 12 | factor *= intensity; 13 | 14 | vec2 texUV = mix(texcoord, focusXY, factor/4.0); 15 | 16 | vec4 color = texture2D(bgl_RenderedTexture, texUV); 17 | vec3 orig = color.rgb; 18 | 19 | float f = 1.0+0.05*factor; 20 | float f2 = 1.0+0.25*factor; 21 | float d = factor/8.0; 22 | float d2 = factor/6.0; 23 | color.rgb = rgb2hsb(color.rgb); 24 | color.r = mix(color.r, 280.0/360.0, pow(factor, 2.0)*0.2); 25 | color.g = min(1.0, color.g*f2+d2); 26 | color.rgb = hsb2rgb(color.rgb); 27 | color.r = min(1.0, color.r*f+d); 28 | color.g = min(1.0, color.g*f+d); 29 | color.b = min(1.0, color.b*f+d); 30 | 31 | //float f3 = 0.5+0.5*sin(float(time)/10.0); 32 | //color = mix(color, vec4(stencil.r, stencil.g, stencil.b, 1.0), f3); 33 | 34 | gl_FragColor = vec4(color.r, color.g, color.b, color.a); 35 | } -------------------------------------------------------------------------------- /ASM/Patchers/Fixes/RecipeStackParsingShaped.java: -------------------------------------------------------------------------------- 1 | package Reika.DragonAPI.ASM.Patchers.Fixes; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | import org.objectweb.asm.tree.MethodNode; 5 | 6 | import Reika.DragonAPI.Libraries.Java.ReikaASMHelper; 7 | 8 | public class RecipeStackParsingShaped extends RecipeStackParser { 9 | 10 | public RecipeStackParsingShaped() { 11 | super("net.minecraft.item.crafting.CraftingManager", "afe"); 12 | } 13 | 14 | @Override 15 | public int getIndexVar() { 16 | return 4; 17 | } 18 | 19 | @Override 20 | public int getMapVar() { 21 | return 7; 22 | } 23 | 24 | @Override 25 | protected boolean supportsOre() { 26 | return false; 27 | } 28 | 29 | @Override 30 | public String getArrayType() { 31 | return "net/minecraft/item/ItemStack"; 32 | } 33 | 34 | @Override 35 | protected MethodNode getMethod(ClassNode cn) { 36 | return ReikaASMHelper.getMethodByName(cn, "func_92103_a", "addRecipe", "(Lnet/minecraft/item/ItemStack;[Ljava/lang/Object;)Lnet/minecraft/item/crafting/ShapedRecipes;"); 37 | } 38 | 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Exception/JarZipException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Exception; 11 | 12 | import Reika.DragonAPI.Base.DragonAPIMod; 13 | 14 | public class JarZipException extends DragonAPIException { 15 | 16 | public JarZipException(DragonAPIMod mod) { 17 | super(); 18 | message.append("Your mod file for "+mod.getDisplayName()+" is a .jar.zip file!\n"); 19 | message.append("Java does not recognize .zip files as jars, and the manifest will fail to load, causing a crash.\n"); 20 | message.append("Rename your file .jar (you may need to enable viewing of file extensions),\n"); 21 | message.append("and disable any browser plugins that automatically rename jars as zips."); 22 | this.crash(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Instantiable/Formula/MathExpression.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.Formula; 11 | 12 | public abstract class MathExpression { 13 | 14 | public abstract double evaluate(double arg) throws ArithmeticException; 15 | 16 | public abstract double getBaseValue(); 17 | 18 | @Override 19 | public abstract String toString(); 20 | 21 | public static final MathExpression self = new MathExpression() { 22 | @Override 23 | public double evaluate(double arg) throws ArithmeticException { 24 | return arg; 25 | } 26 | @Override 27 | public double getBaseValue() { 28 | return 0; 29 | } 30 | @Override 31 | public String toString() { 32 | return ""; 33 | } 34 | }; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Instantiable/ModInteract/PositionedStackWithTooltip.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.ModInteract; 11 | 12 | import java.util.List; 13 | 14 | import codechicken.nei.PositionedStack; 15 | import codechicken.nei.recipe.GuiRecipe; 16 | 17 | public class PositionedStackWithTooltip extends PositionedStack { 18 | 19 | public final String tooltip; 20 | 21 | public PositionedStackWithTooltip(Object o, int x, int y, String s) 22 | { 23 | super(o, x, y); 24 | tooltip = s; 25 | } 26 | 27 | public List handleTooltip(GuiRecipe gui, List currenttip) { 28 | if (tooltip != null && !tooltip.isEmpty()) { 29 | currenttip.add(tooltip); 30 | } 31 | return currenttip; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Instantiable/ModifiableAttributeMap.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable; 11 | 12 | import net.minecraft.entity.ai.attributes.IAttribute; 13 | import net.minecraft.entity.ai.attributes.IAttributeInstance; 14 | import net.minecraft.entity.ai.attributes.ServersideAttributeMap; 15 | 16 | public class ModifiableAttributeMap extends ServersideAttributeMap { 17 | 18 | @Override 19 | public IAttributeInstance registerAttribute(IAttribute par1Attribute) 20 | { 21 | if (attributesByName.containsKey(par1Attribute.getAttributeUnlocalizedName())) 22 | { 23 | attributesByName.remove(par1Attribute.getAttributeUnlocalizedName()); 24 | } 25 | return super.registerAttribute(par1Attribute); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Instantiable/AI/AITaskSeekMachine.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @author Reika Kalseki 3 | * 4 | * Copyright 2017 5 | * 6 | * All rights reserved. 7 | * Distribution of the software in any form is only allowed with 8 | * explicit, prior permission from the owner. 9 | ******************************************************************************/ 10 | package Reika.DragonAPI.Instantiable.AI; 11 | 12 | import net.minecraft.entity.EntityLiving; 13 | import net.minecraft.tileentity.TileEntity; 14 | 15 | import Reika.DragonAPI.Instantiable.Data.Immutable.Coordinate; 16 | import Reika.DragonAPI.Interfaces.TileEntity.MobAttractor; 17 | 18 | public class AITaskSeekMachine extends AITaskSeekLocation { 19 | 20 | private final MobAttractor tile; 21 | 22 | public AITaskSeekMachine(EntityLiving e, double sp, MobAttractor te) { 23 | super(e, sp, new Coordinate((TileEntity)te)); 24 | tile = te; 25 | } 26 | 27 | @Override 28 | public final boolean shouldExecute() { 29 | return tile.canAttract(entity); 30 | } 31 | 32 | } 33 | --------------------------------------------------------------------------------