1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-26 07:03:22 +00:00
Commit Graph

47 Commits

Author SHA1 Message Date
SquidDev
26b73c2ff3 Merge branch 'mc-1.13.x' into mc-1.14-fabric 2019-04-24 10:53:28 +01:00
SquidDev
220e4bd660 Merge branch 'master' into mc-1.13.x 2019-04-24 10:15:33 +01:00
SquidDev
6898f932a0 Remove redstone blocked checks
This has been returning false for almost 2 years (since
8abff95441). At this point, it's probably
worth just dropping it entirely.
2019-04-22 11:40:19 +01:00
SquidDev
c81bc70475 Merge branch 'mc-1.13.x' into mc-1.14-fabric 2019-04-11 08:57:04 +01:00
SquidDev
362dbd97ac Correctly handle capability creation & invalidation
Also make cable part detection more consistent.
2019-04-09 17:29:23 +01:00
SquidDev
fcaa777c95 Merge branch 'master' into mc-1.13.x 2019-04-09 11:11:12 +01:00
SquidDev
63dc0daa09 Convert computer sides to an enum
Previously we just relied on magic int values, which was confusing and
potentially error-prone. We could use EnumFacing, but that's a)
dependent on MC and b) incorrect, as we're referring to local
coordinates.
2019-04-09 10:02:54 +01:00
SquidDev
55a7ee4acf Initial update to Fabric 2019-04-03 23:27:10 +01:00
SquidDev
f9e13ca67a Update CC: Tweaked to 1.13
Look, I originally had this split into several commits, but lots of
other cleanups got mixed in. I then backported some of the cleanups to
1.12, did other tidy ups there, and eventually the web of merges was
unreadable.

Yes, this is a horrible mess, but it's still nicer than it was. Anyway,
changes:

 - Flatten everything. For instance, there are now three instances of
   BlockComputer, two BlockTurtle, ItemPocketComputer. There's also no
   more BlockPeripheral (thank heavens) - there's separate block classes
   for each peripheral type.

 - Remove pretty much all legacy code. As we're breaking world
   compatibility anyway, we can remove all the code to load worlds from
   1.4 days.
 - The command system is largely rewriten to take advantage of 1.13's
   new system. It's very fancy!

 - WidgetTerminal now uses Minecraft's "GUI listener" system.

 - BREAKING CHANGE: All the codes in keys.lua are different, due to the
   move to LWJGL 3. Hopefully this won't have too much of an impact.

   I don't want to map to the old key codes on the Java side, as there
   always ends up being small but slight inconsistencies. IMO it's
   better to make a clean break - people should be using keys rather
   than hard coding the constants anyway.

 - commands.list now allows fetching sub-commands. The ROM has already
   been updated to allow fancy usage such as commands.time.set("noon").

 - Turtles, modems and cables can be waterlogged.
2019-04-02 20:59:48 +01:00
SquidDev
2965fb666f Some further cleanup and 1.13 cherry-picks
Are most of these changes small and petty? Yes. However, IMO they do
make the code more readable. Anyway, a summary of some of the more
interesting changes:

 - Expose Abstract*Upgrade classes in the API
 - Fix the spelling of Jonathan in the API docs (*shakes fist*)
 - Fix bug with printout not working in the offhand.
 - Rename any argments/variables accidentally named "m_*", and add an
   inspection to prevent it happening again.
 - Remove most of the Block*.Properties classes - just inline them in
   the parent class.
 - Return super.writeToNBT instead of reassigning at the top.
2019-04-02 12:08:03 +01:00
SquidDev
173ea72001 Turn inspections up to 11
OK, so let's get this out of the way, there's some actual changes mixed
in here too. I'm really sorry:
 - Turtles can now not be renamed with unnamed item tags (previously it
   would clear the name, this seemed a little unideal).
 - commands.getBlock(s)Data will also include NBT.

Now, onto the horror story which is these inspection changes:
 - Make a lot of methods static
 - Typo fixes
 - Make utility classes final + private constructor
 - Lots of reformatting (ifs -> ternary, invert control flow, etc...)
 - ???
 - Profit!

I'm so going to regret this - can pretty much guarantee this is going to
break something.
2019-03-29 21:26:21 +00:00
SquidDev
c4b371b124 Cherry pick several improvements from 1.13
- Move container opening (and gui handling) into a separate class
 - Move turtle/computer placement code onto the block
 - GUIs now use gui{Left,Top} instead of calculating it manually.
 - IPeripheralTile is now exposed in the API.
2019-03-27 19:20:59 +00:00
SquidDev
11e4d0de82 Fix turtle peripherals becoming desynced
When a turtle was unloaded but not actually disposed of, the
m_peripheral map hangs around. As a result, when creating a new
ServerComputer, the peripherals aren't considered changed and so they're
never attached.

Fixes #50.

Also fix that blumin' deprecated method which has been around for a wee
while now.
2019-02-18 23:28:51 +00:00
SquidDev
3aa3852ff6 Some further improvements to BlockGeneric
- Only have computers implement custom block drop logic: everything
   else only drops in creative mode.
 - Fix redstone inputs not being received correctly. Introduced in
   8b86a954ee, yes I'm a silly billy.
 - Only update the neighbour which changed.
2019-01-25 22:03:44 +00:00
SquidDev
1c9110b927 Happy new year! 2019-01-01 01:10:18 +00:00
SquidDev
ca334e7e5c A couple of minor reformats
- nbttagcompount -> nbt. It's shorter, and hopefully will avoid
   ambiguities with 'tag' in 1.13+.
 - Remove several redundant != null checks.
2018-12-29 14:01:00 +00:00
SquidDev
54acf1d087 Sync computer state through TE data
Previously we would send computer state (labels, id, on/off) through the
ClientComputer rather than as part of the TE description. While this
mostly worked fine, it did end up making things more complex than they
needed to be.

We sync most data to the tile each tick, so there's little risk of
things getting out of date.
2018-12-29 12:44:43 +00:00
SquidDev
57fb77d7fe Refactor common inventory code into a shared interface
Many bits of IInventory (open/close, fields, etc...) are not actually
needed most implementations, so we can clean things up a little with a
common interface.
2018-12-28 11:39:59 +00:00
SquidDev
b59dcbfc0e Remove "client" turtle brains.
These were only used for the vision camera, and so are rather pointless
now.
2018-12-27 13:10:13 +00:00
SquidDev
2c87e66db8 Move several methods from TileGeneric to blocks
- getPickBlock is now implemented directly on computers and turtles,
   rather than on the tile.
 - Bounding boxes are handled on the block rather than tile. This ends
   up being a little ugly in the case of BlockPeripheral, but it's not
   the end of the world.
 - Explosion resistance is only implemented for turtles now.
2018-12-27 11:32:29 +00:00
SquidDev
2032e7a83a Reformat everything
It's been a long time comin'
But tonight is the end of the war, my friend
Tomorrow only one style will remain.
2018-12-23 17:46:58 +00:00
SquidDev
41cce78fcb Merge pull request #518 from SquidDev-CC/ComputerCraft/feature/owner-tracking
Track which player "owns" a turtle
2018-02-05 11:07:06 +00:00
SquidDev
4c0fa1fabe Track which player "owns" a turtle
When a player places a turtle, they are marked as its owner. Any actions
they perform (such as breaking blocks, moving, etc...) are performed
using this player's game profile.

This allows turtles to work correctly with various permissions mods.
Previously you would have to whitelist all turtles in order for them to
function within a claim.
2018-02-04 21:35:21 +00:00
SquidDev
ca7fb8a0b4 Cache turtle family within the tile
This means one can call .getFamily() in a thread-safe manner, ensuring
turtle.getFuelLimit() does not cause issues. As we use a specialist
TE class for each family this does not require any specialist caching.
2018-01-18 13:06:34 +00:00
SquidDev
0caa133089 Merge pull request #454 from SquidDev-CC/ComputerCraft/hotfix/lazy-computer-peripheral
[WIP] Only instantiate ServerComputer on tile ticks
2017-11-15 11:42:54 +00:00
Joseph C. Sible
80ec54eaf6 Remove unnecessary code
- Remove unnecessary casts
- Use the diamond operator where possible
- Remove "throws" declarations that aren't actually thrown
- Remove unused local variables
- Remove unused imports
- Remove redundant superinterfaces
2017-09-24 01:23:29 -04:00
SquidDev
fbbfe33e21 Do not instantiate ServerComputer instances in the peripheral provider
Instead we create a ComputerProxy, which delegates methods to the
ServerComputer or TileComputerBase, depending on which one exists.
2017-09-15 18:58:13 +01:00
Daniel Ratcliffe
61ff91f237 Merge pull request #316 from SquidDev-CC/feature/minecraft-1.12.2
Update to 1.12. Bam!
2017-09-10 20:52:26 +01:00
SquidDev
a2da6d9601 Pass the original block in redstone propagation
notifyBlockOfStateChange and notifyNeighborsOfStateExcept expect the
block which caused the redstone update, rather than the neighbor block.

Fixes #393
2017-09-10 09:32:02 +01:00
SquidDev
08099f08f2 Initial update to 1.12
- Convert most recipes to JSON
 - Add JSON factories for impostor and turtle recipes.
 - Several mappings changes
 - Migrate to Forge's new registry system
2017-07-25 21:10:47 +01:00
SquidDev
35425f0f61 Update to 1.11.2 2017-07-25 21:08:51 +01:00
SquidDev
8c36eccfef Allow dying turtles arbitrary colours
- Makes ITurtleItem implement IColourableItem
 - Only cache one turtle item model for all colours, rather than one for
   each colour.
 - Allow ITurtleAccess to set an arbitrary colour.
2017-05-14 14:17:55 +01:00
Daniel Ratcliffe
891666c8bf Merge pull request #220 from SquidDev-CC/feature/item-handler
Replace most inventory handling code with IItemHandlers
2017-05-13 21:31:58 +01:00
ObloxCC
7f754f33bb Updated (C) from 2016 to 2017 (#229)
* Updated (C)

* Fixed Whitespace

bugs, bugs, and more bugs

* Fixed Whitespaces 1/2

* Fixed Whitespaces 2/2

* Fixed Whitespaces 3/2
2017-05-13 19:20:39 +01:00
SquidDev
b07f28c30c Replace most inventory handling code with IItemHandlers
- Make InventoryUtil deal with item handlers instead. This
   significantly simplifies the implementation, the interface now
   does most of the hard work.
 - Add InvWrapper item handlers to printers, disk drives and turtles
 - Add IItemHandlerModifiable accessor to ITurtleAccess
 - Migrate all other inventory code (mostly turtle commands) to use
   item handlers instead.
2017-05-11 00:00:10 +01:00
SquidDev
5a60818c99 Make many fields final 2017-05-07 13:35:18 +01:00
SquidDev
a3400ecf26 Fix all the deprecated warnings 2017-05-07 13:35:05 +01:00
SquidDev
a2fd0b1f7f Use block comment instead of Javadoc for license 2017-05-07 13:30:10 +01:00
SquidDev
9af15d1e30 Remove some unnecessary constructs
- Replace for and while loops with for iterators
 - Remove unused casts
2017-05-07 13:29:52 +01:00
SquidDev
dc5517303f Add @Nullable and @NonNull annotations 2017-05-07 13:29:49 +01:00
Daniel Ratcliffe
8abff95441 Peripherals no longer break turtle<->redstone connectivity
I can't think of a good reason for this feature tbh
2017-05-04 22:13:14 +01:00
Daniel Ratcliffe
4b0a976bd6 Merge pull request #182 from SquidDev-CC/feature/turtle-upgrade-both
Allow turtle upgrades to act as tools and peripherals
2017-05-04 22:02:09 +01:00
SquidDev
a021a072b5 Allow turtle upgrades to act as tools and peripherals
This may be useful when you want your tool to also provide additional
methods. For instance, a pickaxe could provide methods to check whether
it can break the block in front.
2017-05-03 17:28:54 +01:00
Bartek Bok
4eb4bb933f
Different fix for shadow turtles 2017-05-03 16:03:47 +02:00
Daniel Ratcliffe
b202b7b8a5 Converted tabs to spaces throughout 2017-05-01 15:48:44 +01:00
Daniel Ratcliffe
7d497f2835 ComputerCraft 1.80pr0
Updated the source code to the version shipped as the 1.80pr0 alpha
release. Also removed some unnecessary files from the LuaJ subfolder
which were bulking up the repository.
2017-05-01 14:51:26 +01:00
Daniel Ratcliffe
e85cdacbc5 ComputerCraft 1.79 initial upload
Added the complete source code to ComputerCraft 1.79 for Minecraft
1.8.9, plus newly written README and LICENSE files for the open source
release.
2017-05-01 14:32:39 +01:00